Skip to content

Commit fcabe6c

Browse files
committed
👍 Use Call type from @denops/core v8.0.1
Apply the new `Call` type introduced in @denops/core v8.0.1 (PR #16). This replaces the duplicated tuple type `[string, ...unknown[]]` with the standardized `Call` type, improving type consistency and maintainability across the codebase. Related: vim-denops/deno-denops-core#16
1 parent 42f88a2 commit fcabe6c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

batch/batch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Context, Denops, Dispatcher, Meta } from "@denops/core";
1+
import type { Call, Context, Denops, Dispatcher, Meta } from "@denops/core";
22

33
type Redraw = undefined | boolean;
44

55
class BatchHelper implements Denops {
66
#denops: Denops;
7-
#calls: [string, ...unknown[]][];
7+
#calls: Call[];
88
#redraw: Redraw;
99
#closed: boolean;
1010

@@ -14,7 +14,7 @@ class BatchHelper implements Denops {
1414
this.#closed = false;
1515
}
1616

17-
static getCalls(helper: BatchHelper): [string, ...unknown[]][] {
17+
static getCalls(helper: BatchHelper): Call[] {
1818
return helper.#calls;
1919
}
2020

@@ -64,7 +64,7 @@ class BatchHelper implements Denops {
6464
return Promise.resolve();
6565
}
6666

67-
batch(...calls: [string, ...unknown[]][]): Promise<unknown[]> {
67+
batch(...calls: Call[]): Promise<unknown[]> {
6868
if (this.#closed) {
6969
return this.#denops.batch(...calls);
7070
}

batch/collect.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Context, Denops, Dispatcher, Meta } from "@denops/core";
1+
import type { Call, Context, Denops, Dispatcher, Meta } from "@denops/core";
22

33
type VimVoid<T> = T extends void ? 0 : T;
44

@@ -8,7 +8,7 @@ type Collect<T extends readonly unknown[] | []> = {
88

99
class CollectHelper implements Denops {
1010
#denops: Denops;
11-
#calls: [string, ...unknown[]][];
11+
#calls: Call[];
1212
#closed: boolean;
1313

1414
constructor(denops: Denops) {
@@ -17,7 +17,7 @@ class CollectHelper implements Denops {
1717
this.#closed = false;
1818
}
1919

20-
static getCalls(helper: CollectHelper): [string, ...unknown[]][] {
20+
static getCalls(helper: CollectHelper): Call[] {
2121
return helper.#calls;
2222
}
2323

@@ -63,7 +63,7 @@ class CollectHelper implements Denops {
6363
return Promise.resolve();
6464
}
6565

66-
batch(..._calls: [string, ...unknown[]][]): Promise<unknown[]> {
66+
batch(..._calls: Call[]): Promise<unknown[]> {
6767
throw new Error("The 'batch' method is not available on CollectHelper.");
6868
}
6969

eval/use_eval.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @module
55
*/
66

7-
import type { Context, Denops, Dispatcher, Meta } from "@denops/core";
7+
import type { Call, Context, Denops, Dispatcher, Meta } from "@denops/core";
88
import { isString } from "@core/unknownutil/is/string";
99
import { isUndefined } from "@core/unknownutil/is/undefined";
1010
import { ulid } from "@std/ulid";
@@ -105,11 +105,11 @@ class UseEvalHelper implements Denops {
105105
);
106106
}
107107

108-
async batch(...calls: [string, ...unknown[]][]): Promise<unknown[]> {
108+
async batch(...calls: Call[]): Promise<unknown[]> {
109109
const suffix = await ensurePrerequisites(this.#denops);
110110
const callHelper = `DenopsStd_Eval_UseEval_Call_${suffix}`;
111111
return await this.#denops.batch(
112-
...calls.map(([fn, ...args]): [string, ...unknown[]] => [
112+
...calls.map(([fn, ...args]): Call => [
113113
callHelper,
114114
fn,
115115
stringify(trimEndOfArgs(args)),

0 commit comments

Comments
 (0)