Skip to content

runAddHookedBlockCommand

runAddHookedBlockCommand(options): Promise<{ anchorBlockName: string; blockSlug: string; position: "before" | "after" | "firstChild" | "lastChild"; projectDir: string; }>

Defined in: wp-typia-project-tools/src/runtime/cli-add-workspace.ts:1135

Add one blockHooks entry to an existing official workspace block.

RunAddHookedBlockCommandOptions

Command options for the hooked-block workflow.

Promise<{ anchorBlockName: string; blockSlug: string; position: "before" | "after" | "firstChild" | "lastChild"; projectDir: string; }>

A promise that resolves with the normalized target block slug, anchor block name, position, and owning project directory after block.json is written.

When the command is run outside an official workspace, when the target block is unknown, when required flags are missing, or when the block already defines a hook for the requested anchor.