source: imaps-frontend/node_modules/eslint-plugin-react/lib/util/ast.d.ts@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 5.1 KB
RevLine 
[0c6b92a]1/**
2 * Find a return statement in the current node
3 *
4 * @param {ASTNode} node The AST node being checked
5 * @returns {ASTNode | false}
6 */
7export function findReturnStatement(node: ASTNode): ASTNode | false;
8/**
9 * Get properties for a given AST node
10 * @param {ASTNode} node The AST node being checked.
11 * @returns {Array} Properties array.
12 */
13export function getComponentProperties(node: ASTNode): any[];
14/**
15 * Gets the first node in a line from the initial node, excluding whitespace.
16 * @param {Object} context The node to check
17 * @param {ASTNode} node The node to check
18 * @return {ASTNode} the first node in the line
19 */
20export function getFirstNodeInLine(context: any, node: ASTNode): ASTNode;
21/**
22 * Retrieve the name of a key node
23 * @param {Context} context The AST node with the key.
24 * @param {any} node The AST node with the key.
25 * @return {string | undefined} the name of the key
26 */
27export function getKeyValue(context: Context, node: any): string | undefined;
28/**
29 * Get properties name
30 * @param {Object} node - Property.
31 * @returns {string} Property name.
32 */
33export function getPropertyName(node: any): string;
34/**
35 * Get node with property's name
36 * @param {Object} node - Property.
37 * @returns {Object} Property name node.
38 */
39export function getPropertyNameNode(node: any): any;
40/**
41 * Check if we are in a class constructor
42 * @param {Context} context
43 * @param {ASTNode} node The AST node being checked.
44 * @return {boolean}
45 */
46export function inConstructor(context: Context, node: ASTNode): boolean;
47/**
48 * Checks if a node is being assigned a value: props.bar = 'bar'
49 * @param {ASTNode} node The AST node being checked.
50 * @returns {boolean}
51 */
52export function isAssignmentLHS(node: ASTNode): boolean;
53/**
54 * Matcher used to check whether given node is a `CallExpression`
55 * @param {ASTNode} node The AST node
56 * @returns {boolean} True if node is a `CallExpression`, false if not
57 */
58export function isCallExpression(node: ASTNode): boolean;
59/**
60 * Checks if the node is a class.
61 * @param {ASTNode} node The node to check
62 * @return {boolean} true if it's a class
63 */
64export function isClass(node: ASTNode): boolean;
65/**
66 * Checks if the node is a function.
67 * @param {ASTNode} node The node to check
68 * @return {boolean} true if it's a function
69 */
70export function isFunction(node: ASTNode): boolean;
71/**
72 * Checks if node is a function declaration or expression or arrow function.
73 * @param {ASTNode} node The node to check
74 * @return {boolean} true if it's a function-like
75 */
76export function isFunctionLike(node: ASTNode): boolean;
77/**
78 * Checks if the node is a function or arrow function expression.
79 * @param {ASTNode} node The node to check
80 * @return {boolean} true if it's a function-like expression
81 */
82export function isFunctionLikeExpression(node: ASTNode): boolean;
83/**
84 * Checks if the node is the first in its line, excluding whitespace.
85 * @param {Object} context The node to check
86 * @param {ASTNode} node The node to check
87 * @return {boolean} true if it's the first node in its line
88 */
89export function isNodeFirstInLine(context: any, node: ASTNode): boolean;
90/**
91 * Checks if a node is surrounded by parenthesis.
92 *
93 * @param {object} context - Context from the rule
94 * @param {ASTNode} node - Node to be checked
95 * @returns {boolean}
96 */
97export function isParenthesized(context: object, node: ASTNode): boolean;
98export function isTSAsExpression(node: any): boolean;
99export function isTSFunctionType(node: any): boolean;
100export function isTSInterfaceDeclaration(node: any): boolean;
101export function isTSInterfaceHeritage(node: any): boolean;
102export function isTSIntersectionType(node: any): boolean;
103export function isTSParenthesizedType(node: any): boolean;
104export function isTSTypeAliasDeclaration(node: any): boolean;
105export function isTSTypeAnnotation(node: any): boolean;
106export function isTSTypeDeclaration(node: any): boolean;
107export function isTSTypeLiteral(node: any): boolean;
108export function isTSTypeParameterInstantiation(node: any): boolean;
109export function isTSTypeQuery(node: any): boolean;
110export function isTSTypeReference(node: any): boolean;
111/**
112 * Wrapper for estraverse.traverse
113 *
114 * @param {ASTNode} ASTnode The AST node being checked
115 * @param {Object} visitor Visitor Object for estraverse
116 */
117export function traverse(ASTnode: ASTNode, visitor: any): void;
118/**
119 * Helper function for traversing "returns" (return statements or the
120 * returned expression in the case of an arrow function) of a function
121 *
122 * @param {ASTNode} ASTNode The AST node being checked
123 * @param {Context} context The context of `ASTNode`.
124 * @param {(returnValue: ASTNode, breakTraverse: () => void) => void} onReturn
125 * Function to execute for each returnStatement found
126 * @returns {undefined}
127 */
128export function traverseReturns(ASTNode: ASTNode, context: Context, onReturn: (returnValue: ASTNode, breakTraverse: () => void) => void): undefined;
129/**
130 * Extracts the expression node that is wrapped inside a TS type assertion
131 *
132 * @param {ASTNode} node - potential TS node
133 * @returns {ASTNode} - unwrapped expression node
134 */
135export function unwrapTSAsExpression(node: ASTNode): ASTNode;
136//# sourceMappingURL=ast.d.ts.map
Note: See TracBrowser for help on using the repository browser.