import { SignInProviderType } from './types.js'; /** * Utility class for generating realistic, Firebase-like identifiers for tests. * * @remarks * Provides helpers for synthesizing: * - Firebase-style UIDs, * - provider-specific UIDs, * - project numbers and web app IDs, * - numeric, hex, alphanumeric, and base64-like identifiers. * * All values are pseudo-random (via `Math.random()`) and **not cryptographically secure**. * Intended solely for mocks, fixtures, and deterministic test environments. */ export declare class IdGenerator { /** * Build a Firebase-like web App ID from a project number. * * @param projectNumber - A 12-digit numeric string (see {@link projectNumber}). * @returns A string like `1::web:`. * * @remarks * - The trailing hex segment is 22 hex chars generated via `Math.random()`; **not cryptographically secure**. * - Intended for mocks/tests only. */ static appId(projectNumber: string): string; /** * Generate a pseudo-random numeric Firebase project number. * * @returns A numeric string of length 12, not starting with 0. * * @remarks * Uses `Math.random()`; **not cryptographically secure**. */ static projectNumber(): string; /** * Generate a pseudo-random Firebase-like user ID. * * @returns An alphanumeric string of length 28. * * @remarks * - Uses `Math.random()`; **not cryptographically secure**. * - Suitable for tests and mock identities. */ static firebaseUid(): string; /** * Generates a realistic-looking provider-specific UID for a given sign-in provider type. * * @remarks * This helper is used to synthesize provider UIDs (for example, `providerData[n].uid`) * that resemble those issued by real providers, without needing to match their * exact formats. The output is **not** guaranteed to be unique, but is suitable * for tests and fixtures that need plausible identifiers. * * Known provider types use specialized patterns: * * - `'google' → 21-digit numeric ID * - `'apple'` → `NNNNNN.<32 hex>.[NNNN]` composite ID * - `'facebook'` → 17-digit numeric ID * - `'twitter'` → 18-digit numeric ID * - `'github'` → 10-digit numeric ID * - `'microsoft'` → 32-character hex ID * - `'yahoo'` → 26-character uppercase alphanumeric ID * - `'playgames'` → 20-character base64-like ID * - `'gamecenter'` → `G:<10 digit numeric>` ID * * Any unrecognized `type` falls back to a Firebase-style `uid` generated by * {@link firebaseUid}. * * @param type - Canonical identifier (for example, * `'google'`) indicating which provider format to emulate. * @returns A synthetic provider UID string matching the chosen provider pattern * or a Firebase-style UID for `'aonymous'`, `'custom'`, `'password'`, and `'phone'` types. */ static providerTypeUid(type: SignInProviderType): string; /** * Generates a realistic-looking provider-specific UID for a given sign-in provider. * * @remarks * This helper is used to synthesize provider UIDs (for example, `providerData[n].uid`) * that resemble those issued by real providers, without needing to match their * exact formats. The output is **not** guaranteed to be unique, but is suitable * for tests and fixtures that need plausible identifiers. * * Known provider types use specialized patterns: * * - `'google'` / `'google.com'` → 21-digit numeric ID * - `'apple'` / `'apple.com'` → `NNNNNN.<32 hex>.[NNNN]` composite ID * - `'facebook'` / `'facebook.com'` → 17-digit numeric ID * - `'twitter'` / `'twitter.com'` → 18-digit numeric ID * - `'github'` / `'github.com'` → 10-digit numeric ID * - `'microsoft'` / `'microsoft.com'` → 32-character hex ID * - `'yahoo'` / `'yahoo.com'` → 26-character uppercase alphanumeric ID * - `'playgames'` / `'playgames.google.com'` → 20-character base64-like ID * - `'gamecenter'` / `'gc.apple.com'` → `G:<10 digit numeric>` ID * * Any unrecognized `type` falls back to a Firebase-style `uid` generated by * {@link firebaseUid}. * * @param type - Canonical or provider-style identifier (for example, * `'google'` or `'google.com'`) indicating which provider format to emulate. * @returns A synthetic provider UID string matching the chosen provider pattern * or a Firebase-style UID for generic and unknown types. */ static providerUid(type: string): string; /** * Generate a pseudo-random numeric identifier of a given length. * * @param length - Total length (1–128). First digit is 1–9 (no leading zero). * @returns A numeric string. * * @remarks * Uses `Math.random()`; **not cryptographically secure**. * @internal */ static numericId(length: number): string; /** * Generate a pseudo-random lowercase-hex identifier. * * @param length - Length (1–128). * @returns A hex string using `[0-9a-f]`. * * @remarks * Uses `Math.random()`; **not cryptographically secure**. * @internal */ static hexId(length: number, typecase?: 'lower' | 'upper'): string; /** * Generate a pseudo-random alphanumeric identifier. * * @param length - Length (1–128). * @returns A string using `A-Za-z0-9`. * * @remarks * Uses `Math.random()`; **not cryptographically secure**. * @internal */ static alphanumericId(length: number, typecase?: 'lower' | 'upper' | 'both'): string; /** * Generates a URL-safe base64-like string of the specified length. * No padding character is added. * @param length * @returns */ static base64LikeId(length: number): string; } //# sourceMappingURL=id-generator.d.ts.map