import { type TestContextFactory } from '@dereekb/util/test'; import { type RulesUnitTestFirebaseTestingContextFixture } from './firebase'; /** * Default user ID used for the authenticated context in client-side Firebase tests. */ export declare const TESTING_AUTHORIZED_FIREBASE_USER_ID = "0"; /** * Convenience type alias for a test context factory that produces {@link RulesUnitTestFirebaseTestingContextFixture} instances. */ export type FirebaseTestContextFactory = TestContextFactory; /** * Permissive Firestore security rules that allow all reads and writes. */ export declare const AUTHORIZED_FIRESTORE_RULES = "\nrules_version = '2';\nservice cloud.firestore {\n match /databases/{database}/documents {\n match /{document=**} {\n allow read, write: if true;\n }\n }\n}\n"; /** * Permissive Firebase Storage security rules that allow all reads and writes. */ export declare const AUTHORIZED_STORAGE_RULES = "\nrules_version = '2';\nservice firebase.storage {\n match /b/{bucket}/o {\n match /{allPaths=**} {\n allow read, write: if true;\n }\n }\n}\n"; /** * Pre-configured {@link FirebaseTestContextFactory} that provides a fully authorized (all reads/writes allowed) * Firebase emulator context for both Firestore and Storage. * * Uses permissive security rules and authenticates as {@link TESTING_AUTHORIZED_FIREBASE_USER_ID}. * * **Important:** Only use this factory for tests that actually need Firebase Storage access. * Firestore-only tests should use {@link authorizedFirestoreOnlyFactory} instead to avoid * interfering with the storage emulator's global rules endpoint during parallel test execution. * * @example * ```ts * const f = testWithMockItemStorageFixture()(authorizedFirebaseFactory); * ``` */ export declare const authorizedFirebaseFactory: FirebaseTestContextFactory; /** * Pre-configured {@link FirebaseTestContextFactory} that provides a fully authorized Firestore-only * emulator context without configuring Storage rules. * * Use this for Firestore-only tests when running with parallel workers. The Firebase Storage * emulator maintains rules globally (not per-project like Firestore), so `initializeTestEnvironment` * calls that include storage rules from non-storage workers will hit `PUT /internal/setRules` * concurrently, which can cause transient `storage/unauthorized` errors in the storage test worker. * * @example * ```ts * const f = testWithMockItemCollectionFixture()(authorizedFirestoreOnlyFactory); * ``` */ export declare const authorizedFirestoreOnlyFactory: FirebaseTestContextFactory;