@@ -91,7 +91,7 @@ easily call.
91
91
In the Getting Started, we wrote the following code in the ` main.ts ` file:
92
92
93
93
``` typescript
94
- import type {
Entrypoint }
from " https://deno.land/x/[email protected] /mod.ts " ;
94
+ import type {
Entrypoint }
from " jsr:@denops/[email protected] " ;
95
95
96
96
export const main: Entrypoint = (denops ) => {
97
97
denops .dispatcher = {
@@ -107,14 +107,14 @@ Let's break down this code step by step.
107
107
### About Imports
108
108
109
109
``` typescript
110
- import type {
Entrypoint }
from " https://deno.land/x/[email protected] /mod.ts " ;
110
+ import type {
Entrypoint }
from " jsr:@denops/[email protected] " ;
111
111
```
112
112
113
- The first line imports the ` Entrypoint ` type from the [ denops_std ] standard
113
+ The first line imports the ` Entrypoint ` type from the [ @ denops/std ] standard
114
114
library. You can find detailed information about the library by checking the
115
- URL:
` https://deno.land/x/[email protected] .0 ` (
remove ` /mod.ts ` ).
We fixed the
116
- version in the import URL, so it's recommended to check for details and update
117
- to the latest version URL.
115
+ URL:
` https://jsr.io/@denops/[email protected] .0 ` (
replace ` jsr: ` to ` https://jsr.io/ ` ).
116
+ We fixed the version in the import URL, so it's recommended to check for details
117
+ and update to the latest version URL.
118
118
119
119
Note that we use ` import type ` syntax, which is part of TypeScript's
120
120
[ Type-Only Imports and Export] ( https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html ) .
@@ -130,28 +130,11 @@ meaning. Using `import { Entrypoint }` for a type-only import is also valid.
130
130
> [ ` denops/@denops-private/denops.ts ` ] ( https://github.com/vim-denops/denops.vim/blob/main/denops/%40denops-private/denops.ts ) ,
131
131
> but it is not publicly exposed for the reasons mentioned above.
132
132
>
133
- > This type information is provided by [ denops_core ] , and [ denops_std ] simply
134
- > re-exports the type information from [ denops_core ] . However, [ denops_core ] is
135
- > intended to be referenced only by [ denops.vim] and [ denops_std ] , so Denops
133
+ > This type information is provided by [ @ denops/core ] , and [ @ denops/std ] simply
134
+ > re-exports the type information from [ @ denops/core ] . However, [ @ denops/core ]
135
+ > is intended to be referenced only by [ denops.vim] and [ @ denops/std ] , so Denops
136
136
> plugin developers don't need to use it directly.
137
137
138
- > [ !NOTE]
139
- >
140
- > Prior to denops-std v6.5.0, the ` Entrypoint ` type was not defined thus
141
- > developers must define the ` main ` function as like
142
- >
143
- > ``` typescript
144
- > import type { Denops } from " https://deno.land/x/[email protected] /mod.ts" ;
145
- >
146
- > export function main(denops : Denops ): void {
147
- > denops .dispatcher = {
148
- > async hello() {
149
- > await denops .cmd (` echo "Hello, Denops!" ` );
150
- > },
151
- > };
152
- > }
153
- > ` ` `
154
-
155
138
### About Entry Point
156
139
157
140
``` typescript
@@ -162,8 +145,8 @@ export const main: Entrypoint = (denops) => {
162
145
163
146
The above code exports the ` main ` function. The ` main ` function is called by
164
147
Denops, and it takes the
165
- [ Denops instance] ( https://deno.land/x/denops_std/mod.ts?s= Denops ) (` denops ` ) as
166
- an argument. Denops plugins use this ` denops ` to add user-defined APIs or call
148
+ [ Denops instance] ( https://jsr.io/@denops/core/doc/~/ Denops ) (` denops ` ) as an
149
+ argument. Denops plugins use this ` denops ` to add user-defined APIs or call
167
150
Vim's features.
168
151
169
152
### About User-Defined APIs
@@ -222,17 +205,17 @@ several methods:
222
205
| ` eval ` | Evaluate a Vim expression and returns the result. If ` ctx ` is provided, it is expanded as local variables. |
223
206
| ` dispatch ` | Calls a user-defined API of another Denops plugin and returns the result. |
224
207
225
- Although ` denops ` provides low-level interfaces, [ denops_std ] combines these
208
+ Although ` denops ` provides low-level interfaces, [ @ denops/std ] combines these
226
209
low-level interfaces to offer higher-level interfaces. Therefore, it's
227
- recommended to use [ denops_std ] to call Vim's features in actual plugin
210
+ recommended to use [ @ denops/std ] to call Vim's features in actual plugin
228
211
development.
229
212
230
213
For example, use
231
- [ ` function ` module
] ( https://deno.land/x/[email protected] .0/function/mod.ts ) to
232
- call Vim's function instead of ` denops.call ` like:
214
+ [ ` function ` module
] ( https://jsr.io/@denops/[email protected] .0/doc/ function/~ ) to
call
215
+ Vim's function instead of ` denops.call ` like:
233
216
234
217
``` typescript
235
- import * as fn from " https://deno.land/x/[email protected] .0/function/mod.ts " ;
218
+ import * as fn from " jsr:@denops/[email protected] .0/function" ;
236
219
237
220
// Bad (result1 is `unknown`)
238
221
const result1 = await denops .call (" expand" , " %" );
@@ -251,8 +234,8 @@ plugin.
251
234
252
235
- [ Tutorial (Hello World)] ( ../tutorial/helloworld/README.md )
253
236
- [ Tutorial (Maze)] ( ../tutorial/maze/README.md )
254
- - [ API reference] ( https://deno.land/x/denops_std/mod.ts )
237
+ - [ API reference] ( https://jsr.io/@denops/std )
255
238
256
239
[ denops.vim ] : https://github.com/vim-denops/denops.vim
257
- [ denops_std ] : https://deno.land/x/denops_std
258
- [ denops_core ] : https://deno.land/x/denops_core
240
+ [ @denops/std ] : https://jsr.io/@denops/std
241
+ [ @denops/core ] : https://jsr.io/@denops/core
0 commit comments