import { FieldsExpression, GetOptions } from '@subql/types-core'; import { Model, ModelStatic, Transaction } from '@subql/x-sequelize'; import { NodeConfig } from '../../../configure'; import { HistoricalMode } from '../../types'; import { Cacheable } from '../cacheable'; import { Exporter } from '../exporters'; import { ICachedModelControl } from '../types'; import { BaseEntity, IModel } from './model'; export declare class CachedModel extends Cacheable implements IModel, ICachedModelControl { readonly model: ModelStatic>; private readonly historical; private getNextStoreOperationIndex; private getCache; private setCache; private removeCache; readonly hasAssociations: boolean; exporters: Exporter[]; flushableRecordCounter: number; constructor(model: ModelStatic>, historical: HistoricalMode | undefined, config: NodeConfig, getNextStoreOperationIndex: () => number); allCachedIds(): string[]; get(id: string): Promise; addExporter(cacheState: Exporter): void; /** * getByFields allows ordering and filtering of data from the setCache and DB. * * When ordering, cache data is provided first followed by DB data, this is to ensure offsets work * * It does not use the get cache because there is no way to guarantee order, * and we have no way to tell where setCache data fits in the order. * * There is also no way to flush data here, * flushing will only flush data before the current block so its still required to consider the setCache * */ getByFields(filters: FieldsExpression[], options?: GetOptions): Promise; set(id: string, data: T, blockHeight: number): Promise; bulkCreate(data: T[], blockHeight: number): Promise; bulkUpdate(data: T[], blockHeight: number, fields?: string[]): Promise; remove(id: string, blockHeight: number): Promise; bulkRemove(ids: string[], blockHeight: number): Promise; get isFlushable(): boolean; runFlush(tx: Transaction, blockHeight: number): Promise; flushOperation(operationIndex: number, tx: Transaction): Promise; private filterRemoveRecordByHeight; private filterRecordsWithHeight; private applyBlockRange; clear(blockHeight?: number): void; private historicalMarkPreviousHeightRecordsBatch; private get sequelize(); }