svelte-multiselect
Version:
Svelte multi-select component
26 lines (25 loc) • 964 B
TypeScript
import type { Option, OptionStyle } from '../types';
/**
* Get the label key from an option object or the option itself if it's a string or number
* @param opt Option
* @returns Label
*/
export declare const get_label: (opt: Option) => any;
/**
* This function is used extract CSS strings from a {selected, option} style object to be used in the style attribute of the option.
* If the style is a string, it will be returned as is
* @param option Option
* @param key
* @returns CSS string
*/
export declare function get_style(option: {
style?: OptionStyle;
[key: string]: unknown;
} | string | number, key?: `selected` | `option` | null): any;
/**
* Highlights text nodes that matching the string query
* @param element Parent element
* @param query Search query
* @param noMatchingOptionsMsg Text for empty node
*/
export declare function highlight_matching_nodes(element: HTMLElement, query?: string, noMatchingOptionsMsg?: string): void;