.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / experimental-utils / _ts3.4 / dist / ast-utils / eslint-utils / astUtilities.d.ts
1 import { TSESTree } from '../../ts-estree';\r
2 import * as TSESLint from '../../ts-eslint';\r
3 /**\r
4  * Get the proper location of a given function node to report.\r
5  *\r
6  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}\r
7  */\r
8 declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;\r
9 /**\r
10  * Get the name and kind of a given function node.\r
11  *\r
12  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}\r
13  */\r
14 declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression) => string;\r
15 /**\r
16  * Get the property name of a given property node.\r
17  * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.\r
18  *\r
19  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}\r
20  * @returns The property name of the node. If the property name is not constant then it returns `null`.\r
21  */\r
22 declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.OptionalMemberExpression | TSESTree.Property | TSESTree.MethodDefinition, initialScope?: TSESLint.Scope.Scope | undefined) => string | null;\r
23 /**\r
24  * Get the value of a given node if it can decide the value statically.\r
25  * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the\r
26  * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have\r
27  * not been modified.\r
28  * For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.\r
29  *\r
30  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}\r
31  * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the\r
32  * static value of the node, it returns `null`.\r
33  */\r
34 declare const getStaticValue: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope | undefined) => {\r
35     value: unknown;\r
36 } | null;\r
37 /**\r
38  * Get the string value of a given node.\r
39  * This function is a tiny wrapper of the getStaticValue function.\r
40  *\r
41  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}\r
42  */\r
43 declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope | undefined) => string | null;\r
44 /**\r
45  * Check whether a given node has any side effect or not.\r
46  * The side effect means that it may modify a certain variable or object member. This function considers the node which\r
47  * contains the following types as the node which has side effects:\r
48  * - `AssignmentExpression`\r
49  * - `AwaitExpression`\r
50  * - `CallExpression`\r
51  * - `ImportExpression`\r
52  * - `NewExpression`\r
53  * - `UnaryExpression([operator = "delete"])`\r
54  * - `UpdateExpression`\r
55  * - `YieldExpression`\r
56  * - When `options.considerGetters` is `true`:\r
57  *   - `MemberExpression`\r
58  * - When `options.considerImplicitTypeConversion` is `true`:\r
59  *   - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`\r
60  *   - `MemberExpression([computed = true])`\r
61  *   - `MethodDefinition([computed = true])`\r
62  *   - `Property([computed = true])`\r
63  *   - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`\r
64  *\r
65  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}\r
66  */\r
67 declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {\r
68     considerGetters?: boolean | undefined;\r
69     considerImplicitTypeConversion?: boolean | undefined;\r
70 } | undefined) => boolean;\r
71 /**\r
72  * Check whether a given node is parenthesized or not.\r
73  * This function detects it correctly even if it's parenthesized by specific syntax.\r
74  *\r
75  * @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized}\r
76  * @returns `true` if the node is parenthesized.\r
77  * If `times` was given, it returns `true` only if the node is parenthesized the `times` times.\r
78  * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.\r
79  */\r
80 declare const isParenthesized: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode) => boolean;\r
81 export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, };\r
82 //# sourceMappingURL=astUtilities.d.ts.map\r