map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface SyncStore<ItemType, IDType>

    A synchronous store. It is provided for legacy store implementations only and should not be actively used anymore.

    use AsyncStore instead

    interface SyncStore<
        ItemType extends IndexableThing = IndexableThing,
        IDType extends AllowedIdTypes = AllowedIdTypes,
    > {
        get(id: IDType, options?: GetOptions): undefined | ItemType;
        getIdentity(item: Partial<ItemType>): undefined | IDType;
        getMetadata(): Metadata;
        id: string;
        idProperty?: string;
        query(
            query?: ComplexQueryExpression,
            options?: QueryOptions,
        ): ResultItems<ItemType>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    id: string

    ID of the store.

    idProperty?: string

    Name of the property used as ID. If not provided, the 'getIdentity' method must be declared.

    Methods

    • Retrieves an item by its identifier.

      Parameters

      • id: IDType

        id of an item in the store.

      • Optionaloptions: GetOptions

        options to specify the result.

      Returns undefined | ItemType

    • Returns an items‘s identity. This must always execute synchronously.

      Parameters

      Returns undefined | IDType

      the ID

    • Returns any available metadata about the store. This may include attribution, available fields, cache directives, history or version information.

      Returns Metadata