* @property {string} icon SVG icon string or object.
* @property {string} url URL for the action.
*/
/**
* @typedef {Object} CommandPaletteItemMetadata
* @property {string} [icon] Optional SVG icon string or object.
* @property {string} label Metadata label (e.g., matched title for redirect).
* @property {boolean} [highlightQuery] Whether to highlight the query in the label.
*/
/**
* @typedef {Object} CommandPaletteItemThumbnail
* @property {string} url Thumbnail URL.
* @property {number} [width] Thumbnail width.
* @property {number} [height] Thumbnail height.
*/
/**
* Represents a display item in the Command Palette list.
* Based on the props of CommandPaletteListItem.vue.
*
* @typedef {Object} CommandPaletteItem
* @property {string} id Unique identifier for the item (used as :key and element id).
* @property {string} type Type identifier (e.g., 'page', 'command', 'namespace', 'recent-item'). Used for styling and type labels via mw.message( `citizen-command-palette-type-${type}` ).
* @property {string} [url] The primary URL to navigate to when the item is selected. May not apply to all types (e.g., commands that trigger other actions).
* @property {string} [thumbnailIcon] Optional placeholder icon identifier (e.g., cdxIcon...) if thumbnail URL is missing. Passed to cdx-thumbnail :placeholder-icon prop.
* @property {Array<CommandPaletteItemMetadata>} [metadata] Optional list of metadata badges/tags.
* @property {Array<CommandPaletteItemAction>} [actions] Optional list of actions available for the item.
* @property {string} [value] Optional value associated with the item, used for specific types like commands (e.g. the command trigger string '/ns').
* @property {boolean} [highlightQuery] Whether to highlight the query in the label.
* @property {string} [source] Identifier of the provider that generated this item (e.g., 'recent', 'command', 'search').
* @property {boolean} [isMouseClick] True if the selection was triggered by a mouse click.
*/
/**
* Defines the interface for a Slash Command handler.
* Each command handler module should export an object conforming to this type.
*
* @typedef {Object} CommandPaletteCommand
* @property {string} id A unique programmatic identifier for the command.
* @property {string[]} triggers The triggers for the command.
* @property {string} [description] The user-facing description for the command (used in root '/' suggestions).
* @property {function(CommandPaletteItem): (CommandPaletteActionResult|Promise<CommandPaletteActionResult>)} [onCommandSelect] Optional: Handles selection of the command item itself.
* @property {function(string): Promise<Array<CommandPaletteItem>>} [getResults] Optional: Asynchronously fetches and adapts suggestion data based on the sub-query, returning CommandPaletteItems.
* @property {function(CommandPaletteItem): (CommandPaletteActionResult|Promise<CommandPaletteActionResult>)} [onResultSelect] Optional: Handles selection of an item *generated* by this command.
*/
/**
* Action to navigate to a URL in the current tab.
*
* @typedef {Object} CommandPaletteNavigateAction
* @property {'navigate'} action
* @property {string} payload - The URL to navigate to.
*/
/**
* Action to update the command palette's query string.