|
| 1 | +import { CompositeDisposable } from 'atom'; |
| 2 | +declare type EtchElement = HTMLElement; |
| 3 | +declare interface SelectListProperties { |
| 4 | + items: Array<object | string>; |
| 5 | + elementForItem: (item: object | string, options: { |
| 6 | + selected: boolean; |
| 7 | + index: number; |
| 8 | + visible: boolean; |
| 9 | + }) => EtchElement; |
| 10 | + maxResults?: number; |
| 11 | + filter?: (items: Array<object | string>, query: string) => Array<object>; |
| 12 | + filterKeyForItem?: (item: object | string) => string; |
| 13 | + filterQuery?: (query: string) => string; |
| 14 | + query?: string; |
| 15 | + selectQuery?: boolean; |
| 16 | + order?: (item1: object | string, item2: object | string) => number; |
| 17 | + emptyMessage?: string; |
| 18 | + errorMessage?: string; |
| 19 | + infoMessage?: string; |
| 20 | + loadingMessage?: string; |
| 21 | + loadingBadge?: string | number; |
| 22 | + itemsClassList?: Array<string>; |
| 23 | + initialSelectionIndex?: number; |
| 24 | + didChangeQuery?: (query: string) => void; |
| 25 | + didChangeSelection?: (item: object | string) => void; |
| 26 | + didConfirmSelection?: (item: object | string) => void; |
| 27 | + didConfirmEmptySelection?: () => void; |
| 28 | + didCancelSelection?: () => void; |
| 29 | + initiallyVisibleItemCount?: number; |
| 30 | + skipCommandsRegistration: boolean; |
| 31 | +} |
| 32 | +export default class SelectListView { |
| 33 | + props: SelectListProperties; |
| 34 | + items: Array<object | string>; |
| 35 | + private disposables; |
| 36 | + private element; |
| 37 | + private didClickItemsList; |
| 38 | + private visibilityObserver; |
| 39 | + private listItems; |
| 40 | + private selectionIndex; |
| 41 | + private refs; |
| 42 | + static setScheduler(scheduler: any): void; |
| 43 | + static getScheduler(scheduler: any): any; |
| 44 | + constructor(props: SelectListProperties); |
| 45 | + initializeVisibilityObserver(): void; |
| 46 | + focus(): void; |
| 47 | + didLoseFocus(event: any): void; |
| 48 | + reset(): void; |
| 49 | + destroy(): any; |
| 50 | + registerAtomCommands(): CompositeDisposable; |
| 51 | + update(props?: SelectListProperties): any; |
| 52 | + render(): any; |
| 53 | + renderItems(): any; |
| 54 | + renderErrorMessage(): any; |
| 55 | + renderInfoMessage(): any; |
| 56 | + renderLoadingMessage(): any; |
| 57 | + getQuery(): any; |
| 58 | + getFilterQuery(): any; |
| 59 | + didChangeQuery(): void; |
| 60 | + didClickItem(itemIndex: number): void; |
| 61 | + computeItems(updateComponent?: boolean): void; |
| 62 | + fuzzyFilter(items: Array<object | string>, query?: string): (string | object)[]; |
| 63 | + getSelectedItem(): string | object | null; |
| 64 | + renderItemAtIndex(index: number): void; |
| 65 | + selectPrevious(): any; |
| 66 | + selectNext(): any; |
| 67 | + selectFirst(): any; |
| 68 | + selectLast(): any; |
| 69 | + selectNone(): any; |
| 70 | + selectIndex(index: number, updateComponent?: boolean): any; |
| 71 | + selectItem(item: object | string): any; |
| 72 | + confirmSelection(): void; |
| 73 | + cancelSelection(): void; |
| 74 | +} |
| 75 | +export { SelectListView }; |
0 commit comments