diff --git a/src/runtime/action/index.ts b/src/runtime/action/index.ts index 3469ecbb71..b1c344b6e5 100644 --- a/src/runtime/action/index.ts +++ b/src/runtime/action/index.ts @@ -32,7 +32,7 @@ export type ActionReturn = void extends Parameter * The following example defines an action that only works on `
` elements * and optionally accepts a parameter which it has a default value for: * ```ts - * export const myAction: Action = (node, param = { someProperty: true }) => { + * export const myAction: Action = (node, param = { someProperty: true }) => { * // ... * } * ``` @@ -44,4 +44,6 @@ export type ActionReturn = void extends Parameter export type Action = void extends Parameter ? (node: Node) => void | ActionReturn + : undefined extends Parameter + ? (node: Node, parameter?: Parameter) => void | ActionReturn : (node: Node, parameter: Parameter) => void | ActionReturn;