createExtensionBlueprint()
Home > @backstage/frontend-plugin-api
> createExtensionBlueprint
A simpler replacement for wrapping up createExtension
inside a kind or type. This allows for a cleaner API for creating types and instances of those types.
Signature:
function createExtensionBlueprint<TParams extends object, UOutput extends AnyExtensionDataRef, TInputs extends {
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
optional: boolean;
singleton: boolean;
}>;
}, TConfigSchema extends {
[key in string]: (zImpl: typeof z) => z.ZodType;
}, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TName extends string | undefined = undefined, TDataRefs extends {
[name in string]: AnyExtensionDataRef;
} = never>(options: CreateExtensionBlueprintOptions<TKind, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
kind: TKind;
name: TName;
params: TParams;
output: UOutput;
inputs: string extends keyof TInputs ? {} : TInputs;
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]>;
}>>;
dataRefs: TDataRefs;
}>;
Parameters
Parameter |
Type |
Description |
---|---|---|
options |
CreateExtensionBlueprintOptions<TKind, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs> |
ExtensionBlueprint<{ kind: TKind; name: TName; params: TParams; output: UOutput; inputs: string extends keyof TInputs ? {} : TInputs; 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]>; }>>; dataRefs: TDataRefs; }>