Skip to content

Commit eb46782

Browse files
committed
chore(fastly): update type documentation
1 parent d2908b1 commit eb46782

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

packages/sdk/fastly/src/index.ts

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,53 @@
1+
/**
2+
* This is the API reference for the Fastly LaunchDarkly SDK.
3+
*
4+
* In typical usage, you will call {@link init} once per request to obtain an instance of
5+
* {@link LDClient}, which provides access to all of the SDK's functionality.
6+
*
7+
* For more information, see the SDK reference guide.
8+
*
9+
* @packageDocumentation
10+
*/
111
/// <reference types="@fastly/js-compute" />
212
import { KVStore } from 'fastly:kv-store';
313

4-
import { BasicLogger } from '@launchdarkly/js-server-sdk-common';
14+
import { BasicLogger, LDEvaluationReason } from '@launchdarkly/js-server-sdk-common';
515

616
import { EdgeFeatureStore, EdgeProvider, LDClient } from './api';
717
import { DEFAULT_EVENTS_BACKEND_NAME } from './api/LDClient';
818
import createPlatformInfo from './createPlatformInfo';
9-
import validateOptions, { FastlySDKOptions } from './utils/validateOptions';
19+
import validateOptions, { FastlySDKOptions, LDOptionsCommon } from './utils/validateOptions';
1020

21+
export type {
22+
BasicLogger,
23+
FastlySDKOptions,
24+
KVStore,
25+
LDClient,
26+
LDEvaluationReason,
27+
LDOptionsCommon,
28+
};
29+
30+
/**
31+
* Creates an instance of the Fastly LaunchDarkly client.
32+
*
33+
* Applications should instantiate a single instance for the lifetime of a request.
34+
* The client will begin attempting to connect to the configured Fastly KV as
35+
* soon as it is created. To determine when it is ready to use, call {@link LDClient.waitForInitialization}.
36+
*
37+
* **Important:** Do **not** try to instantiate `LDClient` with its constructor
38+
* (`new LDClient()/new LDClientImpl()/new LDClient()`); the SDK does not currently support
39+
* this.
40+
*
41+
* @param clientSideId
42+
* The client side ID. This is only used to query the kvStore above,
43+
* not to connect with LaunchDarkly servers.
44+
* @param kvStore
45+
* The Fastly KV store configured for LaunchDarkly.
46+
* @param options
47+
* Optional {@link FastlySDKOptions | configuration settings}.
48+
* @return
49+
* The new {@link LDClient} instance.
50+
*/
1151
export const init = (
1252
clientSideId: string,
1353
kvStore: KVStore,

packages/sdk/fastly/src/utils/validateOptions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { LDOptions as LDOptionsCommon, TypeValidators } from '@launchdarkly/js-server-sdk-common';
22

3+
export type { LDOptionsCommon };
34
/**
4-
* The Launchdarkly Fastly Compute SDK configuration options.
5+
* The Launchdarkly Fastly Compute SDK configuration options. See {@link LDOptionsCommon} for more information on the 'logger', 'sendEvents', and 'eventsUri' options.
56
*/
67
export type FastlySDKOptions = Pick<LDOptionsCommon, 'logger' | 'sendEvents' | 'eventsUri'> & {
78
/**

0 commit comments

Comments
 (0)