Skip to content

Commit d282394

Browse files
committed
📝 Add documentation comments on root module
1 parent 5368307 commit d282394

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

denops_std/mod.ts

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

0 commit comments

Comments
 (0)