Interface AGSStore

The type of stores created by the AGSStoreFactory.

interface AGSStore {
    get(id, options?): Promise<undefined | Readonly<Record<string, any>>>;
    getIdentity?(item): undefined | AllowedIdTypes;
    getMetadata(): Promise<Metadata>;
    id: undefined | string;
    idProperty?: string;
    layer: any;
    load(): Promise<void>;
    on?<Name>(eventName, callback): EventHandle;
    on?(eventName, callback): EventHandle;
    on?(eventName, callback): EventHandle;
    query(query?, options?): AsyncQueryResult<Readonly<Record<string, any>>>;
    target: undefined | string;
    url: undefined | string;
}

Hierarchy

  • AsyncStore
    • AGSStore

Properties

id: undefined | string

ID of the store.

idProperty?: string

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

layer: any

The layer used by this store.

target: undefined | string

Deprecated

Use url instead.

url: undefined | string

The URL of the layer queried by this store. Undefined if this store works on a client side layer.

Methods

  • Retrieves an item by its identifier.

    Parameters

    • id: AllowedIdTypes

      id of an item in the store.

    • Optional options: GetOptions

      options to specify the result.

    Returns Promise<undefined | Readonly<Record<string, any>>>

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

    Parameters

    • item: Partial<Readonly<Record<string, any>>>

      the item.

    Returns undefined | AllowedIdTypes

    the ID

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

    Returns Promise<Metadata>

  • Manually loads required metadata from backend services if needed.

    Some methods (such as query) may not be available before metadata have been loaded.

    Note: Metadata can also be loaded by calling AsyncStore.getMetadata.

    Returns Promise<void>

  • Register event listener for specific events.

    Type Parameters

    • Name extends "changed"

    Parameters

    • eventName: Name

      name of the event

    • callback: EventCallback<StoreEvents<AllowedIdTypes>[Name]>

      the event handler callback will be invoked when the event has been emitted

    Returns EventHandle

    a handle to unregister from the event

  • Register event listener for any event.

    Parameters

    • eventName: "*"

      must be "*" for this overload

    • callback: EventCallback<StoreChangedEvent<AllowedIdTypes>>

      the event handler callback will be invoked when any event has been emitted

    Returns EventHandle

    a handle to unregister from the events

  • Register event listener for the events listed in eventName. Comma separated event names are possible, for example "eventA,eventB".

    Parameters

    • eventName: string | string[]

      the event name or list of names

    • callback: EventCallback<unknown>

      the event handler callback

    Returns EventHandle

    a handle to unregister from the event(s)

  • Queries the store using the provided query.

    Parameters

    • Optional query: ComplexQueryExpression

      a query to execute.

    • Optional options: QueryOptions

      the query options.

    Returns AsyncQueryResult<Readonly<Record<string, any>>>

Generated using TypeDoc