export declare const PAGINATION_TYPES: { readonly NONE: "none"; readonly CLIENT_SIDE: "client-side"; readonly SERVER_SIDE: "server-side"; readonly STANDALONE: "standalone"; }; export type PaginationTypes = typeof PAGINATION_TYPES[keyof typeof PAGINATION_TYPES]; export type AggregationTypes = { name: 'sum'; field: null; } | { name: 'avg'; field: null; } | { name: 'min'; field: null; } | { name: 'max'; field: null; } | { name: 'count'; field: null; }; export interface GroupableOptions { fields: Array; aggregators?: Array; expanded?: true | ((row: number, cell: number, data: Record) => boolean); groupRowFormatter?: (idx: number, row: number, cell: number, value: any, col: any, item: Record, api: any) => void; groupFooterRow?: boolean; groupFooterRowFormatter?: (idx: number, row: number, cell: number, value: any, col: any, item: Record, api: any) => void; } /** * Handle Attaching Array / Object Data to Components * Features (now and future): * - data * - sort * - filter * - read/map/loop * - primaryKey * - retrieval * - CRUD * - paging (pageSize, serverSide, cache) * - events (requestStart, requestEnd, change, error) * - sync (sync back original array) */ declare class IdsDataSource { #private; /** * Return all the currently used data, without paging or filter * @returns {Array | null} All the currently used data */ get allData(): any; /** * Sets the data array on the data source object * @param {Array | null} value The array to attach */ set data(value: Array> | null); /** * Return the currently used data in its current state * @returns {Array | null} The attached array of data in its current state */ get data(): Array>; get currentData(): Array>; set currentData(value: Array>); get originalData(): Record[]; get flatten(): boolean; set flatten(value: boolean); get groupable(): GroupableOptions | undefined; set groupable(value: GroupableOptions); get filtered(): boolean; set filtered(value: boolean); /** * Get the total number of items in data * @returns {number} - the current page-total */ get total(): any; /** * Override the total number of items in data * @param {number} value - the new page-total */ set total(value: any); /** * Set the current page-number * @param {number} value - new the page-number */ set pageNumber(value: number); /** * Get the curret page-number * @returns {number} - the current page-number */ get pageNumber(): number; /** * Set the current page-size * @param {number} value - new the page-size */ set pageSize(value: any); /** * Get the current page-size * @returns {number} - the current page-size */ get pageSize(): any; /** * Set the current pagination type * @param {PaginationTypes} value - new pagination type */ set pagination(value: PaginationTypes); /** * Get the current pagination type * @returns {PaginationTypes} - the current pagination type */ get pagination(): PaginationTypes; /** * Set the name of the data property to use as a primary key * @param {string} value primary key name */ set primaryKey(value: string); /** * Get the current name of the data property used as a primary key * @returns {string} primary key name */ get primaryKey(): string; /** * @param {number} pageNumber - a page number to start with * @param {number} pageSize - number of items to return * @returns {Array} the paginated data */ paginate(pageNumber?: number, pageSize?: number): any; /** * Gets index from record data * @param {string} key string key to check * @param {string} value string value to compare * @returns {number} index from record data */ getRecordIndex(key: string, value: string): number; /** * Marks the previous state cache to be updated on the next access */ refreshPreviousState(): void; /** * Creates new records in the current dataset to reflect new state * @param {Array>} items incoming records to update * @param {number} index the index at which to create the value */ create(items?: Array>, index?: number): void; /** * Updates records in the current dataset to reflect new state * @param {Array>} items incoming records to update * @param {boolean} overwrite true if the record should be completely overwritten as opposed to augmented */ update(items?: Array>, overwrite?: boolean): void; /** * Deletes records from the current dataset to reflect new state * @param {Array>} items incoming records to delete */ delete(items?: Array>): void; /** * Executes a provided function once for each array element in the current data * @param {Function} fn An optional function to iterate the array */ forEach(fn: any): void; /** * Sort the dataset * @param {string} field The dataset field * @param {boolean} reverse Sort ascending or descending */ sort(field: string, reverse: boolean): void; /** * An overridable array sort function * @param {string} field The dataset field * @param {any} ascending Sort ascending or descending * @returns {object} The sorted dataset */ sortFunction(field: string, ascending: any): (a: any, b: any) => any; /** * Filter current data with given callback * will reset filter data, if given callback not found * @param {Function} filterFunction User filter function * @returns {void} */ filter(filterFunction: any): void; } export default IdsDataSource;