Skip to content

Commit 9db457b

Browse files
authored
Add Call type for Vim/Neovim function calls (#16)
1 parent fd101cc commit 9db457b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

type.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ export type Dispatcher = {
1919
[key: string]: (...args: unknown[]) => unknown;
2020
};
2121

22+
/**
23+
* Represents a Vim/Neovim function call.
24+
*
25+
* `fn`: A function name of Vim/Neovim.
26+
* `args`: Arguments of the function.
27+
*/
28+
export type Call = [fn: string, ...args: unknown[]];
29+
2230
/**
2331
* Context that expands into the local namespace (l:)
2432
*/
@@ -138,11 +146,11 @@ export interface Denops {
138146
* of the error instance holds succeeded results of functions prior to the
139147
* error.
140148
*
141-
* @param calls: A list of tuples ([fn, args]) to call Vim/Neovim functions.
149+
* @param calls: A list of tuples ([fn, ...args]) to call Vim/Neovim functions.
142150
*
143151
* Note that arguments after `undefined` in `args` will be dropped for convenience.
144152
*/
145-
batch(...calls: [string, ...unknown[]][]): Promise<unknown[]>;
153+
batch(...calls: Call[]): Promise<unknown[]>;
146154

147155
/**
148156
* Execute an arbitrary command of Vim/Neovim under a given context.

0 commit comments

Comments
 (0)