import { Readable, Writable } from "node:stream";
export interface CacheOptions {
    initialDataCapacity: number;
    initialMetadataCapacity: number;
    maxDataCapacity: number;
    maxMetadataCapacity: number;
}
export interface CacheReadOptions {
    tags?: readonly string[];
}
export interface CacheEntryOptions extends CacheReadOptions {
    path?: string;
}
export interface CacheStats {
    dataCapacity: number;
    entries: number;
    freeBytes: number;
    keys: string[];
    largestFreeRegion: number;
    metadataCapacity: number;
    metadataUsedBytes: number;
    pinnedEntries: number;
    staleEntries: number;
    usedBytes: number;
    writingEntries: number;
}
export declare class SharedCache {
    readonly metadata: SharedArrayBuffer;
    readonly data: SharedArrayBuffer;
    private readonly metadataView;
    private readonly metadataBytes;
    private constructor();
    static create(options: CacheOptions): SharedCache;
    static attach(metadata: SharedArrayBuffer, data: SharedArrayBuffer): SharedCache;
    get(key: string, options?: CacheReadOptions): Uint8Array | undefined;
    has(key: string, options?: CacheReadOptions): boolean;
    set(key: string, data: Uint8Array, options?: CacheEntryOptions): void;
    createWriteStream(key: string, expectedLength: number, options?: CacheEntryOptions): Writable;
    createReadStream(key: string): Readable;
    setFile(key: string, filePath: string, options?: CacheEntryOptions): void;
    delete(key: string): boolean;
    addTags(key: string, tags: readonly string[]): void;
    invalidateTag(tag: string): void;
    clear(): void;
    isTagValid(tag: string, key: string): boolean;
    recordPathUpdate(path: string, timestamp?: number): void;
    getPathLastModified(path: string): number | undefined;
    invalidatePath(path: string): void;
    isStale(key: string): boolean;
    getStats(): CacheStats;
    private readUint32;
    private writeUint32;
    private nextTimestamp;
    private grow;
    private allocateMetadata;
    private freeMetadata;
    private name;
    private rehash;
    private current;
    private makeTags;
    private freeTags;
    private stale;
    private updatePath;
    private reserve;
    private allocateData;
    private allocateFreeExtent;
    private reclaimStale;
    private payload;
    private publish;
    private retire;
    private release;
    private linkEntry;
    private unlinkEntry;
    private freeDataExtent;
}
//# sourceMappingURL=shared-cache.d.ts.map