|
1 | 1 | import type { Denops } from "https://deno.land/x/denops_core@v4.0.0/mod.ts";
|
2 | 2 |
|
| 3 | +/** |
| 4 | + * Represents a getter method for retrieving property value. |
| 5 | + */ |
3 | 6 | export type Getter = {
|
4 |
| - get<T = unknown>( |
5 |
| - denops: Denops, |
6 |
| - prop: string, |
7 |
| - defaultValue: T, |
8 |
| - ): Promise<T>; |
9 |
| - get<T = unknown>( |
10 |
| - denops: Denops, |
11 |
| - prop: string, |
12 |
| - ): Promise<T | null>; |
| 7 | + /** |
| 8 | + * Gets the value of the specified property, or default value if it doesn't exist. |
| 9 | + * @param prop - The name of the property. |
| 10 | + * @param defaultValue - The default value to be returned if the property doesn't exist. |
| 11 | + * @returns A promise that resolves to the value of the property. |
| 12 | + */ |
| 13 | + get<T = unknown>(denops: Denops, prop: string, defaultValue?: T): Promise<T>; |
| 14 | + |
| 15 | + /** |
| 16 | + * Gets the value of the specified property, or null if it doesn't exist. |
| 17 | + * @param prop - The name of the property. |
| 18 | + * @returns A promise that resolves to the value of the property. |
| 19 | + */ |
| 20 | + get<T = unknown>(denops: Denops, prop: string): Promise<T | null>; |
13 | 21 | };
|
14 | 22 |
|
| 23 | +/** |
| 24 | + * Represents a setter method for setting property value. |
| 25 | + */ |
15 | 26 | export type Setter = {
|
| 27 | + /** |
| 28 | + * Sets the value of the specified property. |
| 29 | + * @param prop - The name of the property. |
| 30 | + * @param value - The value to be set. |
| 31 | + * @returns A promise that resolves when the value has been set. |
| 32 | + */ |
16 | 33 | set<T = unknown>(denops: Denops, prop: string, value: T): Promise<void>;
|
17 | 34 | };
|
18 | 35 |
|
| 36 | +/** |
| 37 | + * Represents a remover method for removing property value. |
| 38 | + */ |
19 | 39 | export type Remover = {
|
| 40 | + /** |
| 41 | + * Removes the value of the specified property or resets to its default value. |
| 42 | + * @param prop - The name of the property. |
| 43 | + * @returns A promise that resolves when the value has been removed or reset. |
| 44 | + */ |
20 | 45 | remove(denops: Denops, prop: string): Promise<void>;
|
21 | 46 | };
|
0 commit comments