import type { DidDocument } from '@atproto/did'; import type { InternalStateData, Session } from '@atproto/oauth-client'; import type { OAuthAuthorizationServerMetadata, OAuthProtectedResourceMetadata } from '@atproto/oauth-types'; import type { ResolvedHandle } from '@atproto-labs/handle-resolver'; import type { SimpleStore, Value } from '@atproto-labs/simple-store'; import { type DBObjectStore } from './indexed-db/index.js'; type Item = { value: V; expiresAt?: string; }; type EncodedKey = { keyId: string; keyPair: CryptoKeyPair; }; export type Schema = { state: Item & { dpopKey: EncodedKey; }>; session: Item & { dpopKey: EncodedKey; }>; didCache: Item; dpopNonceCache: Item; handleCache: Item; authorizationServerMetadataCache: Item; protectedResourceMetadataCache: Item; }; export type DatabaseStore = SimpleStore; export type BrowserOAuthDatabaseOptions = { name?: string; durability?: 'strict' | 'relaxed'; cleanupInterval?: number; }; export declare class BrowserOAuthDatabase { #private; constructor(options?: BrowserOAuthDatabaseOptions); protected run(storeName: N, mode: 'readonly' | 'readwrite', fn: (s: DBObjectStore) => R | Promise): Promise; protected createStore(name: N, { encode, decode, expiresAt, }: { encode: (value: V) => Schema[N]['value'] | PromiseLike; decode: (encoded: Schema[N]['value']) => V | PromiseLike; expiresAt: (value: V) => null | Date; }): DatabaseStore; getSessionStore(): DatabaseStore; getStateStore(): DatabaseStore; getDpopNonceCache(): DatabaseStore; getDidCache(): DatabaseStore; getHandleCache(): DatabaseStore; getAuthorizationServerMetadataCache(): undefined | DatabaseStore; getProtectedResourceMetadataCache(): undefined | DatabaseStore; cleanup(): Promise; [Symbol.asyncDispose](): Promise; } export {}; //# sourceMappingURL=browser-oauth-database.d.ts.map