import Log4js from 'log4js';
import Logger from '../logger';
import StateManager from '../state-manager';
import Profiler from '../utils/profiler';
import * as ShardusTypes from './../shardus/shardus-types';
import Sqlite3Storage from './sqlite3storage';
import { ColumnDescription } from './utils/schemaDefintions';
/** A type alias to avoid both `any` and having to spell this type out any time
 * we want to use it. */
export type GenericObject = {
    [key: symbol]: unknown;
};
export type ModelAttributes = {
    [column: string]: ColumnDescription;
};
export interface ModelData {
    tableName: string;
    columns: string[];
    columnsString: string;
    substitutionString: string;
    isColumnJSON: {
        [key: string]: boolean;
    };
    JSONkeys: string[];
    insertOrReplaceString?: string;
    insertString?: string;
    selectString?: string;
    updateString?: string;
    deleteString?: string;
}
export type OperationOptions = {
    createOrReplace?: boolean;
    raw?: boolean;
    order?: {
        length: number;
    };
    limit?: number;
};
export interface ParamEntry {
    name: string;
    type?: string;
    v1?: string;
    v2?: string;
    sql?: string;
    vals?: string[];
}
interface Storage {
    serverConfig: ShardusTypes.StrictServerConfiguration;
    profiler: Profiler;
    mainLogger: Log4js.Logger;
    fatalLogger: Log4js.Logger;
    storage: Sqlite3Storage;
    stateManager: StateManager;
    storageModels: any;
    initialized: boolean;
    _create: any;
    _read: any;
    _readOld: any;
    _update: any;
    _delete: any;
    _query: any;
    _queryOld: any;
}
declare class Storage {
    constructor(baseDir: string, config: ShardusTypes.StrictStorageConfiguration, serverConfig: ShardusTypes.StrictServerConfiguration, logger: Logger, profiler: Profiler);
    init(): Promise<void>;
    close(): Promise<void>;
    deleteOldDBPath(): Promise<void>;
    _checkInit(): void;
    addCycles(cycles: any): Promise<void>;
    updateCycle(record: any, newRecord: any): Promise<void>;
    getCycleByCounter(counter: any): Promise<any>;
    getCycleByMarker(marker: any): Promise<any>;
    deleteCycleByCounter(counter: any): Promise<void>;
    deleteCycleByMarker(marker: any): Promise<void>;
    listCycles(): Promise<any>;
    listOldCycles(): Promise<any>;
    getLastOldNetworkHash(): Promise<any>;
    getLastOldPartitionHashes(): Promise<any[]>;
    addNodes(nodes: any): Promise<void>;
    getNodes(node: any): Promise<any>;
    updateNodes(node: any, newNode: any): Promise<void>;
    deleteNodes(nodes: any): Promise<void>;
    listNodes(): Promise<any>;
    setProperty(key: any, value: any): Promise<void>;
    getProperty(key: any): Promise<any>;
    deleteProperty(key: any): Promise<void>;
    listProperties(): Promise<any>;
    clearP2pState(): Promise<void>;
    clearAppRelatedState(): Promise<void>;
    addAcceptedTransactions(acceptedTransactions: any): Promise<void>;
    addPartitionHash(partition: any): Promise<void>;
    addReceiptMapHash(receiptMap: any): Promise<void>;
    addSummaryHash(summaryHash: any): Promise<void>;
    addNetworkState(networkState: any): Promise<void>;
    addNetworkReceipt(networkReceipt: any): Promise<void>;
    addNetworkSummary(networkSummary: any): Promise<void>;
    addAccountStates(accountStates: any): Promise<void>;
    queryAcceptedTransactions(tsStart: any, tsEnd: any, limit: any): Promise<any>;
    queryAcceptedTransactionsByIds(ids: any): Promise<any>;
    queryAccountStateTable(accountStart: any, accountEnd: any, tsStart: any, tsEnd: any, limit: any): Promise<any>;
    queryAccountStateTableByList(addressList: any, tsStart: any, tsEnd: any): Promise<any>;
    queryAccountStateTableByListNewest(accountIDs: any): Promise<any>;
    clearAccountStateTableByList(addressList: any, tsStart: any, tsEnd: any): Promise<void>;
    clearAccountStateTableOlderThan(tsEnd: any): Promise<void>;
    clearAcceptedTX(tsStart: any, tsEnd: any): Promise<void>;
    searchAccountStateTable(accountId: any, txTimestamp: any): Promise<any>;
    createAccountCopies(accountCopies: any): Promise<void>;
    createOrReplaceAccountCopy(accountCopy: any): Promise<void>;
    getAccountReplacmentCopies1(accountIDs: any, cycleNumber: any): Promise<any>;
    getAccountReplacmentCopies(accountIDs: any, cycleNumber: any): Promise<any>;
    clearAccountReplacmentCopies(accountIDs: any, cycleNumber: any): Promise<any[]>;
    getAccountCopiesByCycle(cycleNumber: any): Promise<any>;
    getAccountCopiesByCycleAndRange(cycleNumber: any, lowAddress: any, highAddress: any): Promise<any>;
    getGlobalAccountCopies(cycleNumber: any): Promise<any>;
    getOldAccountCopiesByCycleAndRange(cycleNumber: any, lowAddress: any, highAddress: any): Promise<any>;
    getOldGlobalAccountCopies(cycleNumber: any): Promise<any>;
}
export default Storage;
