@types/esrecurse 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- esrecurse/LICENSE +21 -0
- esrecurse/README.md +78 -0
- esrecurse/index.d.ts +59 -0
- esrecurse/package.json +26 -0
esrecurse/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Microsoft Corporation.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE
|
esrecurse/README.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Installation
|
2
|
+
> `npm install --save @types/esrecurse`
|
3
|
+
|
4
|
+
# Summary
|
5
|
+
This package contains type definitions for esrecurse (https://github.com/estools/esrecurse).
|
6
|
+
|
7
|
+
# Details
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse.
|
9
|
+
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse/index.d.ts)
|
10
|
+
````ts
|
11
|
+
/**
|
12
|
+
* Options for the Visitor constructor and visit function.
|
13
|
+
*/
|
14
|
+
interface VisitorOptions {
|
15
|
+
/**
|
16
|
+
* Fallback strategy for unknown node types.
|
17
|
+
* @default 'iteration'
|
18
|
+
*/
|
19
|
+
fallback?: "iteration" | ((node: any) => string[]);
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Custom keys for child nodes by node type.
|
23
|
+
* @default {}
|
24
|
+
*/
|
25
|
+
childVisitorKeys?: Record<string, string[]>;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* A visitor class for recursively traversing ECMAScript AST.
|
30
|
+
*/
|
31
|
+
declare class Visitor {
|
32
|
+
/**
|
33
|
+
* Creates a new Visitor instance.
|
34
|
+
* @param options Configuration options for the visitor.
|
35
|
+
*/
|
36
|
+
constructor(visitor?: Visitor | null, options?: VisitorOptions | null);
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Visits a node, invoking the appropriate handler.
|
40
|
+
* @param node The AST node to visit.
|
41
|
+
*/
|
42
|
+
visit(node: any): void;
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Visits the children of a node based on childVisitorKeys.
|
46
|
+
* @param node The AST node whose children to visit.
|
47
|
+
*/
|
48
|
+
visitChildren(node: any): void;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Dynamically defined methods for specific node types (e.g., Literal, Program).
|
52
|
+
* @param node The AST node to process.
|
53
|
+
*/
|
54
|
+
[nodeType: string]: ((node: any) => void) | undefined;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Visits an AST node with the specified visitor.
|
59
|
+
* @param ast The AST node to traverse.
|
60
|
+
* @param visitor A visitor instance or visitor object.
|
61
|
+
* @param options Configuration options for the traversal.
|
62
|
+
*/
|
63
|
+
declare function visit(
|
64
|
+
ast: any,
|
65
|
+
visitor?: Visitor | Record<string, (node: any) => void> | null,
|
66
|
+
options?: VisitorOptions,
|
67
|
+
): void;
|
68
|
+
|
69
|
+
export { visit, Visitor, type VisitorOptions };
|
70
|
+
|
71
|
+
````
|
72
|
+
|
73
|
+
### Additional Details
|
74
|
+
* Last updated: Wed, 07 May 2025 18:39:11 GMT
|
75
|
+
* Dependencies: none
|
76
|
+
|
77
|
+
# Credits
|
78
|
+
These definitions were written by [Jimmy Leung](https://github.com/hkleungai).
|
esrecurse/index.d.ts
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* Options for the Visitor constructor and visit function.
|
3
|
+
*/
|
4
|
+
interface VisitorOptions {
|
5
|
+
/**
|
6
|
+
* Fallback strategy for unknown node types.
|
7
|
+
* @default 'iteration'
|
8
|
+
*/
|
9
|
+
fallback?: "iteration" | ((node: any) => string[]);
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Custom keys for child nodes by node type.
|
13
|
+
* @default {}
|
14
|
+
*/
|
15
|
+
childVisitorKeys?: Record<string, string[]>;
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* A visitor class for recursively traversing ECMAScript AST.
|
20
|
+
*/
|
21
|
+
declare class Visitor {
|
22
|
+
/**
|
23
|
+
* Creates a new Visitor instance.
|
24
|
+
* @param options Configuration options for the visitor.
|
25
|
+
*/
|
26
|
+
constructor(visitor?: Visitor | null, options?: VisitorOptions | null);
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Visits a node, invoking the appropriate handler.
|
30
|
+
* @param node The AST node to visit.
|
31
|
+
*/
|
32
|
+
visit(node: any): void;
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Visits the children of a node based on childVisitorKeys.
|
36
|
+
* @param node The AST node whose children to visit.
|
37
|
+
*/
|
38
|
+
visitChildren(node: any): void;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Dynamically defined methods for specific node types (e.g., Literal, Program).
|
42
|
+
* @param node The AST node to process.
|
43
|
+
*/
|
44
|
+
[nodeType: string]: ((node: any) => void) | undefined;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Visits an AST node with the specified visitor.
|
49
|
+
* @param ast The AST node to traverse.
|
50
|
+
* @param visitor A visitor instance or visitor object.
|
51
|
+
* @param options Configuration options for the traversal.
|
52
|
+
*/
|
53
|
+
declare function visit(
|
54
|
+
ast: any,
|
55
|
+
visitor?: Visitor | Record<string, (node: any) => void> | null,
|
56
|
+
options?: VisitorOptions,
|
57
|
+
): void;
|
58
|
+
|
59
|
+
export { visit, Visitor, type VisitorOptions };
|
esrecurse/package.json
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "@types/esrecurse",
|
3
|
+
"version": "4.3.0",
|
4
|
+
"description": "TypeScript definitions for esrecurse",
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse",
|
6
|
+
"license": "MIT",
|
7
|
+
"contributors": [
|
8
|
+
{
|
9
|
+
"name": "Jimmy Leung",
|
10
|
+
"githubUsername": "hkleungai",
|
11
|
+
"url": "https://github.com/hkleungai"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"main": "",
|
15
|
+
"types": "index.d.ts",
|
16
|
+
"repository": {
|
17
|
+
"type": "git",
|
18
|
+
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
19
|
+
"directory": "types/esrecurse"
|
20
|
+
},
|
21
|
+
"scripts": {},
|
22
|
+
"dependencies": {},
|
23
|
+
"peerDependencies": {},
|
24
|
+
"typesPublisherContentHash": "ef1e91eb756ec31bf71dc7be53e530320a0181ae54e7886315e10084c4d1ef33",
|
25
|
+
"typeScriptVersion": "5.1"
|
26
|
+
}
|