import { BacktraceAttachment } from '../../model/attachment'; import { BacktraceDatabaseConfiguration } from '../../model/configuration/BacktraceDatabaseConfiguration'; import { BacktraceData } from '../../model/data/BacktraceData'; import { BacktraceReportSubmission } from '../../model/http/BacktraceReportSubmission'; import { BacktraceModule, BacktraceModuleBindData } from '../BacktraceModule'; import { SessionFiles } from '../storage'; import { BacktraceDatabaseStorageProvider } from './BacktraceDatabaseStorageProvider'; import { BacktraceDatabaseRecord } from './model/BacktraceDatabaseRecord'; export declare class BacktraceDatabase implements BacktraceModule { private readonly _options; private readonly _storageProvider; private readonly _requestHandler; private readonly _sessionFiles?; /** * Determines if the database is enabled. */ get enabled(): boolean; private readonly _databaseRecordContext; private readonly _storageProviders; private readonly _maximumRecords; private readonly _retryInterval; private _intervalId?; private _enabled; constructor(_options: BacktraceDatabaseConfiguration | undefined, _storageProvider: BacktraceDatabaseStorageProvider, _requestHandler: BacktraceReportSubmission, _sessionFiles?: SessionFiles | undefined); /** * Starts database integration. * @returns true if the database started successfully. Otherwise false. */ initialize(): boolean; bind({ reportEvents }: BacktraceModuleBindData): void; /** * Adds backtrace data to the database * @param backtraceData diagnostic data object * @param attachments attachments * @returns record if database is enabled. Otherwise undefined. */ add(backtraceData: BacktraceData, attachments: BacktraceAttachment[]): BacktraceDatabaseRecord | undefined; /** * Returns stored references to Backtrace records * @returns available records in the database */ get(): BacktraceDatabaseRecord[]; /** * @returns Returns number of records stored in the Database */ count(): number; /** * Disables database integration. After running the dispose method, you cannot * execute any database operations. */ dispose(): void; /** * Removes the database record/records * @param recordOrRecords database records */ remove(recordOrRecords: BacktraceDatabaseRecord | BacktraceDatabaseRecord[]): void; addStorageProvider(storageProvider: BacktraceDatabaseStorageProvider): void; /** * Sends all records available in the database to Backtrace and removes them * no matter if the submission process was successful or not. */ flush(): Promise; /** * Sends all records available in the database to Backtrace. */ send(): Promise; /** * Prepare database to insert records * @param totalNumberOfRecords number of records to insert */ private prepareDatabase; private loadReports; private setupDatabaseAutoSend; private lockSessionWithRecord; }