Skip to content

Commit 01da2a9

Browse files
authored
feat: Exported typescript types for Akamai SDK (#135)
Exported typescript types from Akamai SDK
2 parents 71e178a + e9ff17b commit 01da2a9

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

packages/sdk/akamai-base/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@
1212
import {
1313
init as initEdge,
1414
LDClient,
15-
LDContext,
16-
LDMultiKindContext,
17-
LDSingleKindContext,
1815
LDOptions,
1916
EdgeProvider,
2017
EdgeFeatureStore,
2118
} from '@launchdarkly/akamai-edgeworker-sdk-common';
2219
import { BasicLogger } from '@launchdarkly/js-server-sdk-common';
2320

24-
type AkamaiLDClientParams = {
21+
export * from '@launchdarkly/akamai-edgeworker-sdk-common';
22+
23+
export type AkamaiLDClientParams = {
2524
sdkKey: string;
2625
options?: LDOptions;
2726
featureStoreProvider: EdgeProvider;
2827
};
2928

30-
export type { LDClient, LDContext, LDMultiKindContext, LDSingleKindContext, EdgeProvider };
31-
3229
/**
3330
* Initialize Launchdarkly client using Akamai's Edge KV as a feature store
3431
* @param params ClientWithEdgeKVParams

packages/sdk/akamai-edgekv/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,21 @@
1212
import {
1313
init as initEdge,
1414
LDClient,
15-
LDContext,
16-
LDMultiKindContext,
17-
LDSingleKindContext,
1815
LDOptions,
1916
EdgeFeatureStore,
2017
} from '@launchdarkly/akamai-edgeworker-sdk-common';
2118
import { BasicLogger } from '@launchdarkly/js-server-sdk-common';
2219
import EdgeKVProvider from './edgekv/edgeKVProvider';
2320

24-
type AkamaiLDClientParams = {
21+
export * from '@launchdarkly/akamai-edgeworker-sdk-common';
22+
23+
export type AkamaiLDClientParams = {
2524
sdkKey: string;
2625
options?: LDOptions;
2726
namespace: string;
2827
group: string;
2928
};
3029

31-
export type { LDClient, LDContext, LDMultiKindContext, LDSingleKindContext };
32-
3330
/**
3431
* Initialize Launchdarkly client using Akamai's Edge KV as a feature store
3532
* @param params ClientWithEdgeKVParams

packages/shared/akamai-edgeworker-sdk/src/index.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
import {
22
BasicLogger,
3-
LDOptions,
4-
LDContext,
53
LDFeatureStore,
6-
LDMultiKindContext,
7-
LDSingleKindContext,
4+
LDOptions as LDOptionsCommon,
85
} from '@launchdarkly/js-server-sdk-common';
96
import { validateOptions } from './utils';
107
import LDClient from './api/LDClient';
118
import EdgePlatform from './platform';
129
import createPlatformInfo from './platform/info';
1310
import type { EdgeProvider } from './featureStore';
11+
import { EdgeFeatureStore } from './featureStore';
1412

15-
export { EdgeFeatureStore } from './featureStore';
13+
/**
14+
* The Launchdarkly Edge SDKs configuration options. Only logger is officially
15+
* supported. sendEvents is unsupported and is only included as a beta
16+
* preview.
17+
*/
18+
type LDOptions = Pick<LDOptionsCommon, 'logger' | 'sendEvents'>;
1619

17-
export type {
18-
LDClient,
19-
LDContext,
20-
LDMultiKindContext,
21-
LDSingleKindContext,
22-
LDOptions,
23-
EdgeProvider,
24-
};
20+
/**
21+
* The internal options include featureStore because that's how the LDClient
22+
* implementation expects it.
23+
*/
24+
type LDOptionsInternal = LDOptions & Pick<LDOptionsCommon, 'featureStore'>;
25+
26+
export * from '@launchdarkly/js-server-sdk-common';
27+
export { EdgeFeatureStore, EdgeProvider, LDOptions, LDOptionsInternal };
2528

2629
type BaseSDKParams = {
2730
sdkKey: string;

0 commit comments

Comments
 (0)