|
13 | 13 | * @typedef {MdastRoot|MdastContent} MdastNode
|
14 | 14 | * @typedef {Extract<MdastNode, import('unist').Parent>} MdastParent
|
15 | 15 | *
|
16 |
| - * |
17 | 16 | * @typedef {import('vfile').VFile} VFile
|
18 | 17 | * @typedef {ReturnType<import('vfile-location').location>} Location
|
19 | 18 | * @typedef {{
|
20 |
| - * parse(nodes: NlcstContent[]): NlcstRoot |
| 19 | + * parse(nodes: Array<NlcstContent>): NlcstRoot |
21 | 20 | * tokenizeSource(value: string): NlcstSource
|
22 | 21 | * tokenizeWhiteSpace(value: string): NlcstWhiteSpace
|
23 |
| - * tokenize(value: string): NlcstSentenceContent[] |
| 22 | + * tokenize(value: string): Array<NlcstSentenceContent> |
24 | 23 | * }} ParserInstance
|
25 | 24 | * @typedef {new () => ParserInstance} ParserConstructor
|
26 | 25 | *
|
27 | 26 | * @typedef Options
|
28 |
| - * @property {string[]} [ignore] |
29 |
| - * @property {string[]} [source] |
| 27 | + * @property {Array<string>} [ignore] |
| 28 | + * @property {Array<string>} [source] |
30 | 29 | *
|
31 | 30 | * @typedef Context
|
32 | 31 | * @property {string} doc
|
33 | 32 | * @property {Location} place
|
34 | 33 | * @property {ParserInstance} parser
|
35 |
| - * @property {string[]} ignore |
36 |
| - * @property {string[]} source |
| 34 | + * @property {Array<string>} ignore |
| 35 | + * @property {Array<string>} source |
37 | 36 | */
|
38 | 37 |
|
39 | 38 | import {toString} from 'nlcst-to-string'
|
@@ -101,7 +100,7 @@ export function toNlcst(tree, file, Parser, options = {}) {
|
101 | 100 | * Transform a single node.
|
102 | 101 | * @param {Context} config
|
103 | 102 | * @param {MdastNode} node
|
104 |
| - * @returns {NlcstContent[]|undefined} |
| 103 | + * @returns {Array<NlcstContent>|undefined} |
105 | 104 | */
|
106 | 105 | function one(config, node) {
|
107 | 106 | const start = node.position ? node.position.start.offset : undefined
|
@@ -145,11 +144,11 @@ function one(config, node) {
|
145 | 144 | * Transform all nodes in `parent`.
|
146 | 145 | * @param {Context} config
|
147 | 146 | * @param {MdastParent} parent
|
148 |
| - * @returns {NlcstContent[]} |
| 147 | + * @returns {Array<NlcstContent>} |
149 | 148 | */
|
150 | 149 | function all(config, parent) {
|
151 | 150 | let index = -1
|
152 |
| - /** @type {NlcstContent[]} */ |
| 151 | + /** @type {Array<NlcstContent>} */ |
153 | 152 | const results = []
|
154 | 153 | /** @type {Point|undefined} */
|
155 | 154 | let end
|
@@ -188,7 +187,7 @@ function all(config, parent) {
|
188 | 187 | * Patch a position on each node in `nodes`.
|
189 | 188 | * `offset` is the offset in `file` this run of content starts at.
|
190 | 189 | *
|
191 |
| - * @template {NlcstContent[]} T |
| 190 | + * @template {Array<NlcstContent>} T |
192 | 191 | * @param {Context} config
|
193 | 192 | * @param {T} nodes
|
194 | 193 | * @param {number|undefined} offset
|
|
0 commit comments