chore: nearly there, just not matching the overload

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-02-28 14:00:39 +01:00
parent 3ece40f8c4
commit 6d0b7a9ce0
3 changed files with 39 additions and 29 deletions
@@ -64,26 +64,6 @@ type FlattenOptionalProperties<T extends { [key in string]: unknown }> = Expand<
}
>;
/**
* @public
* @deprecated migrate to using the new built in zod schema definitions for schemas
*/
export function createTemplateAction<
TInputParams extends JsonObject = JsonObject,
TOutputParams extends JsonObject = JsonObject,
TInputSchema extends JSONSchema7 = JSONSchema7,
TOutputSchema extends JSONSchema7 = JSONSchema7,
TActionInput extends JsonObject = TInputParams,
TActionOutput extends JsonObject = TOutputParams,
>(
action: TemplateActionOptions<
TActionInput,
TActionOutput,
TInputSchema,
TOutputSchema,
'v1'
>,
): TemplateAction<TActionInput, TActionOutput, 'v1'>;
/**
* @public
* @deprecated migrate to using the new built in zod schema definitions for schemas
@@ -133,17 +113,37 @@ export function createTemplateAction<
}>,
'v2'
>;
/**
* @public
* @deprecated migrate to using the new built in zod schema definitions for schemas
*/
export function createTemplateAction<
TInputParams extends JsonObject = JsonObject,
TOutputParams extends JsonObject = JsonObject,
TInputSchema extends JSONSchema7 = JSONSchema7,
TOutputSchema extends JSONSchema7 = JSONSchema7,
TActionInput extends JsonObject = TInputParams,
TActionOutput extends JsonObject = TOutputParams,
>(
action: TemplateActionOptions<
TActionInput,
TActionOutput,
TInputSchema,
TOutputSchema,
'v1'
>,
): TemplateAction<TActionInput, TActionOutput, 'v1'>;
export function createTemplateAction<
TInputParams extends JsonObject = JsonObject,
TOutputParams extends JsonObject = JsonObject,
TInputSchema extends
| JSONSchema7
| z.ZodType
| { [key in string]: (zImpl: typeof z) => z.ZodType } = {},
| { [key in string]: (zImpl: typeof z) => z.ZodType } = JSONSchema7,
TOutputSchema extends
| JSONSchema7
| z.ZodType
| { [key in string]: (zImpl: typeof z) => z.ZodType } = {},
| { [key in string]: (zImpl: typeof z) => z.ZodType } = JSONSchema7,
TActionInput extends JsonObject = TInputSchema extends z.ZodType<
any,
any,