export type QuotaScope = "user" | "server"; export declare class QuotaExceededError extends Error { readonly scope: QuotaScope; readonly limit: number; constructor(scope: QuotaScope, limit: number); } export interface QuotaReservation { id: string; ownerUserId: string; bytes: number; state: "reserved" | "committed"; } /** A distributed deployment can replace this with a transactional shared ledger. */ export interface FileQuotaPolicy { reserve(input: { id: string; ownerUserId: string; bytes: number; }): Promise; resizeReservation(id: string, actualBytes: number): Promise; commit(id: string, actualBytes: number): Promise; release(id: string): Promise; reconcileCommitted(files: Iterable<{ id: string; ownerUserId: string; bytes: number; }>): Promise; } export declare class LocalFileQuotaPolicy implements FileQuotaPolicy { private readonly limits; private readonly committedBytes; private readonly metadataDirectory; private readonly ledgerPath; private readonly lockPath; private queue; constructor(directory: string, limits: { perUserBytes: number; serverBytes: number; }, committedBytes: () => Promise); reserve(input: { id: string; ownerUserId: string; bytes: number; }): Promise; resizeReservation(id: string, actualBytes: number): Promise; commit(id: string, actualBytes: number): Promise; release(id: string): Promise; reconcileCommitted(files: Iterable<{ id: string; ownerUserId: string; bytes: number; }>): Promise; private assertCapacity; private update; private readLedger; private serialized; } //# sourceMappingURL=quota.d.ts.map