import { type AssetPutOptions, type AssetSignOptions, type AssetStat, type AssetStore, type ByteAssetDescriptor, type ByteAssetInput, type MemoryAssetStoreOptions, type MemoryAssetStoreSnapshot } from './asset-support.js'; /** * The shared contract, errors, and validation live in `asset-support.ts` and are re-exported here so * every existing `images/assets` import keeps resolving. */ export { AssetStoreCapacityError, AssetStoreError, AssetStoreSigningError, AssetStoreValidationError, } from './asset-support.js'; export type { AssetCapacityConstraint, AssetPutOptions, AssetSigner, AssetSignerContext, AssetSignOptions, AssetStat, AssetStore, AssetStoreResult, ByteAssetDescriptor, ByteAssetInput, MemoryAssetStoreOptions, MemoryAssetStoreSnapshot, } from './asset-support.js'; /** * Process-local, bounded asset storage. Capacity exhaustion rejects the write; live entries are never * silently evicted. Expired entries are purged before capacity and access decisions. */ export declare class MemoryAssetStore implements AssetStore { private readonly entries; private readonly maxEntries; private readonly maxTotalBytes; private readonly maxAssetBytes; private readonly defaultTtlSeconds?; private readonly createAssetId; private readonly clock; private readonly signer?; private totalBytes; constructor(options?: MemoryAssetStoreOptions); /** * Stores an asset. Throws when it would exceed a capacity limit, rather than evicting live * assets. */ put(input: ByteAssetInput, options: AssetPutOptions): AssetStat; /** * Reads an asset with its bytes, or `undefined` when it does not exist, has expired, or belongs * to another tenant. */ get(assetId: string, tenantId: string): ByteAssetDescriptor | undefined; /** Describes an asset without its bytes. */ stat(assetId: string, tenantId: string): AssetStat | undefined; /** Deletes an asset. Returns true when it existed. */ delete(assetId: string, tenantId: string): true | undefined; /** Returns a URL from the configured signer. Throws when no signer is configured. */ sign(assetId: string, tenantId: string, options?: AssetSignOptions): Promise; /** Deletes expired assets, returning how many went. */ purgeExpired(): number; /** Entries and bytes held, against the limits. */ snapshot(): MemoryAssetStoreSnapshot; private assertCapacity; private ownedEntry; private purgeExpiredAt; private removeEntry; private nowMs; }