UNPKG

@3mo/command-palette

Version:

Command-palettes are a common way to provide users with a list of actions they can perform in a given context.

22 lines 819 B
import { type MaterialIcon } from '@3mo/del'; export interface CommandPaletteData { icon: MaterialIcon; label: string; secondaryLabel?: string; command: () => void; } export declare abstract class CommandPaletteDataSource<T> { protected static readonly take = 5; readonly take = 5; readonly id: string; abstract readonly name: string; abstract readonly icon: MaterialIcon; readonly order: number; abstract fetch(): Promise<Array<T>>; fetchData(): Promise<CommandPaletteData[]>; abstract search(keyword: string): Promise<Array<T>>; searchData(keyword: string): Promise<CommandPaletteData[]>; abstract getItem(item: T): CommandPaletteData; getNewItem?(query?: string): CommandPaletteData | undefined; } //# sourceMappingURL=CommandPaletteDataSource.d.ts.map