-
Notifications
You must be signed in to change notification settings - Fork 15
/
mod.ts
57 lines (56 loc) 路 1.67 KB
/
mod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Standard module for [denops.vim](https://github.com/vim-denops/denops.vim).
*
* This module is assumed to be used for developing denops plugins. The code
* is assumed to be called in a dedicated worker thread of each plugins.
*
* By using this module, developers can write Vim/Neovim denops plugins like:
*
* ```typescript
* import { Denops } from "./mod.ts";
* import * as fn from "./function/mod.ts";
* import * as vars from "./variable/mod.ts";
* import * as helper from "./helper/mod.ts";
*
* import * as unknownutil from "https://deno.land/x/unknownutil/mod.ts";
*
* export async function main(denops: Denops): Promise<void> {
* denops.dispatcher = {
* async say(where: unknown): Promise<void> {
* unknownutil.assertString(where);
*
* const name = await fn.input(denops, "Your name: ");
* const progname = await vars.v.get(denops, "progname");
* const messages = [
* `Hello ${where}.`,
* `Your name is ${name}.`,
* `This is ${progname}.`,
* ];
* await helper.echo(denops, messages.join("\n"));
* },
* };
*
* await helper.execute(
* denops,
* `
* command! HelloWorld call denops#notify("${denops.name}", "say", ["World"])
* command! HelloDenops call denops#notify("${denops.name}", "say", ["Denops"])
* `,
* );
* }
* ```
*
* See [Denops Documentation](https://vim-denops.github.io/denops-documentation/)
* or [denops-helloworld.vim](https://github.com/vim-denops/denops-helloworld.vim)
* for more details.
*
* @module
*/
// Re-export
export type {
BatchError,
Context,
Denops,
Dispatcher,
Meta,
} from "https://deno.land/x/denops_core@v4.0.0/mod.ts";