11import type { Denops } from "@denops/core" ;
22import type {
33 AutocmdEvent ,
4+ AutocmdPattern ,
45 DefineOptions ,
56 EmitOptions ,
67 ListOptions ,
@@ -41,8 +42,8 @@ import { buildDefineExpr, buildRemoveExpr } from "./_utils.ts";
4142 */
4243export async function define (
4344 denops : Denops ,
44- event : AutocmdEvent | AutocmdEvent [ ] ,
45- pat : string | string [ ] ,
45+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
46+ pat : AutocmdPattern | readonly AutocmdPattern [ ] ,
4647 cmd : string ,
4748 options : DefineOptions = { } ,
4849) : Promise < void > {
@@ -76,8 +77,8 @@ export async function define(
7677 */
7778export async function remove (
7879 denops : Denops ,
79- event ?: "*" | AutocmdEvent | AutocmdEvent [ ] ,
80- pat ?: string | string [ ] ,
80+ event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
81+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
8182 options : RemoveOptions = { } ,
8283) : Promise < void > {
8384 const expr = buildRemoveExpr ( event , pat , options ) ;
@@ -108,8 +109,8 @@ export async function remove(
108109 */
109110export async function list (
110111 denops : Denops ,
111- event ?: "*" | AutocmdEvent | AutocmdEvent [ ] ,
112- pat ?: string | string [ ] ,
112+ event ?: "*" | AutocmdEvent | readonly AutocmdEvent [ ] ,
113+ pat ?: AutocmdPattern | readonly AutocmdPattern [ ] ,
113114 options : ListOptions = { } ,
114115) : Promise < unknown > {
115116 const terms = [ "au" ] ;
@@ -120,13 +121,13 @@ export async function list(
120121 if ( Array . isArray ( event ) ) {
121122 terms . push ( event . join ( "," ) ) ;
122123 } else {
123- terms . push ( event ) ;
124+ terms . push ( event as AutocmdEvent ) ;
124125 }
125126 if ( pat ) {
126127 if ( Array . isArray ( pat ) ) {
127128 terms . push ( pat . join ( "," ) ) ;
128129 } else {
129- terms . push ( pat ) ;
130+ terms . push ( pat as AutocmdPattern ) ;
130131 }
131132 }
132133 }
@@ -155,7 +156,7 @@ export async function list(
155156 */
156157export async function emit (
157158 denops : Denops ,
158- event : AutocmdEvent | AutocmdEvent [ ] ,
159+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
159160 fname ?: string ,
160161 options : EmitOptions = { } ,
161162) : Promise < unknown > {
@@ -169,7 +170,7 @@ export async function emit(
169170 if ( Array . isArray ( event ) ) {
170171 terms . push ( event . join ( "," ) ) ;
171172 } else {
172- terms . push ( event ) ;
173+ terms . push ( event as AutocmdEvent ) ;
173174 }
174175 if ( fname ) {
175176 terms . push ( fname ) ;
@@ -199,7 +200,7 @@ export async function emit(
199200 */
200201export async function emitAll (
201202 denops : Denops ,
202- event : AutocmdEvent | AutocmdEvent [ ] ,
203+ event : AutocmdEvent | readonly AutocmdEvent [ ] ,
203204 fname ?: string ,
204205 options : EmitOptions = { } ,
205206) : Promise < unknown > {
@@ -213,7 +214,7 @@ export async function emitAll(
213214 if ( Array . isArray ( event ) ) {
214215 terms . push ( event . join ( "," ) ) ;
215216 } else {
216- terms . push ( event ) ;
217+ terms . push ( event as AutocmdEvent ) ;
217218 }
218219 if ( fname ) {
219220 terms . push ( fname ) ;
0 commit comments