import type { ServiceAccount } from './firebase-types.js'; import { FirebaseEdgeError } from './errors.js'; import type { CacheConfig } from './cache-types.js'; /** * Firebase Admin Authentication handler for edge environments. * Provides server-side authentication operations using service account credentials. */ export declare class FirebaseAdminAuth { private serviceAccountKey; private tenantId?; private fetch?; private cache?; private cacheName?; private _cacheName; /** * Creates a new Firebase Admin Auth instance. * * @param serviceAccountKey Firebase service account credentials * @param tenantId Optional tenant ID for multi-tenancy * @param fetch Optional custom fetch implementation * @param cache Optional cache implementation for token caching * @param cacheName Optional cache key name (defaults to '__cache') */ constructor(serviceAccountKey: ServiceAccount, tenantId?: string | undefined, fetch?: typeof globalThis.fetch | undefined, cache?: CacheConfig | undefined, cacheName?: string | undefined); /** * Retrieves a cached service account token or fetches a new one. * Tokens are cached for 1 hour. * * @returns Promise with token data and error */ private getCachedToken; /** * Retrieves user account information by UID. * * @param uid User ID to look up * @returns Promise with object containing user data or null, and error if any */ getUser(uid: string): Promise<{ data: null; error: FirebaseEdgeError; } | { data: import("./firebase-types.js").UserInfo | null | undefined; error: null; }>; /** * Retrieves user account information by email address. * * @param email Email address to look up * @returns Promise with object containing user data or null, and error if any */ getUserByEmail(email: string): Promise<{ data: null; error: FirebaseEdgeError; } | { data: import("./firebase-types.js").UserInfo | null | undefined; error: null; }>; /** * Verifies a Firebase ID token and returns the decoded payload. * Optionally checks if the token has been revoked. * * @param idToken Firebase ID token to verify * @param checkRevoked Whether to check if token has been revoked (defaults to false) * @returns Promise with object containing decoded token payload or null, and error if any */ verifyIdToken(idToken: string, checkRevoked?: boolean): Promise<{ data: null; error: FirebaseEdgeError; } | { data: import("./firebase-types.js").FirebaseIdTokenPayload; error: null; }>; /** * Creates a session cookie from a Firebase ID token. * * @param idToken Firebase ID token to convert to session cookie * @param expiresIn_ms Session cookie expiration time in milliseconds * @returns Promise with object containing session cookie string or null, and error if any */ createSessionCookie(idToken: string, expiresIn_ms: number): Promise<{ data: null; error: FirebaseEdgeError; } | { data: string | null; error: null; }>; /** * Verifies a Firebase session cookie and returns the decoded payload. * Optionally checks if the token has been revoked. * * @param sessionCookie Session cookie to verify * @param checkRevoked Whether to check if token has been revoked (defaults to false) * @returns Promise with object containing decoded session payload or null, and error if any */ verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise<{ data: null; error: FirebaseEdgeError; } | { data: import("./firebase-types.js").FirebaseIdTokenPayload; error: null; }>; /** * Creates a custom Firebase authentication token for a given user. * * @param uid User ID to create token for * @param developerClaims Optional custom claims to include in the token * @returns Promise with object containing custom token string or null, and error if any */ createCustomToken(uid: string, developerClaims?: object): Promise<{ data: null; error: FirebaseEdgeError; } | { data: string; error: null; }>; } //# sourceMappingURL=firebase-admin-auth.d.ts.map