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