version-bridge: updated API report + fixups

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-09-10 17:51:29 +02:00
parent ddedf7aab5
commit d6eb28c91a
4 changed files with 13 additions and 19 deletions
+1 -18
View File
@@ -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<Versions>;
// 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<T>(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<T>(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<Versions>;
// 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 {
@@ -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
@@ -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<Versions extends { [version: number]: any }> = {
atVersion<Version extends keyof Versions>(
@@ -27,6 +29,8 @@ export type VersionedValue<Versions extends { [version: number]: any }> = {
/**
* Creates a container for a map of versioned values that implements VersionedValue.
*
* @public
*/
export function createVersionedValueMap<
Versions extends { [version: number]: any },
@@ -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<T>(id: string): T {
const key = makeKey(id);
@@ -44,6 +46,8 @@ export function getGlobalSingleton<T>(id: string): T {
/**
* Serializes access to a global singleton value, with the first caller creating the value.
*
* @public
*/
export function getOrCreateGlobalSingleton<T>(
id: string,