defineAction
function defineAction<TInput, TOutput>(definition): Action<TInput, TOutput>;Defined in: core/src/action/action.types.ts:46
Define an action, wrapping its execute so input is validated against the
input schema before running and the return value against the output schema
after. Throws ActionInputValidationError or
ActionOutputValidationError respectively on a schema mismatch.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TInput extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> |
TOutput extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
definition |
Action<TInput, TOutput> |
Returns
Section titled “Returns”Action<TInput, TOutput>