diff --git a/bun.lockb b/bun.lockb index 1263665..3bf296d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index acb7aa9..499169b 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "clean:node": "rm -rf node_modules" }, "dependencies": { + "hotscript": "^1.0.13", "type-fest": "^4.10.1" }, "devDependencies": { diff --git a/src/tests.ts b/src/tests.ts index b7b0f5e..aedbc6e 100644 --- a/src/tests.ts +++ b/src/tests.ts @@ -1,6 +1,7 @@ import { Simplify } from "type-fest" -import { TraitAbstractMembers, TraitImplInstance, expresses, trait } from "." +import { Trait, TraitAbstractMembers, TraitImplInstance, expresses, trait } from "." import { MergeInheritanceTree, TraitsAbstractMembers } from "./util" +import { Call, Fn, Tuples } from "hotscript" const PrintsHelloOnNew = trait()(Super => @@ -41,12 +42,31 @@ const ActiveStatefulSubscription = trait + ? AbstractMembers + : never +} + // type Test = Simplify>>> type Test1 = [ TraitAbstractMembers, TraitAbstractMembers, ] -type Test2 = Simplify> +type Test2 = TraitsAbstractMembers<[ + typeof StatefulSubscription, + typeof ActiveStatefulSubscription, +]> +type Test3 = Simplify< + MergeInheritanceTree< + Call, [ + typeof StatefulSubscription, + typeof ActiveStatefulSubscription, + ]> + > +> +// type Test2 = Simplify> + const appliedIdentifiable = Identifiable().apply({} as any)