Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/command-palette/domain/CommandSearch

Pure (DOMAIN-001): fuzzy filtering of commands by a typed query.

Cockpit client (features), v0.8. Source: ui/client/features/command-palette/domain/CommandSearch.ts.

Functions#

filterCommands()#

filterCommands(commands, query): Command[]

Defined in: ui/client/features/command-palette/domain/CommandSearch.ts:36

Commands matching query, best first (ties keep registration order). An empty query returns everything in order.

Parameters#

commands

Command[]

query

string

Returns#

Command[]


scoreCommand()#

scoreCommand(query, cmd): number | null

Defined in: ui/client/features/command-palette/domain/CommandSearch.ts:23

Score of a whole query (space-separated tokens, all must match), or null.

Parameters#

query

string

cmd

Command

Returns#

number | null