svelte-multiselect
Version:
Svelte multi-select component
47 lines (46 loc) • 1.71 kB
TypeScript
import { type Attachment } from 'svelte/attachments';
declare global {
interface CSS {
highlights: HighlightRegistry;
}
interface HighlightRegistry extends Map<string, Highlight> {
clear(): void;
delete(key: string): boolean;
set(key: string, value: Highlight): this;
}
}
export interface DraggableOptions {
handle_selector?: string;
on_drag_start?: (event: MouseEvent) => void;
on_drag?: (event: MouseEvent) => void;
on_drag_end?: (event: MouseEvent) => void;
}
export declare const draggable: (options?: DraggableOptions) => Attachment;
export declare function get_html_sort_value(element: HTMLElement): string;
export declare const sortable: ({ header_selector, asc_class, desc_class, sorted_style, }?: {
header_selector?: string | undefined;
asc_class?: string | undefined;
desc_class?: string | undefined;
sorted_style?: {
backgroundColor: string;
} | undefined;
}) => (node: HTMLElement) => () => void;
type HighlightOptions = {
query?: string;
disabled?: boolean;
node_filter?: (node: Node) => number;
css_class?: string;
};
export declare const highlight_matches: (ops: HighlightOptions) => (node: HTMLElement) => (() => void) | undefined;
export declare const tooltip: (options?: {
content?: string;
placement?: `top` | `bottom` | `left` | `right`;
delay?: number;
}) => Attachment;
type ClickOutsideConfig<T extends HTMLElement> = {
enabled?: boolean;
exclude?: string[];
callback?: (node: T, config: ClickOutsideConfig<T>) => void;
};
export declare const click_outside: <T extends HTMLElement>(config?: ClickOutsideConfig<T>) => (node: T) => () => void;
export {};