Skip to content

Commit 4feea08

Browse files
committed
👍 Use type instead of interface when no need to expand
1 parent 8dcd0fb commit 4feea08

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

denops_std/option/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Denops } from "https://deno.land/x/denops_core@v4.0.0/mod.ts";
44
* An option that can be retrieved and modified.
55
* @template T The type of the option value.
66
*/
7-
export interface Option<T> {
7+
export type Option<T> = {
88
/**
99
* Gets the value of the option.
1010
* @returns A Promise that resolves to the value of the option.
@@ -23,13 +23,13 @@ export interface Option<T> {
2323
* @returns A Promise that resolves when the option has been successfully reset.
2424
*/
2525
reset(denops: Denops): Promise<void>;
26-
}
26+
};
2727

2828
/**
2929
* A global option that can be retrieved and modified.
3030
* @template T The type of the option value.
3131
*/
32-
export interface GlobalOption<T> extends Option<T> {
32+
export type GlobalOption<T> = Option<T> & {
3333
/**
3434
* Gets the global value of the option.
3535
* @returns A Promise that resolves to the value of the option.
@@ -48,13 +48,13 @@ export interface GlobalOption<T> extends Option<T> {
4848
* @returns A Promise that resolves when the option has been successfully reset.
4949
*/
5050
resetGlobal(denops: Denops): Promise<void>;
51-
}
51+
};
5252

5353
/**
5454
* A local option that can be retrieved and modified.
5555
* @template T The type of the option value.
5656
*/
57-
export interface LocalOption<T> extends Option<T> {
57+
export type LocalOption<T> = Option<T> & {
5858
/**
5959
* Gets the local value of the option.
6060
* @returns A Promise that resolves to the value of the option.
@@ -103,7 +103,7 @@ export interface LocalOption<T> extends Option<T> {
103103
* @returns A Promise that resolves when the option has been successfully set.
104104
*/
105105
setWindow(denops: Denops, winnr: number, value: T): Promise<void>;
106-
}
106+
};
107107

108108
/**
109109
* A global or local option that can be retrieved and modified.

0 commit comments

Comments
 (0)