-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrefiner.ts
More file actions
33 lines (30 loc) · 902 Bytes
/
refiner.ts
File metadata and controls
33 lines (30 loc) · 902 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
33
import type { Denops } from "@denops/std";
import type { Detail, DetailUnit, IdItem } from "./item.ts";
/**
* Parameters for refining a source or curator.
*/
export type RefineParams<T extends Detail> = {
readonly items: AsyncIterable<IdItem<T>>;
};
/**
* Refiner that refine a source or curator.
*/
export type Refiner<
T extends Detail = DetailUnit,
U extends Detail = DetailUnit,
> = {
__phantom?: (_: T) => void; // This is required for type constraint.
/**
* Refine a source or curator.
*
* @param denops Denops instance.
* @param params Parameters for refining.
* @param options - Additional options, including an abort signal.
* @returns An async iterator over the collected or curated items.
*/
refine: <V extends T>(
denops: Denops,
params: RefineParams<V>,
options: { signal?: AbortSignal },
) => AsyncIterableIterator<IdItem<V & U>>;
};