import { s as FlagConditionGroup, u as FlagContext, F as Flag, H as FlagRule, ad as Segment, G as FlagResult, q as ExclusionLayer, t as FlagConditionLeaf, ab as RolloutConfig } from '../types-YdF1AOxp.js'; import '../core/metrics.js'; import '../core/flag-types.js'; /** * Evaluates a single condition leaf against the context. */ declare function evaluateConditionLeaf(leaf: FlagConditionLeaf, context: FlagContext): boolean; /** * Evaluates a condition group (AND/OR/NOT) recursively. */ declare function evaluateConditionGroup(group: FlagConditionGroup, context: FlagContext): boolean; /** * Resolves the current effective rollout percentage, taking ramp schedule into account. */ declare function resolveRolloutPercentage(rollout: RolloutConfig, now?: Date): number; interface EvaluateOptions { /** Rules for this flag (from DB) */ rules?: FlagRule[]; /** Sticky variant assignment for this user */ userAssignment?: string; /** Developer local override value */ localOverride?: unknown; /** Segments for resolving segment conditions */ segments?: Segment[]; /** Current date (for testing date-based logic) */ now?: Date; /** * Pre-evaluated prerequisite flag results. Keyed by flagKey. * Used by FlagManager to pass resolved prerequisites to the evaluator. */ prerequisiteResults?: Record; /** * Optional exclusion layer details for the layer this flag belongs to. */ exclusionLayer?: ExclusionLayer; /** * Optional logger callback for evaluator warnings (e.g. a rule pointing at * a deleted variant). Keeps the evaluator pure — it never touches console * directly so it stays safe in Edge runtimes and tests. */ onWarning?: (message: string, meta?: Record) => void; /** * When true, the returned FlagResult includes a `trace` field describing * every pipeline step that was evaluated (matched or bypassed). */ trace?: boolean; } /** * Pure evaluation function — the heart of the Rollease SDK. * * Implements the 9-step pipeline: * 1. Flag exists? * 2. Kill switch * 3. Flag disabled / archived * 4. Date window (scheduledAt / expiresAt) * 5. Local override (.rolleaserc.json) * 6. Sticky assignment * 7. Targeting rules (by priority) * 8. Percentage rollout * 9. Default value */ declare function evaluateFlag(flag: Flag, context: FlagContext, options?: EvaluateOptions): FlagResult; export { type EvaluateOptions, evaluateConditionGroup, evaluateConditionLeaf, evaluateFlag, resolveRolloutPercentage };