import type { DatapageSchema, Filter, Paging, Query } from '../datapage/types'; import type { DataObjectMeta } from '../analytics/types/data-model'; import type { DataAsyncResponse } from './types'; import BufferedDataView from './buffered-data-view'; import type { DataViewCall, DataViewCallCombiner, DataViewCallComparator, DataViewCallSeparator } from './buffer-utils-types'; interface Column { value: string; useForSearch?: boolean; } export interface Config { deferDatasource?: boolean; dataSourceMetaData?: { structure?: string; isQueryable?: boolean; } | DataObjectMeta; associationFilter?: string[] | null; propertyFilter?: string[]; matchPosition: string | undefined; ignoreCase: boolean | undefined; maxResultsDisplay?: string; enablePagination?: boolean; dataSource: string; parameters: { [param: string]: string; }; columns: Column[]; cacheLifeSpan?: string; listType?: string; pageSize?: number; invalidateCache?: boolean; purgeDataPageCache?: boolean; } type CacheEntry = Map>; /** For non-queryable data APIs, the cache will store Promise directly * For queryable data APIs, the cache will store CacheEntry which maps page numbers to Promise */ type Cache = Map | CacheEntry>; declare class DataApi { isInitialised: boolean; isQueryable?: boolean; nonQueryableData: object[]; fetchedNQData: boolean; previousSearchText: null | string; totalRecordCount: number; fetchedRecordCount: number; pageNumber: number; parameters?: { [param: string]: string; }; enablePagination?: boolean; columns?: Column[]; pageSize?: number; maxResultsDisplay?: string; matchPosition?: string; ignoreCase?: boolean; cache: Cache; keyCache: Map>; dataSourceMetaData?: { structure?: string; isQueryable?: boolean; } | DataObjectMeta; isNQDataFetchInProgress: boolean; fetchNQDataPromise: Promise<{ data: object[]; }> | null; dataSource: string; context?: string; associationFilter?: string[] | null; propertyFilter?: string[]; listType?: string; bufferInitialized: boolean; constructor(config?: Config, context?: string); private static readonly searchResultsCache; static init(config: Config, context?: string): Promise; static readonly bufferedDataView: BufferedDataView; registerForBufferedCall(bufferedCallParams: { combiner?: DataViewCallCombiner; comparator?: DataViewCallComparator; separator?: DataViewCallSeparator; waitTime?: number; maxSize?: number; }): this; static clearContextedCache(context: string): void; static initializeCache(context: string | undefined, config: Config, uniqueDataApiKey: string, dataApiObj: DataApi): void; fetchMetaData(context: string | undefined): Promise>; initializeBufferCallsForDataPage(bufferedCallParams: { combiner: DataViewCallCombiner; comparator: DataViewCallComparator; separator: DataViewCallSeparator; waitTime?: number; maxSize?: number; }): void; buildSchemaForQueryableBufferDP(searchText: string): DataViewCall; buildQueryWithKeys: (keys: string[], rowData: { [key: string]: string; }, overriddenConfig?: Partial) => Query; buildSchemaForQueryableDPWithKeys: (keys: string[], rowData: { [key: string]: string; }, overriddenConfig?: Partial) => DatapageSchema; getRowDataByKeys: (keys: string[], rowData: { [key: string]: string; }, overriddenConfig?: Partial) => Promise; private buildKeyCacheKey; private memoizedGetRowDataByKeys; getData(searchText: string, overriddenConfig?: Partial): Promise; private getCachedResult; private handleCacheError; private storeCacheResult; isResultCached(searchText: string): boolean; memoizedGetData(searchText: string, overriddenConfig?: Partial): Promise; fetchData(searchText?: string, isPaginated?: boolean, overriddenConfig?: Partial): Promise; fetchPaginatedData(searchText: string): Promise; fetchNonQueryableResults(searchText: string, overriddenConfig?: Partial): Promise; filterDataOnClient(searchText: string, clientSideData: { [key: string]: string; }[], overriddenConfig?: Partial): { [key: string]: string; }[]; private static resolveEmbeddedPath; positionMatches(text: string, searchText: string, overriddenConfig?: Partial): boolean; buildSelect(overriddenConfig?: Partial): { field: string; }[]; buildFilters(searchText: string, overriddenConfig?: Partial): Filter; buildQuery(searchText: string, overriddenConfig?: Partial): Query; buildPageOptions(): Paging; buildSchemaForQueryableDP(searchText: string, overriddenConfig?: Partial): { dataViewParameters: { [param: string]: string; } | undefined; query: Query; paging: Paging; }; buildSchemaForNonQueryableDP(): DatapageSchema; isValidDatasource(): boolean; } export default DataApi;