import { type FeatureFlagDefinition } from "./registry.js"; export type FeatureFlagMode = "off" | "on" | "rules"; export interface FeatureFlagRules { version: 1; mode: FeatureFlagMode; emails: string[]; orgIds: string[]; percentage: number; updatedAt: number | null; updatedBy: string | null; } export interface FeatureFlagScope { userEmail?: string; /** Canonical authenticated identity. V1 callers use normalized email. */ userKey?: string; orgId?: string | null; } export declare const FEATURE_FLAG_SETTINGS_PREFIX = "feature-flag:"; export declare function defaultFeatureFlagRules(): FeatureFlagRules; export declare function normalizeFeatureFlagRules(value: unknown): FeatureFlagRules; export declare function getFeatureFlagRules(key: string, scope: Pick): Promise; /** * Atomically derive one flag's scoped rules. An org's first override starts * from the global fallback, then becomes independently CAS-protected. */ export declare function mutateFeatureFlagRules(key: string, scope: Pick, updater: (current: FeatureFlagRules) => FeatureFlagRules | Promise): Promise; export declare function evaluateFeatureFlagRules(key: string, rules: FeatureFlagRules, scope: FeatureFlagScope): boolean; export declare function evaluateFeatureFlag(key: string, scope?: FeatureFlagScope): Promise; /** Ergonomic app-action guard. Accepts either a registered definition or its key. */ export declare function isFeatureFlagEnabled(flag: string | FeatureFlagDefinition, scope?: FeatureFlagScope): Promise; //# sourceMappingURL=store.d.ts.map