- Preparing search index...
- The search index is not available
@vcmap/core
Type alias OverrideCollectionInterface<T>
OverrideCollectionInterface<T>: { [isOverrideCollection]: boolean; getSerializedByKey: ((key) => object | undefined); override: ((item) => T | null); parseItems: ((items,
moduleId) => Promise<void>); removeModule: ((moduleId) => void); replace: ((item) => T | null); replaced: VcsEvent<ReplacedEvent<T>>; serializeModule: ((moduleId) => object[]); shadowMap: Map<string, (object & { [moduleIdSymbol]?: string; })[]>; uniqueKey: keyof T; }
Type declaration
-
[isOverrideCollection]: boolean
-
getSerializedByKey: ((key) => object | undefined)
-
- (key): object | undefined
-
Returns object | undefined
-
override: ((item) => T | null)
-
- (item): T | null
-
Returns T | null
-
parseItems: ((items, moduleId) => Promise<void>)
-
- (items, moduleId): Promise<void>
-
Parameters
-
items: (object & {
type?: string;
})[] | undefined
-
moduleId: string
Returns Promise<void>
-
removeModule: ((moduleId) => void)
-
- (moduleId): void
-
Returns void
-
replace: ((item) => T | null)
-
- (item): T | null
-
Returns T | null
-
-
serializeModule: ((moduleId) => object[])
-
- (moduleId): object[]
-
Returns object[]
-
shadowMap: Map<string, (object & {
[moduleIdSymbol]?: string;
})[]>
-
uniqueKey: keyof T
The override collection adds the ability to override a unique item and re-creating it, should the override be removed. This does change some flow of called events. 1) if you override an item, removed is not called for the removed current item. 2) replaced is called for items which where replaced. 3) added can be called more the once for the same unique id. Replaced is called before added has been called for the item.