@launchdarkly/js-client-sdk 0.1.0 → 0.3.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/compat.cjs +1 -0
  3. package/dist/compat.d.cts +182 -0
  4. package/dist/compat.d.ts +182 -0
  5. package/dist/compat.js +1 -0
  6. package/dist/index.cjs +1 -0
  7. package/dist/index.d.cts +205 -0
  8. package/dist/index.d.ts +205 -0
  9. package/dist/index.js +1 -0
  10. package/dist/metafile-cjs.json +1 -0
  11. package/dist/metafile-esm.json +1 -0
  12. package/package.json +29 -16
  13. package/dist/index.cjs.js +0 -2
  14. package/dist/index.cjs.js.map +0 -1
  15. package/dist/index.es.js +0 -2
  16. package/dist/index.es.js.map +0 -1
  17. package/dist/src/BrowserApi.d.ts +0 -48
  18. package/dist/src/BrowserApi.d.ts.map +0 -1
  19. package/dist/src/BrowserClient.d.ts +0 -68
  20. package/dist/src/BrowserClient.d.ts.map +0 -1
  21. package/dist/src/BrowserDataManager.d.ts +0 -20
  22. package/dist/src/BrowserDataManager.d.ts.map +0 -1
  23. package/dist/src/BrowserIdentifyOptions.d.ts +0 -23
  24. package/dist/src/BrowserIdentifyOptions.d.ts.map +0 -1
  25. package/dist/src/BrowserStateDetector.d.ts +0 -2
  26. package/dist/src/BrowserStateDetector.d.ts.map +0 -1
  27. package/dist/src/bootstrap.d.ts +0 -5
  28. package/dist/src/bootstrap.d.ts.map +0 -1
  29. package/dist/src/goals/GoalManager.d.ts +0 -20
  30. package/dist/src/goals/GoalManager.d.ts.map +0 -1
  31. package/dist/src/goals/GoalTracker.d.ts +0 -16
  32. package/dist/src/goals/GoalTracker.d.ts.map +0 -1
  33. package/dist/src/goals/Goals.d.ts +0 -33
  34. package/dist/src/goals/Goals.d.ts.map +0 -1
  35. package/dist/src/goals/LocationWatcher.d.ts +0 -6
  36. package/dist/src/goals/LocationWatcher.d.ts.map +0 -1
  37. package/dist/src/index.d.ts +0 -35
  38. package/dist/src/index.d.ts.map +0 -1
  39. package/dist/src/options.d.ts +0 -49
  40. package/dist/src/options.d.ts.map +0 -1
  41. package/dist/src/platform/Backoff.d.ts +0 -42
  42. package/dist/src/platform/Backoff.d.ts.map +0 -1
  43. package/dist/src/platform/BrowserCrypto.d.ts +0 -7
  44. package/dist/src/platform/BrowserCrypto.d.ts.map +0 -1
  45. package/dist/src/platform/BrowserEncoding.d.ts +0 -10
  46. package/dist/src/platform/BrowserEncoding.d.ts.map +0 -1
  47. package/dist/src/platform/BrowserHasher.d.ts +0 -10
  48. package/dist/src/platform/BrowserHasher.d.ts.map +0 -1
  49. package/dist/src/platform/BrowserInfo.d.ts +0 -6
  50. package/dist/src/platform/BrowserInfo.d.ts.map +0 -1
  51. package/dist/src/platform/BrowserPlatform.d.ts +0 -10
  52. package/dist/src/platform/BrowserPlatform.d.ts.map +0 -1
  53. package/dist/src/platform/BrowserRequests.d.ts +0 -7
  54. package/dist/src/platform/BrowserRequests.d.ts.map +0 -1
  55. package/dist/src/platform/DefaultBrowserEventSource.d.ts +0 -33
  56. package/dist/src/platform/DefaultBrowserEventSource.d.ts.map +0 -1
  57. package/dist/src/platform/LocalStorage.d.ts +0 -16
  58. package/dist/src/platform/LocalStorage.d.ts.map +0 -1
  59. package/dist/src/platform/randomUuidV4.d.ts +0 -12
  60. package/dist/src/platform/randomUuidV4.d.ts.map +0 -1
@@ -1,48 +0,0 @@
1
- /**
2
- * All access to browser specific APIs should be limited to this file.
3
- * Care should be taken to ensure that any given method will work in the service worker API. So if
4
- * something isn't available in the service worker API attempt to provide reasonable defaults.
5
- */
6
- export declare function isDocument(): boolean;
7
- export declare function isWindow(): boolean;
8
- /**
9
- * Register an event handler on the document. If there is no document, such as when running in
10
- * a service worker, then no operation is performed.
11
- *
12
- * @param type The event type to register a handler for.
13
- * @param listener The handler to register.
14
- * @param options Event registration options.
15
- * @returns a function which unregisters the handler.
16
- */
17
- export declare function addDocumentEventListener(type: string, listener: (this: Document, ev: Event) => any, options?: boolean | AddEventListenerOptions): () => void;
18
- /**
19
- * Register an event handler on the window. If there is no window, such as when running in
20
- * a service worker, then no operation is performed.
21
- *
22
- * @param type The event type to register a handler for.
23
- * @param listener The handler to register.
24
- * @param options Event registration options.
25
- * @returns a function which unregisters the handler.
26
- */
27
- export declare function addWindowEventListener(type: string, listener: (this: Document, ev: Event) => any, options?: boolean | AddEventListenerOptions): () => void;
28
- /**
29
- * For non-window code this will always be an empty string.
30
- */
31
- export declare function getHref(): string;
32
- /**
33
- * For non-window code this will always be an empty string.
34
- */
35
- export declare function getLocationSearch(): string;
36
- /**
37
- * For non-window code this will always be an empty string.
38
- */
39
- export declare function getLocationHash(): string;
40
- export declare function getCrypto(): Crypto;
41
- /**
42
- * Get the visibility state. For non-documents this will always be 'invisible'.
43
- *
44
- * @returns The document visibility.
45
- */
46
- export declare function getVisibility(): string;
47
- export declare function querySelectorAll(selector: string): NodeListOf<Element> | undefined;
48
- //# sourceMappingURL=BrowserApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserApi.d.ts","sourceRoot":"","sources":["../../src/BrowserApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,UAAU,YAEzB;AAED,wBAAgB,QAAQ,YAEvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,KAAK,GAAG,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,MAAM,IAAI,CASZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,KAAK,GAAG,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,MAAM,IAAI,CASZ;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAKhC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAK1C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAMlC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAKtC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,CAKlF"}
@@ -1,68 +0,0 @@
1
- import { AutoEnvAttributes, LDClient as CommonClient, LDClientImpl, LDContext, LDEmitterEventName, Platform } from '@launchdarkly/js-client-sdk-common';
2
- import { BrowserIdentifyOptions as LDIdentifyOptions } from './BrowserIdentifyOptions';
3
- import { BrowserOptions } from './options';
4
- /**
5
- *
6
- * The LaunchDarkly SDK client object.
7
- *
8
- * Applications should configure the client at page load time and reuse the same instance.
9
- *
10
- * For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/sdk/client-side/javascript).
11
- */
12
- export type LDClient = Omit<CommonClient, 'setConnectionMode' | 'getConnectionMode' | 'getOffline' | 'identify'> & {
13
- /**
14
- * @ignore
15
- * Implementation Note: We are not supporting dynamically setting the connection mode on the LDClient.
16
- * Implementation Note: The SDK does not support offline mode. Instead bootstrap data can be used.
17
- * Implementation Note: The browser SDK has different identify options, so omits the base implementation
18
- * from the interface.
19
- */
20
- /**
21
- * Specifies whether or not to open a streaming connection to LaunchDarkly for live flag updates.
22
- *
23
- * If this is true, the client will always attempt to maintain a streaming connection; if false,
24
- * it never will. If you leave the value undefined (the default), the client will open a streaming
25
- * connection if you subscribe to `"change"` or `"change:flag-key"` events (see {@link LDClient.on}).
26
- *
27
- * This can also be set as the `streaming` property of {@link LDOptions}.
28
- */
29
- setStreaming(streaming?: boolean): void;
30
- /**
31
- * Identifies a context to LaunchDarkly.
32
- *
33
- * Unlike the server-side SDKs, the client-side JavaScript SDKs maintain a current context state,
34
- * which is set when you call `identify()`.
35
- *
36
- * Changing the current context also causes all feature flag values to be reloaded. Until that has
37
- * finished, calls to {@link variation} will still return flag values for the previous context. You can
38
- * await the Promise to determine when the new flag values are available.
39
- *
40
- * @param context
41
- * The LDContext object.
42
- * @param identifyOptions
43
- * Optional configuration. Please see {@link LDIdentifyOptions}.
44
- * @returns
45
- * A Promise which resolves when the flag values for the specified
46
- * context are available. It rejects when:
47
- *
48
- * 1. The context is unspecified or has no key.
49
- *
50
- * 2. The identify timeout is exceeded. In client SDKs this defaults to 5s.
51
- * You can customize this timeout with {@link LDIdentifyOptions | identifyOptions}.
52
- *
53
- * 3. A network error is encountered during initialization.
54
- *
55
- * @ignore Implementation Note: Browser implementation has different options.
56
- */
57
- identify(context: LDContext, identifyOptions?: LDIdentifyOptions): Promise<void>;
58
- };
59
- export declare class BrowserClient extends LDClientImpl implements LDClient {
60
- private readonly _goalManager?;
61
- constructor(clientSideId: string, autoEnvAttributes: AutoEnvAttributes, options?: BrowserOptions, overridePlatform?: Platform);
62
- identify(context: LDContext, identifyOptions?: LDIdentifyOptions): Promise<void>;
63
- setStreaming(streaming?: boolean): void;
64
- private _updateAutomaticStreamingState;
65
- on(eventName: LDEmitterEventName, listener: Function): void;
66
- off(eventName: LDEmitterEventName, listener: Function): void;
67
- }
68
- //# sourceMappingURL=BrowserClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserClient.d.ts","sourceRoot":"","sources":["../../src/BrowserClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,QAAQ,IAAI,YAAY,EAMxB,YAAY,EACZ,SAAS,EAET,kBAAkB,EAElB,QAAQ,EACT,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAAE,sBAAsB,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIvF,OAAwB,EAAE,cAAc,EAAuB,MAAM,WAAW,CAAC;AAGjF;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB,YAAY,EACZ,mBAAmB,GAAG,mBAAmB,GAAG,YAAY,GAAG,UAAU,CACtE,GAAG;IACF;;;;;;OAMG;IAEH;;;;;;;;OAQG;IACH,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClF,CAAC;AAEF,qBAAa,aAAc,SAAQ,YAAa,YAAW,QAAQ;IACjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAc;gBAG1C,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,GAAE,cAAmB,EAC5B,gBAAgB,CAAC,EAAE,QAAQ;IA2Id,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/F,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI;IAOvC,OAAO,CAAC,8BAA8B;IAO7B,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAK3D,GAAG,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAItE"}
@@ -1,20 +0,0 @@
1
- import { BaseDataManager, Configuration, Context, DataSourcePaths, FlagManager, internal, LDEmitter, LDHeaders, LDIdentifyOptions, Platform } from '@launchdarkly/js-client-sdk-common';
2
- import { ValidatedOptions } from './options';
3
- export default class BrowserDataManager extends BaseDataManager {
4
- private readonly _browserConfig;
5
- private _forcedStreaming?;
6
- private _automaticStreamingState;
7
- private _secureModeHash?;
8
- constructor(platform: Platform, flagManager: FlagManager, credential: string, config: Configuration, _browserConfig: ValidatedOptions, getPollingPaths: () => DataSourcePaths, getStreamingPaths: () => DataSourcePaths, baseHeaders: LDHeaders, emitter: LDEmitter, diagnosticsManager?: internal.DiagnosticsManager);
9
- private _debugLog;
10
- identify(identifyResolve: () => void, identifyReject: (err: Error) => void, context: Context, identifyOptions?: LDIdentifyOptions): Promise<void>;
11
- private _finishIdentifyFromPoll;
12
- private _finishIdentifyFromBootstrap;
13
- setForcedStreaming(streaming?: boolean): void;
14
- setAutomaticStreamingState(streaming: boolean): void;
15
- private _updateStreamingState;
16
- private _stopDataSource;
17
- private _startDataSource;
18
- private _setupConnection;
19
- }
20
- //# sourceMappingURL=BrowserDataManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserDataManager.d.ts","sourceRoot":"","sources":["../../src/BrowserDataManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,OAAO,EAEP,eAAe,EAEf,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,iBAAiB,EAEjB,QAAQ,EACT,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,eAAe;IAuB3D,OAAO,CAAC,QAAQ,CAAC,cAAc;IApBjC,OAAO,CAAC,gBAAgB,CAAC,CAAsB;IAC/C,OAAO,CAAC,wBAAwB,CAAkB;IAClD,OAAO,CAAC,eAAe,CAAC,CAAS;gBAc/B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACJ,cAAc,EAAE,gBAAgB,EACjD,eAAe,EAAE,MAAM,eAAe,EACtC,iBAAiB,EAAE,MAAM,eAAe,EACxC,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,SAAS,EAClB,kBAAkB,CAAC,EAAE,QAAQ,CAAC,kBAAkB;IAgBlD,OAAO,CAAC,SAAS;IAIF,QAAQ,CACrB,eAAe,EAAE,MAAM,IAAI,EAC3B,cAAc,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,EACpC,OAAO,EAAE,OAAO,EAChB,eAAe,CAAC,EAAE,iBAAiB,GAClC,OAAO,CAAC,IAAI,CAAC;YAwBF,uBAAuB;IA2CrC,OAAO,CAAC,4BAA4B;IAUpC,kBAAkB,CAAC,SAAS,CAAC,EAAE,OAAO;IAKtC,0BAA0B,CAAC,SAAS,EAAE,OAAO;IAK7C,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,gBAAgB;CAiCzB"}
@@ -1,23 +0,0 @@
1
- import { LDIdentifyOptions } from '@launchdarkly/js-client-sdk-common';
2
- export interface BrowserIdentifyOptions extends Omit<LDIdentifyOptions, 'waitForNetworkResults'> {
3
- /**
4
- * The signed context key if you are using [Secure Mode]
5
- * (https://docs.launchdarkly.com/sdk/features/secure-mode#configuring-secure-mode-in-the-javascript-client-side-sdk).
6
- */
7
- hash?: string;
8
- /**
9
- * The initial set of flags to use until the remote set is retrieved.
10
- *
11
- * Bootstrap data can be generated by server SDKs. When bootstrap data is provided the SDK the
12
- * identification operation will complete without waiting for any values from LaunchDarkly and
13
- * the variation calls can be used immediately.
14
- *
15
- * If streaming is activated, either it is configured to always be used, or is activated
16
- * via setStreaming, or via the addition of change handlers, then a streaming connection will
17
- * subsequently be established.
18
- *
19
- * For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/sdk/features/bootstrapping#javascript).
20
- */
21
- bootstrap?: unknown;
22
- }
23
- //# sourceMappingURL=BrowserIdentifyOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserIdentifyOptions.d.ts","sourceRoot":"","sources":["../../src/BrowserIdentifyOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;IAC9F;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -1,2 +0,0 @@
1
- export declare function registerStateDetection(requestFlush: () => void): () => void;
2
- //# sourceMappingURL=BrowserStateDetector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserStateDetector.d.ts","sourceRoot":"","sources":["../../src/BrowserStateDetector.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAwB3E"}
@@ -1,5 +0,0 @@
1
- import { ItemDescriptor, LDLogger } from '@launchdarkly/js-client-sdk-common';
2
- export declare function readFlagsFromBootstrap(logger: LDLogger, data: any): {
3
- [key: string]: ItemDescriptor;
4
- };
5
- //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEpF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,GAAG,GACR;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAyCnC"}
@@ -1,20 +0,0 @@
1
- import { Requests } from '@launchdarkly/js-client-sdk-common';
2
- import { Goal } from './Goals';
3
- import { LocationWatcher } from './LocationWatcher';
4
- export default class GoalManager {
5
- private readonly _requests;
6
- private readonly _reportError;
7
- private readonly _reportGoal;
8
- private _goals?;
9
- private _url;
10
- private _watcher?;
11
- private _tracker?;
12
- private _isTracking;
13
- constructor(credential: string, _requests: Requests, baseUrl: string, _reportError: (err: Error) => void, _reportGoal: (url: string, goal: Goal) => void, locationWatcherFactory?: (cb: () => void) => LocationWatcher);
14
- initialize(): Promise<void>;
15
- startTracking(): void;
16
- private _createTracker;
17
- private _fetchGoals;
18
- close(): void;
19
- }
20
- //# sourceMappingURL=GoalManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GoalManager.d.ts","sourceRoot":"","sources":["../../../src/goals/GoalManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAGzF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAA0B,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,WAAW;IAS5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAX9B,OAAO,CAAC,MAAM,CAAC,CAAc;IAC7B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,WAAW,CAAS;gBAG1B,UAAU,EAAE,MAAM,EACD,SAAS,EAAE,QAAQ,EACpC,OAAO,EAAE,MAAM,EACE,YAAY,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,EAClC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,EAC/D,sBAAsB,GAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,eACZ;IAUrB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC,aAAa;IAKpB,OAAO,CAAC,cAAc;YAYR,WAAW;IASzB,KAAK,IAAI,IAAI;CAId"}
@@ -1,16 +0,0 @@
1
- import { Goal, Matcher } from './Goals';
2
- type EventHandler = (goal: Goal) => void;
3
- export declare function matchesUrl(matcher: Matcher, href: string, search: string, hash: string): boolean;
4
- /**
5
- * Tracks the goals on an individual "page" (combination of route, query params, and hash).
6
- */
7
- export default class GoalTracker {
8
- private _cleanup?;
9
- constructor(goals: Goal[], onEvent: EventHandler);
10
- /**
11
- * Close the tracker which stops listening to any events.
12
- */
13
- close(): void;
14
- }
15
- export {};
16
- //# sourceMappingURL=GoalTracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GoalTracker.d.ts","sourceRoot":"","sources":["../../../src/goals/GoalTracker.ts"],"names":[],"mappings":"AASA,OAAO,EAAa,IAAI,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEnD,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AAEzC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAyBtF;AA+BD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAa;gBAClB,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY;IAwBhD;;OAEG;IACH,KAAK;CAGN"}
@@ -1,33 +0,0 @@
1
- export type GoalKind = 'click' | 'pageview';
2
- export type MatcherKind = 'exact' | 'canonical' | 'substring' | 'regex';
3
- export interface ExactMatcher {
4
- kind: 'exact';
5
- url: string;
6
- }
7
- export interface SubstringMatcher {
8
- kind: 'substring';
9
- substring: string;
10
- }
11
- export interface CanonicalMatcher {
12
- kind: 'canonical';
13
- url: string;
14
- }
15
- export interface RegexMatcher {
16
- kind: 'regex';
17
- pattern: string;
18
- }
19
- export type Matcher = ExactMatcher | SubstringMatcher | CanonicalMatcher | RegexMatcher;
20
- export interface PageViewGoal {
21
- key: string;
22
- kind: 'pageview';
23
- urls?: Matcher[];
24
- }
25
- export interface ClickGoal {
26
- key: string;
27
- kind: 'click';
28
- urls?: Matcher[];
29
- selector: string;
30
- }
31
- export type Goal = PageViewGoal | ClickGoal;
32
- export declare function isClick(goal: Goal): goal is ClickGoal;
33
- //# sourceMappingURL=Goals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Goals.d.ts","sourceRoot":"","sources":["../../../src/goals/Goals.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;AAExE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAExF,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,IAAI,GAAG,YAAY,GAAG,SAAS,CAAC;AAE5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,SAAS,CAErD"}
@@ -1,6 +0,0 @@
1
- export declare const LOCATION_WATCHER_INTERVAL_MS = 300;
2
- export type IntervalHandle = any;
3
- export interface LocationWatcher {
4
- close(): void;
5
- }
6
- //# sourceMappingURL=LocationWatcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocationWatcher.d.ts","sourceRoot":"","sources":["../../../src/goals/LocationWatcher.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAIhD,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC,MAAM,WAAW,eAAe;IAC9B,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -1,35 +0,0 @@
1
- /**
2
- * This is the API reference for the LaunchDarkly Client-Side SDK for JavaScript.
3
- *
4
- * This SDK is intended for use in browser environments.
5
- *
6
- * In typical usage, you will call {@link initialize} once at startup time to obtain an instance of
7
- * {@link LDClient}, which provides access to all of the SDK's functionality.
8
- *
9
- * For more information, see the SDK reference guide.
10
- *
11
- * @packageDocumentation
12
- */
13
- import { EvaluationSeriesContext, EvaluationSeriesData, Hook, HookMetadata, IdentifySeriesContext, IdentifySeriesData, IdentifySeriesResult, IdentifySeriesStatus, LDContext, LDContextCommon, LDContextMeta, LDEvaluationDetail, LDEvaluationDetailTyped, LDEvaluationReason, LDFlagSet, LDLogger, LDLogLevel, LDMultiKindContext, LDSingleKindContext } from '@launchdarkly/js-client-sdk-common';
14
- import { LDClient } from './BrowserClient';
15
- import { BrowserIdentifyOptions as LDIdentifyOptions } from './BrowserIdentifyOptions';
16
- import { BrowserOptions as LDOptions } from './options';
17
- export type { LDClient, LDFlagSet, LDContext, LDContextCommon, LDContextMeta, LDMultiKindContext, LDSingleKindContext, LDLogLevel, LDLogger, LDOptions, LDEvaluationDetail, LDEvaluationDetailTyped, LDEvaluationReason, LDIdentifyOptions, Hook, HookMetadata, EvaluationSeriesContext, EvaluationSeriesData, IdentifySeriesContext, IdentifySeriesData, IdentifySeriesResult, IdentifySeriesStatus, };
18
- /**
19
- * Creates an instance of the LaunchDarkly client.
20
- *
21
- * Usage:
22
- * ```
23
- * import { initialize } from 'launchdarkly-js-client-sdk';
24
- * const client = initialize(envKey, context, options);
25
- * ```
26
- *
27
- * @param clientSideId
28
- * The client-side id, also known as the environment ID.
29
- * @param options
30
- * Optional configuration settings.
31
- * @return
32
- * The new client instance.
33
- */
34
- export declare function initialize(clientSideId: string, options?: LDOptions): LDClient;
35
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAEL,uBAAuB,EACvB,oBAAoB,EACpB,IAAI,EACJ,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAAiB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAExD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,SAAS,EACT,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAG9E"}
@@ -1,49 +0,0 @@
1
- import { LDLogger, LDOptions as LDOptionsBase } from '@launchdarkly/js-client-sdk-common';
2
- /**
3
- * Initialization options for the LaunchDarkly browser SDK.
4
- */
5
- export interface BrowserOptions extends Omit<LDOptionsBase, 'initialConnectionMode'> {
6
- /**
7
- * Whether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
8
- *
9
- * This is true by default, meaning that this request will be made on every page load.
10
- * Set it to false if you are not using Experimentation and want to skip the request.
11
- */
12
- fetchGoals?: boolean;
13
- /**
14
- * A function which, if present, can change the URL in analytics events to something other
15
- * than the actual browser URL. It will be called with the current browser URL as a parameter,
16
- * and returns the value that should be stored in the event's `url` property.
17
- */
18
- eventUrlTransformer?: (url: string) => string;
19
- /**
20
- * Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
21
- *
22
- * If this is true, the client will always attempt to maintain a streaming connection; if false,
23
- * it never will. If you leave the value undefined (the default), the client will open a streaming
24
- * connection if you subscribe to `"change"` or `"change:flag-key"` events.
25
- *
26
- * This is equivalent to calling `client.setStreaming()` with the same value.
27
- */
28
- streaming?: boolean;
29
- /**
30
- * Determines if the SDK responds to entering different visibility states to handle tasks such as
31
- * flushing events.
32
- *
33
- * This is true by default. Generally speaking the SDK will be able to most reliably delivery
34
- * events with this setting on.
35
- *
36
- * It may be useful to disable for environments where not all window/document objects are
37
- * available, such as when running the SDK in a browser extension.
38
- */
39
- automaticBackgroundHandling?: boolean;
40
- }
41
- export interface ValidatedOptions {
42
- fetchGoals: boolean;
43
- eventUrlTransformer: (url: string) => string;
44
- streaming?: boolean;
45
- automaticBackgroundHandling?: boolean;
46
- }
47
- export declare function filterToBaseOptions(opts: BrowserOptions): LDOptionsBase;
48
- export default function validateOptions(opts: BrowserOptions, logger: LDLogger): ValidatedOptions;
49
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,IAAI,aAAa,EAI3B,MAAM,oCAAoC,CAAC;AAI5C;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,aAAa,EAAE,uBAAuB,CAAC;IAClF;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAE9C;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;;OASG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAcD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CASvE;AAOD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,GAAG,gBAAgB,CAiBhG"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Implements exponential backoff and jitter. This class tracks successful connections and failures
3
- * and produces a retry delay.
4
- *
5
- * It does not start any timers or directly control a connection.
6
- *
7
- * The backoff follows an exponential backoff scheme with 50% jitter starting at
8
- * initialRetryDelayMillis and capping at MAX_RETRY_DELAY. If RESET_INTERVAL has elapsed after a
9
- * success, without an intervening faulure, then the backoff is reset to initialRetryDelayMillis.
10
- */
11
- export default class Backoff {
12
- private readonly _retryResetIntervalMillis;
13
- private readonly _random;
14
- private _retryCount;
15
- private _activeSince?;
16
- private _initialRetryDelayMillis;
17
- /**
18
- * The exponent at which the backoff delay will exceed the maximum.
19
- * Beyond this limit the backoff can be set to the max.
20
- */
21
- private readonly _maxExponent;
22
- constructor(initialRetryDelayMillis: number, _retryResetIntervalMillis: number, _random?: () => number);
23
- private _backoff;
24
- private _jitter;
25
- /**
26
- * This function should be called when a connection attempt is successful.
27
- *
28
- * @param timeStampMs The time of the success. Used primarily for testing, when not provided
29
- * the current time is used.
30
- */
31
- success(timeStampMs?: number): void;
32
- /**
33
- * This function should be called when a connection fails. It returns the a delay, in
34
- * milliseconds, after which a reconnection attempt should be made.
35
- *
36
- * @param timeStampMs The time of the success. Used primarily for testing, when not provided
37
- * the current time is used.
38
- * @returns The delay before the next connection attempt.
39
- */
40
- fail(timeStampMs?: number): number;
41
- }
42
- //# sourceMappingURL=Backoff.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Backoff.d.ts","sourceRoot":"","sources":["../../../src/platform/Backoff.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,OAAO;IAYxB,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAZ1B,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,wBAAwB,CAAS;IACzC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAGpC,uBAAuB,EAAE,MAAM,EACd,yBAAyB,EAAE,MAAM,EACjC,OAAO,eAAc;IAOxC,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,OAAO;IAIf;;;;;OAKG;IACH,OAAO,CAAC,WAAW,GAAE,MAAmB,GAAG,IAAI;IAI/C;;;;;;;OAOG;IACH,IAAI,CAAC,WAAW,GAAE,MAAmB,GAAG,MAAM;CAc/C"}
@@ -1,7 +0,0 @@
1
- import { Crypto } from '@launchdarkly/js-client-sdk-common';
2
- import BrowserHasher from './BrowserHasher';
3
- export default class BrowserCrypto implements Crypto {
4
- createHash(algorithm: string): BrowserHasher;
5
- randomUUID(): string;
6
- }
7
- //# sourceMappingURL=BrowserCrypto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserCrypto.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserCrypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAG5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,MAAM;IAClD,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa;IAI5C,UAAU,IAAI,MAAM;CAGrB"}
@@ -1,10 +0,0 @@
1
- import { Encoding } from '@launchdarkly/js-client-sdk-common';
2
- /**
3
- * Implementation Note: This btoa handles unicode characters, which the base btoa in the browser
4
- * does not.
5
- * Background: https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
6
- */
7
- export default class BrowserEncoding implements Encoding {
8
- btoa(data: string): string;
9
- }
10
- //# sourceMappingURL=BrowserEncoding.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserEncoding.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserEncoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAO9D;;;;GAIG;AAEH,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,QAAQ;IACtD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3B"}
@@ -1,10 +0,0 @@
1
- import { Hasher } from '@launchdarkly/js-client-sdk-common';
2
- export default class BrowserHasher implements Hasher {
3
- private readonly _webcrypto;
4
- private _data;
5
- private _algorithm;
6
- constructor(_webcrypto: Crypto, algorithm: string);
7
- asyncDigest(encoding: string): Promise<string>;
8
- update(data: string): Hasher;
9
- }
10
- //# sourceMappingURL=BrowserHasher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserHasher.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserHasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,MAAM;IAIhD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAH7B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,UAAU,CAAS;gBAER,UAAU,EAAE,MAAM,EACnC,SAAS,EAAE,MAAM;IAcb,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBpD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAI7B"}
@@ -1,6 +0,0 @@
1
- import { Info, PlatformData, SdkData } from '@launchdarkly/js-client-sdk-common';
2
- export default class BrowserInfo implements Info {
3
- platformData(): PlatformData;
4
- sdkData(): SdkData;
5
- }
6
- //# sourceMappingURL=BrowserInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserInfo.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAEjF,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,IAAI;IAC9C,YAAY,IAAI,YAAY;IAK5B,OAAO,IAAI,OAAO;CAOnB"}
@@ -1,10 +0,0 @@
1
- import { Crypto, Encoding, Info, LDLogger, Platform, Requests, Storage } from '@launchdarkly/js-client-sdk-common';
2
- export default class BrowserPlatform implements Platform {
3
- encoding: Encoding;
4
- info: Info;
5
- crypto: Crypto;
6
- requests: Requests;
7
- storage?: Storage;
8
- constructor(logger: LDLogger);
9
- }
10
- //# sourceMappingURL=BrowserPlatform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserPlatform.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserPlatform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACR,MAAM,oCAAoC,CAAC;AAQ5C,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,QAAQ;IACtD,QAAQ,EAAE,QAAQ,CAAyB;IAC3C,IAAI,EAAE,IAAI,CAAqB;IAE/B,MAAM,EAAE,MAAM,CAAuB;IACrC,QAAQ,EAAE,QAAQ,CAAyB;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEN,MAAM,EAAE,QAAQ;CAK7B"}
@@ -1,7 +0,0 @@
1
- import { EventSourceCapabilities, EventSourceInitDict, EventSource as LDEventSource, Options, Requests, Response } from '@launchdarkly/js-client-sdk-common';
2
- export default class BrowserRequests implements Requests {
3
- fetch(url: string, options?: Options): Promise<Response>;
4
- createEventSource(url: string, eventSourceInitDict: EventSourceInitDict): LDEventSource;
5
- getEventSourceCapabilities(): EventSourceCapabilities;
6
- }
7
- //# sourceMappingURL=BrowserRequests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrowserRequests.d.ts","sourceRoot":"","sources":["../../../src/platform/BrowserRequests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,IAAI,aAAa,EAC5B,OAAO,EACP,QAAQ,EACR,QAAQ,EACT,MAAM,oCAAoC,CAAC;AAI5C,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,QAAQ;IACtD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKxD,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,GAAG,aAAa;IAIvF,0BAA0B,IAAI,uBAAuB;CAOtD"}
@@ -1,33 +0,0 @@
1
- import { EventListener, EventName, EventSourceInitDict, HttpErrorResponse, EventSource as LDEventSource } from '@launchdarkly/js-client-sdk-common';
2
- /**
3
- * Implementation Notes:
4
- *
5
- * This event source does not support a read-timeout.
6
- * This event source does not support customized verbs.
7
- * This event source does not support headers.
8
- */
9
- /**
10
- * Browser event source implementation which extends the built-in event
11
- * source with additional reconnection logic.
12
- */
13
- export default class DefaultBrowserEventSource implements LDEventSource {
14
- private readonly _url;
15
- private _es?;
16
- private _backoff;
17
- private _errorFilter;
18
- private _reconnectTimeoutHandle?;
19
- private _listeners;
20
- constructor(_url: string, options: EventSourceInitDict);
21
- onclose: (() => void) | undefined;
22
- onerror: ((err?: HttpErrorResponse) => void) | undefined;
23
- onopen: (() => void) | undefined;
24
- onretrying: ((e: {
25
- delayMillis: number;
26
- }) => void) | undefined;
27
- private _openConnection;
28
- addEventListener(type: EventName, listener: EventListener): void;
29
- close(): void;
30
- private _tryConnect;
31
- private _handleError;
32
- }
33
- //# sourceMappingURL=DefaultBrowserEventSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultBrowserEventSource.d.ts","sourceRoot":"","sources":["../../../src/platform/DefaultBrowserEventSource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,IAAI,aAAa,EAC7B,MAAM,oCAAoC,CAAC;AAI5C;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,YAAW,aAAa;IAWnE,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVvB,OAAO,CAAC,GAAG,CAAC,CAAc;IAC1B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,YAAY,CAAsC;IAG1D,OAAO,CAAC,uBAAuB,CAAC,CAAM;IAEtC,OAAO,CAAC,UAAU,CAAuC;gBAGtC,IAAI,EAAE,MAAM,EAC7B,OAAO,EAAE,mBAAmB;IAO9B,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAElC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEzD,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAEjC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAE/D,OAAO,CAAC,eAAe;IAmBvB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAMhE,KAAK,IAAI,IAAI;IAUb,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,YAAY;CAcrB"}
@@ -1,16 +0,0 @@
1
- import type { LDLogger, Storage } from '@launchdarkly/js-client-sdk-common';
2
- export declare function isLocalStorageSupported(): boolean;
3
- /**
4
- * Implementation of Storage using localStorage for the browser.
5
- *
6
- * The Storage API is async, and localStorage is synchronous. This is fine,
7
- * and none of the methods need to internally await their operations.
8
- */
9
- export default class PlatformStorage implements Storage {
10
- private readonly _logger?;
11
- constructor(_logger?: LDLogger | undefined);
12
- clear(key: string): Promise<void>;
13
- get(key: string): Promise<string | null>;
14
- set(key: string, value: string): Promise<void>;
15
- }
16
- //# sourceMappingURL=LocalStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalStorage.d.ts","sourceRoot":"","sources":["../../../src/platform/LocalStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAE5E,wBAAgB,uBAAuB,YAItC;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,OAAO;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAAR,OAAO,CAAC,EAAE,QAAQ,YAAA;IACzC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAUxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOrD"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Given a list of 16 random bytes generate a UUID in v4 format.
3
- *
4
- * Note: The input bytes are modified to conform to the requirements of UUID v4.
5
- *
6
- * @param bytes A list of 16 bytes.
7
- * @returns A UUID v4 string.
8
- */
9
- export declare function formatDataAsUuidV4(bytes: number[]): string;
10
- export declare function fallbackUuidV4(): string;
11
- export default function randomUuidV4(): string;
12
- //# sourceMappingURL=randomUuidV4.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"randomUuidV4.d.ts","sourceRoot":"","sources":["../../../src/platform/randomUuidV4.ts"],"names":[],"mappings":"AA2DA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAkB1D;AAED,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,MAAM,CAM7C"}