This commit is contained in:
20
src/tests.ts
20
src/tests.ts
@@ -1,7 +1,8 @@
|
||||
import { TraitClass } from "./Trait"
|
||||
import { Trait, TraitClass } from "./Trait"
|
||||
import { trait } from "./TraitBuilder"
|
||||
import { Implements, ImplementsStatic } from "./TraitExpression"
|
||||
import { Implements, ImplementsStatic, TraitExpression } from "./TraitExpression"
|
||||
import { expression } from "./TraitExpressionBuilder"
|
||||
import { ExtendPlain } from "./util"
|
||||
|
||||
|
||||
const PrintsHelloOnNew = trait
|
||||
@@ -80,3 +81,18 @@ class User extends exp.extends implements Implements<typeof exp> {
|
||||
}
|
||||
|
||||
console.log(new User())
|
||||
|
||||
|
||||
type ExpectsObjectArray<T extends readonly object[]> = T
|
||||
|
||||
type Maps<T extends readonly any[]> = {
|
||||
[K in keyof T]: T[K]
|
||||
}
|
||||
|
||||
type MapTraits<Exp extends TraitExpression<any, any>> = (
|
||||
ExpectsObjectArray<
|
||||
Maps<
|
||||
|
||||
>
|
||||
>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user