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'
@@ -16,25 +13,25 @@ import {convert} from 'unist-util-is'
16
13
* @param parent
17
14
* Parent node.
18
15
* @param index
19
- * Child of `parent`, or it’s index.
20
- * @param [ test]
16
+ * Child of `parent` or it’s index.
17
+ * @param test
21
18
* `unist-util-is`-compatible test.
22
19
* @returns
23
- * Child of `parent` that passes `test`, if found .
20
+ * Child of `parent` or `null` .
24
21
*/
25
22
export const findAfter =
26
23
/**
27
24
* @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>>) => T| null) &
29
- * ((node: Parent, index: Node| number, test?: null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything> ) => Node| null)
25
+ * (<T extends Node>(node: Parent, index: Node | number, test: import('unist-util-is').PredicateTest <T>) => T | null) &
26
+ * ((node: Parent, index: Node | number, test?: Test ) => Node | null)
30
27
* )}
31
28
*/
32
29
(
33
30
/**
34
31
* @param {Parent } parent
35
- * @param {Node| number } index
36
- * @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything> } [test]
37
- * @returns {Node| null }
32
+ * @param {Node | number } index
33
+ * @param {Test } [test]
34
+ * @returns {Node | null }
38
35
*/
39
36
function ( parent , index , test ) {
40
37
const is = convert ( test )
0 commit comments