import { IZDataRequest } from './data-request.mjs'; import { IZDataSource } from './data-source.mjs'; import { IZDataSourceStaticOptions } from './data-source-static-options.mjs'; /** * Represents an in memory data source. * * This is very useful for testing and when you * need to cache a data set that you already have. */ export declare class ZDataSourceStatic implements IZDataSource { private _data; private _options; /** * Initializes a new instance of this object. * * @param _data - * The static data to search, sort, filter, and paginate. * @param _options - * The options for the static source. */ constructor(_data: T[] | Promise | Error | Promise, _options?: IZDataSourceStaticOptions); /** * Gets a copy of the current list of items. * * This is equivalent to invoking retrieve * with the default data request. * * @returns * A shallow copy of the current item list. * Returns a rejected promise if the initial * data is an error. */ items(): Promise; /** * Inserts an item into the existing data array. * * @param item - * The item to insert. * @param index - * The index to insert at. If this is equal to or less than 0 * Then the item will be inserted at the front of the data list. * If this is greater than or equal to the maximum number of * items in the current list, then the item will be inserted * at the end of the list. * * @returns * A new data source where the item list has been updated to include * the new item. */ insert(item: T, index?: number): Promise>; /** * Removes a specific matched item in the list. * * @param item - * The item to remove. This will be an exact match. * * @returns * A new data source with the item removed, or a direct * copy if no such item exists within the list. Returns * a rejected promise if the original data is an error. */ remove(item: T): Promise>; /** * Removes a specific item at a given index. * * @param index - * The index of the item to remove. * * @returns * A new data source with the item at the given index * removed, or a direct copy if the index is out * of range. Returns a rejected promise if the * original data is an Error. */ removeAt(index: number): Promise>; /** * Updates an item at the given index. * * @param item - * The item to set. * @param index - * The index of the item to replace. * * @returns * A new data source with the item at the given index * updated, or a direct copy if the index is out * of range. Returns a rejected promise if the * original data is an Error. * */ set(item: T, index: number): Promise>; count(request: IZDataRequest): Promise; retrieve(request: IZDataRequest): Promise; }