Expresses work

This commit is contained in:
Julien Valverdé
2024-01-28 22:52:32 +01:00
parent 096d4a92e7
commit 8b01a13d7c
4 changed files with 84 additions and 83 deletions

View File

@@ -1,4 +1,4 @@
import { trait } from "."
import { expresses, trait } from "."
const PrintsHelloOnNew = trait()(Super =>
@@ -10,11 +10,17 @@ const PrintsHelloOnNew = trait()(Super =>
}
)
const Identifiable = <ID>() =>
trait<{ id: ID }>()(Super =>
const Identifiable = <ID>() => (
trait<{ readonly id: ID }>()(Super =>
class Identifiable extends Super {
equals(el: Identifiable) {
return this.id === el.id
}
}
)
)
const exp = expresses(Identifiable<bigint>())
class User implements typeof exp.implements()