jinaga
Version:
Data management for web and mobile applications.
36 lines • 1.01 kB
TypeScript
/**
* Interface for a component that can save data.
*/
export interface Saver {
/**
* Saves data to the network.
*/
save(): Promise<void>;
}
/**
* Processes a queue with a debouncing mechanism.
* This improves performance by batching multiple operations together.
*/
export declare class QueueProcessor {
private currentBatch;
/**
* Creates a new QueueProcessor.
* @param saver The component that will save the data.
* @param delayMilliseconds The delay in milliseconds before processing the queue.
*/
constructor(saver: Saver, delayMilliseconds: number);
/**
* Schedules processing of the queue with a delay.
* This allows multiple operations to be batched together.
*/
scheduleProcessing(): void;
/**
* Processes the queue immediately, bypassing any delay.
*/
processQueueNow(): Promise<void>;
/**
* Disposes of the QueueProcessor.
*/
dispose(): void;
}
//# sourceMappingURL=QueueProcessor.d.ts.map