import { BaseEntity } from '../model'; export interface Exporter { /** * Exports an array of records. * This method should handle the processing of the provided records. * * @param records An array of records to be exported. * These records are of the same type as the database entries */ export: (record: T[]) => Promise; /** * Shuts down the export operation. * This method should ensure that all ongoing export operations are * completed and any resources used are properly released or closed. * * @returns A promise that resolves when the shutdown process is complete. */ shutdown: () => Promise; } export type TransactionedExporter = Exporter & { commit: () => Promise; }; export declare function isTxExporter(exporter: Exporter): exporter is TransactionedExporter; export declare function asTxExporter(exporter: Exporter): TransactionedExporter; export declare class TxExporter implements TransactionedExporter { #private; constructor(exporter: Exporter); export(data: T[]): Promise; shutdown(): Promise; commit(): Promise; }