0.1.24 (#24)
All checks were successful
continuous-integration/drone/push Build is passing

Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: https://git.jvalver.de/Thilawyn/traitify-ts/pulls/24
This commit was merged in pull request #24.
This commit is contained in:
Julien Valverdé
2024-05-13 01:25:25 +02:00
parent 7bc5d5b812
commit b2eae567c4
8 changed files with 45 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ import { TraitClass } from "./Trait"
import { trait } from "./TraitBuilder"
import { Implements, StaticImplements, TraitExpressionClass } from "./TraitExpression"
import { expression } from "./TraitExpressionBuilder"
import { type } from "./util"
const PrintsHelloOnNew = trait
@@ -18,9 +19,12 @@ const PrintsHelloOnNew = trait
type PrintsHelloOnNewClass = TraitClass<typeof PrintsHelloOnNew>
const Identifiable = <ID>() => trait
.abstract(Super => class extends Super {
declare readonly id: ID
})
// .abstract(Super => class extends Super {
// declare readonly id: ID
// })
.abstractType(Super => type<typeof Super & {
readonly id: ID
}>)
.implement(Super => class Identifiable extends Super {
equals(el: Identifiable) {
return this.id === el.id