Skip to content

searchEntries beta ​

Function of @v12-engine/editor

ts
export declare function searchEntries(found: readonly FoundEntry[], query: string, options?: {
    prefixes?: Record<string, string>;
    recent?: readonly string[];
    first?: (entry: FoundEntry) => boolean;
    fuzzy?: boolean | ((entry: FoundEntry) => boolean);
}): FoundEntry[];

What a search finds, best first: query split in words, each found in the entry's label, kind, detail or words, as typed or nearly (a typo, after everything found as typed: the kit's fuzzyBy, unless fuzzy says not for an entry); a first character that is a source's prefix searches that one alone. With nothing typed, what was used last; with words, what was used last before the rest, and labels that start with the words before those that only have them. What first says comes before the rest found (the actions of the panel the keyboard is in, Ctrl+Shift+P)