Skip to main content

createTemplateAction()

Home > @backstage/plugin-scaffolder-node > createTemplateAction

This function is used to create new template actions to get type safety. Will convert zod schemas to json schemas for use throughout the system.

Signature:

createTemplateAction: <TInputParams extends JsonObject = JsonObject, TOutputParams extends JsonObject = JsonObject, TInputSchema extends z.ZodType<any, z.ZodTypeDef, any> | Schema = {}, TOutputSchema extends z.ZodType<any, z.ZodTypeDef, any> | Schema = {}, TActionInput extends JsonObject = TInputSchema extends z.ZodType<any, any, infer IReturn> ? IReturn : TInputParams, TActionOutput extends JsonObject = TOutputSchema extends z.ZodType<any, any, infer IReturn_1> ? IReturn_1 : TOutputParams>(action: TemplateActionOptions<TActionInput, TActionOutput, TInputSchema, TOutputSchema>) => TemplateAction<TActionInput, TActionOutput>

Parameters

Parameter

Type

Description

action

TemplateActionOptions<TActionInput, TActionOutput, TInputSchema, TOutputSchema>

**Returns:**

TemplateAction<TActionInput, TActionOutput>