@databuddy/sdk 2.3.1 → 2.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,64 +0,0 @@
1
- interface FlagResult {
2
- enabled: boolean;
3
- value: boolean;
4
- payload: any;
5
- reason: string;
6
- flagId?: string;
7
- flagType?: "boolean" | "rollout";
8
- }
9
- interface FlagsConfig {
10
- /** Client ID for flag evaluation */
11
- clientId: string;
12
- apiUrl?: string;
13
- user?: {
14
- userId?: string;
15
- email?: string;
16
- properties?: Record<string, any>;
17
- };
18
- disabled?: boolean;
19
- /** Enable debug logging */
20
- debug?: boolean;
21
- /** Skip persistent storage */
22
- skipStorage?: boolean;
23
- /** Whether session is loading */
24
- isPending?: boolean;
25
- /** Automatically fetch all flags on initialization (default: true) */
26
- autoFetch?: boolean;
27
- }
28
- interface FlagState {
29
- enabled: boolean;
30
- isLoading: boolean;
31
- isReady: boolean;
32
- }
33
- interface FlagsContext {
34
- isEnabled: (key: string) => FlagState;
35
- fetchAllFlags: () => Promise<void>;
36
- updateUser: (user: FlagsConfig["user"]) => void;
37
- refresh: (forceClear?: boolean) => Promise<void>;
38
- }
39
- interface StorageInterface {
40
- get(key: string): any;
41
- set(key: string, value: unknown): void;
42
- getAll(): Record<string, unknown>;
43
- clear(): void;
44
- setAll(flags: Record<string, unknown>): void;
45
- cleanupExpired(): void;
46
- }
47
- interface FlagsManagerOptions {
48
- config: FlagsConfig;
49
- storage?: StorageInterface;
50
- onFlagsUpdate?: (flags: Record<string, FlagResult>) => void;
51
- onConfigUpdate?: (config: FlagsConfig) => void;
52
- }
53
- interface FlagsManager {
54
- getFlag: (key: string) => Promise<FlagResult>;
55
- isEnabled: (key: string) => FlagState;
56
- fetchAllFlags: () => Promise<void>;
57
- updateUser: (user: FlagsConfig["user"]) => void;
58
- refresh: (forceClear?: boolean) => void;
59
- updateConfig: (config: FlagsConfig) => void;
60
- getMemoryFlags: () => Record<string, FlagResult>;
61
- getPendingFlags: () => Set<string>;
62
- }
63
-
64
- export type { FlagsManager as F, StorageInterface as S, FlagsManagerOptions as a, FlagResult as b, FlagState as c, FlagsConfig as d, FlagsContext as e };