@@ -5,26 +5,23 @@ import type { FlatType } from "./util/_typeutil.ts";
55import { defineSource , type Source } from "./source.ts" ;
66import { type Curator , defineCurator } from "./curator.ts" ;
77
8- declare const UNSPECIFIED : unique symbol ;
9- type UNSPECIFIED = typeof UNSPECIFIED ;
10-
118export type ModifyParams < T > = {
129 readonly items : AsyncIterable < IdItem < T > > ;
1310} ;
1411
15- export type Modifier < T , U = UNSPECIFIED > =
12+ export type Modifier < T , U = T > =
1613 & ( <
1714 S extends Source < T > | Curator < T > ,
1815 V extends S extends ( Source < infer V > | Curator < infer V > ) ? V : never ,
19- W extends U extends UNSPECIFIED ? V : U ,
20- R extends S extends Source < T > ? Source < FlatType < V & W > >
21- : Curator < FlatType < V & W > > ,
16+ R extends S extends Source < T > ? Source < FlatType < V & U > >
17+ : Curator < FlatType < V & U > > ,
2218 > ( source : S ) => R )
2319 & {
24- __phantom ?: T ;
20+ // This `__phantom` property is used for type constraint.
21+ __phantom ?: ( _ : T ) => void ;
2522 } ;
2623
27- export function defineModifier < T , U = UNSPECIFIED > (
24+ export function defineModifier < T , U = T > (
2825 modify : (
2926 denops : Denops ,
3027 params : ModifyParams < T > ,
0 commit comments