export interface ArkmeAvatarImagePayload { mediaType: string; dataBase64: string; } export interface ArkmeAvatarImageSnapshot { cacheKey: string; reference: string; value: string; expiresAtMillis: number; } export type ArkmeAvatarImageListener = (imageDataUrl: string | undefined) => void; export interface ArkmeAvatarImagePort { activateScope(scopeKey: string | undefined): void; current(imageRef: string): string | undefined; /** The grant may rotate while the account-scoped display identity stays stable. */ load(imageRef: string, cacheKey?: string): Promise; subscribe(imageRef: string, listener: ArkmeAvatarImageListener): () => void; revalidateActive(imageRefs?: readonly string[]): Promise; snapshot?(scopeKey: string, imageRefs: readonly string[]): ArkmeAvatarImageSnapshot[]; restore?(scopeKey: string, images: readonly ArkmeAvatarImageSnapshot[]): void; } export interface ArkmeAvatarPersistentCache { read(scope: string, imageRef: string): Promise; write(scope: string, imageRef: string, payload: ArkmeAvatarImagePayload): Promise; } /** These references identify immutable bytes, unlike mutable profile references. */ export declare function isImmutableAvatarRef(ref: string): boolean; interface InMemoryArkmeAvatarImageStoreOptions { reader: (imageRef: string) => Promise; onLoadFailure?: (failure: { imageRef: string; scopeKey: string | undefined; trigger: 'load' | 'revalidate'; hasCachedImage: boolean; durationMillis: number; error: unknown; }) => void; cachedReader?: (imageRef: string) => Promise; persistentCache?: ArkmeAvatarPersistentCache; now?: () => number; ttlMillis?: number; jitterMillis?: number | (() => number); concurrency?: number; } export declare class InMemoryArkmeAvatarImageStore implements ArkmeAvatarImagePort { private readonly options; private readonly entries; private readonly listeners; private readonly queue; private readonly now; private readonly ttlMillis; private readonly jitterMillis; private readonly concurrency; private activeDownloads; private activeImmutableReads; private activeCacheProbes; private generation; private scopeKey; constructor(options: InMemoryArkmeAvatarImageStoreOptions); activateScope(scopeKey: string | undefined): void; current(imageRef: string): string | undefined; /** Copy already-resolved bytes only. Never turn opening a window into an image download. */ snapshot(scopeKey: string, imageRefs: readonly string[]): ArkmeAvatarImageSnapshot[]; restore(scopeKey: string, images: readonly ArkmeAvatarImageSnapshot[]): void; load(imageRef: string, cacheKey?: string): Promise; subscribe(imageRef: string, listener: ArkmeAvatarImageListener): () => void; revalidateActive(imageRefs?: readonly string[]): Promise; private loadInternal; private pruneCache; private schedule; private drainQueue; private notify; } export {}; //# sourceMappingURL=avatar-image-store.d.ts.map