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 ,
@@ -41,8 +42,8 @@ import { buildDefineExpr, buildRemoveExpr } from "./_utils.ts";
41
42
*/
42
43
export async function define (
43
44
denops : Denops ,
44
- event : AutocmdEvent | AutocmdEvent [ ] ,
45
- pat : string | string [ ] ,
45
+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
46
+ pat : AutocmdPattern | readonly AutocmdPattern [ ] ,
46
47
cmd : string ,
47
48
options : DefineOptions = { } ,
48
49
) : Promise < void > {
@@ -76,8 +77,8 @@ export async function define(
76
77
*/
77
78
export async function remove (
78
79
denops : Denops ,
79
- event ?: "*" | AutocmdEvent | AutocmdEvent [ ] ,
80
- pat ?: string | string [ ] ,
80
+ event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
81
+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
81
82
options : RemoveOptions = { } ,
82
83
) : Promise < void > {
83
84
const expr = buildRemoveExpr ( event , pat , options ) ;
@@ -108,8 +109,8 @@ export async function remove(
108
109
*/
109
110
export async function list (
110
111
denops : Denops ,
111
- event ?: "*" | AutocmdEvent | AutocmdEvent [ ] ,
112
- pat ?: string | string [ ] ,
112
+ event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
113
+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
113
114
options : ListOptions = { } ,
114
115
) : Promise < unknown > {
115
116
const terms = [ "au" ] ;
@@ -120,13 +121,13 @@ export async function list(
120
121
if ( Array . isArray ( event ) ) {
121
122
terms . push ( event . join ( "," ) ) ;
122
123
} else {
123
- terms . push ( event ) ;
124
+ terms . push ( event as AutocmdEvent ) ;
124
125
}
125
126
if ( pat ) {
126
127
if ( Array . isArray ( pat ) ) {
127
128
terms . push ( pat . join ( "," ) ) ;
128
129
} else {
129
- terms . push ( pat ) ;
130
+ terms . push ( pat as AutocmdPattern ) ;
130
131
}
131
132
}
132
133
}
@@ -155,7 +156,7 @@ export async function list(
155
156
*/
156
157
export async function emit (
157
158
denops : Denops ,
158
- event : AutocmdEvent | AutocmdEvent [ ] ,
159
+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
159
160
fname ?: string ,
160
161
options : EmitOptions = { } ,
161
162
) : Promise < unknown > {
@@ -169,7 +170,7 @@ export async function emit(
169
170
if ( Array . isArray ( event ) ) {
170
171
terms . push ( event . join ( "," ) ) ;
171
172
} else {
172
- terms . push ( event ) ;
173
+ terms . push ( event as AutocmdEvent ) ;
173
174
}
174
175
if ( fname ) {
175
176
terms . push ( fname ) ;
@@ -199,7 +200,7 @@ export async function emit(
199
200
*/
200
201
export async function emitAll (
201
202
denops : Denops ,
202
- event : AutocmdEvent | AutocmdEvent [ ] ,
203
+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
203
204
fname ?: string ,
204
205
options : EmitOptions = { } ,
205
206
) : Promise < unknown > {
@@ -213,7 +214,7 @@ export async function emitAll(
213
214
if ( Array . isArray ( event ) ) {
214
215
terms . push ( event . join ( "," ) ) ;
215
216
} else {
216
- terms . push ( event ) ;
217
+ terms . push ( event as AutocmdEvent ) ;
217
218
}
218
219
if ( fname ) {
219
220
terms . push ( fname ) ;
0 commit comments