1
1
import type { Denops } from "@denops/core" ;
2
2
import type {
3
3
AutocmdEvent ,
4
+ AutocmdPattern ,
4
5
DefineOptions ,
5
6
EmitOptions ,
6
7
ListOptions ,
@@ -42,7 +43,7 @@ import { buildDefineExpr, buildRemoveExpr } from "./_utils.ts";
42
43
export async function define (
43
44
denops : Denops ,
44
45
event : AutocmdEvent | readonly AutocmdEvent [ ] ,
45
- pat : string | readonly string [ ] ,
46
+ pat : AutocmdPattern | readonly AutocmdPattern [ ] ,
46
47
cmd : string ,
47
48
options : DefineOptions = { } ,
48
49
) : Promise < void > {
@@ -77,7 +78,7 @@ export async function define(
77
78
export async function remove (
78
79
denops : Denops ,
79
80
event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
80
- pat ?: string | readonly string [ ] ,
81
+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
81
82
options : RemoveOptions = { } ,
82
83
) : Promise < void > {
83
84
const expr = buildRemoveExpr ( event , pat , options ) ;
@@ -109,7 +110,7 @@ export async function remove(
109
110
export async function list (
110
111
denops : Denops ,
111
112
event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
112
- pat ?: string | readonly string [ ] ,
113
+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
113
114
options : ListOptions = { } ,
114
115
) : Promise < unknown > {
115
116
const terms = [ "au" ] ;
@@ -126,7 +127,7 @@ export async function list(
126
127
if ( Array . isArray ( pat ) ) {
127
128
terms . push ( pat . join ( "," ) ) ;
128
129
} else {
129
- terms . push ( pat as string ) ;
130
+ terms . push ( pat as AutocmdPattern ) ;
130
131
}
131
132
}
132
133
}
0 commit comments