Skip to main content

BeforeActionHookInput

interface

What hook.beforeAction needs in order to declare an interception.

interface BeforeActionHookInput<TAction extends string>

Import

import { BeforeActionHookInput } from '@modular/sdk';

Members4

action
PublicHookActionReference<TAction>

The action to intercept: a host action id such as `workspace.file.write`, or one of your own command ids. Write the command id bare, the `command:` prefix is added for you and passing it yourself is a type error.

idoptional
string

Stable hook id. Defaults to `beforeAction:<action>` with `:` written as `.`.

title
string

Human-readable label shown when the host asks the user about this hook.

whenoptional
Condition<string>

Limits the hook to when this condition holds. Always active when omitted.

Notes

category
Authoring