Skip to main content

Variable: genericMetadataProvider

const genericMetadataProvider: object

Simple metadata provider that stores some sort of meta data for each imageId.

Type declaration​

add()​

add: (imageId, payload) => void

Adds a cloned copy of the metadata for an imageId as the given type. Note that this will strip out any functions or other non-cloneables.

Parameters​

• imageId: string

the imageId for the metadata to store

• payload

the payload

• payload.metadata: unknown

• payload.type: string

Returns​

void

addRaw()​

addRaw: (imageId, payload) => void

Adds a raw metadata instances for an imageId. This allows preserving class inheritance values and member functions/proxy instances, but runs the risk that the raw object can be modified through side affects.

Parameters​

• imageId: string

• payload

• payload.metadata: unknown

• payload.type: string

Returns​

void

clear()​

clear: () => void

Clears all metadata.

Returns​

void

get()​

get: (type, imageId) => unknown

Returns the metadata for an imageId if it exists.

Parameters​

• type: string

the type of metadata to enquire about

• imageId: string

the imageId to enquire about

Returns​

unknown

Defined in​

packages/core/src/utilities/genericMetadataProvider.ts:8