diff --git a/packages/version-bridge/api-report.md b/packages/version-bridge/api-report.md index 21b6cd508b..94ed54ddaa 100644 --- a/packages/version-bridge/api-report.md +++ b/packages/version-bridge/api-report.md @@ -3,16 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -// Warning: (ae-missing-release-tag) "createVersionedContextForTesting" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export function createVersionedContextForTesting(key: string): { set(versions: { [x: number]: unknown }): void; reset(): void; }; -// Warning: (ae-missing-release-tag) "createVersionedValueMap" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function createVersionedValueMap< Versions extends { @@ -20,32 +16,19 @@ export function createVersionedValueMap< }, >(versions: Versions): VersionedValue; -// Warning: (ae-missing-release-tag) "getGlobalSingleton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function getGlobalSingleton(id: string): T; -// Warning: (ae-missing-release-tag) "getOrCreateGlobalSingleton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function getOrCreateGlobalSingleton(id: string, supplier: () => T): T; -// Warning: (ae-missing-release-tag) "setGlobalSingleton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public -export function setGlobalSingleton(id: string, value: unknown): void; - -// Warning: (ae-missing-release-tag) "useVersionedContext" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) export function useVersionedContext< Versions extends { [version in number]: any; }, >(key: string): VersionedValue; -// Warning: (ae-missing-release-tag) "VersionedValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export type VersionedValue< Versions extends { diff --git a/packages/version-bridge/src/lib/VersionedContext.ts b/packages/version-bridge/src/lib/VersionedContext.ts index bd80365c2f..4a08739c16 100644 --- a/packages/version-bridge/src/lib/VersionedContext.ts +++ b/packages/version-bridge/src/lib/VersionedContext.ts @@ -23,6 +23,7 @@ import { createVersionedValueMap, VersionedValue } from './VersionedValue'; * stored inside a global singleton. * * @param key - A key that uniquely identifies the context. + * @public * @example * * ```ts @@ -48,6 +49,7 @@ export function createVersionedContext< * stored inside a global singleton. * * @param key - A key that uniquely identifies the context. + * @public * @example * * ```ts @@ -56,7 +58,7 @@ export function createVersionedContext< * const myValue = versionedHolder.atVersion(1); * * // ... - * ```` + * ``` */ export function useVersionedContext< Versions extends { [version in number]: any }, @@ -75,6 +77,7 @@ export function useVersionedContext< * combinations of versions provided from a context. * * @param key - A key that uniquely identifies the context. + * @public * @example * * ```ts diff --git a/packages/version-bridge/src/lib/VersionedValue.ts b/packages/version-bridge/src/lib/VersionedValue.ts index 3b3064fc7e..28b4de5903 100644 --- a/packages/version-bridge/src/lib/VersionedValue.ts +++ b/packages/version-bridge/src/lib/VersionedValue.ts @@ -18,6 +18,8 @@ * The versioned value interface is a container for a set of values that * can be looked up by version. It is intended to be used as a container * for values that can be versioned independently of package versions. + * + * @public */ export type VersionedValue = { atVersion( @@ -27,6 +29,8 @@ export type VersionedValue = { /** * Creates a container for a map of versioned values that implements VersionedValue. + * + * @public */ export function createVersionedValueMap< Versions extends { [version: number]: any }, diff --git a/packages/version-bridge/src/lib/globalObject.ts b/packages/version-bridge/src/lib/globalObject.ts index 280885f768..765bc62822 100644 --- a/packages/version-bridge/src/lib/globalObject.ts +++ b/packages/version-bridge/src/lib/globalObject.ts @@ -32,6 +32,8 @@ const makeKey = (id: string) => `__@backstage/${id}__`; /** * Used to access a global singleton value, failing if it is not already set. + * + * @public */ export function getGlobalSingleton(id: string): T { const key = makeKey(id); @@ -44,6 +46,8 @@ export function getGlobalSingleton(id: string): T { /** * Serializes access to a global singleton value, with the first caller creating the value. + * + * @public */ export function getOrCreateGlobalSingleton( id: string,