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.
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.
- idrequisstring
- Stable identifier used as the v-for key, the ARIA aria-activedescendant target and the dedup key in the registry.
- labelrequisstring
- Visible primary label. Drives the default fuzzy-match input.
- descriptionstring
- Secondary line shown under the label.
- iconTIcon
- Optional prepend icon.
- kbdReadonlyArray<string>
- Keyboard shortcut hint rendered through OrigamKbd next to the action. Display-only — does NOT bind a global listener.
- groupstring
- Group label (e.g. "Navigation", "Settings"). Commands sharing the same group render under the same subheader.
- keywordsReadonlyArray<string>
- Extra search terms that should match the command (e.g. ["preferences", "config"] for a "Settings" entry).
- performrequis() => 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.
- disabledboolean
- 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
Declaring commands inline on the palette