Expresses work
This commit is contained in:
12
src/tests.ts
12
src/tests.ts
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user