import { TableCertificateField, TableCertificateX, TableCommission, TableMonitorEvent, TableOutput, TableOutputBasket, TableOutputTag, TableOutputTagMap, TableProvenTx, TableProvenTxReq, TableSettings, TableSyncState, TableTransaction, TableTxLabel, TableTxLabelMap, TableUser } from './schema/tables'; import type * as sdk from '../sdk/index'; import { Telemetry, TelemetryConfig } from '@bsv/sdk'; type StorageDate = Date | string; type DateInput = Date | string | number; type OptionalDateInput = DateInput | null | undefined; /** * The `StorageReader` abstract class is the base of the concrete wallet storage provider classes. * * It is the minimal interface required to read all wallet state records and is the base class for sync readers. * * The next class in the heirarchy is the `StorageReaderWriter` which supports sync readers and writers. * * The last class in the heirarchy is the `Storage` class which supports all active wallet operations. * * The ability to construct a properly configured instance of this class implies authentication. * As such there are no user specific authenticated access checks implied in the implementation of any of these methods. */ export declare abstract class StorageReader implements sdk.WalletStorageSyncReader { chain: sdk.Chain; readonly telemetry: Telemetry; _settings?: TableSettings; whenLastAccess?: Date; get dbtype(): DBType | undefined; constructor(options: StorageReaderOptions); isAvailable(): boolean; makeAvailable(): Promise; getSettings(): TableSettings; isStorageProvider(): boolean; abstract destroy(): Promise; abstract transaction(scope: (trx: sdk.TrxToken) => Promise, trx?: sdk.TrxToken): Promise; abstract readSettings(trx?: sdk.TrxToken): Promise; abstract findCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise; abstract findCertificates(args: sdk.FindCertificatesArgs): Promise; abstract findCommissions(args: sdk.FindCommissionsArgs): Promise; abstract findMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise; abstract findOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise; abstract findOutputs(args: sdk.FindOutputsArgs): Promise; abstract findOutputTags(args: sdk.FindOutputTagsArgs): Promise; abstract findSyncStates(args: sdk.FindSyncStatesArgs): Promise; abstract findTransactions(args: sdk.FindTransactionsArgs): Promise; abstract findTxLabels(args: sdk.FindTxLabelsArgs): Promise; abstract findUsers(args: sdk.FindUsersArgs): Promise; abstract countCertificateFields(args: sdk.FindCertificateFieldsArgs): Promise; abstract countCertificates(args: sdk.FindCertificatesArgs): Promise; abstract countCommissions(args: sdk.FindCommissionsArgs): Promise; abstract countMonitorEvents(args: sdk.FindMonitorEventsArgs): Promise; abstract countOutputBaskets(args: sdk.FindOutputBasketsArgs): Promise; abstract countOutputs(args: sdk.FindOutputsArgs): Promise; abstract countOutputTags(args: sdk.FindOutputTagsArgs): Promise; abstract countSyncStates(args: sdk.FindSyncStatesArgs): Promise; abstract countTransactions(args: sdk.FindTransactionsArgs): Promise; abstract countTxLabels(args: sdk.FindTxLabelsArgs): Promise; abstract countUsers(args: sdk.FindUsersArgs): Promise; abstract getProvenTxsForUser(args: sdk.FindForUserSincePagedArgs): Promise; abstract getProvenTxReqsForUser(args: sdk.FindForUserSincePagedArgs): Promise; abstract getTxLabelMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise; abstract getOutputTagMapsForUser(args: sdk.FindForUserSincePagedArgs): Promise; /** * Optional efficient source-side totals for synchronization progress. * Providers without a native count implementation omit the metadata rather * than loading every matching record merely to count it. */ getSyncChunkTotals(_args: sdk.RequestSyncChunkArgs, _userId: number): Promise; findUserByIdentityKey(key: string): Promise; getSyncChunk(args: sdk.RequestSyncChunkArgs): Promise; /** * Force dates to strings on SQLite and Date objects on MySQL and Postgres * @param date * @returns */ validateEntityDate(date: DateInput): StorageDate; /** * * @param date * @param useNowAsDefault if true and date is null or undefiend, set to current time. * @returns */ validateOptionalEntityDate(date: OptionalDateInput, useNowAsDefault?: boolean): StorageDate | undefined; validateDate(date: DateInput): Date; validateOptionalDate(date: OptionalDateInput): Date | undefined; validateDateForWhere(date: DateInput): DateInput; } export interface StorageReaderOptions { chain: sdk.Chain; /** Optional provider-neutral storage and database tracing. */ telemetry?: TelemetryConfig; } export type DBType = 'SQLite' | 'MySQL' | 'Postgres' | 'IndexedDB'; export {}; //# sourceMappingURL=StorageReader.d.ts.map