import { FlagManager } from './engine/manager.mjs'; import { INTERNAL_SECRET } from './core/internal.mjs'; import { J as FlagType, aa as RolleaseHooks, ap as WebhookConfig } from './types-DdEZ8iqq.mjs'; import './core/logger.mjs'; import './core/metrics.mjs'; import './core/flag-types.mjs'; interface MockFlagDefinition { /** Evaluated value. @default true for boolean flags */ value?: unknown; /** Flag type. Inferred from value if omitted. */ type?: FlagType; /** Whether the flag is enabled. @default true */ enabled?: boolean; /** Default value when flag is disabled. */ defaultValue?: unknown; /** Variant key for multivariate flags. */ variant?: string; /** Flag description. */ description?: string; /** Flag tags. */ tags?: string[]; } type MockFlagMap = Record; interface MockRolleaseOptions { /** Flags to pre-seed. Values can be shorthand (boolean/string/number) or full definitions. */ flags?: MockFlagMap; /** Optional hooks (useful for testing RBAC-denial behavior). */ hooks?: RolleaseHooks; /** Webhooks (useful for testing dispatch side-effects). */ webhooks?: WebhookConfig[]; /** Secret for the internal signing slot. @default 'rollease-test-secret-xxxx' */ secret?: string; } interface MockRolleaseClient { /** The FlagManager instance — full production API available. */ flags: FlagManager; /** * Set a flag's enabled state and default value for the current test. * Creates the flag if it doesn't exist; updates it if it does. */ setFlag(key: string, value: unknown): Promise; /** Reset a flag back to its original seeded value. */ resetFlag(key: string): Promise; /** Reset ALL flags back to their seeded state. */ resetAll(): Promise; /** * Force-override a flag value for the duration of a test without touching * the DB — uses the .rolleaserc.json local-override mechanism internally. * Faster than setFlag() for simple boolean gates. */ overrideFlag(key: string, value: unknown): void; /** Clear a specific local override. */ clearOverride(key: string): void; /** Clear all local overrides. */ clearAllOverrides(): void; /** Clean up resources. Call in afterEach/afterAll. */ close(): Promise; /** Symbol-keyed accessor matching the production RolleaseClient shape. */ [INTERNAL_SECRET]?: () => string; } /** Convenience builder for creating flag definitions with full type safety. */ declare function mockFlag(key: string, def: boolean | string | number | MockFlagDefinition): { key: string; def: MockFlagDefinition; }; declare function createMockRollease(options?: MockRolleaseOptions): Promise; export { type MockFlagDefinition, type MockFlagMap, type MockRolleaseClient, type MockRolleaseOptions, createMockRollease as createMock, createMockRollease, mockFlag };