Skip to content

1681-engine / index / prefabPart

Function: prefabPart() ​

Call Signature ​

ts
function prefabPart<S, A>(type, value): PrefabPart<A>;

Defined in: src/ecs/prefab.ts:23

One part of a prefab, typed: the value is checked against the component's type, and a factory's ctx is known. A bare [type, value] tuple works too, unchecked.

Type Parameters ​

Type ParameterDefault type
S extends FieldSpec-
Aunknown

Parameters ​

ParameterType
typeFieldsType<S>
value| PrefabValue<FieldValues<S>, A> | null

Returns ​

PrefabPart<A>

Call Signature ​

ts
function prefabPart<T, A>(type, value): PrefabPart<A>;

Defined in: src/ecs/prefab.ts:24

One part of a prefab, typed: the value is checked against the component's type, and a factory's ctx is known. A bare [type, value] tuple works too, unchecked.

Type Parameters ​

Type ParameterDefault type
T-
Aunknown

Parameters ​

ParameterType
typeComponentType<T>
valuePrefabValue<T, A> | null

Returns ​

PrefabPart<A>

Released under the MIT License.