/** * Action that can be recorded for later execution against a Flushable * in its flush() function. */ export declare type ScriptAction = (t: T) => Promise; /** * Interface implemented by objects that can accumulate changes * that require flushing. */ export interface Flushable { /** * Are there pending changes that need to be flushed? */ dirty: boolean; /** * Flush any pending changes. */ flush(): Promise; } /** * Interface to be implemented by Flushable objects that can accumulate a change script * and play it synchronously. */ export interface ScriptedFlushable extends Flushable { /** * Record an arbitrary action against the backing object. * @param {(p: ProjectAsync) => Promise} action */ recordAction(action: ScriptAction): this; } /** * Defer the given action until the relevant ScriptableFlushable is flushable * @param {ScriptedFlushable} flushable * @param {ScriptAction} promise */ export declare function defer(flushable: ScriptedFlushable, promise: Promise): void; //# sourceMappingURL=Flushable.d.ts.map