|
1 | 1 | /**
|
2 | 2 | * @typedef {import('unist').Node} Node
|
3 | 3 | * @typedef {import('unist').Parent} Parent
|
4 |
| - * |
5 |
| - * @typedef {string} Type |
6 |
| - * @typedef {Record<string, unknown>} Props |
7 |
| - * @typedef {import('unist-util-is').TestFunctionAnything} TestFunctionAnything |
| 4 | + * @typedef {import('unist-util-is').Test} Test |
8 | 5 | */
|
9 | 6 |
|
10 | 7 | import {convert} from 'unist-util-is'
|
11 | 8 |
|
12 | 9 | /**
|
13 |
| - * Find nodes in `parent` after another `node` or after an index, that pass |
14 |
| - * `test`. |
| 10 | + * Find nodes in `parent` after a `child` or after an index, that pass `test`. |
15 | 11 | *
|
16 | 12 | * @param parent
|
17 | 13 | * Parent node.
|
18 | 14 | * @param index
|
19 | 15 | * Child of `parent` or it’s index.
|
20 |
| - * @param [test] |
| 16 | + * @param test |
21 | 17 | * `unist-util-is`-compatible test.
|
22 | 18 | * @returns
|
23 | 19 | * Children of `parent` that pass `test`.
|
24 | 20 | */
|
25 | 21 | export const findAllAfter =
|
26 | 22 | /**
|
27 | 23 | * @type {(
|
28 |
| - * (<T extends Node>(node: Parent, index: Node|number, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>) => Array<T>) & |
29 |
| - * ((node: Parent, index: Node|number, test?: null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>) => Array<Node>) |
| 24 | + * (<T extends Node>(node: Parent, index: Node | number, test: import('unist-util-is').PredicateTest<T>) => Array<T>) & |
| 25 | + * ((node: Parent, index: Node | number, test?: Test) => Array<Node>) |
30 | 26 | * )}
|
31 | 27 | */
|
32 | 28 | (
|
33 | 29 | /**
|
34 | 30 | * @param {Parent} parent
|
35 |
| - * @param {Node|number} index |
36 |
| - * @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>} [test] |
| 31 | + * @param {Node | number} index |
| 32 | + * @param {Test} [test] |
37 | 33 | * @returns {Array<Node>}
|
38 | 34 | */
|
39 | 35 | function (parent, index, test) {
|
|
0 commit comments