RegistryKey Interface
A strongly typed key for a Registry. Use with lookupInRegistry(registry, key).
To use, import via fluid-framework/alpha.
For more information about our API support guarantees, see here.
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.
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
| Parameter | Default | Description |
|---|---|---|
| TOut | The type produced by adapt(value) from a looked-up entry. | |
| TIn | unknown | The 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
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| type | Alpha | readonly | string | Identifier to provide to the Registry. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| adapt(value) | Alpha | TOut | Convert a value from the registry to the desired output type. |
Property Details
type
Identifier to provide to the Registry.
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.
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
| Parameter | Type | Description |
|---|---|---|
| value | TIn | The value from the registry. |
Returns
The converted value.
Return type: TOut