import type { CompilationDependencyChange, CompilationScopeDependency, CompilationScopeGraphSource } from './compilation-scope-graph.js';
import type { CompilationResult, SourceKind, SourceScope } from './types.js';
export interface CompilationScopeSource extends CompilationScopeGraphSource {
    id: string;
    kind: SourceKind;
    candidates: Iterable<string>;
}
export interface CompilationScopeGenerationResult {
    classSet: Iterable<string>;
    dependenciesBySource?: Iterable<readonly [string, Iterable<CompilationScopeDependency>]> | undefined;
}
export interface CompilationScopeRequest {
    scope: SourceScope;
    outputId: string;
    sources: CompilationScopeSource[];
    changes?: CompilationDependencyChange[] | undefined;
    preserveDeletedCss?: boolean | undefined;
}
export interface CompilationScopeState extends Omit<CompilationResult, 'candidatesBySource'> {
    candidatesBySource: Map<string, Set<string>>;
}
export type CompilationScopeExecution<T> = {
    committed: true;
    compilation: CompilationScopeState;
    value: T;
} | {
    committed: false;
    compilation: CompilationScopeState;
    value?: never;
};
export declare class CompilationSessionPool {
    private readonly dependencyState;
    private readonly entries;
    private disposed;
    run<T extends CompilationScopeGenerationResult | undefined>(request: CompilationScopeRequest, compile: (compilation: CompilationScopeState) => Promise<T>): Promise<CompilationScopeExecution<T>>;
    invalidateScope(scopeId: string): void;
    dispose(): Promise<void>;
    get size(): number;
    getAffectedScopes(changes: Iterable<CompilationDependencyChange>): Set<string>;
    getAffectedScopeChanges(changes: Iterable<CompilationDependencyChange>): Map<string, CompilationDependencyChange[]>;
    recordDependencyChanges(changes: Iterable<CompilationDependencyChange>): Set<string>;
    recordAffectedScopes(scopeIds: Iterable<string>): void;
    getScopeDependencyRevision(scopeId: string): number;
    private getEntry;
    private disposeEntry;
    private runEntry;
    private prepareEntry;
    private createGraphSources;
    private normalizeGeneratedDependencies;
    private enqueue;
    private toScopeState;
}
export declare function getCompilationSessionPool(owner: object): CompilationSessionPool;
export declare function disposeCompilationSessionPool(owner: object): Promise<void>;
