-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
curator.ts
38 lines (35 loc) · 921 Bytes
/
curator.ts
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
33
34
35
36
37
38
import type { Denops } from "@denops/std";
import type { Detail, IdItem } from "./item.ts";
/**
* Parameters for curating items.
*/
export type CurateParams = {
/**
* Arguments passed to the picker.
*/
readonly args: readonly string[];
/**
* User input query for filtering items.
*/
readonly query: string;
};
/**
* Curator that collects and filters items based on user input.
*
* Acts as an interactive `Source`.
*/
export type Curator<T extends Detail> = {
/**
* Curates items based on the provided parameters.
*
* @param denops - The Denops instance.
* @param params - Parameters for curating items.
* @param options - Optional settings, including an abort signal.
* @returns An async iterator over curated `IdItem` elements.
*/
curate(
denops: Denops,
params: CurateParams,
options: { signal?: AbortSignal },
): AsyncIterableIterator<IdItem<T>>;
};