import { FieldsExpression, GetOptions } from '@subql/types-core'; import { Model, ModelStatic, Transaction } from '@subql/x-sequelize'; import { Fn } from '@subql/x-sequelize/types/utils'; import { HistoricalMode } from '../../types'; import { Exporter, TransactionedExporter } from '../exporters'; export type BaseEntity = { id: string; __block_range?: (number | null)[] | Fn; }; export interface IModel { model: Readonly>>; get(id: string, tx?: Transaction): Promise; getByFields(filters: FieldsExpression[], options: GetOptions, tx?: Transaction): Promise; set: (id: string, data: T, blockHeight: number, tx?: Transaction) => Promise; bulkCreate(data: T[], blockHeight: number, tx?: Transaction): Promise; bulkUpdate(data: T[], blockHeight: number, fields?: string[], tx?: Transaction): Promise; bulkRemove(ids: string[], blockHeight: number, tx?: Transaction): Promise; exporters: Exporter[]; } export declare class PlainModel implements IModel { readonly model: ModelStatic>; private readonly historical; exporters: TransactionedExporter[]; constructor(model: ModelStatic>, historical?: HistoricalMode); get(id: string, tx?: Transaction): Promise; getByFields(filters: FieldsExpression[], options: GetOptions, tx?: Transaction): Promise; set(id: string, data: T, blockHeight: number, tx?: Transaction): Promise; bulkCreate(data: T[], blockHeight: number, tx?: Transaction): Promise; bulkUpdate(data: T[], blockHeight: number, fields?: string[], tx?: Transaction): Promise; bulkRemove(ids: string[], blockHeight: number, tx?: Transaction): Promise; private get sequelize(); private markAsDeleted; addExporter(exporter: Exporter): void; }