20231230.0.0 #6

Merged
Thilawyn merged 4 commits from next into master 2023-12-30 00:40:56 +01:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit cabf2e0d74 - Show all commits

View File

@@ -5,7 +5,9 @@ import { AbstractClass, AbstractConstructor, Opaque, UnionToIntersection } from
* Represents the static members of a class.
* @template C - The class type.
*/
export type StaticMembers<C> = Pick<C, keyof C>
export type StaticMembers<C> = {
[Key in keyof C as Key extends "prototype" ? never : Key]: C[Key]
}
/**

View File

@@ -1,4 +1,4 @@
import { expresses, trait } from "."
import { expresses, extendsAndExpresses, trait } from "."
const Identifiable = <ID>() =>
@@ -21,8 +21,13 @@ const Identifiable = <ID>() =>
const ImplementsIdentifiable = <ID>(defaultID: ID) =>
trait(Parent => {
abstract class ImplementsIdentifiable extends Identifiable<ID>()(Parent) {
abstract class ImplementsIdentifiable extends extendsAndExpresses(Parent, [Identifiable<ID>()]) {
id: ID = defaultID
constructor(...args: any[]) {
super(...args)
console.log("ImplementsIdentifiable constructor")
}
}
return ImplementsIdentifiable