-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsorter.ts
More file actions
32 lines (30 loc) · 788 Bytes
/
sorter.ts
File metadata and controls
32 lines (30 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type { Denops } from "@denops/std";
import type { Promish } from "./_typeutil.ts";
import type { Detail, DetailUnit, IdItem } from "./item.ts";
/**
* Parameters for sorting items.
*/
export type SortParams<T extends Detail> = {
/**
* Array of items to sort.
*/
readonly items: IdItem<T>[];
};
/**
* Sorter that arranges items in order.
*/
export type Sorter<T extends Detail = DetailUnit> = {
/**
* Sorts items in place.
*
* @param denops - The Denops instance.
* @param params - Parameters specifying the items to sort.
* @param options - Options, including an abort signal.
* @returns Resolves when sorting is complete.
*/
sort(
denops: Denops,
params: SortParams<T>,
options: { signal?: AbortSignal },
): Promish<void>;
};