14 lines
410 B
TypeScript
14 lines
410 B
TypeScript
type SyncTask = (dirPath: string, firstRun?: boolean) => Promise<void>;
|
|
export default class SyncScheduler {
|
|
private readonly task;
|
|
private readonly debounceMs;
|
|
private pending;
|
|
private timers;
|
|
private flushing;
|
|
constructor(task: SyncTask, debounceMs: number);
|
|
schedule(dirPath: string): void;
|
|
enqueue(dirPath: string, firstRun?: boolean): void;
|
|
private flush;
|
|
}
|
|
export {};
|