import { C as CacheAdapter, D as DbAdapter, j as CreateFlagInput, F as Flag, U as ListFlagsInput, V as ListFlagsResult, ak as UpdateFlagInput, I as FlagStatus, A as AddRuleInput, H as FlagRule, al as UpdateRuleInput, ac as RuleOrdering, l as CreateSegmentInput, ad as Segment, am as UpdateSegmentInput, ae as SegmentUsage, k as CreateReleaseInput, $ as Release, q as ExclusionLayer, r as ExclusionLayerAllocation, O as HistoryEntry, ai as TrackEventInput, aj as TrackingEvent, Q as InvalidationBus, S as InvalidationMessage, R as InvalidationListener } from '../types-YdF1AOxp.js'; import '../core/metrics.js'; import '../core/flag-types.js'; /** * In-memory database adapter. All data is stored in Maps and lost on process restart. * Use for development, testing, and prototyping. */ declare class MemoryDbAdapter implements DbAdapter { private idCounter; private flags; private rules; private segments; private releases; private assignments; private exclusionLayers; private history; private impressions; private trackingEvents; private genId; createFlag(input: CreateFlagInput): Promise; getFlag(key: string): Promise; listFlags(input: ListFlagsInput): Promise; updateFlag(key: string, input: UpdateFlagInput): Promise; setFlagStatus(key: string, status: FlagStatus): Promise; deleteFlag(key: string): Promise; cloneFlag(sourceKey: string, newKey: string, includeRules: boolean, includeRollout: boolean): Promise; setRollout(key: string, rollout: { percentage?: number; sticky?: boolean; hashKey?: string; rampSchedule?: { at: string; percentage: number; }[]; }): Promise; addRule(flagKey: string, input: AddRuleInput): Promise; updateRule(flagKey: string, ruleId: string, input: UpdateRuleInput): Promise; removeRule(flagKey: string, ruleId: string): Promise; listRules(flagKey: string): Promise; reorderRules(flagKey: string, ordering: RuleOrdering[]): Promise; createSegment(input: CreateSegmentInput): Promise; updateSegment(key: string, input: UpdateSegmentInput): Promise; deleteSegment(key: string): Promise; listSegments(): Promise; getSegment(key: string): Promise; getSegmentUsage(key: string): Promise; createRelease(input: CreateReleaseInput): Promise; getRelease(releaseId: string): Promise; listReleases(filters?: { environment?: string; status?: string; limit?: number; }): Promise; deployRelease(releaseId: string, deployedBy?: string): Promise; rollbackRelease(releaseId: string, rolledBackBy?: string, reason?: string): Promise; approveRelease(releaseId: string, approverId: string): Promise; rejectRelease(releaseId: string, rejectorId: string, reason?: string): Promise; createExclusionLayer(input: ExclusionLayer): Promise; getExclusionLayer(key: string): Promise; updateExclusionLayer(key: string, allocations: ExclusionLayerAllocation[]): Promise; deleteExclusionLayer(key: string): Promise; listExclusionLayers(): Promise; getUserAssignment(flagKey: string, userId: string): Promise; getUserAssignments(flagKeys: string[], userId: string): Promise>; setUserAssignment(flagKey: string, userId: string, variantKey: string): Promise; addHistory(entry: Omit): Promise; getHistory(flagKey: string, opts?: { limit?: number; }): Promise; trackImpression(params: { flagKey: string; userId: string; value: unknown; variant: string | null; reason: string; }): Promise; getAllActiveFlags(opts?: { namespace?: string; tags?: string[]; keys?: string[]; limit?: number; offset?: number; }): Promise; addTags(flagKey: string, tags: string[]): Promise; removeTags(flagKey: string, tags: string[]): Promise; /** Get rules for a flag. Used internally by the evaluator. */ getRulesForFlag(flagKey: string): FlagRule[]; touchFlagEvaluation(key: string): Promise; forgetUser(userId: string, scope?: Array<"impressions" | "assignments" | "history" | "events">): Promise; trackEvent(event: TrackEventInput): Promise; listTrackingEvents(filters?: { userId?: string; event?: string; limit?: number; }): Promise; deleteImpressionsBefore(cutoff: Date): Promise; deleteHistoryBefore(cutoff: Date): Promise; transaction(fn: (tx: DbAdapter) => Promise): Promise; getUserImpressions(userId: string, opts?: { limit?: number; flagKey?: string; }): Promise>; listScheduledReleases(): Promise; } /** * In-memory cache adapter. Data lost on process restart. */ declare class MemoryCacheAdapter implements CacheAdapter { private store; get(key: string): Promise; set(key: string, value: string, ttlMs: number): Promise; del(key: string): Promise; delPattern(pattern: string): Promise; } /** * In-process invalidation bus useful for tests and single-process workers. * Pass the same instance to multiple FlagManagers to simulate cross-replica * cache/SSE invalidation. */ declare class MemoryInvalidationBus implements InvalidationBus { private listeners; publish(message: InvalidationMessage): Promise; subscribe(listener: InvalidationListener): () => void; close(): Promise; } /** * Factory function to create a memory adapter. */ declare function createMemoryAdapter(): MemoryDbAdapter; export { MemoryCacheAdapter, MemoryDbAdapter, MemoryInvalidationBus, createMemoryAdapter };