Skip to content

Commit

Permalink
docs: add documentation to the SDK to resolve MD warnings (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickybondarenko authored and nicklasl committed Aug 19, 2024
1 parent da24be1 commit 956594b
Show file tree
Hide file tree
Showing 20 changed files with 360 additions and 219 deletions.
26 changes: 11 additions & 15 deletions api/openfeature-server-provider.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,29 @@ import { ProviderMetadata } from '@openfeature/server-sdk';
import { ProviderStatus } from '@openfeature/server-sdk';
import { ResolutionDetails } from '@openfeature/server-sdk';

// Warning: (ae-missing-release-tag) "ConfidenceServerProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export type ConfidenceProviderFactoryOptions = {
region?: 'eu' | 'us';
fetchImplementation?: typeof fetch;
clientSecret: string;
timeout: number;
};

// @public
export class ConfidenceServerProvider implements Provider {
constructor(client: FlagResolver);
// (undocumented)
readonly metadata: ProviderMetadata;
// (undocumented)
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext): Promise<ResolutionDetails<boolean>>;
// (undocumented)
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: EvaluationContext): Promise<ResolutionDetails<number>>;
// (undocumented)
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>>;
// (undocumented)
resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext): Promise<ResolutionDetails<string>>;
// (undocumented)
status: ProviderStatus;
}

// Warning: (ae-forgotten-export) The symbol "ConfidenceProviderFactoryOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "createConfidenceServerProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "createConfidenceServerProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function createConfidenceServerProvider(options: ConfidenceProviderFactoryOptions): Provider;

// @public (undocumented)
// @public
export function createConfidenceServerProvider(confidence: Confidence): Provider;

// (No @packageDocumentation comment for this package)
Expand Down
19 changes: 3 additions & 16 deletions api/openfeature-web-provider.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,26 @@ import { Provider } from '@openfeature/web-sdk';
import { ProviderMetadata } from '@openfeature/web-sdk';
import { ResolutionDetails } from '@openfeature/web-sdk';

// Warning: (ae-missing-release-tag) "ConfidenceWebProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export class ConfidenceWebProvider implements Provider {
constructor(confidence: FlagResolver);
// (undocumented)
readonly events: OpenFeatureEventEmitter;
// (undocumented)
initialize(context?: EvaluationContext): Promise<void>;
// (undocumented)
readonly metadata: ProviderMetadata;
// (undocumented)
onClose(): Promise<void>;
// (undocumented)
onContextChange(oldContext: EvaluationContext, newContext: EvaluationContext): Promise<void>;
// (undocumented)
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean): ResolutionDetails<boolean>;
// (undocumented)
resolveNumberEvaluation(flagKey: string, defaultValue: number): ResolutionDetails<number>;
// (undocumented)
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T): ResolutionDetails<T>;
// (undocumented)
resolveStringEvaluation(flagKey: string, defaultValue: string): ResolutionDetails<string>;
}

// Warning: (ae-forgotten-export) The symbol "ConfidenceWebProviderOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "createConfidenceWebProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "createConfidenceWebProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function createConfidenceWebProvider(options: ConfidenceWebProviderOptions): Provider;

// @public (undocumented)
// @public
export function createConfidenceWebProvider(confidence: Confidence): Provider;

// (No @packageDocumentation comment for this package)
Expand Down
49 changes: 10 additions & 39 deletions api/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import { StateObserver } from '@spotify-confidence/sdk';
import { Trackable } from '@spotify-confidence/sdk';
import { Value } from '@spotify-confidence/sdk';

// Warning: (ae-missing-release-tag) "ConfidenceProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "ConfidenceProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export type ConfidenceProvider = FC<PropsWithChildren<{
confidence: Confidence;
}>> & {
Expand All @@ -29,75 +26,49 @@ export type ConfidenceProvider = FC<PropsWithChildren<{
}>>;
};

// @public (undocumented)
// @public
export const ConfidenceProvider: ConfidenceProvider;

// Warning: (ae-missing-release-tag) "ConfidenceReact" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export class ConfidenceReact implements EventSender, Trackable, FlagResolver {
constructor(delegate: Confidence);
// (undocumented)
clearContext({ transition }?: {
transition?: boolean | undefined;
}): void;
// (undocumented)
get config(): Configuration;
// @internal (undocumented)
// @internal
get contextState(): string;
// @internal (undocumented)
// @internal
readonly delegate: Confidence;
// (undocumented)
evaluateFlag<T extends Value>(path: string, defaultValue: T): FlagEvaluation<Value.Widen<T>>;
// (undocumented)
getContext(): Context;
// (undocumented)
getFlag<T extends Value>(path: string, defaultValue: T): Promise<Value.Widen<T>>;
// (undocumented)
setContext(context: Context, { transition }?: {
transition?: boolean | undefined;
}): void;
// (undocumented)
subscribe(onStateChange?: StateObserver | undefined): () => void;
// (undocumented)
track(name: string, message?: Value.Struct): void;
// (undocumented)
track(manager: Trackable.Manager): Closer;
// (undocumented)
useContext(): Context;
// (undocumented)
useEvaluateFlag<T extends Value>(path: string, defaultValue: T): FlagEvaluation<Value.Widen<T>>;
// (undocumented)
useFlag<T extends Value>(path: string, defaultValue: T): Value.Widen<T>;
// (undocumented)
useWithContext(context: Context): ConfidenceReact;
// (undocumented)
withContext(context: Context): ConfidenceReact;
}

// Warning: (ae-missing-release-tag) "useConfidence" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export const useConfidence: () => ConfidenceReact;

// Warning: (ae-missing-release-tag) "useConfidenceContext" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function useConfidenceContext(confidence?: ConfidenceReact): Context;

// Warning: (ae-missing-release-tag) "useEvaluateFlag" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function useEvaluateFlag<T extends Value>(path: string, defaultValue: T, confidence?: ConfidenceReact): FlagEvaluation<Value.Widen<T>>;

// Warning: (ae-missing-release-tag) "useFlag" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function useFlag<T extends Value>(path: string, defaultValue: T, confidence?: ConfidenceReact): Value.Widen<T>;

// Warning: (ae-missing-release-tag) "useWithContext" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export function useWithContext(context: Context, parent?: ConfidenceReact): ConfidenceReact;

// (No @packageDocumentation comment for this package)
Expand Down
Loading

0 comments on commit 956594b

Please sign in to comment.