CommandsViewApi
interfaceRuns a command: one of this mod's own declarations, or any registered command by id, including commands the host and other mods own. Pass the `command(...)` value itself and the result is the handler's own return type; the host qualifies the id for you. Pass a string id and the result is `unknown`, because nothing this mod compiled against declares what that command returns. When an action exists for what you want, `ctx.action(...)` is the better call: it checks the input and the result against the action's schema.
Import
import { CommandsViewApi } from '@modular/sdk/view';Members1
- execute()
<TResult>(command: Command<string, TResult>, ...args: readonly unknown[]) => Promise<TResult> | (commandId: string, ...args: readonly unknown[]) => Promise<unknown>Runs one of this mod's own commands with `args` and resolves with its typed result. Executes `commandId` with `args` and resolves with what it returned.