@mantlebee/ts-data
    Preparing search index...

    Interface ICachedLookupSource<TItem, TValue>

    A lookup source that remembers the items it resolved, see withCache.

    interface ICachedLookupSource<TItem = Any, TValue = LookupValue> {
        invalidate(values?: List<TValue>): void;
        resolve(values: List<TValue>, signal?: AbortSignal): Promise<List<TItem>>;
        search(
            query: string,
            page: LookupPage,
            signal?: AbortSignal,
        ): Promise<LookupSearchResult<TItem>>;
        valueOf(item: TItem): TValue;
    }

    Type Parameters

    • TItem = Any

      Type of the items.

    • TValue = LookupValue

      Type of the key of an item.

    Hierarchy (View Summary)

    Index
    • Forgets the entries of values, pending ones included, or every entry without argument: the next resolve asks the inner source again.

      Parameters

      • Optionalvalues: List<TValue>

        Keys to forget; every key when omitted.

      Returns void

    • The items whose key is one of values, without the ones the source does not know, in no particular order: index them with valueOf.

      Parameters

      • values: List<TValue>

        Keys to resolve; an empty list resolves to [].

      • Optionalsignal: AbortSignal

        Aborted by the caller when the result is no longer needed.

      Returns Promise<List<TItem>>

      the items found.

    • The items whose text contains query (every item when query is empty), one page at a time.

      Parameters

      • query: string

        Text to look for; "" for every item.

      • page: LookupPage

        Page to return: offset of the first item, a multiple of limit, and limit items.

      • Optionalsignal: AbortSignal

        Aborted by the caller when the result is no longer needed.

      Returns Promise<LookupSearchResult<TItem>>

      the items of the page and whether more may follow.