ICommand

interface
Navigation

A single command/action exposed by OrigamCommandPalette — holds the stable id, label, optional description, icon, keyboard shortcut hint, group, extra search keywords and the perform handler.

TypeScript

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

id
requis
string
Stable identifier used as the v-for key, the ARIA aria-activedescendant target and the dedup key in the registry.
label
requis
string
Visible primary label. Drives the default fuzzy-match input.
description
string
Secondary line shown under the label.
icon
TIcon
Optional prepend icon.
kbd
ReadonlyArray<string>
Keyboard shortcut hint rendered through OrigamKbd next to the action. Display-only — does NOT bind a global listener.
group
string
Group label (e.g. "Navigation", "Settings"). Commands sharing the same group render under the same subheader.
keywords
ReadonlyArray<string>
Extra search terms that should match the command (e.g. ["preferences", "config"] for a "Settings" entry).
perform
requis
() => void | Promise<void>
Handler invoked when the command is selected. May be async — the palette awaits the returned promise before closing when closeOnSelect is true.
disabled
boolean
Disabled commands stay visible but cannot be selected.

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Registering a command via the composable

typescript

Declaring commands inline on the palette

vue