Interface ModelTrait<M, S, U>
Callable
- ModelTrait(): null | S
- ModelTrait(trait: null | S | U, targetTrait?: null | Trait): M
-
Returns null | S
-
Parameters
-
trait: null | S | U
-
Optional targetTrait: null | Trait
Returns M
Properties
fastenerFlags
fastenerFlags: number
Readonly key
key: undefined | string
Readonly name
name: string
Optional observe
observe: boolean
Readonly owner
owner: M
Readonly parentModel
parent
Model: null | Model
Optional sibling
sibling: boolean
Readonly trait
trait: null | S
Optional Readonly type
type: unknown
Methods
attachTrait
- attachTrait(newTrait: S): void
-
Parameters
Returns void
createTrait
- createTrait(): null | S | U
-
Returns null | S | U
detachTrait
- detachTrait(oldTrait: S): void
-
Parameters
Returns void
didMount
-
Returns void
didSetTrait
- didSetTrait(newTrait: null | S, oldTrait: null | S, targetTrait: null | Trait): void
-
Parameters
-
newTrait: null | S
-
oldTrait: null | S
-
targetTrait: null | Trait
Returns void
didUnmount
-
Returns void
doSetTrait
- doSetTrait(newTrait: null | S, targetTrait: null | Trait): void
-
Parameters
-
newTrait: null | S
-
targetTrait: null | Trait
Returns void
fromAny
- fromAny(value: S | U): null | S
-
Parameters
Returns null | S
getTrait
-
Returns S
injectTrait
- injectTrait(parentModel?: null | Model, trait?: null | S | U, targetTrait?: null | Trait, key?: null | string): null | S
-
Parameters
-
Optional parentModel: null | Model
-
Optional trait: null | S | U
-
Optional targetTrait: null | Trait
-
Optional key: null | string
Returns null | S
insertTrait
- insertTrait(parentModel: Model, trait: S, targetTrait: null | Trait, key: undefined | string): void
-
Parameters
-
parentModel: Model
-
trait: S
-
targetTrait: null | Trait
-
key: undefined | string
Returns void
isMounted
-
Returns boolean
mount
-
Returns void
onMount
-
Returns void
onSetTrait
- onSetTrait(newTrait: null | S, oldTrait: null | S, targetTrait: null | Trait): void
-
Parameters
-
newTrait: null | S
-
oldTrait: null | S
-
targetTrait: null | Trait
Returns void
onUnmount
-
Returns void
removeTrait
-
Returns null | S
setFastenerFlags
- setFastenerFlags(fastenerFlags: number): void
-
Parameters
Returns void
setTrait
- setTrait(newTrait: null | S | U, targetTrait?: null | Trait): null | S
-
Parameters
-
newTrait: null | S | U
-
Optional targetTrait: null | Trait
Returns null | S
unmount
-
Returns void
willMount
-
Returns void
willSetTrait
- willSetTrait(newTrait: null | S, oldTrait: null | S, targetTrait: null | Trait): void
-
Parameters
-
newTrait: null | S
-
oldTrait: null | S
-
targetTrait: null | Trait
Returns void
willUnmount
-
Returns void