Interface Embedded
interface Embedded {
create<
D extends DocumentConstructor,
O extends CreateOptions<InstanceType<D>>,
>(
FoundryDoc: D,
options?: O,
): O extends typeof DynMapReducer
? InstanceType<O<O>>
: O extends { ctor: typeof DynMapReducer }
? InstanceType<O<O>["ctor"]>
: DynMapReducer<string, InstanceType<D>>;
destroy<D extends DocumentConstructor>(
FoundryDoc?: D,
reducerName?: string,
): boolean;
get<D extends DocumentConstructor>(
FoundryDoc: D,
reducerName?: string,
): DynMapReducer<string, InstanceType<D>>;
}
create<
D extends DocumentConstructor,
O extends CreateOptions<InstanceType<D>>,
>(
FoundryDoc: D,
options?: O,
): O extends typeof DynMapReducer
? InstanceType<O<O>>
: O extends { ctor: typeof DynMapReducer }
? InstanceType<O<O>["ctor"]>
: DynMapReducer<string, InstanceType<D>>;
destroy<D extends DocumentConstructor>(
FoundryDoc?: D,
reducerName?: string,
): boolean;
get<D extends DocumentConstructor>(
FoundryDoc: D,
reducerName?: string,
): DynMapReducer<string, InstanceType<D>>;
}
Methods
create
- create<D extends DocumentConstructor, O extends CreateOptions<InstanceType<D>>>(
FoundryDoc: D,
options?: O,
): O extends typeof DynMapReducer
? InstanceType<O<O>>
: O extends { ctor: typeof DynMapReducer }
? InstanceType<O<O>["ctor"]>
: DynMapReducer<string, InstanceType<D>> Create a reactive embedded collection store. When no options are provided the name of the embedded collection matches the document name.
Type Parameters
- D extends DocumentConstructor
Foundry Document
. - O extends CreateOptions<InstanceType<D>>
CreateOptions
- Embedded API create options.
Parameters
Returns O extends typeof DynMapReducer
? InstanceType<O<O>>
: O extends { ctor: typeof DynMapReducer }
? InstanceType<O<O>["ctor"]>
: DynMapReducer<string, InstanceType<D>>- D extends DocumentConstructor
destroy
- destroy<D extends DocumentConstructor>(
FoundryDoc?: D,
reducerName?: string,
): boolean Destroys one or more embedded collection reducers. When no
reducerName
is provided all reactive embedded collections are destroyed for the given document type.Type Parameters
- D extends DocumentConstructor
Foundry Document
.
Parameters
Optional
FoundryDoc: DA Foundry document class constructor.
Optional
reducerName: stringOptional name of a specific reducer to destroy.
Returns boolean
- D extends DocumentConstructor
get
- get<D extends DocumentConstructor>(
FoundryDoc: D,
reducerName?: string,
): DynMapReducer<string, InstanceType<D>> Returns a specific existing embedded collection store. When no
reducerName
is provided the document name is used instead.Type Parameters
- D extends DocumentConstructor
Foundry Document
.
Parameters
- FoundryDoc: D
A Foundry document class constructor.
Optional
reducerName: stringOptional name of a specific reducer to get.
Returns DynMapReducer<string, InstanceType<D>>
The associated reactive embedded collection / reducer.
- D extends DocumentConstructor
Provides the public embedded reactive collection API.