fixes for TypeScript 5.0

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-03-25 15:30:22 +01:00
parent cc0e135cb9
commit 2898b6c8d5
22 changed files with 72 additions and 45 deletions
@@ -22,8 +22,8 @@ import { JsonObject } from '@backstage/types';
/** @public */
export type TemplateActionOptions<
TActionInput = {},
TActionOutput = {},
TActionInput extends JsonObject = {},
TActionOutput extends JsonObject = {},
TInputSchema extends Schema | z.ZodType = {},
TOutputSchema extends Schema | z.ZodType = {},
> = {
@@ -48,10 +48,18 @@ export const createTemplateAction = <
TOutputParams extends JsonObject = JsonObject,
TInputSchema extends Schema | z.ZodType = {},
TOutputSchema extends Schema | z.ZodType = {},
TActionInput = TInputSchema extends z.ZodType<any, any, infer IReturn>
TActionInput extends JsonObject = TInputSchema extends z.ZodType<
any,
any,
infer IReturn
>
? IReturn
: TInputParams,
TActionOutput = TOutputSchema extends z.ZodType<any, any, infer IReturn>
TActionOutput extends JsonObject = TOutputSchema extends z.ZodType<
any,
any,
infer IReturn
>
? IReturn
: TOutputParams,
>(
+2 -2
View File
@@ -75,8 +75,8 @@ export type ActionContext<
/** @public */
export type TemplateAction<
TActionInput = unknown,
TActionOutput = JsonObject,
TActionInput extends JsonObject = JsonObject,
TActionOutput extends JsonObject = JsonObject,
> = {
id: string;
description?: string;