Skip to content

Commit

Permalink
feat: Exported typescript types for Akamai SDK (#135)
Browse files Browse the repository at this point in the history
Exported typescript types from Akamai SDK
  • Loading branch information
ctawiah authored Jun 6, 2023
2 parents 71e178a + e9ff17b commit 01da2a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
9 changes: 3 additions & 6 deletions packages/sdk/akamai-base/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@
import {
init as initEdge,
LDClient,
LDContext,
LDMultiKindContext,
LDSingleKindContext,
LDOptions,
EdgeProvider,
EdgeFeatureStore,
} from '@launchdarkly/akamai-edgeworker-sdk-common';
import { BasicLogger } from '@launchdarkly/js-server-sdk-common';

type AkamaiLDClientParams = {
export * from '@launchdarkly/akamai-edgeworker-sdk-common';

export type AkamaiLDClientParams = {
sdkKey: string;
options?: LDOptions;
featureStoreProvider: EdgeProvider;
};

export type { LDClient, LDContext, LDMultiKindContext, LDSingleKindContext, EdgeProvider };

/**
* Initialize Launchdarkly client using Akamai's Edge KV as a feature store
* @param params ClientWithEdgeKVParams
Expand Down
9 changes: 3 additions & 6 deletions packages/sdk/akamai-edgekv/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,21 @@
import {
init as initEdge,
LDClient,
LDContext,
LDMultiKindContext,
LDSingleKindContext,
LDOptions,
EdgeFeatureStore,
} from '@launchdarkly/akamai-edgeworker-sdk-common';
import { BasicLogger } from '@launchdarkly/js-server-sdk-common';
import EdgeKVProvider from './edgekv/edgeKVProvider';

type AkamaiLDClientParams = {
export * from '@launchdarkly/akamai-edgeworker-sdk-common';

export type AkamaiLDClientParams = {
sdkKey: string;
options?: LDOptions;
namespace: string;
group: string;
};

export type { LDClient, LDContext, LDMultiKindContext, LDSingleKindContext };

/**
* Initialize Launchdarkly client using Akamai's Edge KV as a feature store
* @param params ClientWithEdgeKVParams
Expand Down
29 changes: 16 additions & 13 deletions packages/shared/akamai-edgeworker-sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import {
BasicLogger,
LDOptions,
LDContext,
LDFeatureStore,
LDMultiKindContext,
LDSingleKindContext,
LDOptions as LDOptionsCommon,
} from '@launchdarkly/js-server-sdk-common';
import { validateOptions } from './utils';
import LDClient from './api/LDClient';
import EdgePlatform from './platform';
import createPlatformInfo from './platform/info';
import type { EdgeProvider } from './featureStore';
import { EdgeFeatureStore } from './featureStore';

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

export type {
LDClient,
LDContext,
LDMultiKindContext,
LDSingleKindContext,
LDOptions,
EdgeProvider,
};
/**
* The internal options include featureStore because that's how the LDClient
* implementation expects it.
*/
type LDOptionsInternal = LDOptions & Pick<LDOptionsCommon, 'featureStore'>;

export * from '@launchdarkly/js-server-sdk-common';
export { EdgeFeatureStore, EdgeProvider, LDOptions, LDOptionsInternal };

type BaseSDKParams = {
sdkKey: string;
Expand Down

0 comments on commit 01da2a9

Please sign in to comment.