Skip to main content

BeforeActionHookInput

interface

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

interface BeforeActionHookInput

Import

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

Members4

action
HostActionReference

The action to intercept. Three shapes are legal, and they are the three things a hook can truthfully name: a host action id such as `workspace.file.write`; one of this mod's own `command(...)` values, which the host qualifies with the mod id; or `command:` plus the id of a command another mod or the host registers. A bare foreign id is not accepted, because nothing here can tell it apart from a typo.

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

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