Fixed StaticMembers and subtraiting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -5,7 +5,9 @@ import { AbstractClass, AbstractConstructor, Opaque, UnionToIntersection } from
|
|||||||
* Represents the static members of a class.
|
* Represents the static members of a class.
|
||||||
* @template C - The class type.
|
* @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]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { expresses, trait } from "."
|
import { expresses, extendsAndExpresses, trait } from "."
|
||||||
|
|
||||||
|
|
||||||
const Identifiable = <ID>() =>
|
const Identifiable = <ID>() =>
|
||||||
@@ -21,8 +21,13 @@ const Identifiable = <ID>() =>
|
|||||||
|
|
||||||
const ImplementsIdentifiable = <ID>(defaultID: ID) =>
|
const ImplementsIdentifiable = <ID>(defaultID: ID) =>
|
||||||
trait(Parent => {
|
trait(Parent => {
|
||||||
abstract class ImplementsIdentifiable extends Identifiable<ID>()(Parent) {
|
abstract class ImplementsIdentifiable extends extendsAndExpresses(Parent, [Identifiable<ID>()]) {
|
||||||
id: ID = defaultID
|
id: ID = defaultID
|
||||||
|
|
||||||
|
constructor(...args: any[]) {
|
||||||
|
super(...args)
|
||||||
|
console.log("ImplementsIdentifiable constructor")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImplementsIdentifiable
|
return ImplementsIdentifiable
|
||||||
|
|||||||
Reference in New Issue
Block a user