export interface IPlaygroundCompilerGeneration { /** Whether this token still owns the active compiler Worker generation. */ isCurrent(): boolean; } /** * Serializes dependency mutations and fences every asynchronous consumer of a * compiler Worker generation. * * Invalidating a generation immediately makes its active task advisory-only and * prevents its queued tasks from starting. New-generation tasks remain * serialized behind an active old task so two dependency installers can never * mutate the shared compiler filesystem concurrently. */ export declare class PlaygroundCompilerLifecycle { private epoch; private queue; capture(): IPlaygroundCompilerGeneration; invalidate(): IPlaygroundCompilerGeneration; invalidateIfCurrent(generation: IPlaygroundCompilerGeneration): IPlaygroundCompilerGeneration | undefined; /** * Reset a Worker owned by `generation`, then clear its dependency metadata. * * The clear deliberately happens before a caller checks any independent * source version. A source edit during reset still leaves an empty Worker, so * its metadata must become empty too. A Worker-generation replacement * performs its own synchronous clear and prevents this stale reset from * clearing the replacement. */ resetWorkerIfCurrent(generation: IPlaygroundCompilerGeneration, reset: () => Promise, clear: () => void): Promise; /** * Run a Worker mutation and reconcile a source edit that lands during it. * * An RPC cannot be cancelled after it has started mutating the Worker's * MemFS. If its source becomes stale before completion, reset that Worker and * clear the matching dependency metadata before another source can reuse it. */ mutateWorkerIfCurrent(generation: IPlaygroundCompilerGeneration, isSourceCurrent: () => boolean, mutate: () => Promise, reset: () => Promise, clear: () => void): Promise; enqueue(task: (generation: IPlaygroundCompilerGeneration) => Promise): Promise; }