Skip to main content
Version: Next

ExtensionBlueprint.makeWithOverrides()

Home > @backstage/frontend-plugin-api > ExtensionBlueprint > makeWithOverrides

Creates a new extension from the blueprint.

You must either pass params directly, or define a factory that can optionally call the original factory with the same params.

Signature:

makeWithOverrides<TNewName extends string | undefined, TExtensionConfigSchema extends {
[key in string]: (zImpl: typeof z) => z.ZodType;
}, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
optional: boolean;
singleton: boolean;
}>;
}>(args: {
name?: TNewName;
attachTo?: {
id: string;
input: string;
};
disabled?: boolean;
inputs?: TExtraInputs & {
[KName in keyof T['inputs']]?: `Error: Input '${KName & string}' is already defined in parent definition`;
};
output?: Array<UNewOutput>;
config?: {
schema: TExtensionConfigSchema & {
[KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
};
};
factory(originalFactory: (params: T['params'], context?: {
config?: T['config'];
inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
}) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
node: AppNode;
apis: ApiHolder;
config: T['config'] & {
[key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
};
inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
}): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>;
}): ExtensionDefinition<{
config: (string extends keyof TExtensionConfigSchema ? {} : {
[key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
}) & T['config'];
configInput: (string extends keyof TExtensionConfigSchema ? {} : z.input<z.ZodObject<{
[key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
}>>) & T['configInput'];
output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
inputs: T['inputs'] & TExtraInputs;
kind: T['kind'];
name: string | undefined extends TNewName ? T['name'] : TNewName;
params: T['params'];
}>;

Parameters

Parameter

Type

Description

args

{ name?: TNewName; attachTo?: { id: string; input: string; }; disabled?: boolean; inputs?: TExtraInputs & { [KName in keyof T['inputs']]?: `Error: Input '${KName & string}' is already defined in parent definition`; }; output?: Array<UNewOutput>; config?: { schema: TExtensionConfigSchema & { [KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`; }; }; factory(originalFactory: (params: T['params'], context?: { config?: T['config']; inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>; }) => ExtensionDataContainer<NonNullable<T['output']>>, context: { node: AppNode; apis: ApiHolder; config: T['config'] & { [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>; }; inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>; }): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>; }

**Returns:**

ExtensionDefinition<{ config: (string extends keyof TExtensionConfigSchema ? {} : { [key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>; }) & T['config']; configInput: (string extends keyof TExtensionConfigSchema ? {} : z.input<z.ZodObject<{ [key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>; }>>) & T['configInput']; output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput; inputs: T['inputs'] & TExtraInputs; kind: T['kind']; name: string | undefined extends TNewName ? T['name'] : TNewName; params: T['params']; }>