Skip to main content

RegistryKey Interface

A strongly typed key for a Registry. Use with lookupInRegistry(registry, key).

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Input

This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.

Signature

/** @sealed */
export interface RegistryKey<TOut, TIn = unknown>

Type Parameters

ParameterDefaultDescription
TOutThe type produced by adapt(value) from a looked-up entry.
TInunknownThe type of the entries in the Registry this key is used with.

Remarks

Used to look up a TIn in a Registry<TIn>, and produce a TOut from it.

Properties

PropertyAlertsModifiersTypeDescription
typeAlphareadonlystringIdentifier to provide to the Registry.

Methods

MethodAlertsReturn TypeDescription
adapt(value)AlphaTOutConvert a value from the registry to the desired output type.

Property Details

type

Identifier to provide to the Registry.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

readonly type: string;

Type: string

Method Details

adapt

Convert a value from the registry to the desired output type.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

adapt(value: TIn): TOut;

Remarks

How this is done is up to the implementation.

This might be a type guard which throws if the input is not valid. Or it could be a conversion, an identity function, or something else.

Parameters

ParameterTypeDescription
valueTInThe value from the registry.

Returns

The converted value.

Return type: TOut