0.1.0 #1

Merged
Thilawyn merged 65 commits from next into master 2024-02-06 03:15:40 +01:00
3 changed files with 23 additions and 2 deletions
Showing only changes of commit 5f0d21d93b - Show all commits

BIN
bun.lockb

Binary file not shown.

View File

@@ -28,6 +28,7 @@
"clean:node": "rm -rf node_modules" "clean:node": "rm -rf node_modules"
}, },
"dependencies": { "dependencies": {
"hotscript": "^1.0.13",
"type-fest": "^4.10.1" "type-fest": "^4.10.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1,6 +1,7 @@
import { Simplify } from "type-fest" import { Simplify } from "type-fest"
import { TraitAbstractMembers, TraitImplInstance, expresses, trait } from "." import { Trait, TraitAbstractMembers, TraitImplInstance, expresses, trait } from "."
import { MergeInheritanceTree, TraitsAbstractMembers } from "./util" import { MergeInheritanceTree, TraitsAbstractMembers } from "./util"
import { Call, Fn, Tuples } from "hotscript"
const PrintsHelloOnNew = trait()(Super => const PrintsHelloOnNew = trait()(Super =>
@@ -41,12 +42,31 @@ const ActiveStatefulSubscription = trait<ActiveStatefulSubscriptionAbstractMembe
) )
interface AbstractMembersOfTrait extends Fn {
return: this["arg0"] extends Trait<infer AbstractMembers, any>
? AbstractMembers
: never
}
// type Test = Simplify<TraitImplInstance<ReturnType<typeof Identifiable<bigint>>>> // type Test = Simplify<TraitImplInstance<ReturnType<typeof Identifiable<bigint>>>>
type Test1 = [ type Test1 = [
TraitAbstractMembers<typeof StatefulSubscription>, TraitAbstractMembers<typeof StatefulSubscription>,
TraitAbstractMembers<typeof ActiveStatefulSubscription>, TraitAbstractMembers<typeof ActiveStatefulSubscription>,
] ]
type Test2 = Simplify<MergeInheritanceTree<Test1>> type Test2 = TraitsAbstractMembers<[
typeof StatefulSubscription,
typeof ActiveStatefulSubscription,
]>
type Test3 = Simplify<
MergeInheritanceTree<
Call<Tuples.Map<AbstractMembersOfTrait>, [
typeof StatefulSubscription,
typeof ActiveStatefulSubscription,
]>
>
>
// type Test2 = Simplify<MergeInheritanceTree<Test1>>
const appliedIdentifiable = Identifiable<bigint>().apply({} as any) const appliedIdentifiable = Identifiable<bigint>().apply({} as any)