frontend-plugin-api: fix and update API report
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -1281,7 +1281,7 @@ export interface ExtensionBlueprint<
|
||||
params: TParams,
|
||||
context?: {
|
||||
config?: TConfig;
|
||||
inputs?: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
inputs?: ResolveInputValueOverrides<TInputs>;
|
||||
},
|
||||
) => ExtensionDataContainer<UOutput>,
|
||||
context: {
|
||||
@@ -1470,7 +1470,7 @@ export interface ExtensionDefinition<
|
||||
factory(
|
||||
originalFactory: (context?: {
|
||||
config?: TConfig;
|
||||
inputs?: Expand<ResolvedExtensionInputs<TInputs>>;
|
||||
inputs?: ResolveInputValueOverrides<TInputs>;
|
||||
}) => ExtensionDataContainer<UOutput>,
|
||||
context: {
|
||||
node: AppNode;
|
||||
@@ -1868,6 +1868,73 @@ export type ResolvedExtensionInputs<
|
||||
: Expand<ResolvedExtensionInput<TInputs[InputName]> | undefined>;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type ResolveInputValueOverrides<
|
||||
TInputs extends {
|
||||
[inputName in string]: ExtensionInput<
|
||||
AnyExtensionDataRef,
|
||||
{
|
||||
optional: boolean;
|
||||
singleton: boolean;
|
||||
}
|
||||
>;
|
||||
} = {
|
||||
[inputName in string]: ExtensionInput<
|
||||
AnyExtensionDataRef,
|
||||
{
|
||||
optional: boolean;
|
||||
singleton: boolean;
|
||||
}
|
||||
>;
|
||||
},
|
||||
> = Expand<
|
||||
{
|
||||
[KName in keyof TInputs as TInputs[KName] extends ExtensionInput<
|
||||
any,
|
||||
{
|
||||
optional: infer IOptional extends boolean;
|
||||
singleton: boolean;
|
||||
}
|
||||
>
|
||||
? IOptional extends true
|
||||
? never
|
||||
: KName
|
||||
: never]: TInputs[KName] extends ExtensionInput<
|
||||
infer IDataRefs,
|
||||
{
|
||||
optional: boolean;
|
||||
singleton: infer ISingleton extends boolean;
|
||||
}
|
||||
>
|
||||
? ISingleton extends true
|
||||
? Iterable<ExtensionDataRefToValue<IDataRefs>>
|
||||
: Array<Iterable<ExtensionDataRefToValue<IDataRefs>>>
|
||||
: never;
|
||||
} & {
|
||||
[KName in keyof TInputs as TInputs[KName] extends ExtensionInput<
|
||||
any,
|
||||
{
|
||||
optional: infer IOptional extends boolean;
|
||||
singleton: boolean;
|
||||
}
|
||||
>
|
||||
? IOptional extends true
|
||||
? KName
|
||||
: never
|
||||
: never]?: TInputs[KName] extends ExtensionInput<
|
||||
infer IDataRefs,
|
||||
{
|
||||
optional: boolean;
|
||||
singleton: infer ISingleton extends boolean;
|
||||
}
|
||||
>
|
||||
? ISingleton extends true
|
||||
? Iterable<ExtensionDataRefToValue<IDataRefs>>
|
||||
: Array<Iterable<ExtensionDataRefToValue<IDataRefs>>>
|
||||
: never;
|
||||
}
|
||||
>;
|
||||
|
||||
// @public
|
||||
export type RouteFunc<TParams extends AnyRouteRefParams> = (
|
||||
...[params]: TParams extends undefined
|
||||
|
||||
@@ -77,7 +77,7 @@ export type CreateExtensionBlueprintOptions<
|
||||
dataRefs?: TDataRefs;
|
||||
} & VerifyExtensionFactoryOutput<UOutput, UFactoryOutput>;
|
||||
|
||||
/** @ignore */
|
||||
/** @public */
|
||||
export type ResolveInputValueOverrides<
|
||||
TInputs extends {
|
||||
[inputName in string]: ExtensionInput<
|
||||
|
||||
@@ -56,6 +56,7 @@ export {
|
||||
} from './types';
|
||||
export {
|
||||
type CreateExtensionBlueprintOptions,
|
||||
type ResolveInputValueOverrides,
|
||||
type ExtensionBlueprint,
|
||||
createExtensionBlueprint,
|
||||
} from './createExtensionBlueprint';
|
||||
|
||||
Reference in New Issue
Block a user