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