import { Evented, EventSource, EventedOn } from 'apprt-core/Events'; import { Metadata, StoreEvents, SyncStore, QueryOptions, ResultItems, SyncWritableStore, CreateOptions, AsyncStore, AsyncQueryResult, GetOptions, AsyncWritableStore } from './api/Store.js'; import { ComplexQueryExpression } from './api/ComplexQueryLang.js'; import '@arcgis/core/geometry/Geometry'; /** * Constructor options of all in-memory store variants. */ interface ConstructorOptions { /** * Id of the store. */ id?: string; /** * Name of the idProperty. * Default is "id" */ idProperty?: string; /** * Flag if $suggest searches are interpreted as contains inside value. * Default is true. */ suggestContains?: boolean; /** * The array of items, on which the store is working. */ data?: ItemType[]; /** * The metadata of the store instance. */ metadata?: Partial; } /** * A read only synchronous store. */ declare class SyncInMemoryStore, IDType extends string | number> extends Evented> implements SyncStore { readonly id: string; readonly idProperty: string; protected _data: ItemType[]; private _suggestContains; private _queryEngine; private _metadata; constructor(opts?: ConstructorOptions); getIdentity(item: Partial): IDType; get(id: IDType): ItemType | undefined; query(query?: ComplexQueryExpression, options?: QueryOptions): ResultItems; getMetadata(): Metadata; } /** * A writable synchronous store. */ declare class SyncWritableInMemoryStore, IDType extends string | number> extends SyncInMemoryStore implements SyncWritableStore { put(item: Partial, options?: CreateOptions): ItemType; add(item: Partial, options?: CreateOptions): ItemType; remove(id: IDType): void; } /** * A readonly asynchronous store. */ declare class AsyncInMemoryStore, IDType extends string | number> implements AsyncStore, EventSource> { protected _mem: SyncWritableStore; readonly on: EventedOn>; constructor(opts?: ConstructorOptions); get id(): string | undefined; get idProperty(): string | undefined; getIdentity(item: Partial): IDType | undefined; query(query?: ComplexQueryExpression, options?: QueryOptions): AsyncQueryResult; get(id: IDType, options?: GetOptions): Promise; getMetadata(): Promise; } /** * A writeable asynchronous store. */ declare class AsyncWritableInMemoryStore, IDType extends string | number> extends AsyncInMemoryStore implements AsyncWritableStore { put(item: Partial, options?: CreateOptions): Promise; add(item: Partial, options?: CreateOptions): Promise; remove(id: IDType): Promise; } export { AsyncInMemoryStore, AsyncWritableInMemoryStore, SyncInMemoryStore, SyncWritableInMemoryStore }; export type { ConstructorOptions };