createExtension()
Home > @backstage/frontend-plugin-api
> createExtension
Signature:
function createExtension<UOutput extends AnyExtensionDataRef, TInputs extends {
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
optional: boolean;
singleton: boolean;
}>;
}, TConfigSchema extends {
[key: string]: (zImpl: typeof z) => z.ZodType;
}, UFactoryOutput extends ExtensionDataValue<any, any>, const TKind extends string | undefined = undefined, const TName extends string | undefined = undefined>(options: CreateExtensionOptions<TKind, TName, UOutput, TInputs, TConfigSchema, UFactoryOutput>): ExtensionDefinition<{
config: string extends keyof TConfigSchema ? {} : {
[key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
};
configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
[key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
}>>;
output: UOutput;
inputs: TInputs;
params: never;
kind: string | undefined extends TKind ? undefined : TKind;
name: string | undefined extends TName ? undefined : TName;
}>;
Parameters
Parameter |
Type |
Description |
---|---|---|
options |
CreateExtensionOptions<TKind, TName, UOutput, TInputs, TConfigSchema, UFactoryOutput> |
ExtensionDefinition<{ config: string extends keyof TConfigSchema ? {} : { [key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>; }; configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{ [key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>; }>>; output: UOutput; inputs: TInputs; params: never; kind: string | undefined extends TKind ? undefined : TKind; name: string | undefined extends TName ? undefined : TName; }>