This commit is contained in:
@@ -4,9 +4,9 @@ import { AbstractTag, Trait, TraitAbstractMembersFn, TraitApplierSuperTag, Trait
|
|||||||
import { ExtendFn, ExtendableFn, SimplifyFn, StaticMembersFn } from "./util"
|
import { ExtendFn, ExtendableFn, SimplifyFn, StaticMembersFn } from "./util"
|
||||||
|
|
||||||
|
|
||||||
class TraitExpression<
|
export class TraitExpression<
|
||||||
Super extends AbstractClass<{}>,
|
Super extends AbstractClass<{}>,
|
||||||
Traits extends Trait<any, any>[],
|
Traits extends Trait<any, any, any>[],
|
||||||
> {
|
> {
|
||||||
constructor(
|
constructor(
|
||||||
readonly superclass: Super,
|
readonly superclass: Super,
|
||||||
|
|||||||
12
src/trait.ts
12
src/trait.ts
@@ -1,6 +1,6 @@
|
|||||||
import { Fn } from "hotscript"
|
import { Fn } from "hotscript"
|
||||||
import { AbstractClass, Class, Opaque } from "type-fest"
|
import { AbstractClass, Class, Opaque } from "type-fest"
|
||||||
import { AbstractTag } from "."
|
import { AbstractTag, TraitExpression } from "."
|
||||||
import { StaticMembers } from "./util"
|
import { StaticMembers } from "./util"
|
||||||
|
|
||||||
|
|
||||||
@@ -28,21 +28,21 @@ type RemoveAbstractFromImpl<
|
|||||||
|
|
||||||
|
|
||||||
export class Trait<
|
export class Trait<
|
||||||
Abstract extends {},
|
Super extends TraitExpression<any, any>[],
|
||||||
Impl extends Class<{}, []>,
|
Abstract extends {},
|
||||||
Supertraits extends Trait<any, any, any>[]
|
Impl extends Class<{}, []>,
|
||||||
> {
|
> {
|
||||||
constructor(
|
constructor(
|
||||||
readonly supertraits: Supertraits,
|
readonly supertraits: Super,
|
||||||
readonly ownAbstract: Abstract,
|
readonly ownAbstract: Abstract,
|
||||||
readonly apply: (Super: AbstractClass<{}>) => Impl,
|
readonly apply: (Super: AbstractClass<{}>) => Impl,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Trait<
|
export interface Trait<
|
||||||
|
Super extends TraitExpression<any, any>[],
|
||||||
Abstract extends {},
|
Abstract extends {},
|
||||||
Impl extends Class<{}, []>,
|
Impl extends Class<{}, []>,
|
||||||
Supertraits extends Trait<any, any, any>[]
|
|
||||||
> {
|
> {
|
||||||
get ownImplClass(): Impl
|
get ownImplClass(): Impl
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user