pax_global_header00006660000000000000000000000064143462073750014525gustar00rootroot0000000000000052 comment=048c053122b33d21f3e6f38503fa946dcdbd6d15 ast-types-0.16.1/000077500000000000000000000000001434620737500135435ustar00rootroot00000000000000ast-types-0.16.1/.gitattributes000066400000000000000000000001171434620737500164350ustar00rootroot00000000000000# Windows Bash complains if the script contains \r characters *.sh text eol=lf ast-types-0.16.1/.github/000077500000000000000000000000001434620737500151035ustar00rootroot00000000000000ast-types-0.16.1/.github/dependabot.yml000066400000000000000000000004221434620737500177310ustar00rootroot00000000000000# Please see the documentation for all configuration options: # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "daily" ast-types-0.16.1/.github/workflows/000077500000000000000000000000001434620737500171405ustar00rootroot00000000000000ast-types-0.16.1/.github/workflows/main.yml000066400000000000000000000011651434620737500206120ustar00rootroot00000000000000name: CI on: push: branches: [ master ] pull_request: branches: [ master ] jobs: test: name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: node_version: ['12', '14', '16', '18', '19'] os: [ubuntu-latest] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node_version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node_version }} - name: npm install, build and test run: | npm install npm run build --if-present npm test ast-types-0.16.1/.gitignore000066400000000000000000000003071434620737500155330ustar00rootroot00000000000000/node_modules /lib /src/test/data/babel-parser /src/test/data/typescript-compiler # Ignore "npm pack" output /*.tgz # Ignore TypeScript-emitted files lib/ *.js *.d.ts # Except... !/types/**/*.d.ts ast-types-0.16.1/.npmignore000066400000000000000000000005261434620737500155450ustar00rootroot00000000000000# Ignore everything by default ** # Use negative patterns to bring back the specific things we want to publish !/lib/** # But exclude test folders /lib/**/test # NOTE: These don't need to be specified, because NPM includes them automatically. # # package.json # README (and its variants) # CHANGELOG (and its variants) # LICENSE / LICENCE ast-types-0.16.1/.vscode/000077500000000000000000000000001434620737500151045ustar00rootroot00000000000000ast-types-0.16.1/.vscode/launch.json000066400000000000000000000003561434620737500172550ustar00rootroot00000000000000{ "version": "0.2.0", "configurations": [ { "name": "Attach to Node.js inspector", "port": 9229, "request": "attach", "skipFiles": [ "/**" ], "type": "node" }, ] } ast-types-0.16.1/LICENSE000066400000000000000000000020631434620737500145510ustar00rootroot00000000000000Copyright (c) 2013 Ben Newman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ast-types-0.16.1/README.md000066400000000000000000000406671434620737500150370ustar00rootroot00000000000000# AST Types ![CI](https://github.com/benjamn/ast-types/workflows/CI/badge.svg) This module provides an efficient, modular, [Esprima](https://github.com/ariya/esprima)-compatible implementation of the [abstract syntax tree](http://en.wikipedia.org/wiki/Abstract_syntax_tree) type hierarchy pioneered by the [Mozilla Parser API](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API). Installation --- From NPM: npm install ast-types From GitHub: cd path/to/node_modules git clone git://github.com/benjamn/ast-types.git cd ast-types npm install . Basic Usage --- ```js import assert from "assert"; import { namedTypes as n, builders as b, } from "ast-types"; var fooId = b.identifier("foo"); var ifFoo = b.ifStatement(fooId, b.blockStatement([ b.expressionStatement(b.callExpression(fooId, [])) ])); assert.ok(n.IfStatement.check(ifFoo)); assert.ok(n.Statement.check(ifFoo)); assert.ok(n.Node.check(ifFoo)); assert.ok(n.BlockStatement.check(ifFoo.consequent)); assert.strictEqual( ifFoo.consequent.body[0].expression.arguments.length, 0, ); assert.strictEqual(ifFoo.test, fooId); assert.ok(n.Expression.check(ifFoo.test)); assert.ok(n.Identifier.check(ifFoo.test)); assert.ok(!n.Statement.check(ifFoo.test)); ``` AST Traversal --- Because it understands the AST type system so thoroughly, this library is able to provide excellent node iteration and traversal mechanisms. If you want complete control over the traversal, and all you need is a way of enumerating the known fields of your AST nodes and getting their values, you may be interested in the primitives `getFieldNames` and `getFieldValue`: ```js import { getFieldNames, getFieldValue, } from "ast-types"; const partialFunExpr = { type: "FunctionExpression" }; // Even though partialFunExpr doesn't actually contain all the fields that // are expected for a FunctionExpression, types.getFieldNames knows: console.log(getFieldNames(partialFunExpr)); // [ 'type', 'id', 'params', 'body', 'generator', 'expression', // 'defaults', 'rest', 'async' ] // For fields that have default values, types.getFieldValue will return // the default if the field is not actually defined. console.log(getFieldValue(partialFunExpr, "generator")); // false ``` Two more low-level helper functions, `eachField` and `someField`, are defined in terms of `getFieldNames` and `getFieldValue`: ```js // Iterate over all defined fields of an object, including those missing // or undefined, passing each field name and effective value (as returned // by getFieldValue) to the callback. If the object has no corresponding // Def, the callback will never be called. export function eachField(object, callback, context) { getFieldNames(object).forEach(function(name) { callback.call(this, name, getFieldValue(object, name)); }, context); } // Similar to eachField, except that iteration stops as soon as the // callback returns a truthy value. Like Array.prototype.some, the final // result is either true or false to indicates whether the callback // returned true for any element or not. export function someField(object, callback, context) { return getFieldNames(object).some(function(name) { return callback.call(this, name, getFieldValue(object, name)); }, context); } ``` So here's how you might make a copy of an AST node: ```js import { eachField } from "ast-types"; const copy = {}; eachField(node, function(name, value) { // Note that undefined fields will be visited too, according to // the rules associated with node.type, and default field values // will be substituted if appropriate. copy[name] = value; }) ``` But that's not all! You can also easily visit entire syntax trees using the powerful `types.visit` abstraction. Here's a trivial example of how you might assert that `arguments.callee` is never used in `ast`: ```js import assert from "assert"; import { visit, namedTypes as n, } from "ast-types"; visit(ast, { // This method will be called for any node with .type "MemberExpression": visitMemberExpression(path) { // Visitor methods receive a single argument, a NodePath object // wrapping the node of interest. var node = path.node; if ( n.Identifier.check(node.object) && node.object.name === "arguments" && n.Identifier.check(node.property) ) { assert.notStrictEqual(node.property.name, "callee"); } // It's your responsibility to call this.traverse with some // NodePath object (usually the one passed into the visitor // method) before the visitor method returns, or return false to // indicate that the traversal need not continue any further down // this subtree. this.traverse(path); } }); ``` Here's a slightly more involved example of transforming `...rest` parameters into browser-runnable ES5 JavaScript: ```js import { builders as b, visit } from "ast-types"; // Reuse the same AST structure for Array.prototype.slice.call. var sliceExpr = b.memberExpression( b.memberExpression( b.memberExpression( b.identifier("Array"), b.identifier("prototype"), false ), b.identifier("slice"), false ), b.identifier("call"), false ); visit(ast, { // This method will be called for any node whose type is a subtype of // Function (e.g., FunctionDeclaration, FunctionExpression, and // ArrowFunctionExpression). Note that types.visit precomputes a // lookup table from every known type to the appropriate visitor // method to call for nodes of that type, so the dispatch takes // constant time. visitFunction(path) { // Visitor methods receive a single argument, a NodePath object // wrapping the node of interest. const node = path.node; // It's your responsibility to call this.traverse with some // NodePath object (usually the one passed into the visitor // method) before the visitor method returns, or return false to // indicate that the traversal need not continue any further down // this subtree. An assertion will fail if you forget, which is // awesome, because it means you will never again make the // disastrous mistake of forgetting to traverse a subtree. Also // cool: because you can call this method at any point in the // visitor method, it's up to you whether your traversal is // pre-order, post-order, or both! this.traverse(path); // This traversal is only concerned with Function nodes that have // rest parameters. if (!node.rest) { return; } // For the purposes of this example, we won't worry about functions // with Expression bodies. n.BlockStatement.assert(node.body); // Use types.builders to build a variable declaration of the form // // var rest = Array.prototype.slice.call(arguments, n); // // where `rest` is the name of the rest parameter, and `n` is a // numeric literal specifying the number of named parameters the // function takes. const restVarDecl = b.variableDeclaration("var", [ b.variableDeclarator( node.rest, b.callExpression(sliceExpr, [ b.identifier("arguments"), b.literal(node.params.length) ]) ) ]); // Similar to doing node.body.body.unshift(restVarDecl), except // that the other NodePath objects wrapping body statements will // have their indexes updated to accommodate the new statement. path.get("body", "body").unshift(restVarDecl); // Nullify node.rest now that we have simulated the behavior of // the rest parameter using ordinary JavaScript. path.get("rest").replace(null); // There's nothing wrong with doing node.rest = null, but I wanted // to point out that the above statement has the same effect. assert.strictEqual(node.rest, null); } }); ``` Here's how you might use `types.visit` to implement a function that determines if a given function node refers to `this`: ```js function usesThis(funcNode) { n.Function.assert(funcNode); var result = false; visit(funcNode, { visitThisExpression(path) { result = true; // The quickest way to terminate the traversal is to call // this.abort(), which throws a special exception (instanceof // this.AbortRequest) that will be caught in the top-level // types.visit method, so you don't have to worry about // catching the exception yourself. this.abort(); }, visitFunction(path) { // ThisExpression nodes in nested scopes don't count as `this` // references for the original function node, so we can safely // avoid traversing this subtree. return false; }, visitCallExpression(path) { const node = path.node; // If the function contains CallExpression nodes involving // super, those expressions will implicitly depend on the // value of `this`, even though they do not explicitly contain // any ThisExpression nodes. if (this.isSuperCallExpression(node)) { result = true; this.abort(); // Throws AbortRequest exception. } this.traverse(path); }, // Yes, you can define arbitrary helper methods. isSuperCallExpression(callExpr) { n.CallExpression.assert(callExpr); return this.isSuperIdentifier(callExpr.callee) || this.isSuperMemberExpression(callExpr.callee); }, // And even helper helper methods! isSuperIdentifier(node) { return n.Identifier.check(node.callee) && node.callee.name === "super"; }, isSuperMemberExpression(node) { return n.MemberExpression.check(node.callee) && n.Identifier.check(node.callee.object) && node.callee.object.name === "super"; } }); return result; } ``` As you might guess, when an `AbortRequest` is thrown from a subtree, the exception will propagate from the corresponding calls to `this.traverse` in the ancestor visitor methods. If you decide you want to cancel the request, simply catch the exception and call its `.cancel()` method. The rest of the subtree beneath the `try`-`catch` block will be abandoned, but the remaining siblings of the ancestor node will still be visited. NodePath --- The `NodePath` object passed to visitor methods is a wrapper around an AST node, and it serves to provide access to the chain of ancestor objects (all the way back to the root of the AST) and scope information. In general, `path.node` refers to the wrapped node, `path.parent.node` refers to the nearest `Node` ancestor, `path.parent.parent.node` to the grandparent, and so on. Note that `path.node` may not be a direct property value of `path.parent.node`; for instance, it might be the case that `path.node` is an element of an array that is a direct child of the parent node: ```js path.node === path.parent.node.elements[3] ``` in which case you should know that `path.parentPath` provides finer-grained access to the complete path of objects (not just the `Node` ones) from the root of the AST: ```js // In reality, path.parent is the grandparent of path: path.parentPath.parentPath === path.parent // The path.parentPath object wraps the elements array (note that we use // .value because the elements array is not a Node): path.parentPath.value === path.parent.node.elements // The path.node object is the fourth element in that array: path.parentPath.value[3] === path.node // Unlike path.node and path.value, which are synonyms because path.node // is a Node object, path.parentPath.node is distinct from // path.parentPath.value, because the elements array is not a // Node. Instead, path.parentPath.node refers to the closest ancestor // Node, which happens to be the same as path.parent.node: path.parentPath.node === path.parent.node // The path is named for its index in the elements array: path.name === 3 // Likewise, path.parentPath is named for the property by which // path.parent.node refers to it: path.parentPath.name === "elements" // Putting it all together, we can follow the chain of object references // from path.parent.node all the way to path.node by accessing each // property by name: path.parent.node[path.parentPath.name][path.name] === path.node ``` These `NodePath` objects are created during the traversal without modifying the AST nodes themselves, so it's not a problem if the same node appears more than once in the AST (like `Array.prototype.slice.call` in the example above), because it will be visited with a distict `NodePath` each time it appears. Child `NodePath` objects are created lazily, by calling the `.get` method of a parent `NodePath` object: ```js // If a NodePath object for the elements array has never been created // before, it will be created here and cached in the future: path.get("elements").get(3).value === path.value.elements[3] // Alternatively, you can pass multiple property names to .get instead of // chaining multiple .get calls: path.get("elements", 0).value === path.value.elements[0] ``` `NodePath` objects support a number of useful methods: ```js // Replace one node with another node: var fifth = path.get("elements", 4); fifth.replace(newNode); // Now do some stuff that might rearrange the list, and this replacement // remains safe: fifth.replace(newerNode); // Replace the third element in an array with two new nodes: path.get("elements", 2).replace( b.identifier("foo"), b.thisExpression() ); // Remove a node and its parent if it would leave a redundant AST node: //e.g. var t = 1, y =2; removing the `t` and `y` declarators results in `var undefined`. path.prune(); //returns the closest parent `NodePath`. // Remove a node from a list of nodes: path.get("elements", 3).replace(); // Add three new nodes to the beginning of a list of nodes: path.get("elements").unshift(a, b, c); // Remove and return the first node in a list of nodes: path.get("elements").shift(); // Push two new nodes onto the end of a list of nodes: path.get("elements").push(d, e); // Remove and return the last node in a list of nodes: path.get("elements").pop(); // Insert a new node before/after the seventh node in a list of nodes: var seventh = path.get("elements", 6); seventh.insertBefore(newNode); seventh.insertAfter(newNode); // Insert a new element at index 5 in a list of nodes: path.get("elements").insertAt(5, newNode); ``` Scope --- The object exposed as `path.scope` during AST traversals provides information about variable and function declarations in the scope that contains `path.node`. See [scope.ts](lib/scope.ts) for its public interface, which currently includes `.isGlobal`, `.getGlobalScope()`, `.depth`, `.declares(name)`, `.lookup(name)`, and `.getBindings()`. Custom AST Node Types --- The `ast-types` module was designed to be extended. To that end, it provides a readable, declarative syntax for specifying new AST node types, based primarily upon the `require("ast-types").Type.def` function: ```js import { Type, builtInTypes, builders as b, finalize, } from "ast-types"; const { def } = Type; const { string } = builtInTypes; // Suppose you need a named File type to wrap your Programs. def("File") .bases("Node") .build("name", "program") .field("name", string) .field("program", def("Program")); // Prevent further modifications to the File type (and any other // types newly introduced by def(...)). finalize(); // The b.file builder function is now available. It expects two // arguments, as named by .build("name", "program") above. const main = b.file("main.js", b.program([ // Pointless program contents included for extra color. b.functionDeclaration(b.identifier("succ"), [ b.identifier("x") ], b.blockStatement([ b.returnStatement( b.binaryExpression( "+", b.identifier("x"), b.literal(1) ) ) ])) ])); assert.strictEqual(main.name, "main.js"); assert.strictEqual(main.program.body[0].params[0].name, "x"); // etc. // If you pass the wrong type of arguments, or fail to pass enough // arguments, an AssertionError will be thrown. b.file(b.blockStatement([])); // ==> AssertionError: {"body":[],"type":"BlockStatement","loc":null} does not match type string b.file("lib/types.js", b.thisExpression()); // ==> AssertionError: {"type":"ThisExpression","loc":null} does not match type Program ``` The `def` syntax is used to define all the default AST node types found in [babel-core.ts](def/babel-core.ts), [babel.ts](def/babel.ts), [core.ts](def/core.ts), [es-proposals.ts](def/es-proposals.ts), [es6.ts](def/es6.ts), [es7.ts](def/es7.ts), [es2020.ts](def/es2020.ts), [esprima.ts](def/esprima.ts), [flow.ts](def/flow.ts), [jsx.ts](def/jsx.ts), [type-annotations.ts](def/type-annotations.ts), and [typescript.ts](def/typescript.ts), so you have no shortage of examples to learn from. ast-types-0.16.1/package-lock.json000066400000000000000000003353641434620737500167750ustar00rootroot00000000000000{ "name": "ast-types", "version": "0.16.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ast-types", "version": "0.16.1", "license": "MIT", "dependencies": { "tslib": "^2.0.1" }, "devDependencies": { "@babel/parser": "7.20.5", "@babel/types": "7.20.5", "@types/esprima": "4.0.3", "@types/glob": "8.0.0", "@types/mocha": "10.0.1", "espree": "9.4.1", "esprima": "4.0.1", "esprima-fb": "15001.1001.0-dev-harmony-fb", "flow-parser": "0.195.2", "glob": "8.0.3", "mocha": "^10.2.0", "recast": "^0.23.0", "reify": "0.20.12", "rimraf": "3.0.2", "ts-node": "10.9.1", "typescript": "4.9.4" }, "engines": { "node": ">=4" } }, "node_modules/@babel/helper-string-parser": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/types": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, "engines": { "node": ">=12" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "node_modules/@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, "node_modules/@types/esprima": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/esprima/-/esprima-4.0.3.tgz", "integrity": "sha512-jo14dIWVVtF0iMsKkYek6++4cWJjwpvog+rchLulwgFJGTXqIeTdCOvY0B3yMLTaIwMcKCdJ6mQbSR6wYHy98A==", "dev": true, "dependencies": { "@types/estree": "*" } }, "node_modules/@types/estree": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", "dev": true }, "node_modules/@types/glob": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.0.0.tgz", "integrity": "sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==", "dev": true, "dependencies": { "@types/minimatch": "*", "@types/node": "*" } }, "node_modules/@types/minimatch": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, "node_modules/@types/mocha": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", "dev": true }, "node_modules/@types/node": { "version": "16.11.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", "dev": true }, "node_modules/acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" }, "engines": { "node": ">= 8" } }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "node_modules/assert": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", "dev": true, "dependencies": { "es6-object-assign": "^1.1.0", "is-nan": "^1.2.1", "object-is": "^1.0.1", "util": "^0.12.0" } }, "node_modules/ast-types": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", "dev": true, "dependencies": { "tslib": "^2.0.1" }, "engines": { "node": ">=4" } }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { "fill-range": "^7.0.1" }, "engines": { "node": ">=8" } }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chalk/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/debug/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "node_modules/decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/es6-object-assign": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", "dev": true }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/espree": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { "node": ">=4" } }, "node_modules/esprima-fb": { "version": "15001.1001.0-dev-harmony-fb", "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", "integrity": "sha512-m7OsYzocA8OQ3+9CxmhIv7NPHtyDR2ixaLCO7kLZ+YH+xQ/BpaZmll9EXmc+kBxzWA8BRBXbNEuEQqQ6vfsgDw==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { "node": ">=0.4.0" } }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, "bin": { "flat": "cli.js" } }, "node_modules/flow-parser": { "version": "0.195.2", "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.195.2.tgz", "integrity": "sha512-zPXwya4KhbT1xuRN/oqJ5BITjJl9OGCDmaG7qhABgewb4/2wmy4SV0ULRaGoZB5BWt4kWzLG4qve/1mRbpfSOA==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, "optional": true, "os": [ "darwin" ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/glob": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { "function-bind": "^1.1.1" }, "engines": { "node": ">= 0.4.0" } }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "bin": { "he": "bin/he" } }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-generator-function": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, "engines": { "node": ">=0.10.0" } }, "node_modules/is-nan": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", "dev": true, "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-typed-array": { "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { "p-locate": "^5.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", "dev": true, "dependencies": { "sourcemap-codec": "^1.4.8" } }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "node_modules/minimatch": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/minimatch/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { "node": ">= 14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha/node_modules/glob/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/object-is": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, "engines": { "node": ">= 0.4" } }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" } }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { "p-limit": "^3.0.2" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { "picomatch": "^2.2.1" }, "engines": { "node": ">=8.10.0" } }, "node_modules/recast": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.0.tgz", "integrity": "sha512-+eh8cppi1n8wlRv5Y+e1eh/ft0h+yh3mGjviEngpFzEg9TSmVh7Ariax9Fjqi+STZCbIZLUwdO/2dQN0gxYYUg==", "dev": true, "dependencies": { "assert": "^2.0.0", "ast-types": "0.15.2", "esprima": "~4.0.0", "source-map": "~0.6.1", "tslib": "^2.0.1" }, "engines": { "node": ">= 4" } }, "node_modules/reify": { "version": "0.20.12", "resolved": "https://registry.npmjs.org/reify/-/reify-0.20.12.tgz", "integrity": "sha512-4BzKwDWyJJbukwI6xIJRh+BDTitoGzxdgYPiQQ1zbcTZW6I8xgHPw1DnVuEs/mEZQlYm1e09DcFSApb4UaR5bQ==", "dev": true, "dependencies": { "acorn": "^6.1.1", "acorn-dynamic-import": "^4.0.0", "magic-string": "^0.25.3", "semver": "^5.4.1" }, "engines": { "node": ">=4" } }, "node_modules/reify/node_modules/acorn": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true, "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/reify/node_modules/acorn-dynamic-import": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", "deprecated": "This is probably built in to whatever tool you're using. If you still need it... idk", "dev": true, "peerDependencies": { "acorn": "^6.0.0" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, "bin": { "semver": "bin/semver" } }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "dependencies": { "is-number": "^7.0.0" }, "engines": { "node": ">=8.0" } }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "peerDependenciesMeta": { "@swc/core": { "optional": true }, "@swc/wasm": { "optional": true } } }, "node_modules/ts-node/node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "node_modules/typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/util": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dev": true, "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "node_modules/which-typed-array": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0", "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" }, "engines": { "node": ">=10" } }, "node_modules/yargs-parser": { "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" }, "engines": { "node": ">=10" } }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } } }, "dependencies": { "@babel/helper-string-parser": { "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true }, "@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/parser": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz", "integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==", "dev": true }, "@babel/types": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } }, "@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, "@types/esprima": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/esprima/-/esprima-4.0.3.tgz", "integrity": "sha512-jo14dIWVVtF0iMsKkYek6++4cWJjwpvog+rchLulwgFJGTXqIeTdCOvY0B3yMLTaIwMcKCdJ6mQbSR6wYHy98A==", "dev": true, "requires": { "@types/estree": "*" } }, "@types/estree": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", "dev": true }, "@types/glob": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.0.0.tgz", "integrity": "sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==", "dev": true, "requires": { "@types/minimatch": "*", "@types/node": "*" } }, "@types/minimatch": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, "@types/mocha": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", "dev": true }, "@types/node": { "version": "16.11.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", "dev": true }, "acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" } }, "anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "assert": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", "dev": true, "requires": { "es6-object-assign": "^1.1.0", "is-nan": "^1.2.1", "object-is": "^1.0.1", "util": "^0.12.0" } }, "ast-types": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", "dev": true, "requires": { "tslib": "^2.0.1" } }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" } }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" } }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "dependencies": { "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" } } } }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" } }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" }, "dependencies": { "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } }, "decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, "define-properties": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "requires": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "es6-object-assign": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", "dev": true }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, "espree": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esprima-fb": { "version": "15001.1001.0-dev-harmony-fb", "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", "integrity": "sha512-m7OsYzocA8OQ3+9CxmhIv7NPHtyDR2ixaLCO7kLZ+YH+xQ/BpaZmll9EXmc+kBxzWA8BRBXbNEuEQqQ6vfsgDw==", "dev": true }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" } }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, "flow-parser": { "version": "0.195.2", "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.195.2.tgz", "integrity": "sha512-zPXwya4KhbT1xuRN/oqJ5BITjJl9OGCDmaG7qhABgewb4/2wmy4SV0ULRaGoZB5BWt4kWzLG4qve/1mRbpfSOA==", "dev": true }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { "is-callable": "^1.1.3" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" } }, "glob": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" } }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, "requires": { "get-intrinsic": "^1.1.3" } }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { "function-bind": "^1.1.1" } }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "dev": true, "requires": { "get-intrinsic": "^1.1.1" } }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, "requires": { "has-symbols": "^1.0.2" } }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" } }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" } }, "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-generator-function": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" } }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-nan": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", "dev": true, "requires": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" } }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, "is-typed-array": { "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" } }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { "p-locate": "^5.0.0" } }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" } }, "magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", "dev": true, "requires": { "sourcemap-codec": "^1.4.8" } }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "minimatch": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } } } }, "mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "requires": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "dependencies": { "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "dependencies": { "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } } } }, "minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } } } } } }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "object-is": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" } }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" } }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { "yocto-queue": "^0.1.0" } }, "p-locate": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { "p-limit": "^3.0.2" } }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" } }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" } }, "recast": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.0.tgz", "integrity": "sha512-+eh8cppi1n8wlRv5Y+e1eh/ft0h+yh3mGjviEngpFzEg9TSmVh7Ariax9Fjqi+STZCbIZLUwdO/2dQN0gxYYUg==", "dev": true, "requires": { "assert": "^2.0.0", "ast-types": "0.15.2", "esprima": "~4.0.0", "source-map": "~0.6.1", "tslib": "^2.0.1" } }, "reify": { "version": "0.20.12", "resolved": "https://registry.npmjs.org/reify/-/reify-0.20.12.tgz", "integrity": "sha512-4BzKwDWyJJbukwI6xIJRh+BDTitoGzxdgYPiQQ1zbcTZW6I8xgHPw1DnVuEs/mEZQlYm1e09DcFSApb4UaR5bQ==", "dev": true, "requires": { "acorn": "^6.1.1", "acorn-dynamic-import": "^4.0.0", "magic-string": "^0.25.3", "semver": "^5.4.1" }, "dependencies": { "acorn": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true }, "acorn-dynamic-import": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", "dev": true, "requires": {} } } }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" }, "dependencies": { "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } } } }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" } }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" } }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" } }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "dependencies": { "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } }, "tslib": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "typescript": { "version": "4.9.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "dev": true }, "util": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dev": true, "requires": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "which-typed-array": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0", "is-typed-array": "^1.1.10" } }, "workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "yargs-parser": { "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true }, "yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" } }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true } } } ast-types-0.16.1/package.json000066400000000000000000000031321434620737500160300ustar00rootroot00000000000000{ "author": "Ben Newman ", "name": "ast-types", "version": "0.16.1", "description": "Esprima-compatible implementation of the Mozilla JS Parser API", "keywords": [ "ast", "abstract syntax tree", "hierarchy", "mozilla", "spidermonkey", "parser api", "esprima", "types", "type system", "type checking", "dynamic types", "parsing", "transformation", "syntax" ], "homepage": "http://github.com/benjamn/ast-types", "repository": { "type": "git", "url": "git://github.com/benjamn/ast-types.git" }, "license": "MIT", "main": "lib/main.js", "types": "lib/main.d.ts", "exports": { ".": "./lib/main.js", "./lib/*": "./lib/*.js", "./lib/*.js": "./lib/*.js", "./*": "./lib/*.js", "./*.js": "./lib/*.js" }, "scripts": { "gen": "ts-node --transpile-only script/gen-types.ts", "test": "npm run gen && npm run build && script/run-tests.sh", "clean": "rimraf lib/", "build": "tsc", "prepare": "npm run clean && npm run build" }, "dependencies": { "tslib": "^2.0.1" }, "devDependencies": { "@babel/parser": "7.20.5", "@babel/types": "7.20.5", "@types/esprima": "4.0.3", "@types/glob": "8.0.0", "@types/mocha": "10.0.1", "espree": "9.4.1", "esprima": "4.0.1", "esprima-fb": "15001.1001.0-dev-harmony-fb", "flow-parser": "0.195.2", "glob": "8.0.3", "mocha": "^10.2.0", "recast": "^0.23.0", "reify": "0.20.12", "rimraf": "3.0.2", "ts-node": "10.9.1", "typescript": "4.9.4" }, "engines": { "node": ">=4" } } ast-types-0.16.1/script/000077500000000000000000000000001434620737500150475ustar00rootroot00000000000000ast-types-0.16.1/script/gen-types.ts000066400000000000000000000364341434620737500173440ustar00rootroot00000000000000import fs from "fs"; import path from "path"; import { prettyPrint } from "recast"; import { Type, builders as b, namedTypes as n, getBuilderName, } from "../src/main"; const Op = Object.prototype; const hasOwn = Op.hasOwnProperty; const RESERVED_WORDS: { [reservedWord: string]: boolean | undefined } = { extends: true, default: true, arguments: true, static: true, }; const NAMED_TYPES_ID = b.identifier("namedTypes"); const NAMED_TYPES_IMPORT = b.importDeclaration( [b.importSpecifier(NAMED_TYPES_ID)], b.stringLiteral("./namedTypes"), ); const KINDS_ID = b.identifier("K"); const KINDS_IMPORT = b.importDeclaration( [b.importNamespaceSpecifier(KINDS_ID)], b.stringLiteral("./kinds") ); const supertypeToSubtypes = getSupertypeToSubtypes(); const builderTypeNames = getBuilderTypeNames(); const out = [ { file: "kinds.ts", ast: moduleWithBody([ NAMED_TYPES_IMPORT, ...Object.keys(supertypeToSubtypes).map(supertype => { const buildableSubtypes = getBuildableSubtypes(supertype); if (buildableSubtypes.length === 0) { // Some of the XML* types don't have buildable subtypes, // so fall back to using the supertype's node type return b.exportNamedDeclaration( b.tsTypeAliasDeclaration( b.identifier(`${supertype}Kind`), b.tsTypeReference(b.tsQualifiedName(NAMED_TYPES_ID, b.identifier(supertype))) ) ); } return b.exportNamedDeclaration( b.tsTypeAliasDeclaration( b.identifier(`${supertype}Kind`), b.tsUnionType(buildableSubtypes.map(subtype => b.tsTypeReference(b.tsQualifiedName(NAMED_TYPES_ID, b.identifier(subtype))) )) ) ); }), ]), }, { file: "namedTypes.ts", ast: moduleWithBody([ b.importDeclaration([ b.importSpecifier(b.identifier("Type")), b.importSpecifier(b.identifier("Omit")), ], b.stringLiteral("../types")), KINDS_IMPORT, b.exportNamedDeclaration( b.tsModuleDeclaration( b.identifier("namedTypes"), b.tsModuleBlock([ ...Object.keys(n).map(typeName => { const typeDef = Type.def(typeName); const ownFieldNames = Object.keys(typeDef.ownFields); return b.exportNamedDeclaration( b.tsInterfaceDeclaration.from({ id: b.identifier(typeName), extends: typeDef.baseNames.map(baseName => { const baseDef = Type.def(baseName); const commonFieldNames = ownFieldNames .filter(fieldName => !!baseDef.allFields[fieldName]); if (commonFieldNames.length > 0) { return b.tsExpressionWithTypeArguments( b.identifier("Omit"), b.tsTypeParameterInstantiation([ b.tsTypeReference(b.identifier(baseName)), b.tsUnionType( commonFieldNames.map(fieldName => b.tsLiteralType(b.stringLiteral(fieldName)) ) ), ]) ); } else { return b.tsExpressionWithTypeArguments(b.identifier(baseName)); } }), body: b.tsInterfaceBody( ownFieldNames.map(fieldName => { const field = typeDef.allFields[fieldName]; if (field.name === "type" && field.defaultFn) { return b.tsPropertySignature( b.identifier("type"), b.tsTypeAnnotation(b.tsLiteralType(b.stringLiteral(field.defaultFn()))) ); } else if (field.defaultFn) { return b.tsPropertySignature( b.identifier(field.name), b.tsTypeAnnotation(getTSTypeAnnotation(field.type)), true, // optional ); } return b.tsPropertySignature( b.identifier(field.name), b.tsTypeAnnotation(getTSTypeAnnotation(field.type)) ); }) ), }) ); }), b.exportNamedDeclaration( b.tsTypeAliasDeclaration( b.identifier("ASTNode"), b.tsUnionType( Object.keys(n) .filter(typeName => Type.def(typeName).buildable) .map(typeName => b.tsTypeReference(b.identifier(typeName))), ) ) ), ...Object.keys(n).map(typeName => b.exportNamedDeclaration( b.variableDeclaration("let", [ b.variableDeclarator( b.identifier.from({ name: typeName, typeAnnotation: b.tsTypeAnnotation( b.tsTypeReference( b.identifier("Type"), b.tsTypeParameterInstantiation([ b.tsTypeReference( b.identifier(typeName), ), ]), ), ), }), ), ]), ), ), ]), ) ), b.exportNamedDeclaration( b.tsInterfaceDeclaration( b.identifier("NamedTypes"), b.tsInterfaceBody( Object.keys(n).map(typeName => b.tsPropertySignature( b.identifier(typeName), b.tsTypeAnnotation( b.tsTypeReference( b.identifier("Type"), b.tsTypeParameterInstantiation([ b.tsTypeReference(b.tsQualifiedName( b.identifier("namedTypes"), b.identifier(typeName), )), ]) ) ) ) ) ) ) ), ]), }, { file: "builders.ts", ast: moduleWithBody([ KINDS_IMPORT, NAMED_TYPES_IMPORT, ...builderTypeNames.map(typeName => { const typeDef = Type.def(typeName); const returnType = b.tsTypeAnnotation( b.tsTypeReference(b.tsQualifiedName(NAMED_TYPES_ID, b.identifier(typeName))) ); const buildParamAllowsUndefined: { [buildParam: string]: boolean } = {}; const buildParamIsOptional: { [buildParam: string]: boolean } = {}; [...typeDef.buildParams].reverse().forEach((cur, i, arr) => { const field = typeDef.allFields[cur]; if (field && field.defaultFn) { if (i === 0) { buildParamIsOptional[cur] = true; } else { if (buildParamIsOptional[arr[i - 1]]) { buildParamIsOptional[cur] = true; } else { buildParamAllowsUndefined[cur] = true; } } } }); return b.exportNamedDeclaration( b.tsInterfaceDeclaration( b.identifier(`${typeName}Builder`), b.tsInterfaceBody([ b.tsCallSignatureDeclaration( typeDef.buildParams .filter(buildParam => !!typeDef.allFields[buildParam]) .map(buildParam => { const field = typeDef.allFields[buildParam]; const name = RESERVED_WORDS[buildParam] ? `${buildParam}Param` : buildParam; return b.identifier.from({ name, typeAnnotation: b.tsTypeAnnotation( !!buildParamAllowsUndefined[buildParam] ? b.tsUnionType([getTSTypeAnnotation(field.type), b.tsUndefinedKeyword()]) : getTSTypeAnnotation(field.type) ), optional: !!buildParamIsOptional[buildParam], }); }), returnType ), b.tsMethodSignature( b.identifier("from"), [ b.identifier.from({ name: "params", typeAnnotation: b.tsTypeAnnotation( b.tsTypeLiteral( Object.keys(typeDef.allFields) .filter(fieldName => fieldName !== "type") .sort() // Sort field name strings lexicographically. .map(fieldName => { const field = typeDef.allFields[fieldName]; return b.tsPropertySignature( b.identifier(field.name), b.tsTypeAnnotation(getTSTypeAnnotation(field.type)), field.defaultFn != null || field.hidden ); }) ) ), }), ], returnType ), ]) ) ); }), b.exportNamedDeclaration( b.tsInterfaceDeclaration( b.identifier("builders"), b.tsInterfaceBody([ ...builderTypeNames.map(typeName => b.tsPropertySignature( b.identifier(getBuilderName(typeName)), b.tsTypeAnnotation(b.tsTypeReference(b.identifier(`${typeName}Builder`))) ) ), b.tsIndexSignature( [ b.identifier.from({ name: "builderName", typeAnnotation: b.tsTypeAnnotation(b.tsStringKeyword()), }), ], b.tsTypeAnnotation(b.tsAnyKeyword()) ), ]) ) ), ]), }, { file: "visitor.ts", ast: moduleWithBody([ b.importDeclaration( [b.importSpecifier(b.identifier("NodePath"))], b.stringLiteral("../node-path") ), b.importDeclaration( [b.importSpecifier(b.identifier("Context"))], b.stringLiteral("../path-visitor") ), NAMED_TYPES_IMPORT, b.exportNamedDeclaration( b.tsInterfaceDeclaration.from({ id: b.identifier("Visitor"), typeParameters: b.tsTypeParameterDeclaration([ b.tsTypeParameter("M", undefined, b.tsTypeLiteral([])), ]), body: b.tsInterfaceBody([ ...Object.keys(n).map(typeName => { return b.tsMethodSignature.from({ key: b.identifier(`visit${typeName}`), parameters: [ b.identifier.from({ name: "this", typeAnnotation: b.tsTypeAnnotation( b.tsIntersectionType([ b.tsTypeReference(b.identifier("Context")), b.tsTypeReference(b.identifier("M")), ]) ), }), b.identifier.from({ name: "path", typeAnnotation: b.tsTypeAnnotation( b.tsTypeReference( b.identifier("NodePath"), b.tsTypeParameterInstantiation([ b.tsTypeReference(b.tsQualifiedName(NAMED_TYPES_ID, b.identifier(typeName))), ]) ) ), }), ], optional: true, typeAnnotation: b.tsTypeAnnotation(b.tsAnyKeyword()), }); }), ]), }) ), ]), }, ]; out.forEach(({ file, ast }) => { fs.writeFileSync( path.resolve(__dirname, `../src/gen/${file}`), prettyPrint(ast, { tabWidth: 2, includeComments: true }).code ); }); function moduleWithBody(body: any[]) { return b.file.from({ comments: [b.commentBlock(" !!! THIS FILE WAS AUTO-GENERATED BY `npm run gen` !!! ")], program: b.program(body), }); } function getSupertypeToSubtypes() { const supertypeToSubtypes: { [supertypeName: string]: string[] } = {}; Object.keys(n).map(typeName => { Type.def(typeName).supertypeList.forEach(supertypeName => { supertypeToSubtypes[supertypeName] = supertypeToSubtypes[supertypeName] || []; supertypeToSubtypes[supertypeName].push(typeName); }); }); return supertypeToSubtypes; } function getBuilderTypeNames() { return Object.keys(n).filter(typeName => { const typeDef = Type.def(typeName); const builderName = getBuilderName(typeName); return !!typeDef.buildParams && !!(b as any)[builderName]; }); } function getBuildableSubtypes(supertype: string): string[] { return Array.from(new Set( Object.keys(n).filter(typeName => { const typeDef = Type.def(typeName); return typeDef.allSupertypes[supertype] != null && typeDef.buildable; }) )); } function getTSTypeAnnotation(type: import("../src/types").Type): any { switch (type.kind) { case "ArrayType": { const elemTypeAnnotation = getTSTypeAnnotation(type.elemType); // TODO Improve this test. return n.TSUnionType.check(elemTypeAnnotation) ? b.tsArrayType(b.tsParenthesizedType(elemTypeAnnotation)) : b.tsArrayType(elemTypeAnnotation); } case "IdentityType": { if (type.value === null) { return b.tsNullKeyword(); } switch (typeof type.value) { case "undefined": return b.tsUndefinedKeyword(); case "string": return b.tsLiteralType(b.stringLiteral(type.value)); case "boolean": return b.tsLiteralType(b.booleanLiteral(type.value)); case "number": return b.tsNumberKeyword(); case "object": return b.tsObjectKeyword(); case "function": return b.tsFunctionType([]); case "symbol": return b.tsSymbolKeyword(); default: return b.tsAnyKeyword(); } } case "ObjectType": { return b.tsTypeLiteral( type.fields.map(field => b.tsPropertySignature( b.identifier(field.name), b.tsTypeAnnotation(getTSTypeAnnotation(field.type)) ) ) ); } case "OrType": { return b.tsUnionType(type.types.map(type => getTSTypeAnnotation(type))); } case "PredicateType": { if (typeof type.name !== "string") { return b.tsAnyKeyword(); } if (hasOwn.call(n, type.name)) { return b.tsTypeReference(b.tsQualifiedName(KINDS_ID, b.identifier(`${type.name}Kind`))); } if (/^[$A-Z_][a-z0-9_$]*$/i.test(type.name)) { return b.tsTypeReference(b.identifier(type.name)); } if (/^number [<>=]+ \d+$/.test(type.name)) { return b.tsNumberKeyword(); } // Not much else to do... return b.tsAnyKeyword(); } default: return assertNever(type); } } function assertNever(x: never): never { throw new Error("Unexpected: " + x); } ast-types-0.16.1/script/run-tests.sh000077500000000000000000000015211434620737500173510ustar00rootroot00000000000000#!/usr/bin/env bash set -ex cd "$(dirname $0)/../src/test/data" BAB_TAG=v$(node -p 'require("@babel/parser/package.json").version') if [ ! -d babel-parser ] then git clone --branch "$BAB_TAG" --depth 1 \ https://github.com/babel/babel.git mv babel/packages/babel-parser . rm -rf babel fi TS_TAG=v$(node -p 'require("typescript/package.json").version') if [ ! -d typescript-compiler ] then git clone --branch "$TS_TAG" --depth 1 \ https://github.com/Microsoft/TypeScript.git mv TypeScript/src/compiler typescript-compiler rm -rf TypeScript fi cd ../../.. # back to the ast-types/ root directory # Run Mocha on the generated .js code, rather than the .ts source code, so # that we're testing the same kind of output that we're shipping to npm. exec mocha --reporter spec --full-trace $@ lib/test/run.js ast-types-0.16.1/src/000077500000000000000000000000001434620737500143325ustar00rootroot00000000000000ast-types-0.16.1/src/def/000077500000000000000000000000001434620737500150705ustar00rootroot00000000000000ast-types-0.16.1/src/def/babel-core.ts000066400000000000000000000227161434620737500174430ustar00rootroot00000000000000import { Fork } from "../types"; import esProposalsDef from "./es-proposals"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; import { namedTypes as N } from "../gen/namedTypes"; export default function (fork: Fork) { fork.use(esProposalsDef); const types = fork.use(typesPlugin); const defaults = fork.use(sharedPlugin).defaults; const def = types.Type.def; const or = types.Type.or; const { undefined: isUndefined, } = types.builtInTypes; def("Noop") .bases("Statement") .build(); def("DoExpression") .bases("Expression") .build("body") .field("body", [def("Statement")]); def("BindExpression") .bases("Expression") .build("object", "callee") .field("object", or(def("Expression"), null)) .field("callee", def("Expression")); def("ParenthesizedExpression") .bases("Expression") .build("expression") .field("expression", def("Expression")); def("ExportNamespaceSpecifier") .bases("Specifier") .build("exported") .field("exported", def("Identifier")); def("ExportDefaultSpecifier") .bases("Specifier") .build("exported") .field("exported", def("Identifier")); def("CommentBlock") .bases("Comment") .build("value", /*optional:*/ "leading", "trailing"); def("CommentLine") .bases("Comment") .build("value", /*optional:*/ "leading", "trailing"); def("Directive") .bases("Node") .build("value") .field("value", def("DirectiveLiteral")); def("DirectiveLiteral") .bases("Node", "Expression") .build("value") .field("value", String, defaults["use strict"]); def("InterpreterDirective") .bases("Node") .build("value") .field("value", String); def("BlockStatement") .bases("Statement") .build("body") .field("body", [def("Statement")]) .field("directives", [def("Directive")], defaults.emptyArray); def("Program") .bases("Node") .build("body") .field("body", [def("Statement")]) .field("directives", [def("Directive")], defaults.emptyArray) .field("interpreter", or(def("InterpreterDirective"), null), defaults["null"]); function makeLiteralExtra< // Allowing N.RegExpLiteral explicitly here is important because the // node.value field of RegExpLiteral nodes can be undefined, which is not // allowed for other Literal subtypes. TNode extends Omit | N.RegExpLiteral >( rawValueType: any = String, toRaw?: (value: any) => string, ): Parameters { return [ "extra", { rawValue: rawValueType, raw: String, }, function getDefault(this: TNode) { const value = types.getFieldValue(this, "value"); return { rawValue: value, raw: toRaw ? toRaw(value) : String(value), }; }, ]; } // Split Literal def("StringLiteral") .bases("Literal") .build("value") .field("value", String) .field(...makeLiteralExtra(String, val => JSON.stringify(val))); def("NumericLiteral") .bases("Literal") .build("value") .field("value", Number) .field("raw", or(String, null), defaults["null"]) .field(...makeLiteralExtra(Number)); def("BigIntLiteral") .bases("Literal") .build("value") // Only String really seems appropriate here, since BigInt values // often exceed the limits of JS numbers. .field("value", or(String, Number)) .field(...makeLiteralExtra(String, val => val + "n")); // https://github.com/tc39/proposal-decimal // https://github.com/babel/babel/pull/11640 def("DecimalLiteral") .bases("Literal") .build("value") .field("value", String) .field(...makeLiteralExtra(String, val => val + "m")); def("NullLiteral") .bases("Literal") .build() .field("value", null, defaults["null"]); def("BooleanLiteral") .bases("Literal") .build("value") .field("value", Boolean); def("RegExpLiteral") .bases("Literal") .build("pattern", "flags") .field("pattern", String) .field("flags", String) .field("value", RegExp, function (this: N.RegExpLiteral) { return new RegExp(this.pattern, this.flags); }) .field(...makeLiteralExtra( or(RegExp, isUndefined), exp => `/${exp.pattern}/${exp.flags || ""}`, )) // I'm not sure why this field exists, but it's "specified" by estree: // https://github.com/estree/estree/blob/master/es5.md#regexpliteral .field("regex", { pattern: String, flags: String }, function (this: N.RegExpLiteral) { return { pattern: this.pattern, flags: this.flags, }; }); var ObjectExpressionProperty = or( def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement") ); // Split Property -> ObjectProperty and ObjectMethod def("ObjectExpression") .bases("Expression") .build("properties") .field("properties", [ObjectExpressionProperty]); // ObjectMethod hoist .value properties to own properties def("ObjectMethod") .bases("Node", "Function") .build("kind", "key", "params", "body", "computed") .field("kind", or("method", "get", "set")) .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("params", [def("Pattern")]) .field("body", def("BlockStatement")) .field("computed", Boolean, defaults["false"]) .field("generator", Boolean, defaults["false"]) .field("async", Boolean, defaults["false"]) .field("accessibility", // TypeScript or(def("Literal"), null), defaults["null"]) .field("decorators", or([def("Decorator")], null), defaults["null"]); def("ObjectProperty") .bases("Node") .build("key", "value") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("value", or(def("Expression"), def("Pattern"))) .field("accessibility", // TypeScript or(def("Literal"), null), defaults["null"]) .field("computed", Boolean, defaults["false"]); var ClassBodyElement = or( def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("ClassAccessorProperty"), def("StaticBlock"), ); // MethodDefinition -> ClassMethod def("ClassBody") .bases("Declaration") .build("body") .field("body", [ClassBodyElement]); def("ClassMethod") .bases("Declaration", "Function") .build("kind", "key", "params", "body", "computed", "static") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))); def("ClassPrivateMethod") .bases("Declaration", "Function") .build("key", "params", "body", "kind", "computed", "static") .field("key", def("PrivateName")); def("ClassAccessorProperty") .bases("Declaration") .build("key", "value", "decorators", "computed", "static") .field("key", or( def("Literal"), def("Identifier"), def("PrivateName"), // Only when .computed is true (TODO enforce this) def("Expression"), )) .field("value", or(def("Expression"), null), defaults["null"]); ["ClassMethod", "ClassPrivateMethod", ].forEach(typeName => { def(typeName) .field("kind", or("get", "set", "method", "constructor"), () => "method") .field("body", def("BlockStatement")) // For backwards compatibility only. Expect accessibility instead (see below). .field("access", or("public", "private", "protected", null), defaults["null"]) }); ["ClassMethod", "ClassPrivateMethod", "ClassAccessorProperty", ].forEach(typeName => { def(typeName) .field("computed", Boolean, defaults["false"]) .field("static", Boolean, defaults["false"]) .field("abstract", Boolean, defaults["false"]) .field("accessibility", or("public", "private", "protected", null), defaults["null"]) .field("decorators", or([def("Decorator")], null), defaults["null"]) .field("definite", Boolean, defaults["false"]) .field("optional", Boolean, defaults["false"]) .field("override", Boolean, defaults["false"]) .field("readonly", Boolean, defaults["false"]); }); var ObjectPatternProperty = or( def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"), // Used by Esprima def("ObjectProperty"), // Babel 6 def("RestProperty"), // Babel 6 def("RestElement"), // Babel 6 ); // Split into RestProperty and SpreadProperty def("ObjectPattern") .bases("Pattern") .build("properties") .field("properties", [ObjectPatternProperty]) .field("decorators", or([def("Decorator")], null), defaults["null"]); def("SpreadProperty") .bases("Node") .build("argument") .field("argument", def("Expression")); def("RestProperty") .bases("Node") .build("argument") .field("argument", def("Expression")); def("ForAwaitStatement") .bases("Statement") .build("left", "right", "body") .field("left", or( def("VariableDeclaration"), def("Expression"))) .field("right", def("Expression")) .field("body", def("Statement")); // The callee node of a dynamic import(...) expression. def("Import") .bases("Expression") .build(); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/babel.ts000066400000000000000000000012721434620737500165070ustar00rootroot00000000000000import { Fork } from "../types"; import typesPlugin from "../types"; import babelCoreDef from "./babel-core"; import flowDef from "./flow"; import { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { const types = fork.use(typesPlugin); const def = types.Type.def; fork.use(babelCoreDef); fork.use(flowDef); // https://github.com/babel/babel/pull/10148 def("V8IntrinsicIdentifier") .bases("Expression") .build("name") .field("name", String); // https://github.com/babel/babel/pull/13191 // https://github.com/babel/website/pull/2541 def("TopicReference") .bases("Expression") .build(); } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/core.ts000066400000000000000000000246421434620737500164000ustar00rootroot00000000000000import { Fork } from "../types"; import coreOpsDef from "./operators/core"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; import { namedTypes as N } from "../gen/namedTypes"; export default function (fork: Fork) { var types = fork.use(typesPlugin); var Type = types.Type; var def = Type.def; var or = Type.or; var shared = fork.use(sharedPlugin); var defaults = shared.defaults; var geq = shared.geq; const { BinaryOperators, AssignmentOperators, LogicalOperators, } = fork.use(coreOpsDef); // Abstract supertype of all syntactic entities that are allowed to have a // .loc field. def("Printable") .field("loc", or( def("SourceLocation"), null ), defaults["null"], true); def("Node") .bases("Printable") .field("type", String) .field("comments", or( [def("Comment")], null ), defaults["null"], true); def("SourceLocation") .field("start", def("Position")) .field("end", def("Position")) .field("source", or(String, null), defaults["null"]); def("Position") .field("line", geq(1)) .field("column", geq(0)); def("File") .bases("Node") .build("program", "name") .field("program", def("Program")) .field("name", or(String, null), defaults["null"]); def("Program") .bases("Node") .build("body") .field("body", [def("Statement")]); def("Function") .bases("Node") .field("id", or(def("Identifier"), null), defaults["null"]) .field("params", [def("Pattern")]) .field("body", def("BlockStatement")) .field("generator", Boolean, defaults["false"]) .field("async", Boolean, defaults["false"]); def("Statement").bases("Node"); // The empty .build() here means that an EmptyStatement can be constructed // (i.e. it's not abstract) but that it needs no arguments. def("EmptyStatement").bases("Statement").build(); def("BlockStatement") .bases("Statement") .build("body") .field("body", [def("Statement")]); // TODO Figure out how to silently coerce Expressions to // ExpressionStatements where a Statement was expected. def("ExpressionStatement") .bases("Statement") .build("expression") .field("expression", def("Expression")); def("IfStatement") .bases("Statement") .build("test", "consequent", "alternate") .field("test", def("Expression")) .field("consequent", def("Statement")) .field("alternate", or(def("Statement"), null), defaults["null"]); def("LabeledStatement") .bases("Statement") .build("label", "body") .field("label", def("Identifier")) .field("body", def("Statement")); def("BreakStatement") .bases("Statement") .build("label") .field("label", or(def("Identifier"), null), defaults["null"]); def("ContinueStatement") .bases("Statement") .build("label") .field("label", or(def("Identifier"), null), defaults["null"]); def("WithStatement") .bases("Statement") .build("object", "body") .field("object", def("Expression")) .field("body", def("Statement")); def("SwitchStatement") .bases("Statement") .build("discriminant", "cases", "lexical") .field("discriminant", def("Expression")) .field("cases", [def("SwitchCase")]) .field("lexical", Boolean, defaults["false"]); def("ReturnStatement") .bases("Statement") .build("argument") .field("argument", or(def("Expression"), null)); def("ThrowStatement") .bases("Statement") .build("argument") .field("argument", def("Expression")); def("TryStatement") .bases("Statement") .build("block", "handler", "finalizer") .field("block", def("BlockStatement")) .field("handler", or(def("CatchClause"), null), function (this: N.TryStatement) { return this.handlers && this.handlers[0] || null; }) .field("handlers", [def("CatchClause")], function (this: N.TryStatement) { return this.handler ? [this.handler] : []; }, true) // Indicates this field is hidden from eachField iteration. .field("guardedHandlers", [def("CatchClause")], defaults.emptyArray) .field("finalizer", or(def("BlockStatement"), null), defaults["null"]); def("CatchClause") .bases("Node") .build("param", "guard", "body") .field("param", def("Pattern")) .field("guard", or(def("Expression"), null), defaults["null"]) .field("body", def("BlockStatement")); def("WhileStatement") .bases("Statement") .build("test", "body") .field("test", def("Expression")) .field("body", def("Statement")); def("DoWhileStatement") .bases("Statement") .build("body", "test") .field("body", def("Statement")) .field("test", def("Expression")); def("ForStatement") .bases("Statement") .build("init", "test", "update", "body") .field("init", or( def("VariableDeclaration"), def("Expression"), null)) .field("test", or(def("Expression"), null)) .field("update", or(def("Expression"), null)) .field("body", def("Statement")); def("ForInStatement") .bases("Statement") .build("left", "right", "body") .field("left", or( def("VariableDeclaration"), def("Expression"))) .field("right", def("Expression")) .field("body", def("Statement")); def("DebuggerStatement").bases("Statement").build(); def("Declaration").bases("Statement"); def("FunctionDeclaration") .bases("Function", "Declaration") .build("id", "params", "body") .field("id", def("Identifier")); def("FunctionExpression") .bases("Function", "Expression") .build("id", "params", "body"); def("VariableDeclaration") .bases("Declaration") .build("kind", "declarations") .field("kind", or("var", "let", "const")) .field("declarations", [def("VariableDeclarator")]); def("VariableDeclarator") .bases("Node") .build("id", "init") .field("id", def("Pattern")) .field("init", or(def("Expression"), null), defaults["null"]); def("Expression").bases("Node"); def("ThisExpression").bases("Expression").build(); def("ArrayExpression") .bases("Expression") .build("elements") .field("elements", [or(def("Expression"), null)]); def("ObjectExpression") .bases("Expression") .build("properties") .field("properties", [def("Property")]); // TODO Not in the Mozilla Parser API, but used by Esprima. def("Property") .bases("Node") // Want to be able to visit Property Nodes. .build("kind", "key", "value") .field("kind", or("init", "get", "set")) .field("key", or(def("Literal"), def("Identifier"))) .field("value", def("Expression")); def("SequenceExpression") .bases("Expression") .build("expressions") .field("expressions", [def("Expression")]); var UnaryOperator = or( "-", "+", "!", "~", "typeof", "void", "delete"); def("UnaryExpression") .bases("Expression") .build("operator", "argument", "prefix") .field("operator", UnaryOperator) .field("argument", def("Expression")) // Esprima doesn't bother with this field, presumably because it's // always true for unary operators. .field("prefix", Boolean, defaults["true"]); const BinaryOperator = or(...BinaryOperators); def("BinaryExpression") .bases("Expression") .build("operator", "left", "right") .field("operator", BinaryOperator) .field("left", def("Expression")) .field("right", def("Expression")); const AssignmentOperator = or(...AssignmentOperators); def("AssignmentExpression") .bases("Expression") .build("operator", "left", "right") .field("operator", AssignmentOperator) .field("left", or(def("Pattern"), def("MemberExpression"))) .field("right", def("Expression")); var UpdateOperator = or("++", "--"); def("UpdateExpression") .bases("Expression") .build("operator", "argument", "prefix") .field("operator", UpdateOperator) .field("argument", def("Expression")) .field("prefix", Boolean); var LogicalOperator = or(...LogicalOperators); def("LogicalExpression") .bases("Expression") .build("operator", "left", "right") .field("operator", LogicalOperator) .field("left", def("Expression")) .field("right", def("Expression")); def("ConditionalExpression") .bases("Expression") .build("test", "consequent", "alternate") .field("test", def("Expression")) .field("consequent", def("Expression")) .field("alternate", def("Expression")); def("NewExpression") .bases("Expression") .build("callee", "arguments") .field("callee", def("Expression")) // The Mozilla Parser API gives this type as [or(def("Expression"), // null)], but null values don't really make sense at the call site. // TODO Report this nonsense. .field("arguments", [def("Expression")]); def("CallExpression") .bases("Expression") .build("callee", "arguments") .field("callee", def("Expression")) // See comment for NewExpression above. .field("arguments", [def("Expression")]); def("MemberExpression") .bases("Expression") .build("object", "property", "computed") .field("object", def("Expression")) .field("property", or(def("Identifier"), def("Expression"))) .field("computed", Boolean, function (this: N.MemberExpression) { var type = this.property.type; if (type === 'Literal' || type === 'MemberExpression' || type === 'BinaryExpression') { return true; } return false; }); def("Pattern").bases("Node"); def("SwitchCase") .bases("Node") .build("test", "consequent") .field("test", or(def("Expression"), null)) .field("consequent", [def("Statement")]); def("Identifier") .bases("Expression", "Pattern") .build("name") .field("name", String) .field("optional", Boolean, defaults["false"]); def("Literal") .bases("Expression") .build("value") .field("value", or(String, Boolean, null, Number, RegExp, BigInt)); // Abstract (non-buildable) comment supertype. Not a Node. def("Comment") .bases("Printable") .field("value", String) // A .leading comment comes before the node, whereas a .trailing // comment comes after it. These two fields should not both be true, // but they might both be false when the comment falls inside a node // and the node has no children for the comment to lead or trail, // e.g. { /*dangling*/ }. .field("leading", Boolean, defaults["true"]) .field("trailing", Boolean, defaults["false"]); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es-proposals.ts000066400000000000000000000045761434620737500201030ustar00rootroot00000000000000import { Fork } from "../types"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; import es2022Def from "./es2022"; export default function (fork: Fork) { fork.use(es2022Def); const types = fork.use(typesPlugin); const Type = types.Type; const def = types.Type.def; const or = Type.or; const shared = fork.use(sharedPlugin); const defaults = shared.defaults; def("AwaitExpression") .build("argument", "all") .field("argument", or(def("Expression"), null)) .field("all", Boolean, defaults["false"]); // Decorators def("Decorator") .bases("Node") .build("expression") .field("expression", def("Expression")); def("Property") .field("decorators", or([def("Decorator")], null), defaults["null"]); def("MethodDefinition") .field("decorators", or([def("Decorator")], null), defaults["null"]); // Private names def("PrivateName") .bases("Expression", "Pattern") .build("id") .field("id", def("Identifier")); def("ClassPrivateProperty") .bases("ClassProperty") .build("key", "value") .field("key", def("PrivateName")) .field("value", or(def("Expression"), null), defaults["null"]); // https://github.com/tc39/proposal-import-assertions def("ImportAttribute") .bases("Node") .build("key", "value") .field("key", or(def("Identifier"), def("Literal"))) .field("value", def("Expression")); [ "ImportDeclaration", "ExportAllDeclaration", "ExportNamedDeclaration", ].forEach(decl => { def(decl).field( "assertions", [def("ImportAttribute")], defaults.emptyArray, ); }); // https://github.com/tc39/proposal-record-tuple // https://github.com/babel/babel/pull/10865 def("RecordExpression") .bases("Expression") .build("properties") .field("properties", [or( def("ObjectProperty"), def("ObjectMethod"), def("SpreadElement"), )]); def("TupleExpression") .bases("Expression") .build("elements") .field("elements", [or( def("Expression"), def("SpreadElement"), null, )]); // https://github.com/tc39/proposal-js-module-blocks // https://github.com/babel/babel/pull/12469 def("ModuleExpression") .bases("Node") .build("body") .field("body", def("Program")); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2016.ts000066400000000000000000000007461434620737500163670ustar00rootroot00000000000000import { Fork } from "../types"; import es2016OpsDef from "./operators/es2016"; import es6Def from "./es6"; import { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { // The es2016OpsDef plugin comes before es6Def so BinaryOperators and // AssignmentOperators will be appropriately augmented before they are first // used in the core definitions for this fork. fork.use(es2016OpsDef); fork.use(es6Def); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2017.ts000066400000000000000000000011031434620737500163540ustar00rootroot00000000000000import { Fork } from "../types"; import es2016Def from "./es2016"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(es2016Def); const types = fork.use(typesPlugin); const def = types.Type.def; const defaults = fork.use(sharedPlugin).defaults; def("Function") .field("async", Boolean, defaults["false"]); def("AwaitExpression") .bases("Expression") .build("argument") .field("argument", def("Expression")); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2018.ts000066400000000000000000000021651434620737500163660ustar00rootroot00000000000000import { Fork } from "../types"; import es2017Def from "./es2017"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(es2017Def); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const defaults = fork.use(sharedPlugin).defaults; def("ForOfStatement") .field("await", Boolean, defaults["false"]); // Legacy def("SpreadProperty") .bases("Node") .build("argument") .field("argument", def("Expression")); def("ObjectExpression") .field("properties", [or( def("Property"), def("SpreadProperty"), // Legacy def("SpreadElement") )]); def("TemplateElement") .field("value", {"cooked": or(String, null), "raw": String}); // Legacy def("SpreadPropertyPattern") .bases("Pattern") .build("argument") .field("argument", def("Pattern")); def("ObjectPattern") .field("properties", [or(def("PropertyPattern"), def("Property"), def("RestElement"), def("SpreadPropertyPattern"))]); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2019.ts000066400000000000000000000007751434620737500163740ustar00rootroot00000000000000import { Fork } from "../types"; import es2018Def from "./es2018"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(es2018Def); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const defaults = fork.use(sharedPlugin).defaults; def("CatchClause") .field("param", or(def("Pattern"), null), defaults["null"]); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2020.ts000066400000000000000000000033761434620737500163640ustar00rootroot00000000000000import { Fork } from "../types"; import es2020OpsDef from "./operators/es2020"; import es2019Def from "./es2019"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { // The es2020OpsDef plugin comes before es2019Def so LogicalOperators will be // appropriately augmented before first used. fork.use(es2020OpsDef); fork.use(es2019Def); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const shared = fork.use(sharedPlugin); const defaults = shared.defaults; def("ImportExpression") .bases("Expression") .build("source") .field("source", def("Expression")); def("ExportAllDeclaration") .bases("Declaration") .build("source", "exported") .field("source", def("Literal")) .field("exported", or( def("Identifier"), null, void 0, ), defaults["null"]); // Optional chaining def("ChainElement") .bases("Node") .field("optional", Boolean, defaults["false"]); def("CallExpression") .bases("Expression", "ChainElement"); def("MemberExpression") .bases("Expression", "ChainElement"); def("ChainExpression") .bases("Expression") .build("expression") .field("expression", def("ChainElement")); def("OptionalCallExpression") .bases("CallExpression") .build("callee", "arguments", "optional") .field("optional", Boolean, defaults["true"]); // Deprecated optional chaining type, doesn't work with babelParser@7.11.0 or newer def("OptionalMemberExpression") .bases("MemberExpression") .build("object", "property", "computed", "optional") .field("optional", Boolean, defaults["true"]); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2021.ts000066400000000000000000000006511434620737500163560ustar00rootroot00000000000000import { Fork } from "../types"; import es2021OpsDef from "./operators/es2021"; import es2020Def from "./es2020"; import { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { // The es2021OpsDef plugin comes before es2020Def so AssignmentOperators will // be appropriately augmented before first used. fork.use(es2021OpsDef); fork.use(es2020Def); } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es2022.ts000066400000000000000000000006621434620737500163610ustar00rootroot00000000000000import { Fork } from "../types"; import es2021Def from "./es2021"; import typesPlugin from "../types"; import { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(es2021Def); const types = fork.use(typesPlugin); const def = types.Type.def; def("StaticBlock") .bases("Declaration") .build("body") .field("body", [def("Statement")]); } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/es6.ts000066400000000000000000000232471434620737500161450ustar00rootroot00000000000000import { Fork } from "../types"; import coreDef from "./core"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(coreDef); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const defaults = fork.use(sharedPlugin).defaults; def("Function") .field("generator", Boolean, defaults["false"]) .field("expression", Boolean, defaults["false"]) .field("defaults", [or(def("Expression"), null)], defaults.emptyArray) // Legacy .field("rest", or(def("Identifier"), null), defaults["null"]); // The ESTree way of representing a ...rest parameter. def("RestElement") .bases("Pattern") .build("argument") .field("argument", def("Pattern")) .field("typeAnnotation", // for Babylon. Flow parser puts it on the identifier or(def("TypeAnnotation"), def("TSTypeAnnotation"), null), defaults["null"]); def("SpreadElementPattern") .bases("Pattern") .build("argument") .field("argument", def("Pattern")); def("FunctionDeclaration") .build("id", "params", "body", "generator", "expression") // May be `null` in the context of `export default function () {}` .field("id", or(def("Identifier"), null)) def("FunctionExpression") .build("id", "params", "body", "generator", "expression"); def("ArrowFunctionExpression") .bases("Function", "Expression") .build("params", "body", "expression") // The forced null value here is compatible with the overridden // definition of the "id" field in the Function interface. .field("id", null, defaults["null"]) // Arrow function bodies are allowed to be expressions. .field("body", or(def("BlockStatement"), def("Expression"))) // The current spec forbids arrow generators, so I have taken the // liberty of enforcing that. TODO Report this. .field("generator", false, defaults["false"]); def("ForOfStatement") .bases("Statement") .build("left", "right", "body") .field("left", or( def("VariableDeclaration"), def("Pattern"))) .field("right", def("Expression")) .field("body", def("Statement")); def("YieldExpression") .bases("Expression") .build("argument", "delegate") .field("argument", or(def("Expression"), null)) .field("delegate", Boolean, defaults["false"]); def("GeneratorExpression") .bases("Expression") .build("body", "blocks", "filter") .field("body", def("Expression")) .field("blocks", [def("ComprehensionBlock")]) .field("filter", or(def("Expression"), null)); def("ComprehensionExpression") .bases("Expression") .build("body", "blocks", "filter") .field("body", def("Expression")) .field("blocks", [def("ComprehensionBlock")]) .field("filter", or(def("Expression"), null)); def("ComprehensionBlock") .bases("Node") .build("left", "right", "each") .field("left", def("Pattern")) .field("right", def("Expression")) .field("each", Boolean); def("Property") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("value", or(def("Expression"), def("Pattern"))) .field("method", Boolean, defaults["false"]) .field("shorthand", Boolean, defaults["false"]) .field("computed", Boolean, defaults["false"]); def("ObjectProperty") .field("shorthand", Boolean, defaults["false"]); def("PropertyPattern") .bases("Pattern") .build("key", "pattern") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("pattern", def("Pattern")) .field("computed", Boolean, defaults["false"]); def("ObjectPattern") .bases("Pattern") .build("properties") .field("properties", [or(def("PropertyPattern"), def("Property"))]); def("ArrayPattern") .bases("Pattern") .build("elements") .field("elements", [or(def("Pattern"), null)]); def("SpreadElement") .bases("Node") .build("argument") .field("argument", def("Expression")); def("ArrayExpression") .field("elements", [or( def("Expression"), def("SpreadElement"), def("RestElement"), null )]); def("NewExpression") .field("arguments", [or(def("Expression"), def("SpreadElement"))]); def("CallExpression") .field("arguments", [or(def("Expression"), def("SpreadElement"))]); // Note: this node type is *not* an AssignmentExpression with a Pattern on // the left-hand side! The existing AssignmentExpression type already // supports destructuring assignments. AssignmentPattern nodes may appear // wherever a Pattern is allowed, and the right-hand side represents a // default value to be destructured against the left-hand side, if no // value is otherwise provided. For example: default parameter values. def("AssignmentPattern") .bases("Pattern") .build("left", "right") .field("left", def("Pattern")) .field("right", def("Expression")); def("MethodDefinition") .bases("Declaration") .build("kind", "key", "value", "static") .field("kind", or("constructor", "method", "get", "set")) .field("key", def("Expression")) .field("value", def("Function")) .field("computed", Boolean, defaults["false"]) .field("static", Boolean, defaults["false"]); const ClassBodyElement = or( def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("StaticBlock"), ); def("ClassProperty") .bases("Declaration") .build("key") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("computed", Boolean, defaults["false"]); def("ClassPropertyDefinition") // static property .bases("Declaration") .build("definition") // Yes, Virginia, circular definitions are permitted. .field("definition", ClassBodyElement); def("ClassBody") .bases("Declaration") .build("body") .field("body", [ClassBodyElement]); def("ClassDeclaration") .bases("Declaration") .build("id", "body", "superClass") .field("id", or(def("Identifier"), null)) .field("body", def("ClassBody")) .field("superClass", or(def("Expression"), null), defaults["null"]); def("ClassExpression") .bases("Expression") .build("id", "body", "superClass") .field("id", or(def("Identifier"), null), defaults["null"]) .field("body", def("ClassBody")) .field("superClass", or(def("Expression"), null), defaults["null"]); def("Super") .bases("Expression") .build(); // Specifier and ModuleSpecifier are abstract non-standard types // introduced for definitional convenience. def("Specifier").bases("Node"); // This supertype is shared/abused by both def/babel.js and // def/esprima.js. In the future, it will be possible to load only one set // of definitions appropriate for a given parser, but until then we must // rely on default functions to reconcile the conflicting AST formats. def("ModuleSpecifier") .bases("Specifier") // This local field is used by Babel/Acorn. It should not technically // be optional in the Babel/Acorn AST format, but it must be optional // in the Esprima AST format. .field("local", or(def("Identifier"), null), defaults["null"]) // The id and name fields are used by Esprima. The id field should not // technically be optional in the Esprima AST format, but it must be // optional in the Babel/Acorn AST format. .field("id", or(def("Identifier"), null), defaults["null"]) .field("name", or(def("Identifier"), null), defaults["null"]); // import {} from ...; def("ImportSpecifier") .bases("ModuleSpecifier") .build("imported", "local") .field("imported", def("Identifier")); // import from ...; def("ImportDefaultSpecifier") .bases("ModuleSpecifier") .build("local"); // import <* as id> from ...; def("ImportNamespaceSpecifier") .bases("ModuleSpecifier") .build("local"); def("ImportDeclaration") .bases("Declaration") .build("specifiers", "source", "importKind") .field("specifiers", [or( def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier") )], defaults.emptyArray) .field("source", def("Literal")) .field("importKind", or( "value", "type" ), function() { return "value"; }); def("ExportNamedDeclaration") .bases("Declaration") .build("declaration", "specifiers", "source") .field("declaration", or(def("Declaration"), null)) .field("specifiers", [def("ExportSpecifier")], defaults.emptyArray) .field("source", or(def("Literal"), null), defaults["null"]); def("ExportSpecifier") .bases("ModuleSpecifier") .build("local", "exported") .field("exported", def("Identifier")); def("ExportDefaultDeclaration") .bases("Declaration") .build("declaration") .field("declaration", or(def("Declaration"), def("Expression"))); def("ExportAllDeclaration") .bases("Declaration") .build("source") .field("source", def("Literal")); def("TaggedTemplateExpression") .bases("Expression") .build("tag", "quasi") .field("tag", def("Expression")) .field("quasi", def("TemplateLiteral")); def("TemplateLiteral") .bases("Expression") .build("quasis", "expressions") .field("quasis", [def("TemplateElement")]) .field("expressions", [def("Expression")]); def("TemplateElement") .bases("Node") .build("value", "tail") .field("value", {"cooked": String, "raw": String}) .field("tail", Boolean); def("MetaProperty") .bases("Expression") .build("meta", "property") .field("meta", def("Identifier")) .field("property", def("Identifier")); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/esprima.ts000066400000000000000000000036651434620737500171120ustar00rootroot00000000000000import { Fork } from "../types"; import esProposalsDef from "./es-proposals"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(esProposalsDef); var types = fork.use(typesPlugin); var defaults = fork.use(sharedPlugin).defaults; var def = types.Type.def; var or = types.Type.or; def("VariableDeclaration") .field("declarations", [or( def("VariableDeclarator"), def("Identifier") // Esprima deviation. )]); def("Property") .field("value", or( def("Expression"), def("Pattern") // Esprima deviation. )); def("ArrayPattern") .field("elements", [or( def("Pattern"), def("SpreadElement"), null )]); def("ObjectPattern") .field("properties", [or( def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty") // Used by Esprima. )]); // Like ModuleSpecifier, except type:"ExportSpecifier" and buildable. // export {} [from ...]; def("ExportSpecifier") .bases("ModuleSpecifier") .build("id", "name"); // export <*> from ...; def("ExportBatchSpecifier") .bases("Specifier") .build(); def("ExportDeclaration") .bases("Declaration") .build("default", "declaration", "specifiers", "source") .field("default", Boolean) .field("declaration", or( def("Declaration"), def("Expression"), // Implies default. null )) .field("specifiers", [or( def("ExportSpecifier"), def("ExportBatchSpecifier") )], defaults.emptyArray) .field("source", or( def("Literal"), null ), defaults["null"]); def("Block") .bases("Comment") .build("value", /*optional:*/ "leading", "trailing"); def("Line") .bases("Comment") .build("value", /*optional:*/ "leading", "trailing"); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/flow.ts000066400000000000000000000314441434620737500164150ustar00rootroot00000000000000import { Fork } from "../types"; import esProposalsDef from "./es-proposals"; import typeAnnotationsDef from "./type-annotations"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { fork.use(esProposalsDef); fork.use(typeAnnotationsDef); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const defaults = fork.use(sharedPlugin).defaults; // Base types def("Flow").bases("Node"); def("FlowType").bases("Flow"); // Type annotations def("AnyTypeAnnotation") .bases("FlowType") .build(); def("EmptyTypeAnnotation") .bases("FlowType") .build(); def("MixedTypeAnnotation") .bases("FlowType") .build(); def("VoidTypeAnnotation") .bases("FlowType") .build(); def("SymbolTypeAnnotation") .bases("FlowType") .build(); def("NumberTypeAnnotation") .bases("FlowType") .build(); def("BigIntTypeAnnotation") .bases("FlowType") .build(); def("NumberLiteralTypeAnnotation") .bases("FlowType") .build("value", "raw") .field("value", Number) .field("raw", String); // Babylon 6 differs in AST from Flow // same as NumberLiteralTypeAnnotation def("NumericLiteralTypeAnnotation") .bases("FlowType") .build("value", "raw") .field("value", Number) .field("raw", String); def("BigIntLiteralTypeAnnotation") .bases("FlowType") .build("value", "raw") .field("value", null) .field("raw", String); def("StringTypeAnnotation") .bases("FlowType") .build(); def("StringLiteralTypeAnnotation") .bases("FlowType") .build("value", "raw") .field("value", String) .field("raw", String); def("BooleanTypeAnnotation") .bases("FlowType") .build(); def("BooleanLiteralTypeAnnotation") .bases("FlowType") .build("value", "raw") .field("value", Boolean) .field("raw", String); def("TypeAnnotation") .bases("Node") .build("typeAnnotation") .field("typeAnnotation", def("FlowType")); def("NullableTypeAnnotation") .bases("FlowType") .build("typeAnnotation") .field("typeAnnotation", def("FlowType")); def("NullLiteralTypeAnnotation") .bases("FlowType") .build(); def("NullTypeAnnotation") .bases("FlowType") .build(); def("ThisTypeAnnotation") .bases("FlowType") .build(); def("ExistsTypeAnnotation") .bases("FlowType") .build(); def("ExistentialTypeParam") .bases("FlowType") .build(); def("FunctionTypeAnnotation") .bases("FlowType") .build("params", "returnType", "rest", "typeParameters") .field("params", [def("FunctionTypeParam")]) .field("returnType", def("FlowType")) .field("rest", or(def("FunctionTypeParam"), null)) .field("typeParameters", or(def("TypeParameterDeclaration"), null)); def("FunctionTypeParam") .bases("Node") .build("name", "typeAnnotation", "optional") .field("name", or(def("Identifier"), null)) .field("typeAnnotation", def("FlowType")) .field("optional", Boolean); def("ArrayTypeAnnotation") .bases("FlowType") .build("elementType") .field("elementType", def("FlowType")); def("ObjectTypeAnnotation") .bases("FlowType") .build("properties", "indexers", "callProperties") .field("properties", [ or(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty")) ]) .field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray) .field("callProperties", [def("ObjectTypeCallProperty")], defaults.emptyArray) .field("inexact", or(Boolean, void 0), defaults["undefined"]) .field("exact", Boolean, defaults["false"]) .field("internalSlots", [def("ObjectTypeInternalSlot")], defaults.emptyArray); def("Variance") .bases("Node") .build("kind") .field("kind", or("plus", "minus")); const LegacyVariance = or( def("Variance"), "plus", "minus", null ); def("ObjectTypeProperty") .bases("Node") .build("key", "value", "optional") .field("key", or(def("Literal"), def("Identifier"))) .field("value", def("FlowType")) .field("optional", Boolean) .field("variance", LegacyVariance, defaults["null"]); def("ObjectTypeIndexer") .bases("Node") .build("id", "key", "value") .field("id", def("Identifier")) .field("key", def("FlowType")) .field("value", def("FlowType")) .field("variance", LegacyVariance, defaults["null"]) .field("static", Boolean, defaults["false"]); def("ObjectTypeCallProperty") .bases("Node") .build("value") .field("value", def("FunctionTypeAnnotation")) .field("static", Boolean, defaults["false"]); def("QualifiedTypeIdentifier") .bases("Node") .build("qualification", "id") .field("qualification", or(def("Identifier"), def("QualifiedTypeIdentifier"))) .field("id", def("Identifier")); def("GenericTypeAnnotation") .bases("FlowType") .build("id", "typeParameters") .field("id", or(def("Identifier"), def("QualifiedTypeIdentifier"))) .field("typeParameters", or(def("TypeParameterInstantiation"), null)); def("MemberTypeAnnotation") .bases("FlowType") .build("object", "property") .field("object", def("Identifier")) .field("property", or(def("MemberTypeAnnotation"), def("GenericTypeAnnotation"))); def("IndexedAccessType") .bases("FlowType") .build("objectType", "indexType") .field("objectType", def("FlowType")) .field("indexType", def("FlowType")); def("OptionalIndexedAccessType") .bases("FlowType") .build("objectType", "indexType", "optional") .field("objectType", def("FlowType")) .field("indexType", def("FlowType")) .field('optional', Boolean); def("UnionTypeAnnotation") .bases("FlowType") .build("types") .field("types", [def("FlowType")]); def("IntersectionTypeAnnotation") .bases("FlowType") .build("types") .field("types", [def("FlowType")]); def("TypeofTypeAnnotation") .bases("FlowType") .build("argument") .field("argument", def("FlowType")); def("ObjectTypeSpreadProperty") .bases("Node") .build("argument") .field("argument", def("FlowType")); def("ObjectTypeInternalSlot") .bases("Node") .build("id", "value", "optional", "static", "method") .field("id", def("Identifier")) .field("value", def("FlowType")) .field("optional", Boolean) .field("static", Boolean) .field("method", Boolean); def("TypeParameterDeclaration") .bases("Node") .build("params") .field("params", [def("TypeParameter")]); def("TypeParameterInstantiation") .bases("Node") .build("params") .field("params", [def("FlowType")]); def("TypeParameter") .bases("FlowType") .build("name", "variance", "bound", "default") .field("name", String) .field("variance", LegacyVariance, defaults["null"]) .field("bound", or(def("TypeAnnotation"), null), defaults["null"]) .field("default", or(def("FlowType"), null), defaults["null"]); def("ClassProperty") .field("variance", LegacyVariance, defaults["null"]); def("ClassImplements") .bases("Node") .build("id") .field("id", def("Identifier")) .field("superClass", or(def("Expression"), null), defaults["null"]) .field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); def("InterfaceTypeAnnotation") .bases("FlowType") .build("body", "extends") .field("body", def("ObjectTypeAnnotation")) .field("extends", or([def("InterfaceExtends")], null), defaults["null"]); def("InterfaceDeclaration") .bases("Declaration") .build("id", "body", "extends") .field("id", def("Identifier")) .field("typeParameters", or(def("TypeParameterDeclaration"), null), defaults["null"]) .field("body", def("ObjectTypeAnnotation")) .field("extends", [def("InterfaceExtends")]); def("DeclareInterface") .bases("InterfaceDeclaration") .build("id", "body", "extends"); def("InterfaceExtends") .bases("Node") .build("id") .field("id", def("Identifier")) .field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); def("TypeAlias") .bases("Declaration") .build("id", "typeParameters", "right") .field("id", def("Identifier")) .field("typeParameters", or(def("TypeParameterDeclaration"), null)) .field("right", def("FlowType")); def("DeclareTypeAlias") .bases("TypeAlias") .build("id", "typeParameters", "right"); def("OpaqueType") .bases("Declaration") .build("id", "typeParameters", "impltype", "supertype") .field("id", def("Identifier")) .field("typeParameters", or(def("TypeParameterDeclaration"), null)) .field("impltype", def("FlowType")) .field("supertype", or(def("FlowType"), null)); def("DeclareOpaqueType") .bases("OpaqueType") .build("id", "typeParameters", "supertype") .field("impltype", or(def("FlowType"), null)); def("TypeCastExpression") .bases("Expression") .build("expression", "typeAnnotation") .field("expression", def("Expression")) .field("typeAnnotation", def("TypeAnnotation")); def("TupleTypeAnnotation") .bases("FlowType") .build("types") .field("types", [def("FlowType")]); def("DeclareVariable") .bases("Statement") .build("id") .field("id", def("Identifier")); def("DeclareFunction") .bases("Statement") .build("id") .field("id", def("Identifier")) .field("predicate", or(def("FlowPredicate"), null), defaults["null"]); def("DeclareClass") .bases("InterfaceDeclaration") .build("id"); def("DeclareModule") .bases("Statement") .build("id", "body") .field("id", or(def("Identifier"), def("Literal"))) .field("body", def("BlockStatement")); def("DeclareModuleExports") .bases("Statement") .build("typeAnnotation") .field("typeAnnotation", def("TypeAnnotation")); def("DeclareExportDeclaration") .bases("Declaration") .build("default", "declaration", "specifiers", "source") .field("default", Boolean) .field("declaration", or( def("DeclareVariable"), def("DeclareFunction"), def("DeclareClass"), def("FlowType"), // Implies default. def("TypeAlias"), // Implies named type def("DeclareOpaqueType"), // Implies named opaque type def("InterfaceDeclaration"), null )) .field("specifiers", [or( def("ExportSpecifier"), def("ExportBatchSpecifier") )], defaults.emptyArray) .field("source", or( def("Literal"), null ), defaults["null"]); def("DeclareExportAllDeclaration") .bases("Declaration") .build("source") .field("source", or( def("Literal"), null ), defaults["null"]); def("ImportDeclaration") .field("importKind", or("value", "type", "typeof"), () => "value"); def("FlowPredicate").bases("Flow"); def("InferredPredicate") .bases("FlowPredicate") .build(); def("DeclaredPredicate") .bases("FlowPredicate") .build("value") .field("value", def("Expression")); def("Function") .field("predicate", or(def("FlowPredicate"), null), defaults["null"]); def("CallExpression") .field("typeArguments", or( null, def("TypeParameterInstantiation"), ), defaults["null"]); def("NewExpression") .field("typeArguments", or( null, def("TypeParameterInstantiation"), ), defaults["null"]); // Enums def("EnumDeclaration") .bases("Declaration") .build("id", "body") .field("id", def("Identifier")) .field("body", or( def("EnumBooleanBody"), def("EnumNumberBody"), def("EnumStringBody"), def("EnumSymbolBody"))); def("EnumBooleanBody") .build("members", "explicitType") .field("members", [def("EnumBooleanMember")]) .field("explicitType", Boolean); def("EnumNumberBody") .build("members", "explicitType") .field("members", [def("EnumNumberMember")]) .field("explicitType", Boolean); def("EnumStringBody") .build("members", "explicitType") .field("members", or([def("EnumStringMember")], [def("EnumDefaultedMember")])) .field("explicitType", Boolean); def("EnumSymbolBody") .build("members") .field("members", [def("EnumDefaultedMember")]); def("EnumBooleanMember") .build("id", "init") .field("id", def("Identifier")) .field("init", or(def("Literal"), Boolean)); def("EnumNumberMember") .build("id", "init") .field("id", def("Identifier")) .field("init", def("Literal")); def("EnumStringMember") .build("id", "init") .field("id", def("Identifier")) .field("init", def("Literal")); def("EnumDefaultedMember") .build("id") .field("id", def("Identifier")); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/jsx.ts000066400000000000000000000103251434620737500162450ustar00rootroot00000000000000import { Fork } from "../types"; import esProposalsDef from "./es-proposals"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; import { namedTypes as N } from "../gen/namedTypes"; export default function (fork: Fork) { fork.use(esProposalsDef); const types = fork.use(typesPlugin); const def = types.Type.def; const or = types.Type.or; const defaults = fork.use(sharedPlugin).defaults; def("JSXAttribute") .bases("Node") .build("name", "value") .field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))) .field("value", or( def("Literal"), // attr="value" def("JSXExpressionContainer"), // attr={value} def("JSXElement"), // attr=
def("JSXFragment"), // attr=<> null // attr= or just attr ), defaults["null"]); def("JSXIdentifier") .bases("Identifier") .build("name") .field("name", String); def("JSXNamespacedName") .bases("Node") .build("namespace", "name") .field("namespace", def("JSXIdentifier")) .field("name", def("JSXIdentifier")); def("JSXMemberExpression") .bases("MemberExpression") .build("object", "property") .field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))) .field("property", def("JSXIdentifier")) .field("computed", Boolean, defaults.false); const JSXElementName = or( def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression") ); def("JSXSpreadAttribute") .bases("Node") .build("argument") .field("argument", def("Expression")); const JSXAttributes = [or( def("JSXAttribute"), def("JSXSpreadAttribute") )]; def("JSXExpressionContainer") .bases("Expression") .build("expression") .field("expression", or(def("Expression"), def("JSXEmptyExpression"))); const JSXChildren = [or( def("JSXText"), def("JSXExpressionContainer"), def("JSXSpreadChild"), def("JSXElement"), def("JSXFragment"), def("Literal") // Legacy: Esprima should return JSXText instead. )]; def("JSXElement") .bases("Expression") .build("openingElement", "closingElement", "children") .field("openingElement", def("JSXOpeningElement")) .field("closingElement", or(def("JSXClosingElement"), null), defaults["null"]) .field("children", JSXChildren, defaults.emptyArray) .field("name", JSXElementName, function (this: N.JSXElement) { // Little-known fact: the `this` object inside a default function // is none other than the partially-built object itself, and any // fields initialized directly from builder function arguments // (like openingElement, closingElement, and children) are // guaranteed to be available. return this.openingElement.name; }, true) // hidden from traversal .field("selfClosing", Boolean, function (this: N.JSXElement) { return this.openingElement.selfClosing; }, true) // hidden from traversal .field("attributes", JSXAttributes, function (this: N.JSXElement) { return this.openingElement.attributes; }, true); // hidden from traversal def("JSXOpeningElement") .bases("Node") .build("name", "attributes", "selfClosing") .field("name", JSXElementName) .field("attributes", JSXAttributes, defaults.emptyArray) .field("selfClosing", Boolean, defaults["false"]); def("JSXClosingElement") .bases("Node") .build("name") .field("name", JSXElementName); def("JSXFragment") .bases("Expression") .build("openingFragment", "closingFragment", "children") .field("openingFragment", def("JSXOpeningFragment")) .field("closingFragment", def("JSXClosingFragment")) .field("children", JSXChildren, defaults.emptyArray); def("JSXOpeningFragment") .bases("Node") .build(); def("JSXClosingFragment") .bases("Node") .build(); def("JSXText") .bases("Literal") .build("value", "raw") .field("value", String) .field("raw", String, function (this: N.JSXText) { return this.value; }); def("JSXEmptyExpression") .bases("Node") .build(); def("JSXSpreadChild") .bases("Node") .build("expression") .field("expression", def("Expression")); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/operators/000077500000000000000000000000001434620737500171065ustar00rootroot00000000000000ast-types-0.16.1/src/def/operators/core.ts000066400000000000000000000010051434620737500204020ustar00rootroot00000000000000import { maybeSetModuleExports } from "../../shared"; export default function () { return { BinaryOperators: [ "==", "!=", "===", "!==", "<", "<=", ">", ">=", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "&", "|", "^", "in", "instanceof", ], AssignmentOperators: [ "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=", ], LogicalOperators: [ "||", "&&", ], }; } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/operators/es2016.ts000066400000000000000000000011761434620737500204030ustar00rootroot00000000000000import { maybeSetModuleExports } from "../../shared"; import coreOpsDef from "./core"; export default function (fork: import("../../types").Fork) { const result = fork.use(coreOpsDef); // Exponentiation operators. Must run before BinaryOperators or // AssignmentOperators are used (hence before fork.use(es6Def)). // https://github.com/tc39/proposal-exponentiation-operator if (result.BinaryOperators.indexOf("**") < 0) { result.BinaryOperators.push("**"); } if (result.AssignmentOperators.indexOf("**=") < 0) { result.AssignmentOperators.push("**="); } return result; } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/operators/es2020.ts000066400000000000000000000007301434620737500203710ustar00rootroot00000000000000import { maybeSetModuleExports } from "../../shared"; import es2016OpsDef from "./es2016"; export default function (fork: import("../../types").Fork) { const result = fork.use(es2016OpsDef); // Nullish coalescing. Must run before LogicalOperators is used. // https://github.com/tc39/proposal-nullish-coalescing if (result.LogicalOperators.indexOf("??") < 0) { result.LogicalOperators.push("??"); } return result; } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/operators/es2021.ts000066400000000000000000000011101434620737500203630ustar00rootroot00000000000000import { maybeSetModuleExports } from "../../shared"; import es2020OpsDef from "./es2020"; export default function (fork: import("../../types").Fork) { const result = fork.use(es2020OpsDef); // Logical assignment operators. Must run before AssignmentOperators is used. // https://github.com/tc39/proposal-logical-assignment result.LogicalOperators.forEach(op => { const assignOp = op + "="; if (result.AssignmentOperators.indexOf(assignOp) < 0) { result.AssignmentOperators.push(assignOp); } }); return result; } maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/type-annotations.ts000066400000000000000000000034351434620737500207610ustar00rootroot00000000000000/** * Type annotation defs shared between Flow and TypeScript. * These defs could not be defined in ./flow.ts or ./typescript.ts directly * because they use the same name. */ import { Fork } from "../types"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { var types = fork.use(typesPlugin); var def = types.Type.def; var or = types.Type.or; var defaults = fork.use(sharedPlugin).defaults; var TypeAnnotation = or( def("TypeAnnotation"), def("TSTypeAnnotation"), null ); var TypeParamDecl = or( def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null ); def("Identifier") .field("typeAnnotation", TypeAnnotation, defaults["null"]); def("ObjectPattern") .field("typeAnnotation", TypeAnnotation, defaults["null"]); def("Function") .field("returnType", TypeAnnotation, defaults["null"]) .field("typeParameters", TypeParamDecl, defaults["null"]); def("ClassProperty") .build("key", "value", "typeAnnotation", "static") .field("value", or(def("Expression"), null)) .field("static", Boolean, defaults["false"]) .field("typeAnnotation", TypeAnnotation, defaults["null"]); ["ClassDeclaration", "ClassExpression", ].forEach(typeName => { def(typeName) .field("typeParameters", TypeParamDecl, defaults["null"]) .field("superTypeParameters", or(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults["null"]) .field("implements", or([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults.emptyArray); }); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/def/typescript.ts000066400000000000000000000372141434620737500176550ustar00rootroot00000000000000import { Fork } from "../types"; import babelCoreDef from "./babel-core"; import typeAnnotationsDef from "./type-annotations"; import typesPlugin from "../types"; import sharedPlugin, { maybeSetModuleExports } from "../shared"; export default function (fork: Fork) { // Since TypeScript is parsed by Babylon, include the core Babylon types // but omit the Flow-related types. fork.use(babelCoreDef); fork.use(typeAnnotationsDef); var types = fork.use(typesPlugin); var n = types.namedTypes; var def = types.Type.def; var or = types.Type.or; var defaults = fork.use(sharedPlugin).defaults; var StringLiteral = types.Type.from(function (value: any, deep?: any) { if (n.StringLiteral && n.StringLiteral.check(value, deep)) { return true } if (n.Literal && n.Literal.check(value, deep) && typeof value.value === "string") { return true; } return false; }, "StringLiteral"); def("TSType") .bases("Node"); var TSEntityName = or( def("Identifier"), def("TSQualifiedName") ); def("TSTypeReference") .bases("TSType", "TSHasOptionalTypeParameterInstantiation") .build("typeName", "typeParameters") .field("typeName", TSEntityName); // An abstract (non-buildable) base type that provide a commonly-needed // optional .typeParameters field. def("TSHasOptionalTypeParameterInstantiation") .field("typeParameters", or(def("TSTypeParameterInstantiation"), null), defaults["null"]); // An abstract (non-buildable) base type that provide a commonly-needed // optional .typeParameters field. def("TSHasOptionalTypeParameters") .field("typeParameters", or(def("TSTypeParameterDeclaration"), null, void 0), defaults["null"]); // An abstract (non-buildable) base type that provide a commonly-needed // optional .typeAnnotation field. def("TSHasOptionalTypeAnnotation") .field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]); def("TSQualifiedName") .bases("Node") .build("left", "right") .field("left", TSEntityName) .field("right", TSEntityName); def("TSAsExpression") .bases("Expression", "Pattern") .build("expression", "typeAnnotation") .field("expression", def("Expression")) .field("typeAnnotation", def("TSType")) .field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); def("TSTypeCastExpression") .bases("Expression") .build("expression", "typeAnnotation") .field("expression", def("Expression")) .field("typeAnnotation", def("TSType")); def("TSSatisfiesExpression") .bases("Expression", "Pattern") .build("expression", "typeAnnotation") .field("expression", def("Expression")) .field("typeAnnotation", def("TSType")); def("TSNonNullExpression") .bases("Expression", "Pattern") .build("expression") .field("expression", def("Expression")); [ // Define all the simple keyword types. "TSAnyKeyword", "TSBigIntKeyword", "TSBooleanKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword", "TSIntrinsicKeyword", "TSThisType", ].forEach(keywordType => { def(keywordType) .bases("TSType") .build(); }); def("TSArrayType") .bases("TSType") .build("elementType") .field("elementType", def("TSType")) def("TSLiteralType") .bases("TSType") .build("literal") .field("literal", or( def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression"), def("BigIntLiteral"), )); def("TemplateLiteral") // The TemplateLiteral type appears to be reused for TypeScript template // literal types (instead of introducing a new TSTemplateLiteralType type), // so we allow the templateLiteral.expressions array to be either all // expressions or all TypeScript types. .field("expressions", or( [def("Expression")], [def("TSType")], )); ["TSUnionType", "TSIntersectionType", ].forEach(typeName => { def(typeName) .bases("TSType") .build("types") .field("types", [def("TSType")]); }); def("TSConditionalType") .bases("TSType") .build("checkType", "extendsType", "trueType", "falseType") .field("checkType", def("TSType")) .field("extendsType", def("TSType")) .field("trueType", def("TSType")) .field("falseType", def("TSType")); def("TSInferType") .bases("TSType") .build("typeParameter") .field("typeParameter", def("TSTypeParameter")); def("TSParenthesizedType") .bases("TSType") .build("typeAnnotation") .field("typeAnnotation", def("TSType")); var ParametersType = [or( def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern") )]; ["TSFunctionType", "TSConstructorType", ].forEach(typeName => { def(typeName) .bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation") .build("parameters") .field("parameters", ParametersType); }); def("TSDeclareFunction") .bases("Declaration", "TSHasOptionalTypeParameters") .build("id", "params", "returnType") .field("declare", Boolean, defaults["false"]) .field("async", Boolean, defaults["false"]) .field("generator", Boolean, defaults["false"]) .field("id", or(def("Identifier"), null), defaults["null"]) .field("params", [def("Pattern")]) // tSFunctionTypeAnnotationCommon .field("returnType", or(def("TSTypeAnnotation"), def("Noop"), // Still used? null), defaults["null"]); def("TSDeclareMethod") .bases("Declaration", "TSHasOptionalTypeParameters") .build("key", "params", "returnType") .field("async", Boolean, defaults["false"]) .field("generator", Boolean, defaults["false"]) .field("params", [def("Pattern")]) // classMethodOrPropertyCommon .field("abstract", Boolean, defaults["false"]) .field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]) .field("static", Boolean, defaults["false"]) .field("computed", Boolean, defaults["false"]) .field("optional", Boolean, defaults["false"]) .field("key", or( def("Identifier"), def("StringLiteral"), def("NumericLiteral"), // Only allowed if .computed is true. def("Expression") )) // classMethodOrDeclareMethodCommon .field("kind", or("get", "set", "method", "constructor"), function getDefault() { return "method"; }) .field("access", // Not "accessibility"? or("public", "private", "protected", void 0), defaults["undefined"]) .field("decorators", or([def("Decorator")], null), defaults["null"]) // tSFunctionTypeAnnotationCommon .field("returnType", or(def("TSTypeAnnotation"), def("Noop"), // Still used? null), defaults["null"]); def("TSMappedType") .bases("TSType") .build("typeParameter", "typeAnnotation") .field("readonly", or(Boolean, "+", "-"), defaults["false"]) .field("typeParameter", def("TSTypeParameter")) .field("optional", or(Boolean, "+", "-"), defaults["false"]) .field("typeAnnotation", or(def("TSType"), null), defaults["null"]); def("TSTupleType") .bases("TSType") .build("elementTypes") .field("elementTypes", [or( def("TSType"), def("TSNamedTupleMember") )]); def("TSNamedTupleMember") .bases("TSType") .build("label", "elementType", "optional") .field("label", def("Identifier")) .field("optional", Boolean, defaults["false"]) .field("elementType", def("TSType")); def("TSRestType") .bases("TSType") .build("typeAnnotation") .field("typeAnnotation", def("TSType")); def("TSOptionalType") .bases("TSType") .build("typeAnnotation") .field("typeAnnotation", def("TSType")); def("TSIndexedAccessType") .bases("TSType") .build("objectType", "indexType") .field("objectType", def("TSType")) .field("indexType", def("TSType")) def("TSTypeOperator") .bases("TSType") .build("operator") .field("operator", String) .field("typeAnnotation", def("TSType")); def("TSTypeAnnotation") .bases("Node") .build("typeAnnotation") .field("typeAnnotation", or(def("TSType"), def("TSTypeAnnotation"))); def("TSIndexSignature") .bases("Declaration", "TSHasOptionalTypeAnnotation") .build("parameters", "typeAnnotation") .field("parameters", [def("Identifier")]) // Length === 1 .field("readonly", Boolean, defaults["false"]); def("TSPropertySignature") .bases("Declaration", "TSHasOptionalTypeAnnotation") .build("key", "typeAnnotation", "optional") .field("key", def("Expression")) .field("computed", Boolean, defaults["false"]) .field("readonly", Boolean, defaults["false"]) .field("optional", Boolean, defaults["false"]) .field("initializer", or(def("Expression"), null), defaults["null"]); def("TSMethodSignature") .bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation") .build("key", "parameters", "typeAnnotation") .field("key", def("Expression")) .field("computed", Boolean, defaults["false"]) .field("optional", Boolean, defaults["false"]) .field("parameters", ParametersType); def("TSTypePredicate") .bases("TSTypeAnnotation", "TSType") .build("parameterName", "typeAnnotation", "asserts") .field("parameterName", or(def("Identifier"), def("TSThisType"))) .field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]) .field("asserts", Boolean, defaults["false"]); ["TSCallSignatureDeclaration", "TSConstructSignatureDeclaration", ].forEach(typeName => { def(typeName) .bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation") .build("parameters", "typeAnnotation") .field("parameters", ParametersType); }); def("TSEnumMember") .bases("Node") .build("id", "initializer") .field("id", or(def("Identifier"), StringLiteral)) .field("initializer", or(def("Expression"), null), defaults["null"]); def("TSTypeQuery") .bases("TSType") .build("exprName") .field("exprName", or(TSEntityName, def("TSImportType"))); // Inferred from Babylon's tsParseTypeMember method. var TSTypeMember = or( def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature") ); def("TSTypeLiteral") .bases("TSType") .build("members") .field("members", [TSTypeMember]); def("TSTypeParameter") .bases("Identifier") .build("name", "constraint", "default") .field("name", or(def("Identifier"), String)) .field("constraint", or(def("TSType"), void 0), defaults["undefined"]) .field("default", or(def("TSType"), void 0), defaults["undefined"]); def("TSTypeAssertion") .bases("Expression", "Pattern") .build("typeAnnotation", "expression") .field("typeAnnotation", def("TSType")) .field("expression", def("Expression")) .field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); def("TSTypeParameterDeclaration") .bases("Declaration") .build("params") .field("params", [def("TSTypeParameter")]); def("TSInstantiationExpression") .bases("Expression", "TSHasOptionalTypeParameterInstantiation") .build("expression", "typeParameters") .field("expression", def("Expression")); def("TSTypeParameterInstantiation") .bases("Node") .build("params") .field("params", [def("TSType")]); def("TSEnumDeclaration") .bases("Declaration") .build("id", "members") .field("id", def("Identifier")) .field("const", Boolean, defaults["false"]) .field("declare", Boolean, defaults["false"]) .field("members", [def("TSEnumMember")]) .field("initializer", or(def("Expression"), null), defaults["null"]); def("TSTypeAliasDeclaration") .bases("Declaration", "TSHasOptionalTypeParameters") .build("id", "typeAnnotation") .field("id", def("Identifier")) .field("declare", Boolean, defaults["false"]) .field("typeAnnotation", def("TSType")); def("TSModuleBlock") .bases("Node") .build("body") .field("body", [def("Statement")]); def("TSModuleDeclaration") .bases("Declaration") .build("id", "body") .field("id", or(StringLiteral, TSEntityName)) .field("declare", Boolean, defaults["false"]) .field("global", Boolean, defaults["false"]) .field("body", or(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults["null"]); def("TSImportType") .bases("TSType", "TSHasOptionalTypeParameterInstantiation") .build("argument", "qualifier", "typeParameters") .field("argument", StringLiteral) .field("qualifier", or(TSEntityName, void 0), defaults["undefined"]); def("TSImportEqualsDeclaration") .bases("Declaration") .build("id", "moduleReference") .field("id", def("Identifier")) .field("isExport", Boolean, defaults["false"]) .field("moduleReference", or(TSEntityName, def("TSExternalModuleReference"))); def("TSExternalModuleReference") .bases("Declaration") .build("expression") .field("expression", StringLiteral); def("TSExportAssignment") .bases("Statement") .build("expression") .field("expression", def("Expression")); def("TSNamespaceExportDeclaration") .bases("Declaration") .build("id") .field("id", def("Identifier")); def("TSInterfaceBody") .bases("Node") .build("body") .field("body", [TSTypeMember]); def("TSExpressionWithTypeArguments") .bases("TSType", "TSHasOptionalTypeParameterInstantiation") .build("expression", "typeParameters") .field("expression", TSEntityName); def("TSInterfaceDeclaration") .bases("Declaration", "TSHasOptionalTypeParameters") .build("id", "body") .field("id", TSEntityName) .field("declare", Boolean, defaults["false"]) .field("extends", or([def("TSExpressionWithTypeArguments")], null), defaults["null"]) .field("body", def("TSInterfaceBody")); def("TSParameterProperty") .bases("Pattern") .build("parameter") .field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]) .field("readonly", Boolean, defaults["false"]) .field("parameter", or(def("Identifier"), def("AssignmentPattern"))); def("ClassProperty") .field("access", // Not "accessibility"? or("public", "private", "protected", void 0), defaults["undefined"]); def("ClassAccessorProperty") .bases("Declaration", "TSHasOptionalTypeAnnotation"); // Defined already in es6 and babel-core. def("ClassBody") .field("body", [or( def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassAccessorProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("StaticBlock"), // Just need to add these types: def("TSDeclareMethod"), TSTypeMember )]); }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/equiv.ts000066400000000000000000000121651434620737500160400ustar00rootroot00000000000000import { maybeSetModuleExports } from "./shared"; import typesPlugin, { Fork } from "./types"; export default function (fork: Fork) { var types = fork.use(typesPlugin); var getFieldNames = types.getFieldNames; var getFieldValue = types.getFieldValue; var isArray = types.builtInTypes.array; var isObject = types.builtInTypes.object; var isDate = types.builtInTypes.Date; var isRegExp = types.builtInTypes.RegExp; var hasOwn = Object.prototype.hasOwnProperty; function astNodesAreEquivalent(a: any, b: any, problemPath?: any) { if (isArray.check(problemPath)) { problemPath.length = 0; } else { problemPath = null; } return areEquivalent(a, b, problemPath); } astNodesAreEquivalent.assert = function (a: any, b: any) { var problemPath: any[] = []; if (!astNodesAreEquivalent(a, b, problemPath)) { if (problemPath.length === 0) { if (a !== b) { throw new Error("Nodes must be equal"); } } else { throw new Error( "Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join("") ); } } }; function subscriptForProperty(property: any) { if (/[_$a-z][_$a-z0-9]*/i.test(property)) { return "." + property; } return "[" + JSON.stringify(property) + "]"; } function areEquivalent(a: any, b: any, problemPath: any) { if (a === b) { return true; } if (isArray.check(a)) { return arraysAreEquivalent(a, b, problemPath); } if (isObject.check(a)) { return objectsAreEquivalent(a, b, problemPath); } if (isDate.check(a)) { return isDate.check(b) && (+a === +b); } if (isRegExp.check(a)) { return isRegExp.check(b) && ( a.source === b.source && a.global === b.global && a.multiline === b.multiline && a.ignoreCase === b.ignoreCase ); } return a == b; } function arraysAreEquivalent(a: any, b: any, problemPath: any) { isArray.assert(a); var aLength = a.length; if (!isArray.check(b) || b.length !== aLength) { if (problemPath) { problemPath.push("length"); } return false; } for (var i = 0; i < aLength; ++i) { if (problemPath) { problemPath.push(i); } if (i in a !== i in b) { return false; } if (!areEquivalent(a[i], b[i], problemPath)) { return false; } if (problemPath) { var problemPathTail = problemPath.pop(); if (problemPathTail !== i) { throw new Error("" + problemPathTail); } } } return true; } function objectsAreEquivalent(a: any, b: any, problemPath: any) { isObject.assert(a); if (!isObject.check(b)) { return false; } // Fast path for a common property of AST nodes. if (a.type !== b.type) { if (problemPath) { problemPath.push("type"); } return false; } var aNames = getFieldNames(a); var aNameCount = aNames.length; var bNames = getFieldNames(b); var bNameCount = bNames.length; if (aNameCount === bNameCount) { for (var i = 0; i < aNameCount; ++i) { var name = aNames[i]; var aChild = getFieldValue(a, name); var bChild = getFieldValue(b, name); if (problemPath) { problemPath.push(name); } if (!areEquivalent(aChild, bChild, problemPath)) { return false; } if (problemPath) { var problemPathTail = problemPath.pop(); if (problemPathTail !== name) { throw new Error("" + problemPathTail); } } } return true; } if (!problemPath) { return false; } // Since aNameCount !== bNameCount, we need to find some name that's // missing in aNames but present in bNames, or vice-versa. var seenNames = Object.create(null); for (i = 0; i < aNameCount; ++i) { seenNames[aNames[i]] = true; } for (i = 0; i < bNameCount; ++i) { name = bNames[i]; if (!hasOwn.call(seenNames, name)) { problemPath.push(name); return false; } delete seenNames[name]; } for (name in seenNames) { problemPath.push(name); break; } return false; } return astNodesAreEquivalent; }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/esprima.d.ts000066400000000000000000000003461434620737500165670ustar00rootroot00000000000000import * as ESTree from "estree"; /** * "esprima" module augmentations. */ declare module "esprima" { export function parse(input: string, config?: ParseOptions, delegate?: (node: ESTree.Node, meta: any) => void): Program; } ast-types-0.16.1/src/fork.ts000066400000000000000000000030331434620737500156420ustar00rootroot00000000000000import typesPlugin from "./types"; import pathVisitorPlugin from "./path-visitor"; import equivPlugin from "./equiv"; import pathPlugin from "./path"; import nodePathPlugin from "./node-path"; import { Fork, Plugin } from "./types"; import { maybeSetModuleExports } from "./shared"; export default function (plugins: Plugin[]) { const fork = createFork(); const types = fork.use(typesPlugin); plugins.forEach(fork.use); types.finalize(); const PathVisitor = fork.use(pathVisitorPlugin); return { Type: types.Type, builtInTypes: types.builtInTypes, namedTypes: types.namedTypes, builders: types.builders, defineMethod: types.defineMethod, getFieldNames: types.getFieldNames, getFieldValue: types.getFieldValue, eachField: types.eachField, someField: types.someField, getSupertypeNames: types.getSupertypeNames, getBuilderName: types.getBuilderName, astNodesAreEquivalent: fork.use(equivPlugin), finalize: types.finalize, Path: fork.use(pathPlugin), NodePath: fork.use(nodePathPlugin), PathVisitor, use: fork.use, visit: PathVisitor.visit, }; }; function createFork(): Fork { const used: Plugin[] = []; const usedResult: unknown[] = []; function use(plugin: Plugin): T { var idx = used.indexOf(plugin); if (idx === -1) { idx = used.length; used.push(plugin); usedResult[idx] = plugin(fork); } return usedResult[idx] as T; } var fork: Fork = { use }; return fork; } maybeSetModuleExports(() => module); ast-types-0.16.1/src/gen/000077500000000000000000000000001434620737500151035ustar00rootroot00000000000000ast-types-0.16.1/src/gen/builders.ts000066400000000000000000003541701434620737500172760ustar00rootroot00000000000000/* !!! THIS FILE WAS AUTO-GENERATED BY `npm run gen` !!! */ import * as K from "./kinds"; import { namedTypes } from "./namedTypes"; export interface FileBuilder { (program: K.ProgramKind, name?: string | null): namedTypes.File; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name?: string | null; program: K.ProgramKind; } ): namedTypes.File; } export interface ProgramBuilder { (body: K.StatementKind[]): namedTypes.Program; from( params: { body: K.StatementKind[]; comments?: K.CommentKind[] | null; directives?: K.DirectiveKind[]; interpreter?: K.InterpreterDirectiveKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.Program; } export interface IdentifierBuilder { (name: string): namedTypes.Identifier; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: string; optional?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } ): namedTypes.Identifier; } export interface BlockStatementBuilder { (body: K.StatementKind[]): namedTypes.BlockStatement; from( params: { body: K.StatementKind[]; comments?: K.CommentKind[] | null; directives?: K.DirectiveKind[]; loc?: K.SourceLocationKind | null; } ): namedTypes.BlockStatement; } export interface EmptyStatementBuilder { (): namedTypes.EmptyStatement; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.EmptyStatement; } export interface ExpressionStatementBuilder { (expression: K.ExpressionKind): namedTypes.ExpressionStatement; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ExpressionStatement; } export interface IfStatementBuilder { ( test: K.ExpressionKind, consequent: K.StatementKind, alternate?: K.StatementKind | null ): namedTypes.IfStatement; from( params: { alternate?: K.StatementKind | null; comments?: K.CommentKind[] | null; consequent: K.StatementKind; loc?: K.SourceLocationKind | null; test: K.ExpressionKind; } ): namedTypes.IfStatement; } export interface LabeledStatementBuilder { (label: K.IdentifierKind, body: K.StatementKind): namedTypes.LabeledStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; label: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.LabeledStatement; } export interface BreakStatementBuilder { (label?: K.IdentifierKind | null): namedTypes.BreakStatement; from( params: { comments?: K.CommentKind[] | null; label?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.BreakStatement; } export interface ContinueStatementBuilder { (label?: K.IdentifierKind | null): namedTypes.ContinueStatement; from( params: { comments?: K.CommentKind[] | null; label?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ContinueStatement; } export interface WithStatementBuilder { (object: K.ExpressionKind, body: K.StatementKind): namedTypes.WithStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; object: K.ExpressionKind; } ): namedTypes.WithStatement; } export interface SwitchStatementBuilder { ( discriminant: K.ExpressionKind, cases: K.SwitchCaseKind[], lexical?: boolean ): namedTypes.SwitchStatement; from( params: { cases: K.SwitchCaseKind[]; comments?: K.CommentKind[] | null; discriminant: K.ExpressionKind; lexical?: boolean; loc?: K.SourceLocationKind | null; } ): namedTypes.SwitchStatement; } export interface SwitchCaseBuilder { (test: K.ExpressionKind | null, consequent: K.StatementKind[]): namedTypes.SwitchCase; from( params: { comments?: K.CommentKind[] | null; consequent: K.StatementKind[]; loc?: K.SourceLocationKind | null; test: K.ExpressionKind | null; } ): namedTypes.SwitchCase; } export interface ReturnStatementBuilder { (argument: K.ExpressionKind | null): namedTypes.ReturnStatement; from( params: { argument: K.ExpressionKind | null; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ReturnStatement; } export interface ThrowStatementBuilder { (argument: K.ExpressionKind): namedTypes.ThrowStatement; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ThrowStatement; } export interface TryStatementBuilder { ( block: K.BlockStatementKind, handler?: K.CatchClauseKind | null, finalizer?: K.BlockStatementKind | null ): namedTypes.TryStatement; from( params: { block: K.BlockStatementKind; comments?: K.CommentKind[] | null; finalizer?: K.BlockStatementKind | null; guardedHandlers?: K.CatchClauseKind[]; handler?: K.CatchClauseKind | null; handlers?: K.CatchClauseKind[]; loc?: K.SourceLocationKind | null; } ): namedTypes.TryStatement; } export interface CatchClauseBuilder { ( param: K.PatternKind | null | undefined, guard: K.ExpressionKind | null | undefined, body: K.BlockStatementKind ): namedTypes.CatchClause; from( params: { body: K.BlockStatementKind; comments?: K.CommentKind[] | null; guard?: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; param?: K.PatternKind | null; } ): namedTypes.CatchClause; } export interface WhileStatementBuilder { (test: K.ExpressionKind, body: K.StatementKind): namedTypes.WhileStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; test: K.ExpressionKind; } ): namedTypes.WhileStatement; } export interface DoWhileStatementBuilder { (body: K.StatementKind, test: K.ExpressionKind): namedTypes.DoWhileStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; test: K.ExpressionKind; } ): namedTypes.DoWhileStatement; } export interface ForStatementBuilder { ( init: K.VariableDeclarationKind | K.ExpressionKind | null, test: K.ExpressionKind | null, update: K.ExpressionKind | null, body: K.StatementKind ): namedTypes.ForStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; init: K.VariableDeclarationKind | K.ExpressionKind | null; loc?: K.SourceLocationKind | null; test: K.ExpressionKind | null; update: K.ExpressionKind | null; } ): namedTypes.ForStatement; } export interface VariableDeclarationBuilder { ( kind: "var" | "let" | "const", declarations: (K.VariableDeclaratorKind | K.IdentifierKind)[] ): namedTypes.VariableDeclaration; from( params: { comments?: K.CommentKind[] | null; declarations: (K.VariableDeclaratorKind | K.IdentifierKind)[]; kind: "var" | "let" | "const"; loc?: K.SourceLocationKind | null; } ): namedTypes.VariableDeclaration; } export interface ForInStatementBuilder { ( left: K.VariableDeclarationKind | K.ExpressionKind, right: K.ExpressionKind, body: K.StatementKind ): namedTypes.ForInStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; left: K.VariableDeclarationKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; right: K.ExpressionKind; } ): namedTypes.ForInStatement; } export interface DebuggerStatementBuilder { (): namedTypes.DebuggerStatement; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.DebuggerStatement; } export interface FunctionDeclarationBuilder { ( id: K.IdentifierKind | null, params: K.PatternKind[], body: K.BlockStatementKind, generator?: boolean, expression?: boolean ): namedTypes.FunctionDeclaration; from( params: { async?: boolean; body: K.BlockStatementKind; comments?: K.CommentKind[] | null; defaults?: (K.ExpressionKind | null)[]; expression?: boolean; generator?: boolean; id: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.FunctionDeclaration; } export interface FunctionExpressionBuilder { ( id: K.IdentifierKind | null | undefined, params: K.PatternKind[], body: K.BlockStatementKind, generator?: boolean, expression?: boolean ): namedTypes.FunctionExpression; from( params: { async?: boolean; body: K.BlockStatementKind; comments?: K.CommentKind[] | null; defaults?: (K.ExpressionKind | null)[]; expression?: boolean; generator?: boolean; id?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.FunctionExpression; } export interface VariableDeclaratorBuilder { (id: K.PatternKind, init?: K.ExpressionKind | null): namedTypes.VariableDeclarator; from( params: { comments?: K.CommentKind[] | null; id: K.PatternKind; init?: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.VariableDeclarator; } export interface ThisExpressionBuilder { (): namedTypes.ThisExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ThisExpression; } export interface ArrayExpressionBuilder { ( elements: (K.ExpressionKind | K.SpreadElementKind | K.RestElementKind | null)[] ): namedTypes.ArrayExpression; from( params: { comments?: K.CommentKind[] | null; elements: (K.ExpressionKind | K.SpreadElementKind | K.RestElementKind | null)[]; loc?: K.SourceLocationKind | null; } ): namedTypes.ArrayExpression; } export interface ObjectExpressionBuilder { ( properties: (K.PropertyKind | K.ObjectMethodKind | K.ObjectPropertyKind | K.SpreadPropertyKind | K.SpreadElementKind)[] ): namedTypes.ObjectExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; properties: (K.PropertyKind | K.ObjectMethodKind | K.ObjectPropertyKind | K.SpreadPropertyKind | K.SpreadElementKind)[]; } ): namedTypes.ObjectExpression; } export interface PropertyBuilder { ( kind: "init" | "get" | "set", key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, value: K.ExpressionKind | K.PatternKind ): namedTypes.Property; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; kind: "init" | "get" | "set"; loc?: K.SourceLocationKind | null; method?: boolean; shorthand?: boolean; value: K.ExpressionKind | K.PatternKind; } ): namedTypes.Property; } export interface LiteralBuilder { (value: string | boolean | null | number | RegExp | BigInt): namedTypes.Literal; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value: string | boolean | null | number | RegExp | BigInt; } ): namedTypes.Literal; } export interface SequenceExpressionBuilder { (expressions: K.ExpressionKind[]): namedTypes.SequenceExpression; from( params: { comments?: K.CommentKind[] | null; expressions: K.ExpressionKind[]; loc?: K.SourceLocationKind | null; } ): namedTypes.SequenceExpression; } export interface UnaryExpressionBuilder { ( operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete", argument: K.ExpressionKind, prefix?: boolean ): namedTypes.UnaryExpression; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; prefix?: boolean; } ): namedTypes.UnaryExpression; } export interface BinaryExpressionBuilder { ( operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "&" | "|" | "^" | "in" | "instanceof" | "**", left: K.ExpressionKind, right: K.ExpressionKind ): namedTypes.BinaryExpression; from( params: { comments?: K.CommentKind[] | null; left: K.ExpressionKind; loc?: K.SourceLocationKind | null; operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "&" | "|" | "^" | "in" | "instanceof" | "**"; right: K.ExpressionKind; } ): namedTypes.BinaryExpression; } export interface AssignmentExpressionBuilder { ( operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??=", left: K.PatternKind | K.MemberExpressionKind, right: K.ExpressionKind ): namedTypes.AssignmentExpression; from( params: { comments?: K.CommentKind[] | null; left: K.PatternKind | K.MemberExpressionKind; loc?: K.SourceLocationKind | null; operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??="; right: K.ExpressionKind; } ): namedTypes.AssignmentExpression; } export interface MemberExpressionBuilder { ( object: K.ExpressionKind, property: K.IdentifierKind | K.ExpressionKind, computed?: boolean ): namedTypes.MemberExpression; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; loc?: K.SourceLocationKind | null; object: K.ExpressionKind; optional?: boolean; property: K.IdentifierKind | K.ExpressionKind; } ): namedTypes.MemberExpression; } export interface UpdateExpressionBuilder { (operator: "++" | "--", argument: K.ExpressionKind, prefix: boolean): namedTypes.UpdateExpression; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; operator: "++" | "--"; prefix: boolean; } ): namedTypes.UpdateExpression; } export interface LogicalExpressionBuilder { ( operator: "||" | "&&" | "??", left: K.ExpressionKind, right: K.ExpressionKind ): namedTypes.LogicalExpression; from( params: { comments?: K.CommentKind[] | null; left: K.ExpressionKind; loc?: K.SourceLocationKind | null; operator: "||" | "&&" | "??"; right: K.ExpressionKind; } ): namedTypes.LogicalExpression; } export interface ConditionalExpressionBuilder { ( test: K.ExpressionKind, consequent: K.ExpressionKind, alternate: K.ExpressionKind ): namedTypes.ConditionalExpression; from( params: { alternate: K.ExpressionKind; comments?: K.CommentKind[] | null; consequent: K.ExpressionKind; loc?: K.SourceLocationKind | null; test: K.ExpressionKind; } ): namedTypes.ConditionalExpression; } export interface NewExpressionBuilder { ( callee: K.ExpressionKind, argumentsParam: (K.ExpressionKind | K.SpreadElementKind)[] ): namedTypes.NewExpression; from( params: { arguments: (K.ExpressionKind | K.SpreadElementKind)[]; callee: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeArguments?: null | K.TypeParameterInstantiationKind; } ): namedTypes.NewExpression; } export interface CallExpressionBuilder { ( callee: K.ExpressionKind, argumentsParam: (K.ExpressionKind | K.SpreadElementKind)[] ): namedTypes.CallExpression; from( params: { arguments: (K.ExpressionKind | K.SpreadElementKind)[]; callee: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; optional?: boolean; typeArguments?: null | K.TypeParameterInstantiationKind; } ): namedTypes.CallExpression; } export interface RestElementBuilder { (argument: K.PatternKind): namedTypes.RestElement; from( params: { argument: K.PatternKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } ): namedTypes.RestElement; } export interface TypeAnnotationBuilder { (typeAnnotation: K.FlowTypeKind): namedTypes.TypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.FlowTypeKind; } ): namedTypes.TypeAnnotation; } export interface TSTypeAnnotationBuilder { (typeAnnotation: K.TSTypeKind | K.TSTypeAnnotationKind): namedTypes.TSTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind | K.TSTypeAnnotationKind; } ): namedTypes.TSTypeAnnotation; } export interface SpreadElementPatternBuilder { (argument: K.PatternKind): namedTypes.SpreadElementPattern; from( params: { argument: K.PatternKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.SpreadElementPattern; } export interface ArrowFunctionExpressionBuilder { ( params: K.PatternKind[], body: K.BlockStatementKind | K.ExpressionKind, expression?: boolean ): namedTypes.ArrowFunctionExpression; from( params: { async?: boolean; body: K.BlockStatementKind | K.ExpressionKind; comments?: K.CommentKind[] | null; defaults?: (K.ExpressionKind | null)[]; expression?: boolean; generator?: false; id?: null; loc?: K.SourceLocationKind | null; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ArrowFunctionExpression; } export interface ForOfStatementBuilder { ( left: K.VariableDeclarationKind | K.PatternKind, right: K.ExpressionKind, body: K.StatementKind ): namedTypes.ForOfStatement; from( params: { await?: boolean; body: K.StatementKind; comments?: K.CommentKind[] | null; left: K.VariableDeclarationKind | K.PatternKind; loc?: K.SourceLocationKind | null; right: K.ExpressionKind; } ): namedTypes.ForOfStatement; } export interface YieldExpressionBuilder { (argument: K.ExpressionKind | null, delegate?: boolean): namedTypes.YieldExpression; from( params: { argument: K.ExpressionKind | null; comments?: K.CommentKind[] | null; delegate?: boolean; loc?: K.SourceLocationKind | null; } ): namedTypes.YieldExpression; } export interface GeneratorExpressionBuilder { ( body: K.ExpressionKind, blocks: K.ComprehensionBlockKind[], filter: K.ExpressionKind | null ): namedTypes.GeneratorExpression; from( params: { blocks: K.ComprehensionBlockKind[]; body: K.ExpressionKind; comments?: K.CommentKind[] | null; filter: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.GeneratorExpression; } export interface ComprehensionBlockBuilder { (left: K.PatternKind, right: K.ExpressionKind, each: boolean): namedTypes.ComprehensionBlock; from( params: { comments?: K.CommentKind[] | null; each: boolean; left: K.PatternKind; loc?: K.SourceLocationKind | null; right: K.ExpressionKind; } ): namedTypes.ComprehensionBlock; } export interface ComprehensionExpressionBuilder { ( body: K.ExpressionKind, blocks: K.ComprehensionBlockKind[], filter: K.ExpressionKind | null ): namedTypes.ComprehensionExpression; from( params: { blocks: K.ComprehensionBlockKind[]; body: K.ExpressionKind; comments?: K.CommentKind[] | null; filter: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ComprehensionExpression; } export interface ObjectPropertyBuilder { ( key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, value: K.ExpressionKind | K.PatternKind ): namedTypes.ObjectProperty; from( params: { accessibility?: K.LiteralKind | null; comments?: K.CommentKind[] | null; computed?: boolean; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; shorthand?: boolean; value: K.ExpressionKind | K.PatternKind; } ): namedTypes.ObjectProperty; } export interface PropertyPatternBuilder { ( key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, pattern: K.PatternKind ): namedTypes.PropertyPattern; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; pattern: K.PatternKind; } ): namedTypes.PropertyPattern; } export interface ObjectPatternBuilder { ( properties: (K.PropertyKind | K.PropertyPatternKind | K.SpreadPropertyPatternKind | K.SpreadPropertyKind | K.ObjectPropertyKind | K.RestPropertyKind | K.RestElementKind)[] ): namedTypes.ObjectPattern; from( params: { comments?: K.CommentKind[] | null; decorators?: K.DecoratorKind[] | null; loc?: K.SourceLocationKind | null; properties: (K.PropertyKind | K.PropertyPatternKind | K.SpreadPropertyPatternKind | K.SpreadPropertyKind | K.ObjectPropertyKind | K.RestPropertyKind | K.RestElementKind)[]; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } ): namedTypes.ObjectPattern; } export interface ArrayPatternBuilder { (elements: (K.PatternKind | K.SpreadElementKind | null)[]): namedTypes.ArrayPattern; from( params: { comments?: K.CommentKind[] | null; elements: (K.PatternKind | K.SpreadElementKind | null)[]; loc?: K.SourceLocationKind | null; } ): namedTypes.ArrayPattern; } export interface SpreadElementBuilder { (argument: K.ExpressionKind): namedTypes.SpreadElement; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.SpreadElement; } export interface AssignmentPatternBuilder { (left: K.PatternKind, right: K.ExpressionKind): namedTypes.AssignmentPattern; from( params: { comments?: K.CommentKind[] | null; left: K.PatternKind; loc?: K.SourceLocationKind | null; right: K.ExpressionKind; } ): namedTypes.AssignmentPattern; } export interface MethodDefinitionBuilder { ( kind: "constructor" | "method" | "get" | "set", key: K.ExpressionKind, value: K.FunctionKind, staticParam?: boolean ): namedTypes.MethodDefinition; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; key: K.ExpressionKind; kind: "constructor" | "method" | "get" | "set"; loc?: K.SourceLocationKind | null; static?: boolean; value: K.FunctionKind; } ): namedTypes.MethodDefinition; } export interface ClassPropertyDefinitionBuilder { ( definition: K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.StaticBlockKind ): namedTypes.ClassPropertyDefinition; from( params: { comments?: K.CommentKind[] | null; definition: K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.StaticBlockKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ClassPropertyDefinition; } export interface ClassPropertyBuilder { ( key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, value: K.ExpressionKind | null, typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null, staticParam?: boolean ): namedTypes.ClassProperty; from( params: { access?: "public" | "private" | "protected" | undefined; comments?: K.CommentKind[] | null; computed?: boolean; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; static?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; value: K.ExpressionKind | null; variance?: K.VarianceKind | "plus" | "minus" | null; } ): namedTypes.ClassProperty; } export interface StaticBlockBuilder { (body: K.StatementKind[]): namedTypes.StaticBlock; from( params: { body: K.StatementKind[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.StaticBlock; } export interface ClassBodyBuilder { ( body: (K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.ClassPrivatePropertyKind | K.ClassAccessorPropertyKind | K.ClassMethodKind | K.ClassPrivateMethodKind | K.StaticBlockKind | K.TSDeclareMethodKind | K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[] ): namedTypes.ClassBody; from( params: { body: (K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.ClassPrivatePropertyKind | K.ClassAccessorPropertyKind | K.ClassMethodKind | K.ClassPrivateMethodKind | K.StaticBlockKind | K.TSDeclareMethodKind | K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ClassBody; } export interface ClassDeclarationBuilder { ( id: K.IdentifierKind | null, body: K.ClassBodyKind, superClass?: K.ExpressionKind | null ): namedTypes.ClassDeclaration; from( params: { body: K.ClassBodyKind; comments?: K.CommentKind[] | null; id: K.IdentifierKind | null; implements?: K.ClassImplementsKind[] | K.TSExpressionWithTypeArgumentsKind[]; loc?: K.SourceLocationKind | null; superClass?: K.ExpressionKind | null; superTypeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ClassDeclaration; } export interface ClassExpressionBuilder { ( id: K.IdentifierKind | null | undefined, body: K.ClassBodyKind, superClass?: K.ExpressionKind | null ): namedTypes.ClassExpression; from( params: { body: K.ClassBodyKind; comments?: K.CommentKind[] | null; id?: K.IdentifierKind | null; implements?: K.ClassImplementsKind[] | K.TSExpressionWithTypeArgumentsKind[]; loc?: K.SourceLocationKind | null; superClass?: K.ExpressionKind | null; superTypeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ClassExpression; } export interface SuperBuilder { (): namedTypes.Super; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.Super; } export interface ImportSpecifierBuilder { (imported: K.IdentifierKind, local?: K.IdentifierKind | null): namedTypes.ImportSpecifier; from( params: { comments?: K.CommentKind[] | null; id?: K.IdentifierKind | null; imported: K.IdentifierKind; loc?: K.SourceLocationKind | null; local?: K.IdentifierKind | null; name?: K.IdentifierKind | null; } ): namedTypes.ImportSpecifier; } export interface ImportDefaultSpecifierBuilder { (local?: K.IdentifierKind | null): namedTypes.ImportDefaultSpecifier; from( params: { comments?: K.CommentKind[] | null; id?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; local?: K.IdentifierKind | null; name?: K.IdentifierKind | null; } ): namedTypes.ImportDefaultSpecifier; } export interface ImportNamespaceSpecifierBuilder { (local?: K.IdentifierKind | null): namedTypes.ImportNamespaceSpecifier; from( params: { comments?: K.CommentKind[] | null; id?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; local?: K.IdentifierKind | null; name?: K.IdentifierKind | null; } ): namedTypes.ImportNamespaceSpecifier; } export interface ImportDeclarationBuilder { ( specifiers: (K.ImportSpecifierKind | K.ImportNamespaceSpecifierKind | K.ImportDefaultSpecifierKind)[] | undefined, source: K.LiteralKind, importKind?: "value" | "type" | "typeof" ): namedTypes.ImportDeclaration; from( params: { assertions?: K.ImportAttributeKind[]; comments?: K.CommentKind[] | null; importKind?: "value" | "type" | "typeof"; loc?: K.SourceLocationKind | null; source: K.LiteralKind; specifiers?: (K.ImportSpecifierKind | K.ImportNamespaceSpecifierKind | K.ImportDefaultSpecifierKind)[]; } ): namedTypes.ImportDeclaration; } export interface ExportNamedDeclarationBuilder { ( declaration: K.DeclarationKind | null, specifiers?: K.ExportSpecifierKind[], source?: K.LiteralKind | null ): namedTypes.ExportNamedDeclaration; from( params: { assertions?: K.ImportAttributeKind[]; comments?: K.CommentKind[] | null; declaration: K.DeclarationKind | null; loc?: K.SourceLocationKind | null; source?: K.LiteralKind | null; specifiers?: K.ExportSpecifierKind[]; } ): namedTypes.ExportNamedDeclaration; } export interface ExportSpecifierBuilder { (id?: K.IdentifierKind | null, name?: K.IdentifierKind | null): namedTypes.ExportSpecifier; from( params: { comments?: K.CommentKind[] | null; exported: K.IdentifierKind; id?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; local?: K.IdentifierKind | null; name?: K.IdentifierKind | null; } ): namedTypes.ExportSpecifier; } export interface ExportDefaultDeclarationBuilder { (declaration: K.DeclarationKind | K.ExpressionKind): namedTypes.ExportDefaultDeclaration; from( params: { comments?: K.CommentKind[] | null; declaration: K.DeclarationKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ExportDefaultDeclaration; } export interface ExportAllDeclarationBuilder { (source: K.LiteralKind, exported?: K.IdentifierKind | null | undefined): namedTypes.ExportAllDeclaration; from( params: { assertions?: K.ImportAttributeKind[]; comments?: K.CommentKind[] | null; exported?: K.IdentifierKind | null | undefined; loc?: K.SourceLocationKind | null; source: K.LiteralKind; } ): namedTypes.ExportAllDeclaration; } export interface TaggedTemplateExpressionBuilder { (tag: K.ExpressionKind, quasi: K.TemplateLiteralKind): namedTypes.TaggedTemplateExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; quasi: K.TemplateLiteralKind; tag: K.ExpressionKind; } ): namedTypes.TaggedTemplateExpression; } export interface TemplateLiteralBuilder { ( quasis: K.TemplateElementKind[], expressions: K.ExpressionKind[] | K.TSTypeKind[] ): namedTypes.TemplateLiteral; from( params: { comments?: K.CommentKind[] | null; expressions: K.ExpressionKind[] | K.TSTypeKind[]; loc?: K.SourceLocationKind | null; quasis: K.TemplateElementKind[]; } ): namedTypes.TemplateLiteral; } export interface TemplateElementBuilder { ( value: { cooked: string | null; raw: string; }, tail: boolean ): namedTypes.TemplateElement; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; tail: boolean; value: { cooked: string | null; raw: string; }; } ): namedTypes.TemplateElement; } export interface MetaPropertyBuilder { (meta: K.IdentifierKind, property: K.IdentifierKind): namedTypes.MetaProperty; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; meta: K.IdentifierKind; property: K.IdentifierKind; } ): namedTypes.MetaProperty; } export interface AwaitExpressionBuilder { (argument: K.ExpressionKind | null, all?: boolean): namedTypes.AwaitExpression; from( params: { all?: boolean; argument: K.ExpressionKind | null; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.AwaitExpression; } export interface SpreadPropertyBuilder { (argument: K.ExpressionKind): namedTypes.SpreadProperty; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.SpreadProperty; } export interface SpreadPropertyPatternBuilder { (argument: K.PatternKind): namedTypes.SpreadPropertyPattern; from( params: { argument: K.PatternKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.SpreadPropertyPattern; } export interface ImportExpressionBuilder { (source: K.ExpressionKind): namedTypes.ImportExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; source: K.ExpressionKind; } ): namedTypes.ImportExpression; } export interface ChainExpressionBuilder { (expression: K.ChainElementKind): namedTypes.ChainExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ChainElementKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ChainExpression; } export interface OptionalCallExpressionBuilder { ( callee: K.ExpressionKind, argumentsParam: (K.ExpressionKind | K.SpreadElementKind)[], optional?: boolean ): namedTypes.OptionalCallExpression; from( params: { arguments: (K.ExpressionKind | K.SpreadElementKind)[]; callee: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; optional?: boolean; typeArguments?: null | K.TypeParameterInstantiationKind; } ): namedTypes.OptionalCallExpression; } export interface OptionalMemberExpressionBuilder { ( object: K.ExpressionKind, property: K.IdentifierKind | K.ExpressionKind, computed?: boolean, optional?: boolean ): namedTypes.OptionalMemberExpression; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; loc?: K.SourceLocationKind | null; object: K.ExpressionKind; optional?: boolean; property: K.IdentifierKind | K.ExpressionKind; } ): namedTypes.OptionalMemberExpression; } export interface DecoratorBuilder { (expression: K.ExpressionKind): namedTypes.Decorator; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.Decorator; } export interface PrivateNameBuilder { (id: K.IdentifierKind): namedTypes.PrivateName; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.PrivateName; } export interface ClassPrivatePropertyBuilder { (key: K.PrivateNameKind, value?: K.ExpressionKind | null): namedTypes.ClassPrivateProperty; from( params: { access?: "public" | "private" | "protected" | undefined; comments?: K.CommentKind[] | null; computed?: boolean; key: K.PrivateNameKind; loc?: K.SourceLocationKind | null; static?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; value?: K.ExpressionKind | null; variance?: K.VarianceKind | "plus" | "minus" | null; } ): namedTypes.ClassPrivateProperty; } export interface ImportAttributeBuilder { (key: K.IdentifierKind | K.LiteralKind, value: K.ExpressionKind): namedTypes.ImportAttribute; from( params: { comments?: K.CommentKind[] | null; key: K.IdentifierKind | K.LiteralKind; loc?: K.SourceLocationKind | null; value: K.ExpressionKind; } ): namedTypes.ImportAttribute; } export interface RecordExpressionBuilder { ( properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[] ): namedTypes.RecordExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[]; } ): namedTypes.RecordExpression; } export interface ObjectMethodBuilder { ( kind: "method" | "get" | "set", key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, params: K.PatternKind[], body: K.BlockStatementKind, computed?: boolean ): namedTypes.ObjectMethod; from( params: { accessibility?: K.LiteralKind | null; async?: boolean; body: K.BlockStatementKind; comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; defaults?: (K.ExpressionKind | null)[]; expression?: boolean; generator?: boolean; id?: K.IdentifierKind | null; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; kind: "method" | "get" | "set"; loc?: K.SourceLocationKind | null; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ObjectMethod; } export interface TupleExpressionBuilder { (elements: (K.ExpressionKind | K.SpreadElementKind | null)[]): namedTypes.TupleExpression; from( params: { comments?: K.CommentKind[] | null; elements: (K.ExpressionKind | K.SpreadElementKind | null)[]; loc?: K.SourceLocationKind | null; } ): namedTypes.TupleExpression; } export interface ModuleExpressionBuilder { (body: K.ProgramKind): namedTypes.ModuleExpression; from( params: { body: K.ProgramKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ModuleExpression; } export interface JSXAttributeBuilder { ( name: K.JSXIdentifierKind | K.JSXNamespacedNameKind, value?: K.LiteralKind | K.JSXExpressionContainerKind | K.JSXElementKind | K.JSXFragmentKind | null ): namedTypes.JSXAttribute; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind; value?: K.LiteralKind | K.JSXExpressionContainerKind | K.JSXElementKind | K.JSXFragmentKind | null; } ): namedTypes.JSXAttribute; } export interface JSXIdentifierBuilder { (name: string): namedTypes.JSXIdentifier; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: string; optional?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } ): namedTypes.JSXIdentifier; } export interface JSXNamespacedNameBuilder { (namespace: K.JSXIdentifierKind, name: K.JSXIdentifierKind): namedTypes.JSXNamespacedName; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: K.JSXIdentifierKind; namespace: K.JSXIdentifierKind; } ): namedTypes.JSXNamespacedName; } export interface JSXExpressionContainerBuilder { (expression: K.ExpressionKind | K.JSXEmptyExpressionKind): namedTypes.JSXExpressionContainer; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind | K.JSXEmptyExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXExpressionContainer; } export interface JSXElementBuilder { ( openingElement: K.JSXOpeningElementKind, closingElement?: K.JSXClosingElementKind | null, children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[] ): namedTypes.JSXElement; from( params: { attributes?: (K.JSXAttributeKind | K.JSXSpreadAttributeKind)[]; children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[]; closingElement?: K.JSXClosingElementKind | null; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name?: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; openingElement: K.JSXOpeningElementKind; selfClosing?: boolean; } ): namedTypes.JSXElement; } export interface JSXFragmentBuilder { ( openingFragment: K.JSXOpeningFragmentKind, closingFragment: K.JSXClosingFragmentKind, children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[] ): namedTypes.JSXFragment; from( params: { children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[]; closingFragment: K.JSXClosingFragmentKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; openingFragment: K.JSXOpeningFragmentKind; } ): namedTypes.JSXFragment; } export interface JSXMemberExpressionBuilder { ( object: K.JSXIdentifierKind | K.JSXMemberExpressionKind, property: K.JSXIdentifierKind ): namedTypes.JSXMemberExpression; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; loc?: K.SourceLocationKind | null; object: K.JSXIdentifierKind | K.JSXMemberExpressionKind; optional?: boolean; property: K.JSXIdentifierKind; } ): namedTypes.JSXMemberExpression; } export interface JSXSpreadAttributeBuilder { (argument: K.ExpressionKind): namedTypes.JSXSpreadAttribute; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXSpreadAttribute; } export interface JSXEmptyExpressionBuilder { (): namedTypes.JSXEmptyExpression; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXEmptyExpression; } export interface JSXTextBuilder { (value: string, raw?: string): namedTypes.JSXText; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw?: string; value: string; } ): namedTypes.JSXText; } export interface JSXSpreadChildBuilder { (expression: K.ExpressionKind): namedTypes.JSXSpreadChild; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXSpreadChild; } export interface JSXOpeningElementBuilder { ( name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind, attributes?: (K.JSXAttributeKind | K.JSXSpreadAttributeKind)[], selfClosing?: boolean ): namedTypes.JSXOpeningElement; from( params: { attributes?: (K.JSXAttributeKind | K.JSXSpreadAttributeKind)[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; selfClosing?: boolean; } ): namedTypes.JSXOpeningElement; } export interface JSXClosingElementBuilder { ( name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind ): namedTypes.JSXClosingElement; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; } ): namedTypes.JSXClosingElement; } export interface JSXOpeningFragmentBuilder { (): namedTypes.JSXOpeningFragment; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXOpeningFragment; } export interface JSXClosingFragmentBuilder { (): namedTypes.JSXClosingFragment; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.JSXClosingFragment; } export interface TypeParameterDeclarationBuilder { (params: K.TypeParameterKind[]): namedTypes.TypeParameterDeclaration; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; params: K.TypeParameterKind[]; } ): namedTypes.TypeParameterDeclaration; } export interface TSTypeParameterDeclarationBuilder { (params: K.TSTypeParameterKind[]): namedTypes.TSTypeParameterDeclaration; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; params: K.TSTypeParameterKind[]; } ): namedTypes.TSTypeParameterDeclaration; } export interface TypeParameterInstantiationBuilder { (params: K.FlowTypeKind[]): namedTypes.TypeParameterInstantiation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; params: K.FlowTypeKind[]; } ): namedTypes.TypeParameterInstantiation; } export interface TSTypeParameterInstantiationBuilder { (params: K.TSTypeKind[]): namedTypes.TSTypeParameterInstantiation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; params: K.TSTypeKind[]; } ): namedTypes.TSTypeParameterInstantiation; } export interface ClassImplementsBuilder { (id: K.IdentifierKind): namedTypes.ClassImplements; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; superClass?: K.ExpressionKind | null; typeParameters?: K.TypeParameterInstantiationKind | null; } ): namedTypes.ClassImplements; } export interface TSExpressionWithTypeArgumentsBuilder { ( expression: K.IdentifierKind | K.TSQualifiedNameKind, typeParameters?: K.TSTypeParameterInstantiationKind | null ): namedTypes.TSExpressionWithTypeArguments; from( params: { comments?: K.CommentKind[] | null; expression: K.IdentifierKind | K.TSQualifiedNameKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TSTypeParameterInstantiationKind | null; } ): namedTypes.TSExpressionWithTypeArguments; } export interface AnyTypeAnnotationBuilder { (): namedTypes.AnyTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.AnyTypeAnnotation; } export interface EmptyTypeAnnotationBuilder { (): namedTypes.EmptyTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.EmptyTypeAnnotation; } export interface MixedTypeAnnotationBuilder { (): namedTypes.MixedTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.MixedTypeAnnotation; } export interface VoidTypeAnnotationBuilder { (): namedTypes.VoidTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.VoidTypeAnnotation; } export interface SymbolTypeAnnotationBuilder { (): namedTypes.SymbolTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.SymbolTypeAnnotation; } export interface NumberTypeAnnotationBuilder { (): namedTypes.NumberTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.NumberTypeAnnotation; } export interface BigIntTypeAnnotationBuilder { (): namedTypes.BigIntTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.BigIntTypeAnnotation; } export interface NumberLiteralTypeAnnotationBuilder { (value: number, raw: string): namedTypes.NumberLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw: string; value: number; } ): namedTypes.NumberLiteralTypeAnnotation; } export interface NumericLiteralTypeAnnotationBuilder { (value: number, raw: string): namedTypes.NumericLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw: string; value: number; } ): namedTypes.NumericLiteralTypeAnnotation; } export interface BigIntLiteralTypeAnnotationBuilder { (value: null, raw: string): namedTypes.BigIntLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw: string; value: null; } ): namedTypes.BigIntLiteralTypeAnnotation; } export interface StringTypeAnnotationBuilder { (): namedTypes.StringTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.StringTypeAnnotation; } export interface StringLiteralTypeAnnotationBuilder { (value: string, raw: string): namedTypes.StringLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw: string; value: string; } ): namedTypes.StringLiteralTypeAnnotation; } export interface BooleanTypeAnnotationBuilder { (): namedTypes.BooleanTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.BooleanTypeAnnotation; } export interface BooleanLiteralTypeAnnotationBuilder { (value: boolean, raw: string): namedTypes.BooleanLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; raw: string; value: boolean; } ): namedTypes.BooleanLiteralTypeAnnotation; } export interface NullableTypeAnnotationBuilder { (typeAnnotation: K.FlowTypeKind): namedTypes.NullableTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.FlowTypeKind; } ): namedTypes.NullableTypeAnnotation; } export interface NullLiteralTypeAnnotationBuilder { (): namedTypes.NullLiteralTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.NullLiteralTypeAnnotation; } export interface NullTypeAnnotationBuilder { (): namedTypes.NullTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.NullTypeAnnotation; } export interface ThisTypeAnnotationBuilder { (): namedTypes.ThisTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ThisTypeAnnotation; } export interface ExistsTypeAnnotationBuilder { (): namedTypes.ExistsTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ExistsTypeAnnotation; } export interface ExistentialTypeParamBuilder { (): namedTypes.ExistentialTypeParam; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ExistentialTypeParam; } export interface FunctionTypeAnnotationBuilder { ( params: K.FunctionTypeParamKind[], returnType: K.FlowTypeKind, rest: K.FunctionTypeParamKind | null, typeParameters: K.TypeParameterDeclarationKind | null ): namedTypes.FunctionTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; params: K.FunctionTypeParamKind[]; rest: K.FunctionTypeParamKind | null; returnType: K.FlowTypeKind; typeParameters: K.TypeParameterDeclarationKind | null; } ): namedTypes.FunctionTypeAnnotation; } export interface FunctionTypeParamBuilder { ( name: K.IdentifierKind | null, typeAnnotation: K.FlowTypeKind, optional: boolean ): namedTypes.FunctionTypeParam; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: K.IdentifierKind | null; optional: boolean; typeAnnotation: K.FlowTypeKind; } ): namedTypes.FunctionTypeParam; } export interface ArrayTypeAnnotationBuilder { (elementType: K.FlowTypeKind): namedTypes.ArrayTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; elementType: K.FlowTypeKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ArrayTypeAnnotation; } export interface ObjectTypeAnnotationBuilder { ( properties: (K.ObjectTypePropertyKind | K.ObjectTypeSpreadPropertyKind)[], indexers?: K.ObjectTypeIndexerKind[], callProperties?: K.ObjectTypeCallPropertyKind[] ): namedTypes.ObjectTypeAnnotation; from( params: { callProperties?: K.ObjectTypeCallPropertyKind[]; comments?: K.CommentKind[] | null; exact?: boolean; indexers?: K.ObjectTypeIndexerKind[]; inexact?: boolean | undefined; internalSlots?: K.ObjectTypeInternalSlotKind[]; loc?: K.SourceLocationKind | null; properties: (K.ObjectTypePropertyKind | K.ObjectTypeSpreadPropertyKind)[]; } ): namedTypes.ObjectTypeAnnotation; } export interface ObjectTypePropertyBuilder { ( key: K.LiteralKind | K.IdentifierKind, value: K.FlowTypeKind, optional: boolean ): namedTypes.ObjectTypeProperty; from( params: { comments?: K.CommentKind[] | null; key: K.LiteralKind | K.IdentifierKind; loc?: K.SourceLocationKind | null; optional: boolean; value: K.FlowTypeKind; variance?: K.VarianceKind | "plus" | "minus" | null; } ): namedTypes.ObjectTypeProperty; } export interface ObjectTypeSpreadPropertyBuilder { (argument: K.FlowTypeKind): namedTypes.ObjectTypeSpreadProperty; from( params: { argument: K.FlowTypeKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ObjectTypeSpreadProperty; } export interface ObjectTypeIndexerBuilder { (id: K.IdentifierKind, key: K.FlowTypeKind, value: K.FlowTypeKind): namedTypes.ObjectTypeIndexer; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; key: K.FlowTypeKind; loc?: K.SourceLocationKind | null; static?: boolean; value: K.FlowTypeKind; variance?: K.VarianceKind | "plus" | "minus" | null; } ): namedTypes.ObjectTypeIndexer; } export interface ObjectTypeCallPropertyBuilder { (value: K.FunctionTypeAnnotationKind): namedTypes.ObjectTypeCallProperty; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; static?: boolean; value: K.FunctionTypeAnnotationKind; } ): namedTypes.ObjectTypeCallProperty; } export interface ObjectTypeInternalSlotBuilder { ( id: K.IdentifierKind, value: K.FlowTypeKind, optional: boolean, staticParam: boolean, method: boolean ): namedTypes.ObjectTypeInternalSlot; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; method: boolean; optional: boolean; static: boolean; value: K.FlowTypeKind; } ): namedTypes.ObjectTypeInternalSlot; } export interface VarianceBuilder { (kind: "plus" | "minus"): namedTypes.Variance; from( params: { comments?: K.CommentKind[] | null; kind: "plus" | "minus"; loc?: K.SourceLocationKind | null; } ): namedTypes.Variance; } export interface QualifiedTypeIdentifierBuilder { ( qualification: K.IdentifierKind | K.QualifiedTypeIdentifierKind, id: K.IdentifierKind ): namedTypes.QualifiedTypeIdentifier; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; qualification: K.IdentifierKind | K.QualifiedTypeIdentifierKind; } ): namedTypes.QualifiedTypeIdentifier; } export interface GenericTypeAnnotationBuilder { ( id: K.IdentifierKind | K.QualifiedTypeIdentifierKind, typeParameters: K.TypeParameterInstantiationKind | null ): namedTypes.GenericTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind | K.QualifiedTypeIdentifierKind; loc?: K.SourceLocationKind | null; typeParameters: K.TypeParameterInstantiationKind | null; } ): namedTypes.GenericTypeAnnotation; } export interface MemberTypeAnnotationBuilder { ( object: K.IdentifierKind, property: K.MemberTypeAnnotationKind | K.GenericTypeAnnotationKind ): namedTypes.MemberTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; object: K.IdentifierKind; property: K.MemberTypeAnnotationKind | K.GenericTypeAnnotationKind; } ): namedTypes.MemberTypeAnnotation; } export interface IndexedAccessTypeBuilder { (objectType: K.FlowTypeKind, indexType: K.FlowTypeKind): namedTypes.IndexedAccessType; from( params: { comments?: K.CommentKind[] | null; indexType: K.FlowTypeKind; loc?: K.SourceLocationKind | null; objectType: K.FlowTypeKind; } ): namedTypes.IndexedAccessType; } export interface OptionalIndexedAccessTypeBuilder { (objectType: K.FlowTypeKind, indexType: K.FlowTypeKind, optional: boolean): namedTypes.OptionalIndexedAccessType; from( params: { comments?: K.CommentKind[] | null; indexType: K.FlowTypeKind; loc?: K.SourceLocationKind | null; objectType: K.FlowTypeKind; optional: boolean; } ): namedTypes.OptionalIndexedAccessType; } export interface UnionTypeAnnotationBuilder { (types: K.FlowTypeKind[]): namedTypes.UnionTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; types: K.FlowTypeKind[]; } ): namedTypes.UnionTypeAnnotation; } export interface IntersectionTypeAnnotationBuilder { (types: K.FlowTypeKind[]): namedTypes.IntersectionTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; types: K.FlowTypeKind[]; } ): namedTypes.IntersectionTypeAnnotation; } export interface TypeofTypeAnnotationBuilder { (argument: K.FlowTypeKind): namedTypes.TypeofTypeAnnotation; from( params: { argument: K.FlowTypeKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TypeofTypeAnnotation; } export interface TypeParameterBuilder { ( name: string, variance?: K.VarianceKind | "plus" | "minus" | null, bound?: K.TypeAnnotationKind | null, defaultParam?: K.FlowTypeKind | null ): namedTypes.TypeParameter; from( params: { bound?: K.TypeAnnotationKind | null; comments?: K.CommentKind[] | null; default?: K.FlowTypeKind | null; loc?: K.SourceLocationKind | null; name: string; variance?: K.VarianceKind | "plus" | "minus" | null; } ): namedTypes.TypeParameter; } export interface InterfaceTypeAnnotationBuilder { ( body: K.ObjectTypeAnnotationKind, extendsParam?: K.InterfaceExtendsKind[] | null ): namedTypes.InterfaceTypeAnnotation; from( params: { body: K.ObjectTypeAnnotationKind; comments?: K.CommentKind[] | null; extends?: K.InterfaceExtendsKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.InterfaceTypeAnnotation; } export interface InterfaceExtendsBuilder { (id: K.IdentifierKind): namedTypes.InterfaceExtends; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TypeParameterInstantiationKind | null; } ): namedTypes.InterfaceExtends; } export interface InterfaceDeclarationBuilder { ( id: K.IdentifierKind, body: K.ObjectTypeAnnotationKind, extendsParam: K.InterfaceExtendsKind[] ): namedTypes.InterfaceDeclaration; from( params: { body: K.ObjectTypeAnnotationKind; comments?: K.CommentKind[] | null; extends: K.InterfaceExtendsKind[]; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TypeParameterDeclarationKind | null; } ): namedTypes.InterfaceDeclaration; } export interface DeclareInterfaceBuilder { ( id: K.IdentifierKind, body: K.ObjectTypeAnnotationKind, extendsParam: K.InterfaceExtendsKind[] ): namedTypes.DeclareInterface; from( params: { body: K.ObjectTypeAnnotationKind; comments?: K.CommentKind[] | null; extends: K.InterfaceExtendsKind[]; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TypeParameterDeclarationKind | null; } ): namedTypes.DeclareInterface; } export interface TypeAliasBuilder { ( id: K.IdentifierKind, typeParameters: K.TypeParameterDeclarationKind | null, right: K.FlowTypeKind ): namedTypes.TypeAlias; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; right: K.FlowTypeKind; typeParameters: K.TypeParameterDeclarationKind | null; } ): namedTypes.TypeAlias; } export interface DeclareTypeAliasBuilder { ( id: K.IdentifierKind, typeParameters: K.TypeParameterDeclarationKind | null, right: K.FlowTypeKind ): namedTypes.DeclareTypeAlias; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; right: K.FlowTypeKind; typeParameters: K.TypeParameterDeclarationKind | null; } ): namedTypes.DeclareTypeAlias; } export interface OpaqueTypeBuilder { ( id: K.IdentifierKind, typeParameters: K.TypeParameterDeclarationKind | null, impltype: K.FlowTypeKind, supertype: K.FlowTypeKind | null ): namedTypes.OpaqueType; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; impltype: K.FlowTypeKind; loc?: K.SourceLocationKind | null; supertype: K.FlowTypeKind | null; typeParameters: K.TypeParameterDeclarationKind | null; } ): namedTypes.OpaqueType; } export interface DeclareOpaqueTypeBuilder { ( id: K.IdentifierKind, typeParameters: K.TypeParameterDeclarationKind | null, supertype: K.FlowTypeKind | null ): namedTypes.DeclareOpaqueType; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; impltype: K.FlowTypeKind | null; loc?: K.SourceLocationKind | null; supertype: K.FlowTypeKind | null; typeParameters: K.TypeParameterDeclarationKind | null; } ): namedTypes.DeclareOpaqueType; } export interface TypeCastExpressionBuilder { (expression: K.ExpressionKind, typeAnnotation: K.TypeAnnotationKind): namedTypes.TypeCastExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; typeAnnotation: K.TypeAnnotationKind; } ): namedTypes.TypeCastExpression; } export interface TupleTypeAnnotationBuilder { (types: K.FlowTypeKind[]): namedTypes.TupleTypeAnnotation; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; types: K.FlowTypeKind[]; } ): namedTypes.TupleTypeAnnotation; } export interface DeclareVariableBuilder { (id: K.IdentifierKind): namedTypes.DeclareVariable; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.DeclareVariable; } export interface DeclareFunctionBuilder { (id: K.IdentifierKind): namedTypes.DeclareFunction; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; predicate?: K.FlowPredicateKind | null; } ): namedTypes.DeclareFunction; } export interface DeclareClassBuilder { (id: K.IdentifierKind): namedTypes.DeclareClass; from( params: { body: K.ObjectTypeAnnotationKind; comments?: K.CommentKind[] | null; extends: K.InterfaceExtendsKind[]; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TypeParameterDeclarationKind | null; } ): namedTypes.DeclareClass; } export interface DeclareModuleBuilder { (id: K.IdentifierKind | K.LiteralKind, body: K.BlockStatementKind): namedTypes.DeclareModule; from( params: { body: K.BlockStatementKind; comments?: K.CommentKind[] | null; id: K.IdentifierKind | K.LiteralKind; loc?: K.SourceLocationKind | null; } ): namedTypes.DeclareModule; } export interface DeclareModuleExportsBuilder { (typeAnnotation: K.TypeAnnotationKind): namedTypes.DeclareModuleExports; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TypeAnnotationKind; } ): namedTypes.DeclareModuleExports; } export interface DeclareExportDeclarationBuilder { ( defaultParam: boolean, declaration: K.DeclareVariableKind | K.DeclareFunctionKind | K.DeclareClassKind | K.FlowTypeKind | K.TypeAliasKind | K.DeclareOpaqueTypeKind | K.InterfaceDeclarationKind | null, specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[], source?: K.LiteralKind | null ): namedTypes.DeclareExportDeclaration; from( params: { comments?: K.CommentKind[] | null; declaration: K.DeclareVariableKind | K.DeclareFunctionKind | K.DeclareClassKind | K.FlowTypeKind | K.TypeAliasKind | K.DeclareOpaqueTypeKind | K.InterfaceDeclarationKind | null; default: boolean; loc?: K.SourceLocationKind | null; source?: K.LiteralKind | null; specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[]; } ): namedTypes.DeclareExportDeclaration; } export interface ExportBatchSpecifierBuilder { (): namedTypes.ExportBatchSpecifier; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.ExportBatchSpecifier; } export interface DeclareExportAllDeclarationBuilder { (source?: K.LiteralKind | null): namedTypes.DeclareExportAllDeclaration; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; source?: K.LiteralKind | null; } ): namedTypes.DeclareExportAllDeclaration; } export interface InferredPredicateBuilder { (): namedTypes.InferredPredicate; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.InferredPredicate; } export interface DeclaredPredicateBuilder { (value: K.ExpressionKind): namedTypes.DeclaredPredicate; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value: K.ExpressionKind; } ): namedTypes.DeclaredPredicate; } export interface EnumDeclarationBuilder { ( id: K.IdentifierKind, body: K.EnumBooleanBodyKind | K.EnumNumberBodyKind | K.EnumStringBodyKind | K.EnumSymbolBodyKind ): namedTypes.EnumDeclaration; from( params: { body: K.EnumBooleanBodyKind | K.EnumNumberBodyKind | K.EnumStringBodyKind | K.EnumSymbolBodyKind; comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.EnumDeclaration; } export interface EnumBooleanBodyBuilder { (members: K.EnumBooleanMemberKind[], explicitType: boolean): namedTypes.EnumBooleanBody; from( params: { explicitType: boolean; members: K.EnumBooleanMemberKind[]; } ): namedTypes.EnumBooleanBody; } export interface EnumNumberBodyBuilder { (members: K.EnumNumberMemberKind[], explicitType: boolean): namedTypes.EnumNumberBody; from( params: { explicitType: boolean; members: K.EnumNumberMemberKind[]; } ): namedTypes.EnumNumberBody; } export interface EnumStringBodyBuilder { ( members: K.EnumStringMemberKind[] | K.EnumDefaultedMemberKind[], explicitType: boolean ): namedTypes.EnumStringBody; from( params: { explicitType: boolean; members: K.EnumStringMemberKind[] | K.EnumDefaultedMemberKind[]; } ): namedTypes.EnumStringBody; } export interface EnumSymbolBodyBuilder { (members: K.EnumDefaultedMemberKind[]): namedTypes.EnumSymbolBody; from( params: { members: K.EnumDefaultedMemberKind[]; } ): namedTypes.EnumSymbolBody; } export interface EnumBooleanMemberBuilder { (id: K.IdentifierKind, init: K.LiteralKind | boolean): namedTypes.EnumBooleanMember; from( params: { id: K.IdentifierKind; init: K.LiteralKind | boolean; } ): namedTypes.EnumBooleanMember; } export interface EnumNumberMemberBuilder { (id: K.IdentifierKind, init: K.LiteralKind): namedTypes.EnumNumberMember; from( params: { id: K.IdentifierKind; init: K.LiteralKind; } ): namedTypes.EnumNumberMember; } export interface EnumStringMemberBuilder { (id: K.IdentifierKind, init: K.LiteralKind): namedTypes.EnumStringMember; from( params: { id: K.IdentifierKind; init: K.LiteralKind; } ): namedTypes.EnumStringMember; } export interface EnumDefaultedMemberBuilder { (id: K.IdentifierKind): namedTypes.EnumDefaultedMember; from( params: { id: K.IdentifierKind; } ): namedTypes.EnumDefaultedMember; } export interface ExportDeclarationBuilder { ( defaultParam: boolean, declaration: K.DeclarationKind | K.ExpressionKind | null, specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[], source?: K.LiteralKind | null ): namedTypes.ExportDeclaration; from( params: { comments?: K.CommentKind[] | null; declaration: K.DeclarationKind | K.ExpressionKind | null; default: boolean; loc?: K.SourceLocationKind | null; source?: K.LiteralKind | null; specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[]; } ): namedTypes.ExportDeclaration; } export interface BlockBuilder { (value: string, leading?: boolean, trailing?: boolean): namedTypes.Block; from( params: { leading?: boolean; loc?: K.SourceLocationKind | null; trailing?: boolean; value: string; } ): namedTypes.Block; } export interface LineBuilder { (value: string, leading?: boolean, trailing?: boolean): namedTypes.Line; from( params: { leading?: boolean; loc?: K.SourceLocationKind | null; trailing?: boolean; value: string; } ): namedTypes.Line; } export interface NoopBuilder { (): namedTypes.Noop; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.Noop; } export interface DoExpressionBuilder { (body: K.StatementKind[]): namedTypes.DoExpression; from( params: { body: K.StatementKind[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.DoExpression; } export interface BindExpressionBuilder { (object: K.ExpressionKind | null, callee: K.ExpressionKind): namedTypes.BindExpression; from( params: { callee: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; object: K.ExpressionKind | null; } ): namedTypes.BindExpression; } export interface ParenthesizedExpressionBuilder { (expression: K.ExpressionKind): namedTypes.ParenthesizedExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ParenthesizedExpression; } export interface ExportNamespaceSpecifierBuilder { (exported: K.IdentifierKind): namedTypes.ExportNamespaceSpecifier; from( params: { comments?: K.CommentKind[] | null; exported: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ExportNamespaceSpecifier; } export interface ExportDefaultSpecifierBuilder { (exported: K.IdentifierKind): namedTypes.ExportDefaultSpecifier; from( params: { comments?: K.CommentKind[] | null; exported: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.ExportDefaultSpecifier; } export interface CommentBlockBuilder { (value: string, leading?: boolean, trailing?: boolean): namedTypes.CommentBlock; from( params: { leading?: boolean; loc?: K.SourceLocationKind | null; trailing?: boolean; value: string; } ): namedTypes.CommentBlock; } export interface CommentLineBuilder { (value: string, leading?: boolean, trailing?: boolean): namedTypes.CommentLine; from( params: { leading?: boolean; loc?: K.SourceLocationKind | null; trailing?: boolean; value: string; } ): namedTypes.CommentLine; } export interface DirectiveBuilder { (value: K.DirectiveLiteralKind): namedTypes.Directive; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value: K.DirectiveLiteralKind; } ): namedTypes.Directive; } export interface DirectiveLiteralBuilder { (value?: string): namedTypes.DirectiveLiteral; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value?: string; } ): namedTypes.DirectiveLiteral; } export interface InterpreterDirectiveBuilder { (value: string): namedTypes.InterpreterDirective; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value: string; } ): namedTypes.InterpreterDirective; } export interface StringLiteralBuilder { (value: string): namedTypes.StringLiteral; from( params: { comments?: K.CommentKind[] | null; extra?: { rawValue: string; raw: string; }; loc?: K.SourceLocationKind | null; value: string; } ): namedTypes.StringLiteral; } export interface NumericLiteralBuilder { (value: number): namedTypes.NumericLiteral; from( params: { comments?: K.CommentKind[] | null; extra?: { rawValue: number; raw: string; }; loc?: K.SourceLocationKind | null; raw?: string | null; value: number; } ): namedTypes.NumericLiteral; } export interface BigIntLiteralBuilder { (value: string | number): namedTypes.BigIntLiteral; from( params: { comments?: K.CommentKind[] | null; extra?: { rawValue: string; raw: string; }; loc?: K.SourceLocationKind | null; value: string | number; } ): namedTypes.BigIntLiteral; } export interface DecimalLiteralBuilder { (value: string): namedTypes.DecimalLiteral; from( params: { comments?: K.CommentKind[] | null; extra?: { rawValue: string; raw: string; }; loc?: K.SourceLocationKind | null; value: string; } ): namedTypes.DecimalLiteral; } export interface NullLiteralBuilder { (): namedTypes.NullLiteral; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value?: null; } ): namedTypes.NullLiteral; } export interface BooleanLiteralBuilder { (value: boolean): namedTypes.BooleanLiteral; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; value: boolean; } ): namedTypes.BooleanLiteral; } export interface RegExpLiteralBuilder { (pattern: string, flags: string): namedTypes.RegExpLiteral; from( params: { comments?: K.CommentKind[] | null; extra?: { rawValue: RegExp | undefined; raw: string; }; flags: string; loc?: K.SourceLocationKind | null; pattern: string; regex?: { pattern: string; flags: string; }; value?: RegExp; } ): namedTypes.RegExpLiteral; } export interface ClassMethodBuilder { ( kind: "get" | "set" | "method" | "constructor" | undefined, key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, params: K.PatternKind[], body: K.BlockStatementKind, computed?: boolean, staticParam?: boolean ): namedTypes.ClassMethod; from( params: { abstract?: boolean; access?: "public" | "private" | "protected" | null; accessibility?: "public" | "private" | "protected" | null; async?: boolean; body: K.BlockStatementKind; comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; defaults?: (K.ExpressionKind | null)[]; definite?: boolean; expression?: boolean; generator?: boolean; id?: K.IdentifierKind | null; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; kind?: "get" | "set" | "method" | "constructor"; loc?: K.SourceLocationKind | null; optional?: boolean; override?: boolean; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; readonly?: boolean; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; static?: boolean; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ClassMethod; } export interface ClassPrivateMethodBuilder { ( key: K.PrivateNameKind, params: K.PatternKind[], body: K.BlockStatementKind, kind?: "get" | "set" | "method" | "constructor", computed?: boolean, staticParam?: boolean ): namedTypes.ClassPrivateMethod; from( params: { abstract?: boolean; access?: "public" | "private" | "protected" | null; accessibility?: "public" | "private" | "protected" | null; async?: boolean; body: K.BlockStatementKind; comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; defaults?: (K.ExpressionKind | null)[]; definite?: boolean; expression?: boolean; generator?: boolean; id?: K.IdentifierKind | null; key: K.PrivateNameKind; kind?: "get" | "set" | "method" | "constructor"; loc?: K.SourceLocationKind | null; optional?: boolean; override?: boolean; params: K.PatternKind[]; predicate?: K.FlowPredicateKind | null; readonly?: boolean; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; static?: boolean; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; } ): namedTypes.ClassPrivateMethod; } export interface ClassAccessorPropertyBuilder { ( key: K.LiteralKind | K.IdentifierKind | K.PrivateNameKind | K.ExpressionKind, value?: K.ExpressionKind | null, decorators?: K.DecoratorKind[] | null, computed?: boolean, staticParam?: boolean ): namedTypes.ClassAccessorProperty; from( params: { abstract?: boolean; accessibility?: "public" | "private" | "protected" | null; comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; definite?: boolean; key: K.LiteralKind | K.IdentifierKind | K.PrivateNameKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; optional?: boolean; override?: boolean; readonly?: boolean; static?: boolean; typeAnnotation?: K.TSTypeAnnotationKind | null; value?: K.ExpressionKind | null; } ): namedTypes.ClassAccessorProperty; } export interface RestPropertyBuilder { (argument: K.ExpressionKind): namedTypes.RestProperty; from( params: { argument: K.ExpressionKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.RestProperty; } export interface ForAwaitStatementBuilder { ( left: K.VariableDeclarationKind | K.ExpressionKind, right: K.ExpressionKind, body: K.StatementKind ): namedTypes.ForAwaitStatement; from( params: { body: K.StatementKind; comments?: K.CommentKind[] | null; left: K.VariableDeclarationKind | K.ExpressionKind; loc?: K.SourceLocationKind | null; right: K.ExpressionKind; } ): namedTypes.ForAwaitStatement; } export interface ImportBuilder { (): namedTypes.Import; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.Import; } export interface V8IntrinsicIdentifierBuilder { (name: string): namedTypes.V8IntrinsicIdentifier; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; name: string; } ): namedTypes.V8IntrinsicIdentifier; } export interface TopicReferenceBuilder { (): namedTypes.TopicReference; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TopicReference; } export interface TSQualifiedNameBuilder { ( left: K.IdentifierKind | K.TSQualifiedNameKind, right: K.IdentifierKind | K.TSQualifiedNameKind ): namedTypes.TSQualifiedName; from( params: { comments?: K.CommentKind[] | null; left: K.IdentifierKind | K.TSQualifiedNameKind; loc?: K.SourceLocationKind | null; right: K.IdentifierKind | K.TSQualifiedNameKind; } ): namedTypes.TSQualifiedName; } export interface TSTypeReferenceBuilder { ( typeName: K.IdentifierKind | K.TSQualifiedNameKind, typeParameters?: K.TSTypeParameterInstantiationKind | null ): namedTypes.TSTypeReference; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeName: K.IdentifierKind | K.TSQualifiedNameKind; typeParameters?: K.TSTypeParameterInstantiationKind | null; } ): namedTypes.TSTypeReference; } export interface TSAsExpressionBuilder { (expression: K.ExpressionKind, typeAnnotation: K.TSTypeKind): namedTypes.TSAsExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; extra?: { parenthesized: boolean; } | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSAsExpression; } export interface TSTypeCastExpressionBuilder { (expression: K.ExpressionKind, typeAnnotation: K.TSTypeKind): namedTypes.TSTypeCastExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSTypeCastExpression; } export interface TSSatisfiesExpressionBuilder { (expression: K.ExpressionKind, typeAnnotation: K.TSTypeKind): namedTypes.TSSatisfiesExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSSatisfiesExpression; } export interface TSNonNullExpressionBuilder { (expression: K.ExpressionKind): namedTypes.TSNonNullExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSNonNullExpression; } export interface TSAnyKeywordBuilder { (): namedTypes.TSAnyKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSAnyKeyword; } export interface TSBigIntKeywordBuilder { (): namedTypes.TSBigIntKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSBigIntKeyword; } export interface TSBooleanKeywordBuilder { (): namedTypes.TSBooleanKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSBooleanKeyword; } export interface TSNeverKeywordBuilder { (): namedTypes.TSNeverKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSNeverKeyword; } export interface TSNullKeywordBuilder { (): namedTypes.TSNullKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSNullKeyword; } export interface TSNumberKeywordBuilder { (): namedTypes.TSNumberKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSNumberKeyword; } export interface TSObjectKeywordBuilder { (): namedTypes.TSObjectKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSObjectKeyword; } export interface TSStringKeywordBuilder { (): namedTypes.TSStringKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSStringKeyword; } export interface TSSymbolKeywordBuilder { (): namedTypes.TSSymbolKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSSymbolKeyword; } export interface TSUndefinedKeywordBuilder { (): namedTypes.TSUndefinedKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSUndefinedKeyword; } export interface TSUnknownKeywordBuilder { (): namedTypes.TSUnknownKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSUnknownKeyword; } export interface TSVoidKeywordBuilder { (): namedTypes.TSVoidKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSVoidKeyword; } export interface TSIntrinsicKeywordBuilder { (): namedTypes.TSIntrinsicKeyword; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSIntrinsicKeyword; } export interface TSThisTypeBuilder { (): namedTypes.TSThisType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSThisType; } export interface TSArrayTypeBuilder { (elementType: K.TSTypeKind): namedTypes.TSArrayType; from( params: { comments?: K.CommentKind[] | null; elementType: K.TSTypeKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSArrayType; } export interface TSLiteralTypeBuilder { ( literal: K.NumericLiteralKind | K.StringLiteralKind | K.BooleanLiteralKind | K.TemplateLiteralKind | K.UnaryExpressionKind | K.BigIntLiteralKind ): namedTypes.TSLiteralType; from( params: { comments?: K.CommentKind[] | null; literal: K.NumericLiteralKind | K.StringLiteralKind | K.BooleanLiteralKind | K.TemplateLiteralKind | K.UnaryExpressionKind | K.BigIntLiteralKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSLiteralType; } export interface TSUnionTypeBuilder { (types: K.TSTypeKind[]): namedTypes.TSUnionType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; types: K.TSTypeKind[]; } ): namedTypes.TSUnionType; } export interface TSIntersectionTypeBuilder { (types: K.TSTypeKind[]): namedTypes.TSIntersectionType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; types: K.TSTypeKind[]; } ): namedTypes.TSIntersectionType; } export interface TSConditionalTypeBuilder { ( checkType: K.TSTypeKind, extendsType: K.TSTypeKind, trueType: K.TSTypeKind, falseType: K.TSTypeKind ): namedTypes.TSConditionalType; from( params: { checkType: K.TSTypeKind; comments?: K.CommentKind[] | null; extendsType: K.TSTypeKind; falseType: K.TSTypeKind; loc?: K.SourceLocationKind | null; trueType: K.TSTypeKind; } ): namedTypes.TSConditionalType; } export interface TSInferTypeBuilder { (typeParameter: K.TSTypeParameterKind): namedTypes.TSInferType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeParameter: K.TSTypeParameterKind; } ): namedTypes.TSInferType; } export interface TSTypeParameterBuilder { ( name: K.IdentifierKind | string, constraint?: K.TSTypeKind | undefined, defaultParam?: K.TSTypeKind | undefined ): namedTypes.TSTypeParameter; from( params: { comments?: K.CommentKind[] | null; constraint?: K.TSTypeKind | undefined; default?: K.TSTypeKind | undefined; loc?: K.SourceLocationKind | null; name: K.IdentifierKind | string; optional?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } ): namedTypes.TSTypeParameter; } export interface TSParenthesizedTypeBuilder { (typeAnnotation: K.TSTypeKind): namedTypes.TSParenthesizedType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSParenthesizedType; } export interface TSFunctionTypeBuilder { ( parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[] ): namedTypes.TSFunctionType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; typeAnnotation?: K.TSTypeAnnotationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSFunctionType; } export interface TSConstructorTypeBuilder { ( parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[] ): namedTypes.TSConstructorType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; typeAnnotation?: K.TSTypeAnnotationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSConstructorType; } export interface TSDeclareFunctionBuilder { ( id: K.IdentifierKind | null | undefined, params: K.PatternKind[], returnType?: K.TSTypeAnnotationKind | K.NoopKind | null ): namedTypes.TSDeclareFunction; from( params: { async?: boolean; comments?: K.CommentKind[] | null; declare?: boolean; generator?: boolean; id?: K.IdentifierKind | null; loc?: K.SourceLocationKind | null; params: K.PatternKind[]; returnType?: K.TSTypeAnnotationKind | K.NoopKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSDeclareFunction; } export interface TSDeclareMethodBuilder { ( key: K.IdentifierKind | K.StringLiteralKind | K.NumericLiteralKind | K.ExpressionKind, params: K.PatternKind[], returnType?: K.TSTypeAnnotationKind | K.NoopKind | null ): namedTypes.TSDeclareMethod; from( params: { abstract?: boolean; access?: "public" | "private" | "protected" | undefined; accessibility?: "public" | "private" | "protected" | undefined; async?: boolean; comments?: K.CommentKind[] | null; computed?: boolean; decorators?: K.DecoratorKind[] | null; generator?: boolean; key: K.IdentifierKind | K.StringLiteralKind | K.NumericLiteralKind | K.ExpressionKind; kind?: "get" | "set" | "method" | "constructor"; loc?: K.SourceLocationKind | null; optional?: boolean; params: K.PatternKind[]; returnType?: K.TSTypeAnnotationKind | K.NoopKind | null; static?: boolean; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSDeclareMethod; } export interface TSMappedTypeBuilder { (typeParameter: K.TSTypeParameterKind, typeAnnotation?: K.TSTypeKind | null): namedTypes.TSMappedType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; optional?: boolean | "+" | "-"; readonly?: boolean | "+" | "-"; typeAnnotation?: K.TSTypeKind | null; typeParameter: K.TSTypeParameterKind; } ): namedTypes.TSMappedType; } export interface TSTupleTypeBuilder { (elementTypes: (K.TSTypeKind | K.TSNamedTupleMemberKind)[]): namedTypes.TSTupleType; from( params: { comments?: K.CommentKind[] | null; elementTypes: (K.TSTypeKind | K.TSNamedTupleMemberKind)[]; loc?: K.SourceLocationKind | null; } ): namedTypes.TSTupleType; } export interface TSNamedTupleMemberBuilder { (label: K.IdentifierKind, elementType: K.TSTypeKind, optional?: boolean): namedTypes.TSNamedTupleMember; from( params: { comments?: K.CommentKind[] | null; elementType: K.TSTypeKind; label: K.IdentifierKind; loc?: K.SourceLocationKind | null; optional?: boolean; } ): namedTypes.TSNamedTupleMember; } export interface TSRestTypeBuilder { (typeAnnotation: K.TSTypeKind): namedTypes.TSRestType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSRestType; } export interface TSOptionalTypeBuilder { (typeAnnotation: K.TSTypeKind): namedTypes.TSOptionalType; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSOptionalType; } export interface TSIndexedAccessTypeBuilder { (objectType: K.TSTypeKind, indexType: K.TSTypeKind): namedTypes.TSIndexedAccessType; from( params: { comments?: K.CommentKind[] | null; indexType: K.TSTypeKind; loc?: K.SourceLocationKind | null; objectType: K.TSTypeKind; } ): namedTypes.TSIndexedAccessType; } export interface TSTypeOperatorBuilder { (operator: string): namedTypes.TSTypeOperator; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; operator: string; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSTypeOperator; } export interface TSIndexSignatureBuilder { ( parameters: K.IdentifierKind[], typeAnnotation?: K.TSTypeAnnotationKind | null ): namedTypes.TSIndexSignature; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameters: K.IdentifierKind[]; readonly?: boolean; typeAnnotation?: K.TSTypeAnnotationKind | null; } ): namedTypes.TSIndexSignature; } export interface TSPropertySignatureBuilder { ( key: K.ExpressionKind, typeAnnotation?: K.TSTypeAnnotationKind | null, optional?: boolean ): namedTypes.TSPropertySignature; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; initializer?: K.ExpressionKind | null; key: K.ExpressionKind; loc?: K.SourceLocationKind | null; optional?: boolean; readonly?: boolean; typeAnnotation?: K.TSTypeAnnotationKind | null; } ): namedTypes.TSPropertySignature; } export interface TSMethodSignatureBuilder { ( key: K.ExpressionKind, parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[], typeAnnotation?: K.TSTypeAnnotationKind | null ): namedTypes.TSMethodSignature; from( params: { comments?: K.CommentKind[] | null; computed?: boolean; key: K.ExpressionKind; loc?: K.SourceLocationKind | null; optional?: boolean; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; typeAnnotation?: K.TSTypeAnnotationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSMethodSignature; } export interface TSTypePredicateBuilder { ( parameterName: K.IdentifierKind | K.TSThisTypeKind, typeAnnotation?: K.TSTypeAnnotationKind | null, asserts?: boolean ): namedTypes.TSTypePredicate; from( params: { asserts?: boolean; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameterName: K.IdentifierKind | K.TSThisTypeKind; typeAnnotation?: K.TSTypeAnnotationKind | null; } ): namedTypes.TSTypePredicate; } export interface TSCallSignatureDeclarationBuilder { ( parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[], typeAnnotation?: K.TSTypeAnnotationKind | null ): namedTypes.TSCallSignatureDeclaration; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; typeAnnotation?: K.TSTypeAnnotationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSCallSignatureDeclaration; } export interface TSConstructSignatureDeclarationBuilder { ( parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[], typeAnnotation?: K.TSTypeAnnotationKind | null ): namedTypes.TSConstructSignatureDeclaration; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; typeAnnotation?: K.TSTypeAnnotationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSConstructSignatureDeclaration; } export interface TSEnumMemberBuilder { ( id: K.IdentifierKind | K.StringLiteralKind, initializer?: K.ExpressionKind | null ): namedTypes.TSEnumMember; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind | K.StringLiteralKind; initializer?: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSEnumMember; } export interface TSTypeQueryBuilder { (exprName: K.IdentifierKind | K.TSQualifiedNameKind | K.TSImportTypeKind): namedTypes.TSTypeQuery; from( params: { comments?: K.CommentKind[] | null; exprName: K.IdentifierKind | K.TSQualifiedNameKind | K.TSImportTypeKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSTypeQuery; } export interface TSImportTypeBuilder { ( argument: K.StringLiteralKind, qualifier?: K.IdentifierKind | K.TSQualifiedNameKind | undefined, typeParameters?: K.TSTypeParameterInstantiationKind | null ): namedTypes.TSImportType; from( params: { argument: K.StringLiteralKind; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; qualifier?: K.IdentifierKind | K.TSQualifiedNameKind | undefined; typeParameters?: K.TSTypeParameterInstantiationKind | null; } ): namedTypes.TSImportType; } export interface TSTypeLiteralBuilder { ( members: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[] ): namedTypes.TSTypeLiteral; from( params: { comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; members: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; } ): namedTypes.TSTypeLiteral; } export interface TSTypeAssertionBuilder { (typeAnnotation: K.TSTypeKind, expression: K.ExpressionKind): namedTypes.TSTypeAssertion; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; extra?: { parenthesized: boolean; } | null; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; } ): namedTypes.TSTypeAssertion; } export interface TSInstantiationExpressionBuilder { ( expression: K.ExpressionKind, typeParameters?: K.TSTypeParameterInstantiationKind | null ): namedTypes.TSInstantiationExpression; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TSTypeParameterInstantiationKind | null; } ): namedTypes.TSInstantiationExpression; } export interface TSEnumDeclarationBuilder { (id: K.IdentifierKind, members: K.TSEnumMemberKind[]): namedTypes.TSEnumDeclaration; from( params: { comments?: K.CommentKind[] | null; const?: boolean; declare?: boolean; id: K.IdentifierKind; initializer?: K.ExpressionKind | null; loc?: K.SourceLocationKind | null; members: K.TSEnumMemberKind[]; } ): namedTypes.TSEnumDeclaration; } export interface TSTypeAliasDeclarationBuilder { (id: K.IdentifierKind, typeAnnotation: K.TSTypeKind): namedTypes.TSTypeAliasDeclaration; from( params: { comments?: K.CommentKind[] | null; declare?: boolean; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; typeAnnotation: K.TSTypeKind; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSTypeAliasDeclaration; } export interface TSModuleBlockBuilder { (body: K.StatementKind[]): namedTypes.TSModuleBlock; from( params: { body: K.StatementKind[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSModuleBlock; } export interface TSModuleDeclarationBuilder { ( id: K.StringLiteralKind | K.IdentifierKind | K.TSQualifiedNameKind, body?: K.TSModuleBlockKind | K.TSModuleDeclarationKind | null ): namedTypes.TSModuleDeclaration; from( params: { body?: K.TSModuleBlockKind | K.TSModuleDeclarationKind | null; comments?: K.CommentKind[] | null; declare?: boolean; global?: boolean; id: K.StringLiteralKind | K.IdentifierKind | K.TSQualifiedNameKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSModuleDeclaration; } export interface TSImportEqualsDeclarationBuilder { ( id: K.IdentifierKind, moduleReference: K.IdentifierKind | K.TSQualifiedNameKind | K.TSExternalModuleReferenceKind ): namedTypes.TSImportEqualsDeclaration; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; isExport?: boolean; loc?: K.SourceLocationKind | null; moduleReference: K.IdentifierKind | K.TSQualifiedNameKind | K.TSExternalModuleReferenceKind; } ): namedTypes.TSImportEqualsDeclaration; } export interface TSExternalModuleReferenceBuilder { (expression: K.StringLiteralKind): namedTypes.TSExternalModuleReference; from( params: { comments?: K.CommentKind[] | null; expression: K.StringLiteralKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSExternalModuleReference; } export interface TSExportAssignmentBuilder { (expression: K.ExpressionKind): namedTypes.TSExportAssignment; from( params: { comments?: K.CommentKind[] | null; expression: K.ExpressionKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSExportAssignment; } export interface TSNamespaceExportDeclarationBuilder { (id: K.IdentifierKind): namedTypes.TSNamespaceExportDeclaration; from( params: { comments?: K.CommentKind[] | null; id: K.IdentifierKind; loc?: K.SourceLocationKind | null; } ): namedTypes.TSNamespaceExportDeclaration; } export interface TSInterfaceBodyBuilder { ( body: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[] ): namedTypes.TSInterfaceBody; from( params: { body: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; } ): namedTypes.TSInterfaceBody; } export interface TSInterfaceDeclarationBuilder { (id: K.IdentifierKind | K.TSQualifiedNameKind, body: K.TSInterfaceBodyKind): namedTypes.TSInterfaceDeclaration; from( params: { body: K.TSInterfaceBodyKind; comments?: K.CommentKind[] | null; declare?: boolean; extends?: K.TSExpressionWithTypeArgumentsKind[] | null; id: K.IdentifierKind | K.TSQualifiedNameKind; loc?: K.SourceLocationKind | null; typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } ): namedTypes.TSInterfaceDeclaration; } export interface TSParameterPropertyBuilder { (parameter: K.IdentifierKind | K.AssignmentPatternKind): namedTypes.TSParameterProperty; from( params: { accessibility?: "public" | "private" | "protected" | undefined; comments?: K.CommentKind[] | null; loc?: K.SourceLocationKind | null; parameter: K.IdentifierKind | K.AssignmentPatternKind; readonly?: boolean; } ): namedTypes.TSParameterProperty; } export interface builders { file: FileBuilder; program: ProgramBuilder; identifier: IdentifierBuilder; blockStatement: BlockStatementBuilder; emptyStatement: EmptyStatementBuilder; expressionStatement: ExpressionStatementBuilder; ifStatement: IfStatementBuilder; labeledStatement: LabeledStatementBuilder; breakStatement: BreakStatementBuilder; continueStatement: ContinueStatementBuilder; withStatement: WithStatementBuilder; switchStatement: SwitchStatementBuilder; switchCase: SwitchCaseBuilder; returnStatement: ReturnStatementBuilder; throwStatement: ThrowStatementBuilder; tryStatement: TryStatementBuilder; catchClause: CatchClauseBuilder; whileStatement: WhileStatementBuilder; doWhileStatement: DoWhileStatementBuilder; forStatement: ForStatementBuilder; variableDeclaration: VariableDeclarationBuilder; forInStatement: ForInStatementBuilder; debuggerStatement: DebuggerStatementBuilder; functionDeclaration: FunctionDeclarationBuilder; functionExpression: FunctionExpressionBuilder; variableDeclarator: VariableDeclaratorBuilder; thisExpression: ThisExpressionBuilder; arrayExpression: ArrayExpressionBuilder; objectExpression: ObjectExpressionBuilder; property: PropertyBuilder; literal: LiteralBuilder; sequenceExpression: SequenceExpressionBuilder; unaryExpression: UnaryExpressionBuilder; binaryExpression: BinaryExpressionBuilder; assignmentExpression: AssignmentExpressionBuilder; memberExpression: MemberExpressionBuilder; updateExpression: UpdateExpressionBuilder; logicalExpression: LogicalExpressionBuilder; conditionalExpression: ConditionalExpressionBuilder; newExpression: NewExpressionBuilder; callExpression: CallExpressionBuilder; restElement: RestElementBuilder; typeAnnotation: TypeAnnotationBuilder; tsTypeAnnotation: TSTypeAnnotationBuilder; spreadElementPattern: SpreadElementPatternBuilder; arrowFunctionExpression: ArrowFunctionExpressionBuilder; forOfStatement: ForOfStatementBuilder; yieldExpression: YieldExpressionBuilder; generatorExpression: GeneratorExpressionBuilder; comprehensionBlock: ComprehensionBlockBuilder; comprehensionExpression: ComprehensionExpressionBuilder; objectProperty: ObjectPropertyBuilder; propertyPattern: PropertyPatternBuilder; objectPattern: ObjectPatternBuilder; arrayPattern: ArrayPatternBuilder; spreadElement: SpreadElementBuilder; assignmentPattern: AssignmentPatternBuilder; methodDefinition: MethodDefinitionBuilder; classPropertyDefinition: ClassPropertyDefinitionBuilder; classProperty: ClassPropertyBuilder; staticBlock: StaticBlockBuilder; classBody: ClassBodyBuilder; classDeclaration: ClassDeclarationBuilder; classExpression: ClassExpressionBuilder; super: SuperBuilder; importSpecifier: ImportSpecifierBuilder; importDefaultSpecifier: ImportDefaultSpecifierBuilder; importNamespaceSpecifier: ImportNamespaceSpecifierBuilder; importDeclaration: ImportDeclarationBuilder; exportNamedDeclaration: ExportNamedDeclarationBuilder; exportSpecifier: ExportSpecifierBuilder; exportDefaultDeclaration: ExportDefaultDeclarationBuilder; exportAllDeclaration: ExportAllDeclarationBuilder; taggedTemplateExpression: TaggedTemplateExpressionBuilder; templateLiteral: TemplateLiteralBuilder; templateElement: TemplateElementBuilder; metaProperty: MetaPropertyBuilder; awaitExpression: AwaitExpressionBuilder; spreadProperty: SpreadPropertyBuilder; spreadPropertyPattern: SpreadPropertyPatternBuilder; importExpression: ImportExpressionBuilder; chainExpression: ChainExpressionBuilder; optionalCallExpression: OptionalCallExpressionBuilder; optionalMemberExpression: OptionalMemberExpressionBuilder; decorator: DecoratorBuilder; privateName: PrivateNameBuilder; classPrivateProperty: ClassPrivatePropertyBuilder; importAttribute: ImportAttributeBuilder; recordExpression: RecordExpressionBuilder; objectMethod: ObjectMethodBuilder; tupleExpression: TupleExpressionBuilder; moduleExpression: ModuleExpressionBuilder; jsxAttribute: JSXAttributeBuilder; jsxIdentifier: JSXIdentifierBuilder; jsxNamespacedName: JSXNamespacedNameBuilder; jsxExpressionContainer: JSXExpressionContainerBuilder; jsxElement: JSXElementBuilder; jsxFragment: JSXFragmentBuilder; jsxMemberExpression: JSXMemberExpressionBuilder; jsxSpreadAttribute: JSXSpreadAttributeBuilder; jsxEmptyExpression: JSXEmptyExpressionBuilder; jsxText: JSXTextBuilder; jsxSpreadChild: JSXSpreadChildBuilder; jsxOpeningElement: JSXOpeningElementBuilder; jsxClosingElement: JSXClosingElementBuilder; jsxOpeningFragment: JSXOpeningFragmentBuilder; jsxClosingFragment: JSXClosingFragmentBuilder; typeParameterDeclaration: TypeParameterDeclarationBuilder; tsTypeParameterDeclaration: TSTypeParameterDeclarationBuilder; typeParameterInstantiation: TypeParameterInstantiationBuilder; tsTypeParameterInstantiation: TSTypeParameterInstantiationBuilder; classImplements: ClassImplementsBuilder; tsExpressionWithTypeArguments: TSExpressionWithTypeArgumentsBuilder; anyTypeAnnotation: AnyTypeAnnotationBuilder; emptyTypeAnnotation: EmptyTypeAnnotationBuilder; mixedTypeAnnotation: MixedTypeAnnotationBuilder; voidTypeAnnotation: VoidTypeAnnotationBuilder; symbolTypeAnnotation: SymbolTypeAnnotationBuilder; numberTypeAnnotation: NumberTypeAnnotationBuilder; bigIntTypeAnnotation: BigIntTypeAnnotationBuilder; numberLiteralTypeAnnotation: NumberLiteralTypeAnnotationBuilder; numericLiteralTypeAnnotation: NumericLiteralTypeAnnotationBuilder; bigIntLiteralTypeAnnotation: BigIntLiteralTypeAnnotationBuilder; stringTypeAnnotation: StringTypeAnnotationBuilder; stringLiteralTypeAnnotation: StringLiteralTypeAnnotationBuilder; booleanTypeAnnotation: BooleanTypeAnnotationBuilder; booleanLiteralTypeAnnotation: BooleanLiteralTypeAnnotationBuilder; nullableTypeAnnotation: NullableTypeAnnotationBuilder; nullLiteralTypeAnnotation: NullLiteralTypeAnnotationBuilder; nullTypeAnnotation: NullTypeAnnotationBuilder; thisTypeAnnotation: ThisTypeAnnotationBuilder; existsTypeAnnotation: ExistsTypeAnnotationBuilder; existentialTypeParam: ExistentialTypeParamBuilder; functionTypeAnnotation: FunctionTypeAnnotationBuilder; functionTypeParam: FunctionTypeParamBuilder; arrayTypeAnnotation: ArrayTypeAnnotationBuilder; objectTypeAnnotation: ObjectTypeAnnotationBuilder; objectTypeProperty: ObjectTypePropertyBuilder; objectTypeSpreadProperty: ObjectTypeSpreadPropertyBuilder; objectTypeIndexer: ObjectTypeIndexerBuilder; objectTypeCallProperty: ObjectTypeCallPropertyBuilder; objectTypeInternalSlot: ObjectTypeInternalSlotBuilder; variance: VarianceBuilder; qualifiedTypeIdentifier: QualifiedTypeIdentifierBuilder; genericTypeAnnotation: GenericTypeAnnotationBuilder; memberTypeAnnotation: MemberTypeAnnotationBuilder; indexedAccessType: IndexedAccessTypeBuilder; optionalIndexedAccessType: OptionalIndexedAccessTypeBuilder; unionTypeAnnotation: UnionTypeAnnotationBuilder; intersectionTypeAnnotation: IntersectionTypeAnnotationBuilder; typeofTypeAnnotation: TypeofTypeAnnotationBuilder; typeParameter: TypeParameterBuilder; interfaceTypeAnnotation: InterfaceTypeAnnotationBuilder; interfaceExtends: InterfaceExtendsBuilder; interfaceDeclaration: InterfaceDeclarationBuilder; declareInterface: DeclareInterfaceBuilder; typeAlias: TypeAliasBuilder; declareTypeAlias: DeclareTypeAliasBuilder; opaqueType: OpaqueTypeBuilder; declareOpaqueType: DeclareOpaqueTypeBuilder; typeCastExpression: TypeCastExpressionBuilder; tupleTypeAnnotation: TupleTypeAnnotationBuilder; declareVariable: DeclareVariableBuilder; declareFunction: DeclareFunctionBuilder; declareClass: DeclareClassBuilder; declareModule: DeclareModuleBuilder; declareModuleExports: DeclareModuleExportsBuilder; declareExportDeclaration: DeclareExportDeclarationBuilder; exportBatchSpecifier: ExportBatchSpecifierBuilder; declareExportAllDeclaration: DeclareExportAllDeclarationBuilder; inferredPredicate: InferredPredicateBuilder; declaredPredicate: DeclaredPredicateBuilder; enumDeclaration: EnumDeclarationBuilder; enumBooleanBody: EnumBooleanBodyBuilder; enumNumberBody: EnumNumberBodyBuilder; enumStringBody: EnumStringBodyBuilder; enumSymbolBody: EnumSymbolBodyBuilder; enumBooleanMember: EnumBooleanMemberBuilder; enumNumberMember: EnumNumberMemberBuilder; enumStringMember: EnumStringMemberBuilder; enumDefaultedMember: EnumDefaultedMemberBuilder; exportDeclaration: ExportDeclarationBuilder; block: BlockBuilder; line: LineBuilder; noop: NoopBuilder; doExpression: DoExpressionBuilder; bindExpression: BindExpressionBuilder; parenthesizedExpression: ParenthesizedExpressionBuilder; exportNamespaceSpecifier: ExportNamespaceSpecifierBuilder; exportDefaultSpecifier: ExportDefaultSpecifierBuilder; commentBlock: CommentBlockBuilder; commentLine: CommentLineBuilder; directive: DirectiveBuilder; directiveLiteral: DirectiveLiteralBuilder; interpreterDirective: InterpreterDirectiveBuilder; stringLiteral: StringLiteralBuilder; numericLiteral: NumericLiteralBuilder; bigIntLiteral: BigIntLiteralBuilder; decimalLiteral: DecimalLiteralBuilder; nullLiteral: NullLiteralBuilder; booleanLiteral: BooleanLiteralBuilder; regExpLiteral: RegExpLiteralBuilder; classMethod: ClassMethodBuilder; classPrivateMethod: ClassPrivateMethodBuilder; classAccessorProperty: ClassAccessorPropertyBuilder; restProperty: RestPropertyBuilder; forAwaitStatement: ForAwaitStatementBuilder; import: ImportBuilder; v8IntrinsicIdentifier: V8IntrinsicIdentifierBuilder; topicReference: TopicReferenceBuilder; tsQualifiedName: TSQualifiedNameBuilder; tsTypeReference: TSTypeReferenceBuilder; tsAsExpression: TSAsExpressionBuilder; tsTypeCastExpression: TSTypeCastExpressionBuilder; tsSatisfiesExpression: TSSatisfiesExpressionBuilder; tsNonNullExpression: TSNonNullExpressionBuilder; tsAnyKeyword: TSAnyKeywordBuilder; tsBigIntKeyword: TSBigIntKeywordBuilder; tsBooleanKeyword: TSBooleanKeywordBuilder; tsNeverKeyword: TSNeverKeywordBuilder; tsNullKeyword: TSNullKeywordBuilder; tsNumberKeyword: TSNumberKeywordBuilder; tsObjectKeyword: TSObjectKeywordBuilder; tsStringKeyword: TSStringKeywordBuilder; tsSymbolKeyword: TSSymbolKeywordBuilder; tsUndefinedKeyword: TSUndefinedKeywordBuilder; tsUnknownKeyword: TSUnknownKeywordBuilder; tsVoidKeyword: TSVoidKeywordBuilder; tsIntrinsicKeyword: TSIntrinsicKeywordBuilder; tsThisType: TSThisTypeBuilder; tsArrayType: TSArrayTypeBuilder; tsLiteralType: TSLiteralTypeBuilder; tsUnionType: TSUnionTypeBuilder; tsIntersectionType: TSIntersectionTypeBuilder; tsConditionalType: TSConditionalTypeBuilder; tsInferType: TSInferTypeBuilder; tsTypeParameter: TSTypeParameterBuilder; tsParenthesizedType: TSParenthesizedTypeBuilder; tsFunctionType: TSFunctionTypeBuilder; tsConstructorType: TSConstructorTypeBuilder; tsDeclareFunction: TSDeclareFunctionBuilder; tsDeclareMethod: TSDeclareMethodBuilder; tsMappedType: TSMappedTypeBuilder; tsTupleType: TSTupleTypeBuilder; tsNamedTupleMember: TSNamedTupleMemberBuilder; tsRestType: TSRestTypeBuilder; tsOptionalType: TSOptionalTypeBuilder; tsIndexedAccessType: TSIndexedAccessTypeBuilder; tsTypeOperator: TSTypeOperatorBuilder; tsIndexSignature: TSIndexSignatureBuilder; tsPropertySignature: TSPropertySignatureBuilder; tsMethodSignature: TSMethodSignatureBuilder; tsTypePredicate: TSTypePredicateBuilder; tsCallSignatureDeclaration: TSCallSignatureDeclarationBuilder; tsConstructSignatureDeclaration: TSConstructSignatureDeclarationBuilder; tsEnumMember: TSEnumMemberBuilder; tsTypeQuery: TSTypeQueryBuilder; tsImportType: TSImportTypeBuilder; tsTypeLiteral: TSTypeLiteralBuilder; tsTypeAssertion: TSTypeAssertionBuilder; tsInstantiationExpression: TSInstantiationExpressionBuilder; tsEnumDeclaration: TSEnumDeclarationBuilder; tsTypeAliasDeclaration: TSTypeAliasDeclarationBuilder; tsModuleBlock: TSModuleBlockBuilder; tsModuleDeclaration: TSModuleDeclarationBuilder; tsImportEqualsDeclaration: TSImportEqualsDeclarationBuilder; tsExternalModuleReference: TSExternalModuleReferenceBuilder; tsExportAssignment: TSExportAssignmentBuilder; tsNamespaceExportDeclaration: TSNamespaceExportDeclarationBuilder; tsInterfaceBody: TSInterfaceBodyBuilder; tsInterfaceDeclaration: TSInterfaceDeclarationBuilder; tsParameterProperty: TSParameterPropertyBuilder; [builderName: string]: any; }ast-types-0.16.1/src/gen/kinds.ts000066400000000000000000001314701434620737500165710ustar00rootroot00000000000000/* !!! THIS FILE WAS AUTO-GENERATED BY `npm run gen` !!! */ import { namedTypes } from "./namedTypes"; export type PrintableKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.StaticBlock | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.Decorator | namedTypes.PrivateName | namedTypes.ClassPrivateProperty | namedTypes.ImportAttribute | namedTypes.RecordExpression | namedTypes.ObjectMethod | namedTypes.TupleExpression | namedTypes.ModuleExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXEmptyExpression | namedTypes.JSXText | namedTypes.JSXSpreadChild | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.IndexedAccessType | namedTypes.OptionalIndexedAccessType | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Block | namedTypes.Line | namedTypes.Noop | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.CommentBlock | namedTypes.CommentLine | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.DecimalLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.ClassAccessorProperty | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.V8IntrinsicIdentifier | namedTypes.TopicReference | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSTypeCastExpression | namedTypes.TSSatisfiesExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSIntrinsicKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSInstantiationExpression | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty; export type SourceLocationKind = namedTypes.SourceLocation; export type NodeKind = namedTypes.File | namedTypes.Program | namedTypes.Identifier | namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.SwitchCase | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.CatchClause | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.VariableDeclarator | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Property | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.RestElement | namedTypes.TypeAnnotation | namedTypes.TSTypeAnnotation | namedTypes.SpreadElementPattern | namedTypes.ArrowFunctionExpression | namedTypes.ForOfStatement | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionBlock | namedTypes.ComprehensionExpression | namedTypes.ObjectProperty | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.SpreadElement | namedTypes.AssignmentPattern | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.StaticBlock | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ClassExpression | namedTypes.Super | namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportSpecifier | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.TemplateElement | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.SpreadProperty | namedTypes.SpreadPropertyPattern | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.Decorator | namedTypes.PrivateName | namedTypes.ClassPrivateProperty | namedTypes.ImportAttribute | namedTypes.RecordExpression | namedTypes.ObjectMethod | namedTypes.TupleExpression | namedTypes.ModuleExpression | namedTypes.JSXAttribute | namedTypes.JSXIdentifier | namedTypes.JSXNamespacedName | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXSpreadAttribute | namedTypes.JSXEmptyExpression | namedTypes.JSXText | namedTypes.JSXSpreadChild | namedTypes.JSXOpeningElement | namedTypes.JSXClosingElement | namedTypes.JSXOpeningFragment | namedTypes.JSXClosingFragment | namedTypes.TypeParameterDeclaration | namedTypes.TSTypeParameterDeclaration | namedTypes.TypeParameterInstantiation | namedTypes.TSTypeParameterInstantiation | namedTypes.ClassImplements | namedTypes.TSExpressionWithTypeArguments | namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.FunctionTypeParam | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.ObjectTypeProperty | namedTypes.ObjectTypeSpreadProperty | namedTypes.ObjectTypeIndexer | namedTypes.ObjectTypeCallProperty | namedTypes.ObjectTypeInternalSlot | namedTypes.Variance | namedTypes.QualifiedTypeIdentifier | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.IndexedAccessType | namedTypes.OptionalIndexedAccessType | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.InterfaceExtends | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.TypeCastExpression | namedTypes.TupleTypeAnnotation | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.ExportBatchSpecifier | namedTypes.DeclareExportAllDeclaration | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Noop | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier | namedTypes.Directive | namedTypes.DirectiveLiteral | namedTypes.InterpreterDirective | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.DecimalLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.ClassAccessorProperty | namedTypes.RestProperty | namedTypes.ForAwaitStatement | namedTypes.Import | namedTypes.V8IntrinsicIdentifier | namedTypes.TopicReference | namedTypes.TSQualifiedName | namedTypes.TSTypeReference | namedTypes.TSAsExpression | namedTypes.TSTypeCastExpression | namedTypes.TSSatisfiesExpression | namedTypes.TSNonNullExpression | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSIntrinsicKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSTypeParameter | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSTypePredicate | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumMember | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral | namedTypes.TSTypeAssertion | namedTypes.TSInstantiationExpression | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleBlock | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceBody | namedTypes.TSInterfaceDeclaration | namedTypes.TSParameterProperty; export type CommentKind = namedTypes.Block | namedTypes.Line | namedTypes.CommentBlock | namedTypes.CommentLine; export type PositionKind = namedTypes.Position; export type FileKind = namedTypes.File; export type ProgramKind = namedTypes.Program; export type StatementKind = namedTypes.BlockStatement | namedTypes.EmptyStatement | namedTypes.ExpressionStatement | namedTypes.IfStatement | namedTypes.LabeledStatement | namedTypes.BreakStatement | namedTypes.ContinueStatement | namedTypes.WithStatement | namedTypes.SwitchStatement | namedTypes.ReturnStatement | namedTypes.ThrowStatement | namedTypes.TryStatement | namedTypes.WhileStatement | namedTypes.DoWhileStatement | namedTypes.ForStatement | namedTypes.VariableDeclaration | namedTypes.ForInStatement | namedTypes.DebuggerStatement | namedTypes.FunctionDeclaration | namedTypes.ForOfStatement | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.StaticBlock | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.ClassPrivateProperty | namedTypes.TSTypeParameterDeclaration | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.DeclareVariable | namedTypes.DeclareFunction | namedTypes.DeclareClass | namedTypes.DeclareModule | namedTypes.DeclareModuleExports | namedTypes.DeclareExportDeclaration | namedTypes.DeclareExportAllDeclaration | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.Noop | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.ClassAccessorProperty | namedTypes.ForAwaitStatement | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSExportAssignment | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceDeclaration; export type FunctionKind = namedTypes.FunctionDeclaration | namedTypes.FunctionExpression | namedTypes.ArrowFunctionExpression | namedTypes.ObjectMethod | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod; export type ExpressionKind = namedTypes.Identifier | namedTypes.FunctionExpression | namedTypes.ThisExpression | namedTypes.ArrayExpression | namedTypes.ObjectExpression | namedTypes.Literal | namedTypes.SequenceExpression | namedTypes.UnaryExpression | namedTypes.BinaryExpression | namedTypes.AssignmentExpression | namedTypes.MemberExpression | namedTypes.UpdateExpression | namedTypes.LogicalExpression | namedTypes.ConditionalExpression | namedTypes.NewExpression | namedTypes.CallExpression | namedTypes.ArrowFunctionExpression | namedTypes.YieldExpression | namedTypes.GeneratorExpression | namedTypes.ComprehensionExpression | namedTypes.ClassExpression | namedTypes.Super | namedTypes.TaggedTemplateExpression | namedTypes.TemplateLiteral | namedTypes.MetaProperty | namedTypes.AwaitExpression | namedTypes.ImportExpression | namedTypes.ChainExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.PrivateName | namedTypes.RecordExpression | namedTypes.TupleExpression | namedTypes.JSXIdentifier | namedTypes.JSXExpressionContainer | namedTypes.JSXElement | namedTypes.JSXFragment | namedTypes.JSXMemberExpression | namedTypes.JSXText | namedTypes.TypeCastExpression | namedTypes.DoExpression | namedTypes.BindExpression | namedTypes.ParenthesizedExpression | namedTypes.DirectiveLiteral | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.DecimalLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral | namedTypes.Import | namedTypes.V8IntrinsicIdentifier | namedTypes.TopicReference | namedTypes.TSAsExpression | namedTypes.TSTypeCastExpression | namedTypes.TSSatisfiesExpression | namedTypes.TSNonNullExpression | namedTypes.TSTypeParameter | namedTypes.TSTypeAssertion | namedTypes.TSInstantiationExpression; export type PatternKind = namedTypes.Identifier | namedTypes.RestElement | namedTypes.SpreadElementPattern | namedTypes.PropertyPattern | namedTypes.ObjectPattern | namedTypes.ArrayPattern | namedTypes.AssignmentPattern | namedTypes.SpreadPropertyPattern | namedTypes.PrivateName | namedTypes.JSXIdentifier | namedTypes.TSAsExpression | namedTypes.TSSatisfiesExpression | namedTypes.TSNonNullExpression | namedTypes.TSTypeParameter | namedTypes.TSTypeAssertion | namedTypes.TSParameterProperty; export type IdentifierKind = namedTypes.Identifier | namedTypes.JSXIdentifier | namedTypes.TSTypeParameter; export type BlockStatementKind = namedTypes.BlockStatement; export type EmptyStatementKind = namedTypes.EmptyStatement; export type ExpressionStatementKind = namedTypes.ExpressionStatement; export type IfStatementKind = namedTypes.IfStatement; export type LabeledStatementKind = namedTypes.LabeledStatement; export type BreakStatementKind = namedTypes.BreakStatement; export type ContinueStatementKind = namedTypes.ContinueStatement; export type WithStatementKind = namedTypes.WithStatement; export type SwitchStatementKind = namedTypes.SwitchStatement; export type SwitchCaseKind = namedTypes.SwitchCase; export type ReturnStatementKind = namedTypes.ReturnStatement; export type ThrowStatementKind = namedTypes.ThrowStatement; export type TryStatementKind = namedTypes.TryStatement; export type CatchClauseKind = namedTypes.CatchClause; export type WhileStatementKind = namedTypes.WhileStatement; export type DoWhileStatementKind = namedTypes.DoWhileStatement; export type ForStatementKind = namedTypes.ForStatement; export type DeclarationKind = namedTypes.VariableDeclaration | namedTypes.FunctionDeclaration | namedTypes.MethodDefinition | namedTypes.ClassPropertyDefinition | namedTypes.ClassProperty | namedTypes.StaticBlock | namedTypes.ClassBody | namedTypes.ClassDeclaration | namedTypes.ImportDeclaration | namedTypes.ExportNamedDeclaration | namedTypes.ExportDefaultDeclaration | namedTypes.ExportAllDeclaration | namedTypes.ClassPrivateProperty | namedTypes.TSTypeParameterDeclaration | namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.TypeAlias | namedTypes.DeclareTypeAlias | namedTypes.OpaqueType | namedTypes.DeclareOpaqueType | namedTypes.DeclareClass | namedTypes.DeclareExportDeclaration | namedTypes.DeclareExportAllDeclaration | namedTypes.EnumDeclaration | namedTypes.ExportDeclaration | namedTypes.ClassMethod | namedTypes.ClassPrivateMethod | namedTypes.ClassAccessorProperty | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSEnumDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSModuleDeclaration | namedTypes.TSImportEqualsDeclaration | namedTypes.TSExternalModuleReference | namedTypes.TSNamespaceExportDeclaration | namedTypes.TSInterfaceDeclaration; export type VariableDeclarationKind = namedTypes.VariableDeclaration; export type ForInStatementKind = namedTypes.ForInStatement; export type DebuggerStatementKind = namedTypes.DebuggerStatement; export type FunctionDeclarationKind = namedTypes.FunctionDeclaration; export type FunctionExpressionKind = namedTypes.FunctionExpression; export type VariableDeclaratorKind = namedTypes.VariableDeclarator; export type ThisExpressionKind = namedTypes.ThisExpression; export type ArrayExpressionKind = namedTypes.ArrayExpression; export type ObjectExpressionKind = namedTypes.ObjectExpression; export type PropertyKind = namedTypes.Property; export type LiteralKind = namedTypes.Literal | namedTypes.JSXText | namedTypes.StringLiteral | namedTypes.NumericLiteral | namedTypes.BigIntLiteral | namedTypes.DecimalLiteral | namedTypes.NullLiteral | namedTypes.BooleanLiteral | namedTypes.RegExpLiteral; export type SequenceExpressionKind = namedTypes.SequenceExpression; export type UnaryExpressionKind = namedTypes.UnaryExpression; export type BinaryExpressionKind = namedTypes.BinaryExpression; export type AssignmentExpressionKind = namedTypes.AssignmentExpression; export type ChainElementKind = namedTypes.MemberExpression | namedTypes.CallExpression | namedTypes.OptionalCallExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXMemberExpression; export type MemberExpressionKind = namedTypes.MemberExpression | namedTypes.OptionalMemberExpression | namedTypes.JSXMemberExpression; export type UpdateExpressionKind = namedTypes.UpdateExpression; export type LogicalExpressionKind = namedTypes.LogicalExpression; export type ConditionalExpressionKind = namedTypes.ConditionalExpression; export type NewExpressionKind = namedTypes.NewExpression; export type CallExpressionKind = namedTypes.CallExpression | namedTypes.OptionalCallExpression; export type RestElementKind = namedTypes.RestElement; export type TypeAnnotationKind = namedTypes.TypeAnnotation; export type TSTypeAnnotationKind = namedTypes.TSTypeAnnotation | namedTypes.TSTypePredicate; export type SpreadElementPatternKind = namedTypes.SpreadElementPattern; export type ArrowFunctionExpressionKind = namedTypes.ArrowFunctionExpression; export type ForOfStatementKind = namedTypes.ForOfStatement; export type YieldExpressionKind = namedTypes.YieldExpression; export type GeneratorExpressionKind = namedTypes.GeneratorExpression; export type ComprehensionBlockKind = namedTypes.ComprehensionBlock; export type ComprehensionExpressionKind = namedTypes.ComprehensionExpression; export type ObjectPropertyKind = namedTypes.ObjectProperty; export type PropertyPatternKind = namedTypes.PropertyPattern; export type ObjectPatternKind = namedTypes.ObjectPattern; export type ArrayPatternKind = namedTypes.ArrayPattern; export type SpreadElementKind = namedTypes.SpreadElement; export type AssignmentPatternKind = namedTypes.AssignmentPattern; export type MethodDefinitionKind = namedTypes.MethodDefinition; export type ClassPropertyDefinitionKind = namedTypes.ClassPropertyDefinition; export type ClassPropertyKind = namedTypes.ClassProperty | namedTypes.ClassPrivateProperty; export type StaticBlockKind = namedTypes.StaticBlock; export type ClassBodyKind = namedTypes.ClassBody; export type ClassDeclarationKind = namedTypes.ClassDeclaration; export type ClassExpressionKind = namedTypes.ClassExpression; export type SuperKind = namedTypes.Super; export type SpecifierKind = namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ExportSpecifier | namedTypes.ExportBatchSpecifier | namedTypes.ExportNamespaceSpecifier | namedTypes.ExportDefaultSpecifier; export type ModuleSpecifierKind = namedTypes.ImportSpecifier | namedTypes.ImportDefaultSpecifier | namedTypes.ImportNamespaceSpecifier | namedTypes.ExportSpecifier; export type ImportSpecifierKind = namedTypes.ImportSpecifier; export type ImportDefaultSpecifierKind = namedTypes.ImportDefaultSpecifier; export type ImportNamespaceSpecifierKind = namedTypes.ImportNamespaceSpecifier; export type ImportDeclarationKind = namedTypes.ImportDeclaration; export type ExportNamedDeclarationKind = namedTypes.ExportNamedDeclaration; export type ExportSpecifierKind = namedTypes.ExportSpecifier; export type ExportDefaultDeclarationKind = namedTypes.ExportDefaultDeclaration; export type ExportAllDeclarationKind = namedTypes.ExportAllDeclaration; export type TaggedTemplateExpressionKind = namedTypes.TaggedTemplateExpression; export type TemplateLiteralKind = namedTypes.TemplateLiteral; export type TemplateElementKind = namedTypes.TemplateElement; export type MetaPropertyKind = namedTypes.MetaProperty; export type AwaitExpressionKind = namedTypes.AwaitExpression; export type SpreadPropertyKind = namedTypes.SpreadProperty; export type SpreadPropertyPatternKind = namedTypes.SpreadPropertyPattern; export type ImportExpressionKind = namedTypes.ImportExpression; export type ChainExpressionKind = namedTypes.ChainExpression; export type OptionalCallExpressionKind = namedTypes.OptionalCallExpression; export type OptionalMemberExpressionKind = namedTypes.OptionalMemberExpression; export type DecoratorKind = namedTypes.Decorator; export type PrivateNameKind = namedTypes.PrivateName; export type ClassPrivatePropertyKind = namedTypes.ClassPrivateProperty; export type ImportAttributeKind = namedTypes.ImportAttribute; export type RecordExpressionKind = namedTypes.RecordExpression; export type ObjectMethodKind = namedTypes.ObjectMethod; export type TupleExpressionKind = namedTypes.TupleExpression; export type ModuleExpressionKind = namedTypes.ModuleExpression; export type JSXAttributeKind = namedTypes.JSXAttribute; export type JSXIdentifierKind = namedTypes.JSXIdentifier; export type JSXNamespacedNameKind = namedTypes.JSXNamespacedName; export type JSXExpressionContainerKind = namedTypes.JSXExpressionContainer; export type JSXElementKind = namedTypes.JSXElement; export type JSXFragmentKind = namedTypes.JSXFragment; export type JSXMemberExpressionKind = namedTypes.JSXMemberExpression; export type JSXSpreadAttributeKind = namedTypes.JSXSpreadAttribute; export type JSXEmptyExpressionKind = namedTypes.JSXEmptyExpression; export type JSXTextKind = namedTypes.JSXText; export type JSXSpreadChildKind = namedTypes.JSXSpreadChild; export type JSXOpeningElementKind = namedTypes.JSXOpeningElement; export type JSXClosingElementKind = namedTypes.JSXClosingElement; export type JSXOpeningFragmentKind = namedTypes.JSXOpeningFragment; export type JSXClosingFragmentKind = namedTypes.JSXClosingFragment; export type TypeParameterDeclarationKind = namedTypes.TypeParameterDeclaration; export type TSTypeParameterDeclarationKind = namedTypes.TSTypeParameterDeclaration; export type TypeParameterInstantiationKind = namedTypes.TypeParameterInstantiation; export type TSTypeParameterInstantiationKind = namedTypes.TSTypeParameterInstantiation; export type ClassImplementsKind = namedTypes.ClassImplements; export type TSTypeKind = namedTypes.TSExpressionWithTypeArguments | namedTypes.TSTypeReference | namedTypes.TSAnyKeyword | namedTypes.TSBigIntKeyword | namedTypes.TSBooleanKeyword | namedTypes.TSNeverKeyword | namedTypes.TSNullKeyword | namedTypes.TSNumberKeyword | namedTypes.TSObjectKeyword | namedTypes.TSStringKeyword | namedTypes.TSSymbolKeyword | namedTypes.TSUndefinedKeyword | namedTypes.TSUnknownKeyword | namedTypes.TSVoidKeyword | namedTypes.TSIntrinsicKeyword | namedTypes.TSThisType | namedTypes.TSArrayType | namedTypes.TSLiteralType | namedTypes.TSUnionType | namedTypes.TSIntersectionType | namedTypes.TSConditionalType | namedTypes.TSInferType | namedTypes.TSParenthesizedType | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSMappedType | namedTypes.TSTupleType | namedTypes.TSNamedTupleMember | namedTypes.TSRestType | namedTypes.TSOptionalType | namedTypes.TSIndexedAccessType | namedTypes.TSTypeOperator | namedTypes.TSTypePredicate | namedTypes.TSTypeQuery | namedTypes.TSImportType | namedTypes.TSTypeLiteral; export type TSHasOptionalTypeParameterInstantiationKind = namedTypes.TSExpressionWithTypeArguments | namedTypes.TSTypeReference | namedTypes.TSImportType | namedTypes.TSInstantiationExpression; export type TSExpressionWithTypeArgumentsKind = namedTypes.TSExpressionWithTypeArguments; export type FlowKind = namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.IndexedAccessType | namedTypes.OptionalIndexedAccessType | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.TupleTypeAnnotation | namedTypes.InferredPredicate | namedTypes.DeclaredPredicate; export type FlowTypeKind = namedTypes.AnyTypeAnnotation | namedTypes.EmptyTypeAnnotation | namedTypes.MixedTypeAnnotation | namedTypes.VoidTypeAnnotation | namedTypes.SymbolTypeAnnotation | namedTypes.NumberTypeAnnotation | namedTypes.BigIntTypeAnnotation | namedTypes.NumberLiteralTypeAnnotation | namedTypes.NumericLiteralTypeAnnotation | namedTypes.BigIntLiteralTypeAnnotation | namedTypes.StringTypeAnnotation | namedTypes.StringLiteralTypeAnnotation | namedTypes.BooleanTypeAnnotation | namedTypes.BooleanLiteralTypeAnnotation | namedTypes.NullableTypeAnnotation | namedTypes.NullLiteralTypeAnnotation | namedTypes.NullTypeAnnotation | namedTypes.ThisTypeAnnotation | namedTypes.ExistsTypeAnnotation | namedTypes.ExistentialTypeParam | namedTypes.FunctionTypeAnnotation | namedTypes.ArrayTypeAnnotation | namedTypes.ObjectTypeAnnotation | namedTypes.GenericTypeAnnotation | namedTypes.MemberTypeAnnotation | namedTypes.IndexedAccessType | namedTypes.OptionalIndexedAccessType | namedTypes.UnionTypeAnnotation | namedTypes.IntersectionTypeAnnotation | namedTypes.TypeofTypeAnnotation | namedTypes.TypeParameter | namedTypes.InterfaceTypeAnnotation | namedTypes.TupleTypeAnnotation; export type AnyTypeAnnotationKind = namedTypes.AnyTypeAnnotation; export type EmptyTypeAnnotationKind = namedTypes.EmptyTypeAnnotation; export type MixedTypeAnnotationKind = namedTypes.MixedTypeAnnotation; export type VoidTypeAnnotationKind = namedTypes.VoidTypeAnnotation; export type SymbolTypeAnnotationKind = namedTypes.SymbolTypeAnnotation; export type NumberTypeAnnotationKind = namedTypes.NumberTypeAnnotation; export type BigIntTypeAnnotationKind = namedTypes.BigIntTypeAnnotation; export type NumberLiteralTypeAnnotationKind = namedTypes.NumberLiteralTypeAnnotation; export type NumericLiteralTypeAnnotationKind = namedTypes.NumericLiteralTypeAnnotation; export type BigIntLiteralTypeAnnotationKind = namedTypes.BigIntLiteralTypeAnnotation; export type StringTypeAnnotationKind = namedTypes.StringTypeAnnotation; export type StringLiteralTypeAnnotationKind = namedTypes.StringLiteralTypeAnnotation; export type BooleanTypeAnnotationKind = namedTypes.BooleanTypeAnnotation; export type BooleanLiteralTypeAnnotationKind = namedTypes.BooleanLiteralTypeAnnotation; export type NullableTypeAnnotationKind = namedTypes.NullableTypeAnnotation; export type NullLiteralTypeAnnotationKind = namedTypes.NullLiteralTypeAnnotation; export type NullTypeAnnotationKind = namedTypes.NullTypeAnnotation; export type ThisTypeAnnotationKind = namedTypes.ThisTypeAnnotation; export type ExistsTypeAnnotationKind = namedTypes.ExistsTypeAnnotation; export type ExistentialTypeParamKind = namedTypes.ExistentialTypeParam; export type FunctionTypeAnnotationKind = namedTypes.FunctionTypeAnnotation; export type FunctionTypeParamKind = namedTypes.FunctionTypeParam; export type ArrayTypeAnnotationKind = namedTypes.ArrayTypeAnnotation; export type ObjectTypeAnnotationKind = namedTypes.ObjectTypeAnnotation; export type ObjectTypePropertyKind = namedTypes.ObjectTypeProperty; export type ObjectTypeSpreadPropertyKind = namedTypes.ObjectTypeSpreadProperty; export type ObjectTypeIndexerKind = namedTypes.ObjectTypeIndexer; export type ObjectTypeCallPropertyKind = namedTypes.ObjectTypeCallProperty; export type ObjectTypeInternalSlotKind = namedTypes.ObjectTypeInternalSlot; export type VarianceKind = namedTypes.Variance; export type QualifiedTypeIdentifierKind = namedTypes.QualifiedTypeIdentifier; export type GenericTypeAnnotationKind = namedTypes.GenericTypeAnnotation; export type MemberTypeAnnotationKind = namedTypes.MemberTypeAnnotation; export type IndexedAccessTypeKind = namedTypes.IndexedAccessType; export type OptionalIndexedAccessTypeKind = namedTypes.OptionalIndexedAccessType; export type UnionTypeAnnotationKind = namedTypes.UnionTypeAnnotation; export type IntersectionTypeAnnotationKind = namedTypes.IntersectionTypeAnnotation; export type TypeofTypeAnnotationKind = namedTypes.TypeofTypeAnnotation; export type TypeParameterKind = namedTypes.TypeParameter; export type InterfaceTypeAnnotationKind = namedTypes.InterfaceTypeAnnotation; export type InterfaceExtendsKind = namedTypes.InterfaceExtends; export type InterfaceDeclarationKind = namedTypes.InterfaceDeclaration | namedTypes.DeclareInterface | namedTypes.DeclareClass; export type DeclareInterfaceKind = namedTypes.DeclareInterface; export type TypeAliasKind = namedTypes.TypeAlias | namedTypes.DeclareTypeAlias; export type DeclareTypeAliasKind = namedTypes.DeclareTypeAlias; export type OpaqueTypeKind = namedTypes.OpaqueType | namedTypes.DeclareOpaqueType; export type DeclareOpaqueTypeKind = namedTypes.DeclareOpaqueType; export type TypeCastExpressionKind = namedTypes.TypeCastExpression; export type TupleTypeAnnotationKind = namedTypes.TupleTypeAnnotation; export type DeclareVariableKind = namedTypes.DeclareVariable; export type DeclareFunctionKind = namedTypes.DeclareFunction; export type FlowPredicateKind = namedTypes.InferredPredicate | namedTypes.DeclaredPredicate; export type DeclareClassKind = namedTypes.DeclareClass; export type DeclareModuleKind = namedTypes.DeclareModule; export type DeclareModuleExportsKind = namedTypes.DeclareModuleExports; export type DeclareExportDeclarationKind = namedTypes.DeclareExportDeclaration; export type ExportBatchSpecifierKind = namedTypes.ExportBatchSpecifier; export type DeclareExportAllDeclarationKind = namedTypes.DeclareExportAllDeclaration; export type InferredPredicateKind = namedTypes.InferredPredicate; export type DeclaredPredicateKind = namedTypes.DeclaredPredicate; export type EnumDeclarationKind = namedTypes.EnumDeclaration; export type EnumBooleanBodyKind = namedTypes.EnumBooleanBody; export type EnumNumberBodyKind = namedTypes.EnumNumberBody; export type EnumStringBodyKind = namedTypes.EnumStringBody; export type EnumSymbolBodyKind = namedTypes.EnumSymbolBody; export type EnumBooleanMemberKind = namedTypes.EnumBooleanMember; export type EnumNumberMemberKind = namedTypes.EnumNumberMember; export type EnumStringMemberKind = namedTypes.EnumStringMember; export type EnumDefaultedMemberKind = namedTypes.EnumDefaultedMember; export type ExportDeclarationKind = namedTypes.ExportDeclaration; export type BlockKind = namedTypes.Block; export type LineKind = namedTypes.Line; export type NoopKind = namedTypes.Noop; export type DoExpressionKind = namedTypes.DoExpression; export type BindExpressionKind = namedTypes.BindExpression; export type ParenthesizedExpressionKind = namedTypes.ParenthesizedExpression; export type ExportNamespaceSpecifierKind = namedTypes.ExportNamespaceSpecifier; export type ExportDefaultSpecifierKind = namedTypes.ExportDefaultSpecifier; export type CommentBlockKind = namedTypes.CommentBlock; export type CommentLineKind = namedTypes.CommentLine; export type DirectiveKind = namedTypes.Directive; export type DirectiveLiteralKind = namedTypes.DirectiveLiteral; export type InterpreterDirectiveKind = namedTypes.InterpreterDirective; export type StringLiteralKind = namedTypes.StringLiteral; export type NumericLiteralKind = namedTypes.NumericLiteral; export type BigIntLiteralKind = namedTypes.BigIntLiteral; export type DecimalLiteralKind = namedTypes.DecimalLiteral; export type NullLiteralKind = namedTypes.NullLiteral; export type BooleanLiteralKind = namedTypes.BooleanLiteral; export type RegExpLiteralKind = namedTypes.RegExpLiteral; export type ClassMethodKind = namedTypes.ClassMethod; export type ClassPrivateMethodKind = namedTypes.ClassPrivateMethod; export type TSHasOptionalTypeAnnotationKind = namedTypes.ClassAccessorProperty | namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSIndexSignature | namedTypes.TSPropertySignature | namedTypes.TSMethodSignature | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration; export type ClassAccessorPropertyKind = namedTypes.ClassAccessorProperty; export type RestPropertyKind = namedTypes.RestProperty; export type ForAwaitStatementKind = namedTypes.ForAwaitStatement; export type ImportKind = namedTypes.Import; export type V8IntrinsicIdentifierKind = namedTypes.V8IntrinsicIdentifier; export type TopicReferenceKind = namedTypes.TopicReference; export type TSQualifiedNameKind = namedTypes.TSQualifiedName; export type TSTypeReferenceKind = namedTypes.TSTypeReference; export type TSHasOptionalTypeParametersKind = namedTypes.TSFunctionType | namedTypes.TSConstructorType | namedTypes.TSDeclareFunction | namedTypes.TSDeclareMethod | namedTypes.TSMethodSignature | namedTypes.TSCallSignatureDeclaration | namedTypes.TSConstructSignatureDeclaration | namedTypes.TSTypeAliasDeclaration | namedTypes.TSInterfaceDeclaration; export type TSAsExpressionKind = namedTypes.TSAsExpression; export type TSTypeCastExpressionKind = namedTypes.TSTypeCastExpression; export type TSSatisfiesExpressionKind = namedTypes.TSSatisfiesExpression; export type TSNonNullExpressionKind = namedTypes.TSNonNullExpression; export type TSAnyKeywordKind = namedTypes.TSAnyKeyword; export type TSBigIntKeywordKind = namedTypes.TSBigIntKeyword; export type TSBooleanKeywordKind = namedTypes.TSBooleanKeyword; export type TSNeverKeywordKind = namedTypes.TSNeverKeyword; export type TSNullKeywordKind = namedTypes.TSNullKeyword; export type TSNumberKeywordKind = namedTypes.TSNumberKeyword; export type TSObjectKeywordKind = namedTypes.TSObjectKeyword; export type TSStringKeywordKind = namedTypes.TSStringKeyword; export type TSSymbolKeywordKind = namedTypes.TSSymbolKeyword; export type TSUndefinedKeywordKind = namedTypes.TSUndefinedKeyword; export type TSUnknownKeywordKind = namedTypes.TSUnknownKeyword; export type TSVoidKeywordKind = namedTypes.TSVoidKeyword; export type TSIntrinsicKeywordKind = namedTypes.TSIntrinsicKeyword; export type TSThisTypeKind = namedTypes.TSThisType; export type TSArrayTypeKind = namedTypes.TSArrayType; export type TSLiteralTypeKind = namedTypes.TSLiteralType; export type TSUnionTypeKind = namedTypes.TSUnionType; export type TSIntersectionTypeKind = namedTypes.TSIntersectionType; export type TSConditionalTypeKind = namedTypes.TSConditionalType; export type TSInferTypeKind = namedTypes.TSInferType; export type TSTypeParameterKind = namedTypes.TSTypeParameter; export type TSParenthesizedTypeKind = namedTypes.TSParenthesizedType; export type TSFunctionTypeKind = namedTypes.TSFunctionType; export type TSConstructorTypeKind = namedTypes.TSConstructorType; export type TSDeclareFunctionKind = namedTypes.TSDeclareFunction; export type TSDeclareMethodKind = namedTypes.TSDeclareMethod; export type TSMappedTypeKind = namedTypes.TSMappedType; export type TSTupleTypeKind = namedTypes.TSTupleType; export type TSNamedTupleMemberKind = namedTypes.TSNamedTupleMember; export type TSRestTypeKind = namedTypes.TSRestType; export type TSOptionalTypeKind = namedTypes.TSOptionalType; export type TSIndexedAccessTypeKind = namedTypes.TSIndexedAccessType; export type TSTypeOperatorKind = namedTypes.TSTypeOperator; export type TSIndexSignatureKind = namedTypes.TSIndexSignature; export type TSPropertySignatureKind = namedTypes.TSPropertySignature; export type TSMethodSignatureKind = namedTypes.TSMethodSignature; export type TSTypePredicateKind = namedTypes.TSTypePredicate; export type TSCallSignatureDeclarationKind = namedTypes.TSCallSignatureDeclaration; export type TSConstructSignatureDeclarationKind = namedTypes.TSConstructSignatureDeclaration; export type TSEnumMemberKind = namedTypes.TSEnumMember; export type TSTypeQueryKind = namedTypes.TSTypeQuery; export type TSImportTypeKind = namedTypes.TSImportType; export type TSTypeLiteralKind = namedTypes.TSTypeLiteral; export type TSTypeAssertionKind = namedTypes.TSTypeAssertion; export type TSInstantiationExpressionKind = namedTypes.TSInstantiationExpression; export type TSEnumDeclarationKind = namedTypes.TSEnumDeclaration; export type TSTypeAliasDeclarationKind = namedTypes.TSTypeAliasDeclaration; export type TSModuleBlockKind = namedTypes.TSModuleBlock; export type TSModuleDeclarationKind = namedTypes.TSModuleDeclaration; export type TSImportEqualsDeclarationKind = namedTypes.TSImportEqualsDeclaration; export type TSExternalModuleReferenceKind = namedTypes.TSExternalModuleReference; export type TSExportAssignmentKind = namedTypes.TSExportAssignment; export type TSNamespaceExportDeclarationKind = namedTypes.TSNamespaceExportDeclaration; export type TSInterfaceBodyKind = namedTypes.TSInterfaceBody; export type TSInterfaceDeclarationKind = namedTypes.TSInterfaceDeclaration; export type TSParameterPropertyKind = namedTypes.TSParameterProperty;ast-types-0.16.1/src/gen/namedTypes.ts000066400000000000000000002632551434620737500176010ustar00rootroot00000000000000/* !!! THIS FILE WAS AUTO-GENERATED BY `npm run gen` !!! */ import { Type, Omit } from "../types"; import * as K from "./kinds"; export namespace namedTypes { export interface Printable { loc?: K.SourceLocationKind | null; } export interface SourceLocation { start: K.PositionKind; end: K.PositionKind; source?: string | null; } export interface Node extends Printable { type: string; comments?: K.CommentKind[] | null; } export interface Comment extends Printable { value: string; leading?: boolean; trailing?: boolean; } export interface Position { line: number; column: number; } export interface File extends Omit { type: "File"; program: K.ProgramKind; name?: string | null; } export interface Program extends Omit { type: "Program"; body: K.StatementKind[]; directives?: K.DirectiveKind[]; interpreter?: K.InterpreterDirectiveKind | null; } export interface Statement extends Node {} export interface Function extends Node { id?: K.IdentifierKind | null; params: K.PatternKind[]; body: K.BlockStatementKind; generator?: boolean; async?: boolean; expression?: boolean; defaults?: (K.ExpressionKind | null)[]; rest?: K.IdentifierKind | null; returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; predicate?: K.FlowPredicateKind | null; } export interface Expression extends Node {} export interface Pattern extends Node {} export interface Identifier extends Omit, Omit { type: "Identifier"; name: string; optional?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } export interface BlockStatement extends Omit { type: "BlockStatement"; body: K.StatementKind[]; directives?: K.DirectiveKind[]; } export interface EmptyStatement extends Omit { type: "EmptyStatement"; } export interface ExpressionStatement extends Omit { type: "ExpressionStatement"; expression: K.ExpressionKind; } export interface IfStatement extends Omit { type: "IfStatement"; test: K.ExpressionKind; consequent: K.StatementKind; alternate?: K.StatementKind | null; } export interface LabeledStatement extends Omit { type: "LabeledStatement"; label: K.IdentifierKind; body: K.StatementKind; } export interface BreakStatement extends Omit { type: "BreakStatement"; label?: K.IdentifierKind | null; } export interface ContinueStatement extends Omit { type: "ContinueStatement"; label?: K.IdentifierKind | null; } export interface WithStatement extends Omit { type: "WithStatement"; object: K.ExpressionKind; body: K.StatementKind; } export interface SwitchStatement extends Omit { type: "SwitchStatement"; discriminant: K.ExpressionKind; cases: K.SwitchCaseKind[]; lexical?: boolean; } export interface SwitchCase extends Omit { type: "SwitchCase"; test: K.ExpressionKind | null; consequent: K.StatementKind[]; } export interface ReturnStatement extends Omit { type: "ReturnStatement"; argument: K.ExpressionKind | null; } export interface ThrowStatement extends Omit { type: "ThrowStatement"; argument: K.ExpressionKind; } export interface TryStatement extends Omit { type: "TryStatement"; block: K.BlockStatementKind; handler?: K.CatchClauseKind | null; handlers?: K.CatchClauseKind[]; guardedHandlers?: K.CatchClauseKind[]; finalizer?: K.BlockStatementKind | null; } export interface CatchClause extends Omit { type: "CatchClause"; param?: K.PatternKind | null; guard?: K.ExpressionKind | null; body: K.BlockStatementKind; } export interface WhileStatement extends Omit { type: "WhileStatement"; test: K.ExpressionKind; body: K.StatementKind; } export interface DoWhileStatement extends Omit { type: "DoWhileStatement"; body: K.StatementKind; test: K.ExpressionKind; } export interface ForStatement extends Omit { type: "ForStatement"; init: K.VariableDeclarationKind | K.ExpressionKind | null; test: K.ExpressionKind | null; update: K.ExpressionKind | null; body: K.StatementKind; } export interface Declaration extends Statement {} export interface VariableDeclaration extends Omit { type: "VariableDeclaration"; kind: "var" | "let" | "const"; declarations: (K.VariableDeclaratorKind | K.IdentifierKind)[]; } export interface ForInStatement extends Omit { type: "ForInStatement"; left: K.VariableDeclarationKind | K.ExpressionKind; right: K.ExpressionKind; body: K.StatementKind; } export interface DebuggerStatement extends Omit { type: "DebuggerStatement"; } export interface FunctionDeclaration extends Omit, Omit { type: "FunctionDeclaration"; id: K.IdentifierKind | null; } export interface FunctionExpression extends Omit, Omit { type: "FunctionExpression"; } export interface VariableDeclarator extends Omit { type: "VariableDeclarator"; id: K.PatternKind; init?: K.ExpressionKind | null; } export interface ThisExpression extends Omit { type: "ThisExpression"; } export interface ArrayExpression extends Omit { type: "ArrayExpression"; elements: (K.ExpressionKind | K.SpreadElementKind | K.RestElementKind | null)[]; } export interface ObjectExpression extends Omit { type: "ObjectExpression"; properties: (K.PropertyKind | K.ObjectMethodKind | K.ObjectPropertyKind | K.SpreadPropertyKind | K.SpreadElementKind)[]; } export interface Property extends Omit { type: "Property"; kind: "init" | "get" | "set"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; value: K.ExpressionKind | K.PatternKind; method?: boolean; shorthand?: boolean; computed?: boolean; decorators?: K.DecoratorKind[] | null; } export interface Literal extends Omit { type: "Literal"; value: string | boolean | null | number | RegExp | BigInt; } export interface SequenceExpression extends Omit { type: "SequenceExpression"; expressions: K.ExpressionKind[]; } export interface UnaryExpression extends Omit { type: "UnaryExpression"; operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; argument: K.ExpressionKind; prefix?: boolean; } export interface BinaryExpression extends Omit { type: "BinaryExpression"; operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "&" | "|" | "^" | "in" | "instanceof" | "**"; left: K.ExpressionKind; right: K.ExpressionKind; } export interface AssignmentExpression extends Omit { type: "AssignmentExpression"; operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??="; left: K.PatternKind | K.MemberExpressionKind; right: K.ExpressionKind; } export interface ChainElement extends Node { optional?: boolean; } export interface MemberExpression extends Omit, Omit { type: "MemberExpression"; object: K.ExpressionKind; property: K.IdentifierKind | K.ExpressionKind; computed?: boolean; } export interface UpdateExpression extends Omit { type: "UpdateExpression"; operator: "++" | "--"; argument: K.ExpressionKind; prefix: boolean; } export interface LogicalExpression extends Omit { type: "LogicalExpression"; operator: "||" | "&&" | "??"; left: K.ExpressionKind; right: K.ExpressionKind; } export interface ConditionalExpression extends Omit { type: "ConditionalExpression"; test: K.ExpressionKind; consequent: K.ExpressionKind; alternate: K.ExpressionKind; } export interface NewExpression extends Omit { type: "NewExpression"; callee: K.ExpressionKind; arguments: (K.ExpressionKind | K.SpreadElementKind)[]; typeArguments?: null | K.TypeParameterInstantiationKind; } export interface CallExpression extends Omit, Omit { type: "CallExpression"; callee: K.ExpressionKind; arguments: (K.ExpressionKind | K.SpreadElementKind)[]; typeArguments?: null | K.TypeParameterInstantiationKind; } export interface RestElement extends Omit { type: "RestElement"; argument: K.PatternKind; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; } export interface TypeAnnotation extends Omit { type: "TypeAnnotation"; typeAnnotation: K.FlowTypeKind; } export interface TSTypeAnnotation extends Omit { type: "TSTypeAnnotation"; typeAnnotation: K.TSTypeKind | K.TSTypeAnnotationKind; } export interface SpreadElementPattern extends Omit { type: "SpreadElementPattern"; argument: K.PatternKind; } export interface ArrowFunctionExpression extends Omit, Omit { type: "ArrowFunctionExpression"; id?: null; body: K.BlockStatementKind | K.ExpressionKind; generator?: false; } export interface ForOfStatement extends Omit { type: "ForOfStatement"; left: K.VariableDeclarationKind | K.PatternKind; right: K.ExpressionKind; body: K.StatementKind; await?: boolean; } export interface YieldExpression extends Omit { type: "YieldExpression"; argument: K.ExpressionKind | null; delegate?: boolean; } export interface GeneratorExpression extends Omit { type: "GeneratorExpression"; body: K.ExpressionKind; blocks: K.ComprehensionBlockKind[]; filter: K.ExpressionKind | null; } export interface ComprehensionBlock extends Omit { type: "ComprehensionBlock"; left: K.PatternKind; right: K.ExpressionKind; each: boolean; } export interface ComprehensionExpression extends Omit { type: "ComprehensionExpression"; body: K.ExpressionKind; blocks: K.ComprehensionBlockKind[]; filter: K.ExpressionKind | null; } export interface ObjectProperty extends Omit { shorthand?: boolean; type: "ObjectProperty"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; value: K.ExpressionKind | K.PatternKind; accessibility?: K.LiteralKind | null; computed?: boolean; } export interface PropertyPattern extends Omit { type: "PropertyPattern"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; pattern: K.PatternKind; computed?: boolean; } export interface ObjectPattern extends Omit { type: "ObjectPattern"; properties: (K.PropertyKind | K.PropertyPatternKind | K.SpreadPropertyPatternKind | K.SpreadPropertyKind | K.ObjectPropertyKind | K.RestPropertyKind | K.RestElementKind)[]; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; decorators?: K.DecoratorKind[] | null; } export interface ArrayPattern extends Omit { type: "ArrayPattern"; elements: (K.PatternKind | K.SpreadElementKind | null)[]; } export interface SpreadElement extends Omit { type: "SpreadElement"; argument: K.ExpressionKind; } export interface AssignmentPattern extends Omit { type: "AssignmentPattern"; left: K.PatternKind; right: K.ExpressionKind; } export interface MethodDefinition extends Omit { type: "MethodDefinition"; kind: "constructor" | "method" | "get" | "set"; key: K.ExpressionKind; value: K.FunctionKind; computed?: boolean; static?: boolean; decorators?: K.DecoratorKind[] | null; } export interface ClassPropertyDefinition extends Omit { type: "ClassPropertyDefinition"; definition: K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.StaticBlockKind; } export interface ClassProperty extends Omit { type: "ClassProperty"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; computed?: boolean; value: K.ExpressionKind | null; static?: boolean; typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null; variance?: K.VarianceKind | "plus" | "minus" | null; access?: "public" | "private" | "protected" | undefined; } export interface StaticBlock extends Omit { type: "StaticBlock"; body: K.StatementKind[]; } export interface ClassBody extends Omit { type: "ClassBody"; body: (K.MethodDefinitionKind | K.VariableDeclaratorKind | K.ClassPropertyDefinitionKind | K.ClassPropertyKind | K.ClassPrivatePropertyKind | K.ClassAccessorPropertyKind | K.ClassMethodKind | K.ClassPrivateMethodKind | K.StaticBlockKind | K.TSDeclareMethodKind | K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; } export interface ClassDeclaration extends Omit { type: "ClassDeclaration"; id: K.IdentifierKind | null; body: K.ClassBodyKind; superClass?: K.ExpressionKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; superTypeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null; implements?: K.ClassImplementsKind[] | K.TSExpressionWithTypeArgumentsKind[]; } export interface ClassExpression extends Omit { type: "ClassExpression"; id?: K.IdentifierKind | null; body: K.ClassBodyKind; superClass?: K.ExpressionKind | null; typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null; superTypeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null; implements?: K.ClassImplementsKind[] | K.TSExpressionWithTypeArgumentsKind[]; } export interface Super extends Omit { type: "Super"; } export interface Specifier extends Node {} export interface ModuleSpecifier extends Specifier { local?: K.IdentifierKind | null; id?: K.IdentifierKind | null; name?: K.IdentifierKind | null; } export interface ImportSpecifier extends Omit { type: "ImportSpecifier"; imported: K.IdentifierKind; } export interface ImportDefaultSpecifier extends Omit { type: "ImportDefaultSpecifier"; } export interface ImportNamespaceSpecifier extends Omit { type: "ImportNamespaceSpecifier"; } export interface ImportDeclaration extends Omit { type: "ImportDeclaration"; specifiers?: (K.ImportSpecifierKind | K.ImportNamespaceSpecifierKind | K.ImportDefaultSpecifierKind)[]; source: K.LiteralKind; importKind?: "value" | "type" | "typeof"; assertions?: K.ImportAttributeKind[]; } export interface ExportNamedDeclaration extends Omit { type: "ExportNamedDeclaration"; declaration: K.DeclarationKind | null; specifiers?: K.ExportSpecifierKind[]; source?: K.LiteralKind | null; assertions?: K.ImportAttributeKind[]; } export interface ExportSpecifier extends Omit { type: "ExportSpecifier"; exported: K.IdentifierKind; } export interface ExportDefaultDeclaration extends Omit { type: "ExportDefaultDeclaration"; declaration: K.DeclarationKind | K.ExpressionKind; } export interface ExportAllDeclaration extends Omit { type: "ExportAllDeclaration"; source: K.LiteralKind; exported?: K.IdentifierKind | null | undefined; assertions?: K.ImportAttributeKind[]; } export interface TaggedTemplateExpression extends Omit { type: "TaggedTemplateExpression"; tag: K.ExpressionKind; quasi: K.TemplateLiteralKind; } export interface TemplateLiteral extends Omit { type: "TemplateLiteral"; quasis: K.TemplateElementKind[]; expressions: K.ExpressionKind[] | K.TSTypeKind[]; } export interface TemplateElement extends Omit { type: "TemplateElement"; value: { cooked: string | null; raw: string; }; tail: boolean; } export interface MetaProperty extends Omit { type: "MetaProperty"; meta: K.IdentifierKind; property: K.IdentifierKind; } export interface AwaitExpression extends Omit { type: "AwaitExpression"; argument: K.ExpressionKind | null; all?: boolean; } export interface SpreadProperty extends Omit { type: "SpreadProperty"; argument: K.ExpressionKind; } export interface SpreadPropertyPattern extends Omit { type: "SpreadPropertyPattern"; argument: K.PatternKind; } export interface ImportExpression extends Omit { type: "ImportExpression"; source: K.ExpressionKind; } export interface ChainExpression extends Omit { type: "ChainExpression"; expression: K.ChainElementKind; } export interface OptionalCallExpression extends Omit { type: "OptionalCallExpression"; optional?: boolean; } export interface OptionalMemberExpression extends Omit { type: "OptionalMemberExpression"; optional?: boolean; } export interface Decorator extends Omit { type: "Decorator"; expression: K.ExpressionKind; } export interface PrivateName extends Omit, Omit { type: "PrivateName"; id: K.IdentifierKind; } export interface ClassPrivateProperty extends Omit { type: "ClassPrivateProperty"; key: K.PrivateNameKind; value?: K.ExpressionKind | null; } export interface ImportAttribute extends Omit { type: "ImportAttribute"; key: K.IdentifierKind | K.LiteralKind; value: K.ExpressionKind; } export interface RecordExpression extends Omit { type: "RecordExpression"; properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[]; } export interface ObjectMethod extends Omit, Omit { type: "ObjectMethod"; kind: "method" | "get" | "set"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; params: K.PatternKind[]; body: K.BlockStatementKind; computed?: boolean; generator?: boolean; async?: boolean; accessibility?: K.LiteralKind | null; decorators?: K.DecoratorKind[] | null; } export interface TupleExpression extends Omit { type: "TupleExpression"; elements: (K.ExpressionKind | K.SpreadElementKind | null)[]; } export interface ModuleExpression extends Omit { type: "ModuleExpression"; body: K.ProgramKind; } export interface JSXAttribute extends Omit { type: "JSXAttribute"; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind; value?: K.LiteralKind | K.JSXExpressionContainerKind | K.JSXElementKind | K.JSXFragmentKind | null; } export interface JSXIdentifier extends Omit { type: "JSXIdentifier"; name: string; } export interface JSXNamespacedName extends Omit { type: "JSXNamespacedName"; namespace: K.JSXIdentifierKind; name: K.JSXIdentifierKind; } export interface JSXExpressionContainer extends Omit { type: "JSXExpressionContainer"; expression: K.ExpressionKind | K.JSXEmptyExpressionKind; } export interface JSXElement extends Omit { type: "JSXElement"; openingElement: K.JSXOpeningElementKind; closingElement?: K.JSXClosingElementKind | null; children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[]; name?: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; selfClosing?: boolean; attributes?: (K.JSXAttributeKind | K.JSXSpreadAttributeKind)[]; } export interface JSXFragment extends Omit { type: "JSXFragment"; openingFragment: K.JSXOpeningFragmentKind; closingFragment: K.JSXClosingFragmentKind; children?: (K.JSXTextKind | K.JSXExpressionContainerKind | K.JSXSpreadChildKind | K.JSXElementKind | K.JSXFragmentKind | K.LiteralKind)[]; } export interface JSXMemberExpression extends Omit { type: "JSXMemberExpression"; object: K.JSXIdentifierKind | K.JSXMemberExpressionKind; property: K.JSXIdentifierKind; computed?: boolean; } export interface JSXSpreadAttribute extends Omit { type: "JSXSpreadAttribute"; argument: K.ExpressionKind; } export interface JSXEmptyExpression extends Omit { type: "JSXEmptyExpression"; } export interface JSXText extends Omit { type: "JSXText"; value: string; raw?: string; } export interface JSXSpreadChild extends Omit { type: "JSXSpreadChild"; expression: K.ExpressionKind; } export interface JSXOpeningElement extends Omit { type: "JSXOpeningElement"; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; attributes?: (K.JSXAttributeKind | K.JSXSpreadAttributeKind)[]; selfClosing?: boolean; } export interface JSXClosingElement extends Omit { type: "JSXClosingElement"; name: K.JSXIdentifierKind | K.JSXNamespacedNameKind | K.JSXMemberExpressionKind; } export interface JSXOpeningFragment extends Omit { type: "JSXOpeningFragment"; } export interface JSXClosingFragment extends Omit { type: "JSXClosingFragment"; } export interface TypeParameterDeclaration extends Omit { type: "TypeParameterDeclaration"; params: K.TypeParameterKind[]; } export interface TSTypeParameterDeclaration extends Omit { type: "TSTypeParameterDeclaration"; params: K.TSTypeParameterKind[]; } export interface TypeParameterInstantiation extends Omit { type: "TypeParameterInstantiation"; params: K.FlowTypeKind[]; } export interface TSTypeParameterInstantiation extends Omit { type: "TSTypeParameterInstantiation"; params: K.TSTypeKind[]; } export interface ClassImplements extends Omit { type: "ClassImplements"; id: K.IdentifierKind; superClass?: K.ExpressionKind | null; typeParameters?: K.TypeParameterInstantiationKind | null; } export interface TSType extends Node {} export interface TSHasOptionalTypeParameterInstantiation { typeParameters?: K.TSTypeParameterInstantiationKind | null; } export interface TSExpressionWithTypeArguments extends Omit, TSHasOptionalTypeParameterInstantiation { type: "TSExpressionWithTypeArguments"; expression: K.IdentifierKind | K.TSQualifiedNameKind; } export interface Flow extends Node {} export interface FlowType extends Flow {} export interface AnyTypeAnnotation extends Omit { type: "AnyTypeAnnotation"; } export interface EmptyTypeAnnotation extends Omit { type: "EmptyTypeAnnotation"; } export interface MixedTypeAnnotation extends Omit { type: "MixedTypeAnnotation"; } export interface VoidTypeAnnotation extends Omit { type: "VoidTypeAnnotation"; } export interface SymbolTypeAnnotation extends Omit { type: "SymbolTypeAnnotation"; } export interface NumberTypeAnnotation extends Omit { type: "NumberTypeAnnotation"; } export interface BigIntTypeAnnotation extends Omit { type: "BigIntTypeAnnotation"; } export interface NumberLiteralTypeAnnotation extends Omit { type: "NumberLiteralTypeAnnotation"; value: number; raw: string; } export interface NumericLiteralTypeAnnotation extends Omit { type: "NumericLiteralTypeAnnotation"; value: number; raw: string; } export interface BigIntLiteralTypeAnnotation extends Omit { type: "BigIntLiteralTypeAnnotation"; value: null; raw: string; } export interface StringTypeAnnotation extends Omit { type: "StringTypeAnnotation"; } export interface StringLiteralTypeAnnotation extends Omit { type: "StringLiteralTypeAnnotation"; value: string; raw: string; } export interface BooleanTypeAnnotation extends Omit { type: "BooleanTypeAnnotation"; } export interface BooleanLiteralTypeAnnotation extends Omit { type: "BooleanLiteralTypeAnnotation"; value: boolean; raw: string; } export interface NullableTypeAnnotation extends Omit { type: "NullableTypeAnnotation"; typeAnnotation: K.FlowTypeKind; } export interface NullLiteralTypeAnnotation extends Omit { type: "NullLiteralTypeAnnotation"; } export interface NullTypeAnnotation extends Omit { type: "NullTypeAnnotation"; } export interface ThisTypeAnnotation extends Omit { type: "ThisTypeAnnotation"; } export interface ExistsTypeAnnotation extends Omit { type: "ExistsTypeAnnotation"; } export interface ExistentialTypeParam extends Omit { type: "ExistentialTypeParam"; } export interface FunctionTypeAnnotation extends Omit { type: "FunctionTypeAnnotation"; params: K.FunctionTypeParamKind[]; returnType: K.FlowTypeKind; rest: K.FunctionTypeParamKind | null; typeParameters: K.TypeParameterDeclarationKind | null; } export interface FunctionTypeParam extends Omit { type: "FunctionTypeParam"; name: K.IdentifierKind | null; typeAnnotation: K.FlowTypeKind; optional: boolean; } export interface ArrayTypeAnnotation extends Omit { type: "ArrayTypeAnnotation"; elementType: K.FlowTypeKind; } export interface ObjectTypeAnnotation extends Omit { type: "ObjectTypeAnnotation"; properties: (K.ObjectTypePropertyKind | K.ObjectTypeSpreadPropertyKind)[]; indexers?: K.ObjectTypeIndexerKind[]; callProperties?: K.ObjectTypeCallPropertyKind[]; inexact?: boolean | undefined; exact?: boolean; internalSlots?: K.ObjectTypeInternalSlotKind[]; } export interface ObjectTypeProperty extends Omit { type: "ObjectTypeProperty"; key: K.LiteralKind | K.IdentifierKind; value: K.FlowTypeKind; optional: boolean; variance?: K.VarianceKind | "plus" | "minus" | null; } export interface ObjectTypeSpreadProperty extends Omit { type: "ObjectTypeSpreadProperty"; argument: K.FlowTypeKind; } export interface ObjectTypeIndexer extends Omit { type: "ObjectTypeIndexer"; id: K.IdentifierKind; key: K.FlowTypeKind; value: K.FlowTypeKind; variance?: K.VarianceKind | "plus" | "minus" | null; static?: boolean; } export interface ObjectTypeCallProperty extends Omit { type: "ObjectTypeCallProperty"; value: K.FunctionTypeAnnotationKind; static?: boolean; } export interface ObjectTypeInternalSlot extends Omit { type: "ObjectTypeInternalSlot"; id: K.IdentifierKind; value: K.FlowTypeKind; optional: boolean; static: boolean; method: boolean; } export interface Variance extends Omit { type: "Variance"; kind: "plus" | "minus"; } export interface QualifiedTypeIdentifier extends Omit { type: "QualifiedTypeIdentifier"; qualification: K.IdentifierKind | K.QualifiedTypeIdentifierKind; id: K.IdentifierKind; } export interface GenericTypeAnnotation extends Omit { type: "GenericTypeAnnotation"; id: K.IdentifierKind | K.QualifiedTypeIdentifierKind; typeParameters: K.TypeParameterInstantiationKind | null; } export interface MemberTypeAnnotation extends Omit { type: "MemberTypeAnnotation"; object: K.IdentifierKind; property: K.MemberTypeAnnotationKind | K.GenericTypeAnnotationKind; } export interface IndexedAccessType extends Omit { type: "IndexedAccessType"; objectType: K.FlowTypeKind; indexType: K.FlowTypeKind; } export interface OptionalIndexedAccessType extends Omit { type: "OptionalIndexedAccessType"; objectType: K.FlowTypeKind; indexType: K.FlowTypeKind; optional: boolean; } export interface UnionTypeAnnotation extends Omit { type: "UnionTypeAnnotation"; types: K.FlowTypeKind[]; } export interface IntersectionTypeAnnotation extends Omit { type: "IntersectionTypeAnnotation"; types: K.FlowTypeKind[]; } export interface TypeofTypeAnnotation extends Omit { type: "TypeofTypeAnnotation"; argument: K.FlowTypeKind; } export interface TypeParameter extends Omit { type: "TypeParameter"; name: string; variance?: K.VarianceKind | "plus" | "minus" | null; bound?: K.TypeAnnotationKind | null; default?: K.FlowTypeKind | null; } export interface InterfaceTypeAnnotation extends Omit { type: "InterfaceTypeAnnotation"; body: K.ObjectTypeAnnotationKind; extends?: K.InterfaceExtendsKind[] | null; } export interface InterfaceExtends extends Omit { type: "InterfaceExtends"; id: K.IdentifierKind; typeParameters?: K.TypeParameterInstantiationKind | null; } export interface InterfaceDeclaration extends Omit { type: "InterfaceDeclaration"; id: K.IdentifierKind; typeParameters?: K.TypeParameterDeclarationKind | null; body: K.ObjectTypeAnnotationKind; extends: K.InterfaceExtendsKind[]; } export interface DeclareInterface extends Omit { type: "DeclareInterface"; } export interface TypeAlias extends Omit { type: "TypeAlias"; id: K.IdentifierKind; typeParameters: K.TypeParameterDeclarationKind | null; right: K.FlowTypeKind; } export interface DeclareTypeAlias extends Omit { type: "DeclareTypeAlias"; } export interface OpaqueType extends Omit { type: "OpaqueType"; id: K.IdentifierKind; typeParameters: K.TypeParameterDeclarationKind | null; impltype: K.FlowTypeKind; supertype: K.FlowTypeKind | null; } export interface DeclareOpaqueType extends Omit { type: "DeclareOpaqueType"; impltype: K.FlowTypeKind | null; } export interface TypeCastExpression extends Omit { type: "TypeCastExpression"; expression: K.ExpressionKind; typeAnnotation: K.TypeAnnotationKind; } export interface TupleTypeAnnotation extends Omit { type: "TupleTypeAnnotation"; types: K.FlowTypeKind[]; } export interface DeclareVariable extends Omit { type: "DeclareVariable"; id: K.IdentifierKind; } export interface DeclareFunction extends Omit { type: "DeclareFunction"; id: K.IdentifierKind; predicate?: K.FlowPredicateKind | null; } export interface FlowPredicate extends Flow {} export interface DeclareClass extends Omit { type: "DeclareClass"; } export interface DeclareModule extends Omit { type: "DeclareModule"; id: K.IdentifierKind | K.LiteralKind; body: K.BlockStatementKind; } export interface DeclareModuleExports extends Omit { type: "DeclareModuleExports"; typeAnnotation: K.TypeAnnotationKind; } export interface DeclareExportDeclaration extends Omit { type: "DeclareExportDeclaration"; default: boolean; declaration: K.DeclareVariableKind | K.DeclareFunctionKind | K.DeclareClassKind | K.FlowTypeKind | K.TypeAliasKind | K.DeclareOpaqueTypeKind | K.InterfaceDeclarationKind | null; specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[]; source?: K.LiteralKind | null; } export interface ExportBatchSpecifier extends Omit { type: "ExportBatchSpecifier"; } export interface DeclareExportAllDeclaration extends Omit { type: "DeclareExportAllDeclaration"; source?: K.LiteralKind | null; } export interface InferredPredicate extends Omit { type: "InferredPredicate"; } export interface DeclaredPredicate extends Omit { type: "DeclaredPredicate"; value: K.ExpressionKind; } export interface EnumDeclaration extends Omit { type: "EnumDeclaration"; id: K.IdentifierKind; body: K.EnumBooleanBodyKind | K.EnumNumberBodyKind | K.EnumStringBodyKind | K.EnumSymbolBodyKind; } export interface EnumBooleanBody { type: "EnumBooleanBody"; members: K.EnumBooleanMemberKind[]; explicitType: boolean; } export interface EnumNumberBody { type: "EnumNumberBody"; members: K.EnumNumberMemberKind[]; explicitType: boolean; } export interface EnumStringBody { type: "EnumStringBody"; members: K.EnumStringMemberKind[] | K.EnumDefaultedMemberKind[]; explicitType: boolean; } export interface EnumSymbolBody { type: "EnumSymbolBody"; members: K.EnumDefaultedMemberKind[]; } export interface EnumBooleanMember { type: "EnumBooleanMember"; id: K.IdentifierKind; init: K.LiteralKind | boolean; } export interface EnumNumberMember { type: "EnumNumberMember"; id: K.IdentifierKind; init: K.LiteralKind; } export interface EnumStringMember { type: "EnumStringMember"; id: K.IdentifierKind; init: K.LiteralKind; } export interface EnumDefaultedMember { type: "EnumDefaultedMember"; id: K.IdentifierKind; } export interface ExportDeclaration extends Omit { type: "ExportDeclaration"; default: boolean; declaration: K.DeclarationKind | K.ExpressionKind | null; specifiers?: (K.ExportSpecifierKind | K.ExportBatchSpecifierKind)[]; source?: K.LiteralKind | null; } export interface Block extends Comment { type: "Block"; } export interface Line extends Comment { type: "Line"; } export interface Noop extends Omit { type: "Noop"; } export interface DoExpression extends Omit { type: "DoExpression"; body: K.StatementKind[]; } export interface BindExpression extends Omit { type: "BindExpression"; object: K.ExpressionKind | null; callee: K.ExpressionKind; } export interface ParenthesizedExpression extends Omit { type: "ParenthesizedExpression"; expression: K.ExpressionKind; } export interface ExportNamespaceSpecifier extends Omit { type: "ExportNamespaceSpecifier"; exported: K.IdentifierKind; } export interface ExportDefaultSpecifier extends Omit { type: "ExportDefaultSpecifier"; exported: K.IdentifierKind; } export interface CommentBlock extends Comment { type: "CommentBlock"; } export interface CommentLine extends Comment { type: "CommentLine"; } export interface Directive extends Omit { type: "Directive"; value: K.DirectiveLiteralKind; } export interface DirectiveLiteral extends Omit, Omit { type: "DirectiveLiteral"; value?: string; } export interface InterpreterDirective extends Omit { type: "InterpreterDirective"; value: string; } export interface StringLiteral extends Omit { type: "StringLiteral"; value: string; extra?: { rawValue: string; raw: string; }; } export interface NumericLiteral extends Omit { type: "NumericLiteral"; value: number; raw?: string | null; extra?: { rawValue: number; raw: string; }; } export interface BigIntLiteral extends Omit { type: "BigIntLiteral"; value: string | number; extra?: { rawValue: string; raw: string; }; } export interface DecimalLiteral extends Omit { type: "DecimalLiteral"; value: string; extra?: { rawValue: string; raw: string; }; } export interface NullLiteral extends Omit { type: "NullLiteral"; value?: null; } export interface BooleanLiteral extends Omit { type: "BooleanLiteral"; value: boolean; } export interface RegExpLiteral extends Omit { type: "RegExpLiteral"; pattern: string; flags: string; value?: RegExp; extra?: { rawValue: RegExp | undefined; raw: string; }; regex?: { pattern: string; flags: string; }; } export interface ClassMethod extends Omit, Omit { type: "ClassMethod"; key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind; kind?: "get" | "set" | "method" | "constructor"; body: K.BlockStatementKind; access?: "public" | "private" | "protected" | null; computed?: boolean; static?: boolean; abstract?: boolean; accessibility?: "public" | "private" | "protected" | null; decorators?: K.DecoratorKind[] | null; definite?: boolean; optional?: boolean; override?: boolean; readonly?: boolean; } export interface ClassPrivateMethod extends Omit, Omit { type: "ClassPrivateMethod"; key: K.PrivateNameKind; kind?: "get" | "set" | "method" | "constructor"; body: K.BlockStatementKind; access?: "public" | "private" | "protected" | null; computed?: boolean; static?: boolean; abstract?: boolean; accessibility?: "public" | "private" | "protected" | null; decorators?: K.DecoratorKind[] | null; definite?: boolean; optional?: boolean; override?: boolean; readonly?: boolean; } export interface TSHasOptionalTypeAnnotation { typeAnnotation?: K.TSTypeAnnotationKind | null; } export interface ClassAccessorProperty extends Omit, TSHasOptionalTypeAnnotation { type: "ClassAccessorProperty"; key: K.LiteralKind | K.IdentifierKind | K.PrivateNameKind | K.ExpressionKind; value?: K.ExpressionKind | null; computed?: boolean; static?: boolean; abstract?: boolean; accessibility?: "public" | "private" | "protected" | null; decorators?: K.DecoratorKind[] | null; definite?: boolean; optional?: boolean; override?: boolean; readonly?: boolean; } export interface RestProperty extends Omit { type: "RestProperty"; argument: K.ExpressionKind; } export interface ForAwaitStatement extends Omit { type: "ForAwaitStatement"; left: K.VariableDeclarationKind | K.ExpressionKind; right: K.ExpressionKind; body: K.StatementKind; } export interface Import extends Omit { type: "Import"; } export interface V8IntrinsicIdentifier extends Omit { type: "V8IntrinsicIdentifier"; name: string; } export interface TopicReference extends Omit { type: "TopicReference"; } export interface TSQualifiedName extends Omit { type: "TSQualifiedName"; left: K.IdentifierKind | K.TSQualifiedNameKind; right: K.IdentifierKind | K.TSQualifiedNameKind; } export interface TSTypeReference extends Omit, TSHasOptionalTypeParameterInstantiation { type: "TSTypeReference"; typeName: K.IdentifierKind | K.TSQualifiedNameKind; } export interface TSHasOptionalTypeParameters { typeParameters?: K.TSTypeParameterDeclarationKind | null | undefined; } export interface TSAsExpression extends Omit, Omit { type: "TSAsExpression"; expression: K.ExpressionKind; typeAnnotation: K.TSTypeKind; extra?: { parenthesized: boolean; } | null; } export interface TSTypeCastExpression extends Omit { type: "TSTypeCastExpression"; expression: K.ExpressionKind; typeAnnotation: K.TSTypeKind; } export interface TSSatisfiesExpression extends Omit, Omit { type: "TSSatisfiesExpression"; expression: K.ExpressionKind; typeAnnotation: K.TSTypeKind; } export interface TSNonNullExpression extends Omit, Omit { type: "TSNonNullExpression"; expression: K.ExpressionKind; } export interface TSAnyKeyword extends Omit { type: "TSAnyKeyword"; } export interface TSBigIntKeyword extends Omit { type: "TSBigIntKeyword"; } export interface TSBooleanKeyword extends Omit { type: "TSBooleanKeyword"; } export interface TSNeverKeyword extends Omit { type: "TSNeverKeyword"; } export interface TSNullKeyword extends Omit { type: "TSNullKeyword"; } export interface TSNumberKeyword extends Omit { type: "TSNumberKeyword"; } export interface TSObjectKeyword extends Omit { type: "TSObjectKeyword"; } export interface TSStringKeyword extends Omit { type: "TSStringKeyword"; } export interface TSSymbolKeyword extends Omit { type: "TSSymbolKeyword"; } export interface TSUndefinedKeyword extends Omit { type: "TSUndefinedKeyword"; } export interface TSUnknownKeyword extends Omit { type: "TSUnknownKeyword"; } export interface TSVoidKeyword extends Omit { type: "TSVoidKeyword"; } export interface TSIntrinsicKeyword extends Omit { type: "TSIntrinsicKeyword"; } export interface TSThisType extends Omit { type: "TSThisType"; } export interface TSArrayType extends Omit { type: "TSArrayType"; elementType: K.TSTypeKind; } export interface TSLiteralType extends Omit { type: "TSLiteralType"; literal: K.NumericLiteralKind | K.StringLiteralKind | K.BooleanLiteralKind | K.TemplateLiteralKind | K.UnaryExpressionKind | K.BigIntLiteralKind; } export interface TSUnionType extends Omit { type: "TSUnionType"; types: K.TSTypeKind[]; } export interface TSIntersectionType extends Omit { type: "TSIntersectionType"; types: K.TSTypeKind[]; } export interface TSConditionalType extends Omit { type: "TSConditionalType"; checkType: K.TSTypeKind; extendsType: K.TSTypeKind; trueType: K.TSTypeKind; falseType: K.TSTypeKind; } export interface TSInferType extends Omit { type: "TSInferType"; typeParameter: K.TSTypeParameterKind; } export interface TSTypeParameter extends Omit { type: "TSTypeParameter"; name: K.IdentifierKind | string; constraint?: K.TSTypeKind | undefined; default?: K.TSTypeKind | undefined; } export interface TSParenthesizedType extends Omit { type: "TSParenthesizedType"; typeAnnotation: K.TSTypeKind; } export interface TSFunctionType extends Omit, TSHasOptionalTypeParameters, TSHasOptionalTypeAnnotation { type: "TSFunctionType"; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; } export interface TSConstructorType extends Omit, TSHasOptionalTypeParameters, TSHasOptionalTypeAnnotation { type: "TSConstructorType"; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; } export interface TSDeclareFunction extends Omit, TSHasOptionalTypeParameters { type: "TSDeclareFunction"; declare?: boolean; async?: boolean; generator?: boolean; id?: K.IdentifierKind | null; params: K.PatternKind[]; returnType?: K.TSTypeAnnotationKind | K.NoopKind | null; } export interface TSDeclareMethod extends Omit, TSHasOptionalTypeParameters { type: "TSDeclareMethod"; async?: boolean; generator?: boolean; params: K.PatternKind[]; abstract?: boolean; accessibility?: "public" | "private" | "protected" | undefined; static?: boolean; computed?: boolean; optional?: boolean; key: K.IdentifierKind | K.StringLiteralKind | K.NumericLiteralKind | K.ExpressionKind; kind?: "get" | "set" | "method" | "constructor"; access?: "public" | "private" | "protected" | undefined; decorators?: K.DecoratorKind[] | null; returnType?: K.TSTypeAnnotationKind | K.NoopKind | null; } export interface TSMappedType extends Omit { type: "TSMappedType"; readonly?: boolean | "+" | "-"; typeParameter: K.TSTypeParameterKind; optional?: boolean | "+" | "-"; typeAnnotation?: K.TSTypeKind | null; } export interface TSTupleType extends Omit { type: "TSTupleType"; elementTypes: (K.TSTypeKind | K.TSNamedTupleMemberKind)[]; } export interface TSNamedTupleMember extends Omit { type: "TSNamedTupleMember"; label: K.IdentifierKind; optional?: boolean; elementType: K.TSTypeKind; } export interface TSRestType extends Omit { type: "TSRestType"; typeAnnotation: K.TSTypeKind; } export interface TSOptionalType extends Omit { type: "TSOptionalType"; typeAnnotation: K.TSTypeKind; } export interface TSIndexedAccessType extends Omit { type: "TSIndexedAccessType"; objectType: K.TSTypeKind; indexType: K.TSTypeKind; } export interface TSTypeOperator extends Omit { type: "TSTypeOperator"; operator: string; typeAnnotation: K.TSTypeKind; } export interface TSIndexSignature extends Omit, TSHasOptionalTypeAnnotation { type: "TSIndexSignature"; parameters: K.IdentifierKind[]; readonly?: boolean; } export interface TSPropertySignature extends Omit, TSHasOptionalTypeAnnotation { type: "TSPropertySignature"; key: K.ExpressionKind; computed?: boolean; readonly?: boolean; optional?: boolean; initializer?: K.ExpressionKind | null; } export interface TSMethodSignature extends Omit, TSHasOptionalTypeParameters, TSHasOptionalTypeAnnotation { type: "TSMethodSignature"; key: K.ExpressionKind; computed?: boolean; optional?: boolean; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; } export interface TSTypePredicate extends Omit, Omit { type: "TSTypePredicate"; parameterName: K.IdentifierKind | K.TSThisTypeKind; typeAnnotation?: K.TSTypeAnnotationKind | null; asserts?: boolean; } export interface TSCallSignatureDeclaration extends Omit, TSHasOptionalTypeParameters, TSHasOptionalTypeAnnotation { type: "TSCallSignatureDeclaration"; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; } export interface TSConstructSignatureDeclaration extends Omit, TSHasOptionalTypeParameters, TSHasOptionalTypeAnnotation { type: "TSConstructSignatureDeclaration"; parameters: (K.IdentifierKind | K.RestElementKind | K.ArrayPatternKind | K.ObjectPatternKind)[]; } export interface TSEnumMember extends Omit { type: "TSEnumMember"; id: K.IdentifierKind | K.StringLiteralKind; initializer?: K.ExpressionKind | null; } export interface TSTypeQuery extends Omit { type: "TSTypeQuery"; exprName: K.IdentifierKind | K.TSQualifiedNameKind | K.TSImportTypeKind; } export interface TSImportType extends Omit, TSHasOptionalTypeParameterInstantiation { type: "TSImportType"; argument: K.StringLiteralKind; qualifier?: K.IdentifierKind | K.TSQualifiedNameKind | undefined; } export interface TSTypeLiteral extends Omit { type: "TSTypeLiteral"; members: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; } export interface TSTypeAssertion extends Omit, Omit { type: "TSTypeAssertion"; typeAnnotation: K.TSTypeKind; expression: K.ExpressionKind; extra?: { parenthesized: boolean; } | null; } export interface TSInstantiationExpression extends Omit, TSHasOptionalTypeParameterInstantiation { type: "TSInstantiationExpression"; expression: K.ExpressionKind; } export interface TSEnumDeclaration extends Omit { type: "TSEnumDeclaration"; id: K.IdentifierKind; const?: boolean; declare?: boolean; members: K.TSEnumMemberKind[]; initializer?: K.ExpressionKind | null; } export interface TSTypeAliasDeclaration extends Omit, TSHasOptionalTypeParameters { type: "TSTypeAliasDeclaration"; id: K.IdentifierKind; declare?: boolean; typeAnnotation: K.TSTypeKind; } export interface TSModuleBlock extends Omit { type: "TSModuleBlock"; body: K.StatementKind[]; } export interface TSModuleDeclaration extends Omit { type: "TSModuleDeclaration"; id: K.StringLiteralKind | K.IdentifierKind | K.TSQualifiedNameKind; declare?: boolean; global?: boolean; body?: K.TSModuleBlockKind | K.TSModuleDeclarationKind | null; } export interface TSImportEqualsDeclaration extends Omit { type: "TSImportEqualsDeclaration"; id: K.IdentifierKind; isExport?: boolean; moduleReference: K.IdentifierKind | K.TSQualifiedNameKind | K.TSExternalModuleReferenceKind; } export interface TSExternalModuleReference extends Omit { type: "TSExternalModuleReference"; expression: K.StringLiteralKind; } export interface TSExportAssignment extends Omit { type: "TSExportAssignment"; expression: K.ExpressionKind; } export interface TSNamespaceExportDeclaration extends Omit { type: "TSNamespaceExportDeclaration"; id: K.IdentifierKind; } export interface TSInterfaceBody extends Omit { type: "TSInterfaceBody"; body: (K.TSCallSignatureDeclarationKind | K.TSConstructSignatureDeclarationKind | K.TSIndexSignatureKind | K.TSMethodSignatureKind | K.TSPropertySignatureKind)[]; } export interface TSInterfaceDeclaration extends Omit, TSHasOptionalTypeParameters { type: "TSInterfaceDeclaration"; id: K.IdentifierKind | K.TSQualifiedNameKind; declare?: boolean; extends?: K.TSExpressionWithTypeArgumentsKind[] | null; body: K.TSInterfaceBodyKind; } export interface TSParameterProperty extends Omit { type: "TSParameterProperty"; accessibility?: "public" | "private" | "protected" | undefined; readonly?: boolean; parameter: K.IdentifierKind | K.AssignmentPatternKind; } export type ASTNode = File | Program | Identifier | BlockStatement | EmptyStatement | ExpressionStatement | IfStatement | LabeledStatement | BreakStatement | ContinueStatement | WithStatement | SwitchStatement | SwitchCase | ReturnStatement | ThrowStatement | TryStatement | CatchClause | WhileStatement | DoWhileStatement | ForStatement | VariableDeclaration | ForInStatement | DebuggerStatement | FunctionDeclaration | FunctionExpression | VariableDeclarator | ThisExpression | ArrayExpression | ObjectExpression | Property | Literal | SequenceExpression | UnaryExpression | BinaryExpression | AssignmentExpression | MemberExpression | UpdateExpression | LogicalExpression | ConditionalExpression | NewExpression | CallExpression | RestElement | TypeAnnotation | TSTypeAnnotation | SpreadElementPattern | ArrowFunctionExpression | ForOfStatement | YieldExpression | GeneratorExpression | ComprehensionBlock | ComprehensionExpression | ObjectProperty | PropertyPattern | ObjectPattern | ArrayPattern | SpreadElement | AssignmentPattern | MethodDefinition | ClassPropertyDefinition | ClassProperty | StaticBlock | ClassBody | ClassDeclaration | ClassExpression | Super | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportDeclaration | ExportNamedDeclaration | ExportSpecifier | ExportDefaultDeclaration | ExportAllDeclaration | TaggedTemplateExpression | TemplateLiteral | TemplateElement | MetaProperty | AwaitExpression | SpreadProperty | SpreadPropertyPattern | ImportExpression | ChainExpression | OptionalCallExpression | OptionalMemberExpression | Decorator | PrivateName | ClassPrivateProperty | ImportAttribute | RecordExpression | ObjectMethod | TupleExpression | ModuleExpression | JSXAttribute | JSXIdentifier | JSXNamespacedName | JSXExpressionContainer | JSXElement | JSXFragment | JSXMemberExpression | JSXSpreadAttribute | JSXEmptyExpression | JSXText | JSXSpreadChild | JSXOpeningElement | JSXClosingElement | JSXOpeningFragment | JSXClosingFragment | TypeParameterDeclaration | TSTypeParameterDeclaration | TypeParameterInstantiation | TSTypeParameterInstantiation | ClassImplements | TSExpressionWithTypeArguments | AnyTypeAnnotation | EmptyTypeAnnotation | MixedTypeAnnotation | VoidTypeAnnotation | SymbolTypeAnnotation | NumberTypeAnnotation | BigIntTypeAnnotation | NumberLiteralTypeAnnotation | NumericLiteralTypeAnnotation | BigIntLiteralTypeAnnotation | StringTypeAnnotation | StringLiteralTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullableTypeAnnotation | NullLiteralTypeAnnotation | NullTypeAnnotation | ThisTypeAnnotation | ExistsTypeAnnotation | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | ArrayTypeAnnotation | ObjectTypeAnnotation | ObjectTypeProperty | ObjectTypeSpreadProperty | ObjectTypeIndexer | ObjectTypeCallProperty | ObjectTypeInternalSlot | Variance | QualifiedTypeIdentifier | GenericTypeAnnotation | MemberTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType | UnionTypeAnnotation | IntersectionTypeAnnotation | TypeofTypeAnnotation | TypeParameter | InterfaceTypeAnnotation | InterfaceExtends | InterfaceDeclaration | DeclareInterface | TypeAlias | DeclareTypeAlias | OpaqueType | DeclareOpaqueType | TypeCastExpression | TupleTypeAnnotation | DeclareVariable | DeclareFunction | DeclareClass | DeclareModule | DeclareModuleExports | DeclareExportDeclaration | ExportBatchSpecifier | DeclareExportAllDeclaration | InferredPredicate | DeclaredPredicate | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | ExportDeclaration | Block | Line | Noop | DoExpression | BindExpression | ParenthesizedExpression | ExportNamespaceSpecifier | ExportDefaultSpecifier | CommentBlock | CommentLine | Directive | DirectiveLiteral | InterpreterDirective | StringLiteral | NumericLiteral | BigIntLiteral | DecimalLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ClassMethod | ClassPrivateMethod | ClassAccessorProperty | RestProperty | ForAwaitStatement | Import | V8IntrinsicIdentifier | TopicReference | TSQualifiedName | TSTypeReference | TSAsExpression | TSTypeCastExpression | TSSatisfiesExpression | TSNonNullExpression | TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSIntrinsicKeyword | TSThisType | TSArrayType | TSLiteralType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSTypeParameter | TSParenthesizedType | TSFunctionType | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSMappedType | TSTupleType | TSNamedTupleMember | TSRestType | TSOptionalType | TSIndexedAccessType | TSTypeOperator | TSIndexSignature | TSPropertySignature | TSMethodSignature | TSTypePredicate | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSEnumMember | TSTypeQuery | TSImportType | TSTypeLiteral | TSTypeAssertion | TSInstantiationExpression | TSEnumDeclaration | TSTypeAliasDeclaration | TSModuleBlock | TSModuleDeclaration | TSImportEqualsDeclaration | TSExternalModuleReference | TSExportAssignment | TSNamespaceExportDeclaration | TSInterfaceBody | TSInterfaceDeclaration | TSParameterProperty; export let Printable: Type; export let SourceLocation: Type; export let Node: Type; export let Comment: Type; export let Position: Type; export let File: Type; export let Program: Type; export let Statement: Type; export let Function: Type; export let Expression: Type; export let Pattern: Type; export let Identifier: Type; export let BlockStatement: Type; export let EmptyStatement: Type; export let ExpressionStatement: Type; export let IfStatement: Type; export let LabeledStatement: Type; export let BreakStatement: Type; export let ContinueStatement: Type; export let WithStatement: Type; export let SwitchStatement: Type; export let SwitchCase: Type; export let ReturnStatement: Type; export let ThrowStatement: Type; export let TryStatement: Type; export let CatchClause: Type; export let WhileStatement: Type; export let DoWhileStatement: Type; export let ForStatement: Type; export let Declaration: Type; export let VariableDeclaration: Type; export let ForInStatement: Type; export let DebuggerStatement: Type; export let FunctionDeclaration: Type; export let FunctionExpression: Type; export let VariableDeclarator: Type; export let ThisExpression: Type; export let ArrayExpression: Type; export let ObjectExpression: Type; export let Property: Type; export let Literal: Type; export let SequenceExpression: Type; export let UnaryExpression: Type; export let BinaryExpression: Type; export let AssignmentExpression: Type; export let ChainElement: Type; export let MemberExpression: Type; export let UpdateExpression: Type; export let LogicalExpression: Type; export let ConditionalExpression: Type; export let NewExpression: Type; export let CallExpression: Type; export let RestElement: Type; export let TypeAnnotation: Type; export let TSTypeAnnotation: Type; export let SpreadElementPattern: Type; export let ArrowFunctionExpression: Type; export let ForOfStatement: Type; export let YieldExpression: Type; export let GeneratorExpression: Type; export let ComprehensionBlock: Type; export let ComprehensionExpression: Type; export let ObjectProperty: Type; export let PropertyPattern: Type; export let ObjectPattern: Type; export let ArrayPattern: Type; export let SpreadElement: Type; export let AssignmentPattern: Type; export let MethodDefinition: Type; export let ClassPropertyDefinition: Type; export let ClassProperty: Type; export let StaticBlock: Type; export let ClassBody: Type; export let ClassDeclaration: Type; export let ClassExpression: Type; export let Super: Type; export let Specifier: Type; export let ModuleSpecifier: Type; export let ImportSpecifier: Type; export let ImportDefaultSpecifier: Type; export let ImportNamespaceSpecifier: Type; export let ImportDeclaration: Type; export let ExportNamedDeclaration: Type; export let ExportSpecifier: Type; export let ExportDefaultDeclaration: Type; export let ExportAllDeclaration: Type; export let TaggedTemplateExpression: Type; export let TemplateLiteral: Type; export let TemplateElement: Type; export let MetaProperty: Type; export let AwaitExpression: Type; export let SpreadProperty: Type; export let SpreadPropertyPattern: Type; export let ImportExpression: Type; export let ChainExpression: Type; export let OptionalCallExpression: Type; export let OptionalMemberExpression: Type; export let Decorator: Type; export let PrivateName: Type; export let ClassPrivateProperty: Type; export let ImportAttribute: Type; export let RecordExpression: Type; export let ObjectMethod: Type; export let TupleExpression: Type; export let ModuleExpression: Type; export let JSXAttribute: Type; export let JSXIdentifier: Type; export let JSXNamespacedName: Type; export let JSXExpressionContainer: Type; export let JSXElement: Type; export let JSXFragment: Type; export let JSXMemberExpression: Type; export let JSXSpreadAttribute: Type; export let JSXEmptyExpression: Type; export let JSXText: Type; export let JSXSpreadChild: Type; export let JSXOpeningElement: Type; export let JSXClosingElement: Type; export let JSXOpeningFragment: Type; export let JSXClosingFragment: Type; export let TypeParameterDeclaration: Type; export let TSTypeParameterDeclaration: Type; export let TypeParameterInstantiation: Type; export let TSTypeParameterInstantiation: Type; export let ClassImplements: Type; export let TSType: Type; export let TSHasOptionalTypeParameterInstantiation: Type; export let TSExpressionWithTypeArguments: Type; export let Flow: Type; export let FlowType: Type; export let AnyTypeAnnotation: Type; export let EmptyTypeAnnotation: Type; export let MixedTypeAnnotation: Type; export let VoidTypeAnnotation: Type; export let SymbolTypeAnnotation: Type; export let NumberTypeAnnotation: Type; export let BigIntTypeAnnotation: Type; export let NumberLiteralTypeAnnotation: Type; export let NumericLiteralTypeAnnotation: Type; export let BigIntLiteralTypeAnnotation: Type; export let StringTypeAnnotation: Type; export let StringLiteralTypeAnnotation: Type; export let BooleanTypeAnnotation: Type; export let BooleanLiteralTypeAnnotation: Type; export let NullableTypeAnnotation: Type; export let NullLiteralTypeAnnotation: Type; export let NullTypeAnnotation: Type; export let ThisTypeAnnotation: Type; export let ExistsTypeAnnotation: Type; export let ExistentialTypeParam: Type; export let FunctionTypeAnnotation: Type; export let FunctionTypeParam: Type; export let ArrayTypeAnnotation: Type; export let ObjectTypeAnnotation: Type; export let ObjectTypeProperty: Type; export let ObjectTypeSpreadProperty: Type; export let ObjectTypeIndexer: Type; export let ObjectTypeCallProperty: Type; export let ObjectTypeInternalSlot: Type; export let Variance: Type; export let QualifiedTypeIdentifier: Type; export let GenericTypeAnnotation: Type; export let MemberTypeAnnotation: Type; export let IndexedAccessType: Type; export let OptionalIndexedAccessType: Type; export let UnionTypeAnnotation: Type; export let IntersectionTypeAnnotation: Type; export let TypeofTypeAnnotation: Type; export let TypeParameter: Type; export let InterfaceTypeAnnotation: Type; export let InterfaceExtends: Type; export let InterfaceDeclaration: Type; export let DeclareInterface: Type; export let TypeAlias: Type; export let DeclareTypeAlias: Type; export let OpaqueType: Type; export let DeclareOpaqueType: Type; export let TypeCastExpression: Type; export let TupleTypeAnnotation: Type; export let DeclareVariable: Type; export let DeclareFunction: Type; export let FlowPredicate: Type; export let DeclareClass: Type; export let DeclareModule: Type; export let DeclareModuleExports: Type; export let DeclareExportDeclaration: Type; export let ExportBatchSpecifier: Type; export let DeclareExportAllDeclaration: Type; export let InferredPredicate: Type; export let DeclaredPredicate: Type; export let EnumDeclaration: Type; export let EnumBooleanBody: Type; export let EnumNumberBody: Type; export let EnumStringBody: Type; export let EnumSymbolBody: Type; export let EnumBooleanMember: Type; export let EnumNumberMember: Type; export let EnumStringMember: Type; export let EnumDefaultedMember: Type; export let ExportDeclaration: Type; export let Block: Type; export let Line: Type; export let Noop: Type; export let DoExpression: Type; export let BindExpression: Type; export let ParenthesizedExpression: Type; export let ExportNamespaceSpecifier: Type; export let ExportDefaultSpecifier: Type; export let CommentBlock: Type; export let CommentLine: Type; export let Directive: Type; export let DirectiveLiteral: Type; export let InterpreterDirective: Type; export let StringLiteral: Type; export let NumericLiteral: Type; export let BigIntLiteral: Type; export let DecimalLiteral: Type; export let NullLiteral: Type; export let BooleanLiteral: Type; export let RegExpLiteral: Type; export let ClassMethod: Type; export let ClassPrivateMethod: Type; export let TSHasOptionalTypeAnnotation: Type; export let ClassAccessorProperty: Type; export let RestProperty: Type; export let ForAwaitStatement: Type; export let Import: Type; export let V8IntrinsicIdentifier: Type; export let TopicReference: Type; export let TSQualifiedName: Type; export let TSTypeReference: Type; export let TSHasOptionalTypeParameters: Type; export let TSAsExpression: Type; export let TSTypeCastExpression: Type; export let TSSatisfiesExpression: Type; export let TSNonNullExpression: Type; export let TSAnyKeyword: Type; export let TSBigIntKeyword: Type; export let TSBooleanKeyword: Type; export let TSNeverKeyword: Type; export let TSNullKeyword: Type; export let TSNumberKeyword: Type; export let TSObjectKeyword: Type; export let TSStringKeyword: Type; export let TSSymbolKeyword: Type; export let TSUndefinedKeyword: Type; export let TSUnknownKeyword: Type; export let TSVoidKeyword: Type; export let TSIntrinsicKeyword: Type; export let TSThisType: Type; export let TSArrayType: Type; export let TSLiteralType: Type; export let TSUnionType: Type; export let TSIntersectionType: Type; export let TSConditionalType: Type; export let TSInferType: Type; export let TSTypeParameter: Type; export let TSParenthesizedType: Type; export let TSFunctionType: Type; export let TSConstructorType: Type; export let TSDeclareFunction: Type; export let TSDeclareMethod: Type; export let TSMappedType: Type; export let TSTupleType: Type; export let TSNamedTupleMember: Type; export let TSRestType: Type; export let TSOptionalType: Type; export let TSIndexedAccessType: Type; export let TSTypeOperator: Type; export let TSIndexSignature: Type; export let TSPropertySignature: Type; export let TSMethodSignature: Type; export let TSTypePredicate: Type; export let TSCallSignatureDeclaration: Type; export let TSConstructSignatureDeclaration: Type; export let TSEnumMember: Type; export let TSTypeQuery: Type; export let TSImportType: Type; export let TSTypeLiteral: Type; export let TSTypeAssertion: Type; export let TSInstantiationExpression: Type; export let TSEnumDeclaration: Type; export let TSTypeAliasDeclaration: Type; export let TSModuleBlock: Type; export let TSModuleDeclaration: Type; export let TSImportEqualsDeclaration: Type; export let TSExternalModuleReference: Type; export let TSExportAssignment: Type; export let TSNamespaceExportDeclaration: Type; export let TSInterfaceBody: Type; export let TSInterfaceDeclaration: Type; export let TSParameterProperty: Type; } export interface NamedTypes { Printable: Type; SourceLocation: Type; Node: Type; Comment: Type; Position: Type; File: Type; Program: Type; Statement: Type; Function: Type; Expression: Type; Pattern: Type; Identifier: Type; BlockStatement: Type; EmptyStatement: Type; ExpressionStatement: Type; IfStatement: Type; LabeledStatement: Type; BreakStatement: Type; ContinueStatement: Type; WithStatement: Type; SwitchStatement: Type; SwitchCase: Type; ReturnStatement: Type; ThrowStatement: Type; TryStatement: Type; CatchClause: Type; WhileStatement: Type; DoWhileStatement: Type; ForStatement: Type; Declaration: Type; VariableDeclaration: Type; ForInStatement: Type; DebuggerStatement: Type; FunctionDeclaration: Type; FunctionExpression: Type; VariableDeclarator: Type; ThisExpression: Type; ArrayExpression: Type; ObjectExpression: Type; Property: Type; Literal: Type; SequenceExpression: Type; UnaryExpression: Type; BinaryExpression: Type; AssignmentExpression: Type; ChainElement: Type; MemberExpression: Type; UpdateExpression: Type; LogicalExpression: Type; ConditionalExpression: Type; NewExpression: Type; CallExpression: Type; RestElement: Type; TypeAnnotation: Type; TSTypeAnnotation: Type; SpreadElementPattern: Type; ArrowFunctionExpression: Type; ForOfStatement: Type; YieldExpression: Type; GeneratorExpression: Type; ComprehensionBlock: Type; ComprehensionExpression: Type; ObjectProperty: Type; PropertyPattern: Type; ObjectPattern: Type; ArrayPattern: Type; SpreadElement: Type; AssignmentPattern: Type; MethodDefinition: Type; ClassPropertyDefinition: Type; ClassProperty: Type; StaticBlock: Type; ClassBody: Type; ClassDeclaration: Type; ClassExpression: Type; Super: Type; Specifier: Type; ModuleSpecifier: Type; ImportSpecifier: Type; ImportDefaultSpecifier: Type; ImportNamespaceSpecifier: Type; ImportDeclaration: Type; ExportNamedDeclaration: Type; ExportSpecifier: Type; ExportDefaultDeclaration: Type; ExportAllDeclaration: Type; TaggedTemplateExpression: Type; TemplateLiteral: Type; TemplateElement: Type; MetaProperty: Type; AwaitExpression: Type; SpreadProperty: Type; SpreadPropertyPattern: Type; ImportExpression: Type; ChainExpression: Type; OptionalCallExpression: Type; OptionalMemberExpression: Type; Decorator: Type; PrivateName: Type; ClassPrivateProperty: Type; ImportAttribute: Type; RecordExpression: Type; ObjectMethod: Type; TupleExpression: Type; ModuleExpression: Type; JSXAttribute: Type; JSXIdentifier: Type; JSXNamespacedName: Type; JSXExpressionContainer: Type; JSXElement: Type; JSXFragment: Type; JSXMemberExpression: Type; JSXSpreadAttribute: Type; JSXEmptyExpression: Type; JSXText: Type; JSXSpreadChild: Type; JSXOpeningElement: Type; JSXClosingElement: Type; JSXOpeningFragment: Type; JSXClosingFragment: Type; TypeParameterDeclaration: Type; TSTypeParameterDeclaration: Type; TypeParameterInstantiation: Type; TSTypeParameterInstantiation: Type; ClassImplements: Type; TSType: Type; TSHasOptionalTypeParameterInstantiation: Type; TSExpressionWithTypeArguments: Type; Flow: Type; FlowType: Type; AnyTypeAnnotation: Type; EmptyTypeAnnotation: Type; MixedTypeAnnotation: Type; VoidTypeAnnotation: Type; SymbolTypeAnnotation: Type; NumberTypeAnnotation: Type; BigIntTypeAnnotation: Type; NumberLiteralTypeAnnotation: Type; NumericLiteralTypeAnnotation: Type; BigIntLiteralTypeAnnotation: Type; StringTypeAnnotation: Type; StringLiteralTypeAnnotation: Type; BooleanTypeAnnotation: Type; BooleanLiteralTypeAnnotation: Type; NullableTypeAnnotation: Type; NullLiteralTypeAnnotation: Type; NullTypeAnnotation: Type; ThisTypeAnnotation: Type; ExistsTypeAnnotation: Type; ExistentialTypeParam: Type; FunctionTypeAnnotation: Type; FunctionTypeParam: Type; ArrayTypeAnnotation: Type; ObjectTypeAnnotation: Type; ObjectTypeProperty: Type; ObjectTypeSpreadProperty: Type; ObjectTypeIndexer: Type; ObjectTypeCallProperty: Type; ObjectTypeInternalSlot: Type; Variance: Type; QualifiedTypeIdentifier: Type; GenericTypeAnnotation: Type; MemberTypeAnnotation: Type; IndexedAccessType: Type; OptionalIndexedAccessType: Type; UnionTypeAnnotation: Type; IntersectionTypeAnnotation: Type; TypeofTypeAnnotation: Type; TypeParameter: Type; InterfaceTypeAnnotation: Type; InterfaceExtends: Type; InterfaceDeclaration: Type; DeclareInterface: Type; TypeAlias: Type; DeclareTypeAlias: Type; OpaqueType: Type; DeclareOpaqueType: Type; TypeCastExpression: Type; TupleTypeAnnotation: Type; DeclareVariable: Type; DeclareFunction: Type; FlowPredicate: Type; DeclareClass: Type; DeclareModule: Type; DeclareModuleExports: Type; DeclareExportDeclaration: Type; ExportBatchSpecifier: Type; DeclareExportAllDeclaration: Type; InferredPredicate: Type; DeclaredPredicate: Type; EnumDeclaration: Type; EnumBooleanBody: Type; EnumNumberBody: Type; EnumStringBody: Type; EnumSymbolBody: Type; EnumBooleanMember: Type; EnumNumberMember: Type; EnumStringMember: Type; EnumDefaultedMember: Type; ExportDeclaration: Type; Block: Type; Line: Type; Noop: Type; DoExpression: Type; BindExpression: Type; ParenthesizedExpression: Type; ExportNamespaceSpecifier: Type; ExportDefaultSpecifier: Type; CommentBlock: Type; CommentLine: Type; Directive: Type; DirectiveLiteral: Type; InterpreterDirective: Type; StringLiteral: Type; NumericLiteral: Type; BigIntLiteral: Type; DecimalLiteral: Type; NullLiteral: Type; BooleanLiteral: Type; RegExpLiteral: Type; ClassMethod: Type; ClassPrivateMethod: Type; TSHasOptionalTypeAnnotation: Type; ClassAccessorProperty: Type; RestProperty: Type; ForAwaitStatement: Type; Import: Type; V8IntrinsicIdentifier: Type; TopicReference: Type; TSQualifiedName: Type; TSTypeReference: Type; TSHasOptionalTypeParameters: Type; TSAsExpression: Type; TSTypeCastExpression: Type; TSSatisfiesExpression: Type; TSNonNullExpression: Type; TSAnyKeyword: Type; TSBigIntKeyword: Type; TSBooleanKeyword: Type; TSNeverKeyword: Type; TSNullKeyword: Type; TSNumberKeyword: Type; TSObjectKeyword: Type; TSStringKeyword: Type; TSSymbolKeyword: Type; TSUndefinedKeyword: Type; TSUnknownKeyword: Type; TSVoidKeyword: Type; TSIntrinsicKeyword: Type; TSThisType: Type; TSArrayType: Type; TSLiteralType: Type; TSUnionType: Type; TSIntersectionType: Type; TSConditionalType: Type; TSInferType: Type; TSTypeParameter: Type; TSParenthesizedType: Type; TSFunctionType: Type; TSConstructorType: Type; TSDeclareFunction: Type; TSDeclareMethod: Type; TSMappedType: Type; TSTupleType: Type; TSNamedTupleMember: Type; TSRestType: Type; TSOptionalType: Type; TSIndexedAccessType: Type; TSTypeOperator: Type; TSIndexSignature: Type; TSPropertySignature: Type; TSMethodSignature: Type; TSTypePredicate: Type; TSCallSignatureDeclaration: Type; TSConstructSignatureDeclaration: Type; TSEnumMember: Type; TSTypeQuery: Type; TSImportType: Type; TSTypeLiteral: Type; TSTypeAssertion: Type; TSInstantiationExpression: Type; TSEnumDeclaration: Type; TSTypeAliasDeclaration: Type; TSModuleBlock: Type; TSModuleDeclaration: Type; TSImportEqualsDeclaration: Type; TSExternalModuleReference: Type; TSExportAssignment: Type; TSNamespaceExportDeclaration: Type; TSInterfaceBody: Type; TSInterfaceDeclaration: Type; TSParameterProperty: Type; }ast-types-0.16.1/src/gen/visitor.ts000066400000000000000000000670241434620737500171630ustar00rootroot00000000000000/* !!! THIS FILE WAS AUTO-GENERATED BY `npm run gen` !!! */ import { NodePath } from "../node-path"; import { Context } from "../path-visitor"; import { namedTypes } from "./namedTypes"; export interface Visitor { visitPrintable?(this: Context & M, path: NodePath): any; visitSourceLocation?(this: Context & M, path: NodePath): any; visitNode?(this: Context & M, path: NodePath): any; visitComment?(this: Context & M, path: NodePath): any; visitPosition?(this: Context & M, path: NodePath): any; visitFile?(this: Context & M, path: NodePath): any; visitProgram?(this: Context & M, path: NodePath): any; visitStatement?(this: Context & M, path: NodePath): any; visitFunction?(this: Context & M, path: NodePath): any; visitExpression?(this: Context & M, path: NodePath): any; visitPattern?(this: Context & M, path: NodePath): any; visitIdentifier?(this: Context & M, path: NodePath): any; visitBlockStatement?(this: Context & M, path: NodePath): any; visitEmptyStatement?(this: Context & M, path: NodePath): any; visitExpressionStatement?(this: Context & M, path: NodePath): any; visitIfStatement?(this: Context & M, path: NodePath): any; visitLabeledStatement?(this: Context & M, path: NodePath): any; visitBreakStatement?(this: Context & M, path: NodePath): any; visitContinueStatement?(this: Context & M, path: NodePath): any; visitWithStatement?(this: Context & M, path: NodePath): any; visitSwitchStatement?(this: Context & M, path: NodePath): any; visitSwitchCase?(this: Context & M, path: NodePath): any; visitReturnStatement?(this: Context & M, path: NodePath): any; visitThrowStatement?(this: Context & M, path: NodePath): any; visitTryStatement?(this: Context & M, path: NodePath): any; visitCatchClause?(this: Context & M, path: NodePath): any; visitWhileStatement?(this: Context & M, path: NodePath): any; visitDoWhileStatement?(this: Context & M, path: NodePath): any; visitForStatement?(this: Context & M, path: NodePath): any; visitDeclaration?(this: Context & M, path: NodePath): any; visitVariableDeclaration?(this: Context & M, path: NodePath): any; visitForInStatement?(this: Context & M, path: NodePath): any; visitDebuggerStatement?(this: Context & M, path: NodePath): any; visitFunctionDeclaration?(this: Context & M, path: NodePath): any; visitFunctionExpression?(this: Context & M, path: NodePath): any; visitVariableDeclarator?(this: Context & M, path: NodePath): any; visitThisExpression?(this: Context & M, path: NodePath): any; visitArrayExpression?(this: Context & M, path: NodePath): any; visitObjectExpression?(this: Context & M, path: NodePath): any; visitProperty?(this: Context & M, path: NodePath): any; visitLiteral?(this: Context & M, path: NodePath): any; visitSequenceExpression?(this: Context & M, path: NodePath): any; visitUnaryExpression?(this: Context & M, path: NodePath): any; visitBinaryExpression?(this: Context & M, path: NodePath): any; visitAssignmentExpression?(this: Context & M, path: NodePath): any; visitChainElement?(this: Context & M, path: NodePath): any; visitMemberExpression?(this: Context & M, path: NodePath): any; visitUpdateExpression?(this: Context & M, path: NodePath): any; visitLogicalExpression?(this: Context & M, path: NodePath): any; visitConditionalExpression?(this: Context & M, path: NodePath): any; visitNewExpression?(this: Context & M, path: NodePath): any; visitCallExpression?(this: Context & M, path: NodePath): any; visitRestElement?(this: Context & M, path: NodePath): any; visitTypeAnnotation?(this: Context & M, path: NodePath): any; visitTSTypeAnnotation?(this: Context & M, path: NodePath): any; visitSpreadElementPattern?(this: Context & M, path: NodePath): any; visitArrowFunctionExpression?(this: Context & M, path: NodePath): any; visitForOfStatement?(this: Context & M, path: NodePath): any; visitYieldExpression?(this: Context & M, path: NodePath): any; visitGeneratorExpression?(this: Context & M, path: NodePath): any; visitComprehensionBlock?(this: Context & M, path: NodePath): any; visitComprehensionExpression?(this: Context & M, path: NodePath): any; visitObjectProperty?(this: Context & M, path: NodePath): any; visitPropertyPattern?(this: Context & M, path: NodePath): any; visitObjectPattern?(this: Context & M, path: NodePath): any; visitArrayPattern?(this: Context & M, path: NodePath): any; visitSpreadElement?(this: Context & M, path: NodePath): any; visitAssignmentPattern?(this: Context & M, path: NodePath): any; visitMethodDefinition?(this: Context & M, path: NodePath): any; visitClassPropertyDefinition?(this: Context & M, path: NodePath): any; visitClassProperty?(this: Context & M, path: NodePath): any; visitStaticBlock?(this: Context & M, path: NodePath): any; visitClassBody?(this: Context & M, path: NodePath): any; visitClassDeclaration?(this: Context & M, path: NodePath): any; visitClassExpression?(this: Context & M, path: NodePath): any; visitSuper?(this: Context & M, path: NodePath): any; visitSpecifier?(this: Context & M, path: NodePath): any; visitModuleSpecifier?(this: Context & M, path: NodePath): any; visitImportSpecifier?(this: Context & M, path: NodePath): any; visitImportDefaultSpecifier?(this: Context & M, path: NodePath): any; visitImportNamespaceSpecifier?(this: Context & M, path: NodePath): any; visitImportDeclaration?(this: Context & M, path: NodePath): any; visitExportNamedDeclaration?(this: Context & M, path: NodePath): any; visitExportSpecifier?(this: Context & M, path: NodePath): any; visitExportDefaultDeclaration?(this: Context & M, path: NodePath): any; visitExportAllDeclaration?(this: Context & M, path: NodePath): any; visitTaggedTemplateExpression?(this: Context & M, path: NodePath): any; visitTemplateLiteral?(this: Context & M, path: NodePath): any; visitTemplateElement?(this: Context & M, path: NodePath): any; visitMetaProperty?(this: Context & M, path: NodePath): any; visitAwaitExpression?(this: Context & M, path: NodePath): any; visitSpreadProperty?(this: Context & M, path: NodePath): any; visitSpreadPropertyPattern?(this: Context & M, path: NodePath): any; visitImportExpression?(this: Context & M, path: NodePath): any; visitChainExpression?(this: Context & M, path: NodePath): any; visitOptionalCallExpression?(this: Context & M, path: NodePath): any; visitOptionalMemberExpression?(this: Context & M, path: NodePath): any; visitDecorator?(this: Context & M, path: NodePath): any; visitPrivateName?(this: Context & M, path: NodePath): any; visitClassPrivateProperty?(this: Context & M, path: NodePath): any; visitImportAttribute?(this: Context & M, path: NodePath): any; visitRecordExpression?(this: Context & M, path: NodePath): any; visitObjectMethod?(this: Context & M, path: NodePath): any; visitTupleExpression?(this: Context & M, path: NodePath): any; visitModuleExpression?(this: Context & M, path: NodePath): any; visitJSXAttribute?(this: Context & M, path: NodePath): any; visitJSXIdentifier?(this: Context & M, path: NodePath): any; visitJSXNamespacedName?(this: Context & M, path: NodePath): any; visitJSXExpressionContainer?(this: Context & M, path: NodePath): any; visitJSXElement?(this: Context & M, path: NodePath): any; visitJSXFragment?(this: Context & M, path: NodePath): any; visitJSXMemberExpression?(this: Context & M, path: NodePath): any; visitJSXSpreadAttribute?(this: Context & M, path: NodePath): any; visitJSXEmptyExpression?(this: Context & M, path: NodePath): any; visitJSXText?(this: Context & M, path: NodePath): any; visitJSXSpreadChild?(this: Context & M, path: NodePath): any; visitJSXOpeningElement?(this: Context & M, path: NodePath): any; visitJSXClosingElement?(this: Context & M, path: NodePath): any; visitJSXOpeningFragment?(this: Context & M, path: NodePath): any; visitJSXClosingFragment?(this: Context & M, path: NodePath): any; visitTypeParameterDeclaration?(this: Context & M, path: NodePath): any; visitTSTypeParameterDeclaration?(this: Context & M, path: NodePath): any; visitTypeParameterInstantiation?(this: Context & M, path: NodePath): any; visitTSTypeParameterInstantiation?(this: Context & M, path: NodePath): any; visitClassImplements?(this: Context & M, path: NodePath): any; visitTSType?(this: Context & M, path: NodePath): any; visitTSHasOptionalTypeParameterInstantiation?( this: Context & M, path: NodePath ): any; visitTSExpressionWithTypeArguments?( this: Context & M, path: NodePath ): any; visitFlow?(this: Context & M, path: NodePath): any; visitFlowType?(this: Context & M, path: NodePath): any; visitAnyTypeAnnotation?(this: Context & M, path: NodePath): any; visitEmptyTypeAnnotation?(this: Context & M, path: NodePath): any; visitMixedTypeAnnotation?(this: Context & M, path: NodePath): any; visitVoidTypeAnnotation?(this: Context & M, path: NodePath): any; visitSymbolTypeAnnotation?(this: Context & M, path: NodePath): any; visitNumberTypeAnnotation?(this: Context & M, path: NodePath): any; visitBigIntTypeAnnotation?(this: Context & M, path: NodePath): any; visitNumberLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitNumericLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitBigIntLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitStringTypeAnnotation?(this: Context & M, path: NodePath): any; visitStringLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitBooleanTypeAnnotation?(this: Context & M, path: NodePath): any; visitBooleanLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitNullableTypeAnnotation?(this: Context & M, path: NodePath): any; visitNullLiteralTypeAnnotation?(this: Context & M, path: NodePath): any; visitNullTypeAnnotation?(this: Context & M, path: NodePath): any; visitThisTypeAnnotation?(this: Context & M, path: NodePath): any; visitExistsTypeAnnotation?(this: Context & M, path: NodePath): any; visitExistentialTypeParam?(this: Context & M, path: NodePath): any; visitFunctionTypeAnnotation?(this: Context & M, path: NodePath): any; visitFunctionTypeParam?(this: Context & M, path: NodePath): any; visitArrayTypeAnnotation?(this: Context & M, path: NodePath): any; visitObjectTypeAnnotation?(this: Context & M, path: NodePath): any; visitObjectTypeProperty?(this: Context & M, path: NodePath): any; visitObjectTypeSpreadProperty?(this: Context & M, path: NodePath): any; visitObjectTypeIndexer?(this: Context & M, path: NodePath): any; visitObjectTypeCallProperty?(this: Context & M, path: NodePath): any; visitObjectTypeInternalSlot?(this: Context & M, path: NodePath): any; visitVariance?(this: Context & M, path: NodePath): any; visitQualifiedTypeIdentifier?(this: Context & M, path: NodePath): any; visitGenericTypeAnnotation?(this: Context & M, path: NodePath): any; visitMemberTypeAnnotation?(this: Context & M, path: NodePath): any; visitIndexedAccessType?(this: Context & M, path: NodePath): any; visitOptionalIndexedAccessType?(this: Context & M, path: NodePath): any; visitUnionTypeAnnotation?(this: Context & M, path: NodePath): any; visitIntersectionTypeAnnotation?(this: Context & M, path: NodePath): any; visitTypeofTypeAnnotation?(this: Context & M, path: NodePath): any; visitTypeParameter?(this: Context & M, path: NodePath): any; visitInterfaceTypeAnnotation?(this: Context & M, path: NodePath): any; visitInterfaceExtends?(this: Context & M, path: NodePath): any; visitInterfaceDeclaration?(this: Context & M, path: NodePath): any; visitDeclareInterface?(this: Context & M, path: NodePath): any; visitTypeAlias?(this: Context & M, path: NodePath): any; visitDeclareTypeAlias?(this: Context & M, path: NodePath): any; visitOpaqueType?(this: Context & M, path: NodePath): any; visitDeclareOpaqueType?(this: Context & M, path: NodePath): any; visitTypeCastExpression?(this: Context & M, path: NodePath): any; visitTupleTypeAnnotation?(this: Context & M, path: NodePath): any; visitDeclareVariable?(this: Context & M, path: NodePath): any; visitDeclareFunction?(this: Context & M, path: NodePath): any; visitFlowPredicate?(this: Context & M, path: NodePath): any; visitDeclareClass?(this: Context & M, path: NodePath): any; visitDeclareModule?(this: Context & M, path: NodePath): any; visitDeclareModuleExports?(this: Context & M, path: NodePath): any; visitDeclareExportDeclaration?(this: Context & M, path: NodePath): any; visitExportBatchSpecifier?(this: Context & M, path: NodePath): any; visitDeclareExportAllDeclaration?(this: Context & M, path: NodePath): any; visitInferredPredicate?(this: Context & M, path: NodePath): any; visitDeclaredPredicate?(this: Context & M, path: NodePath): any; visitEnumDeclaration?(this: Context & M, path: NodePath): any; visitEnumBooleanBody?(this: Context & M, path: NodePath): any; visitEnumNumberBody?(this: Context & M, path: NodePath): any; visitEnumStringBody?(this: Context & M, path: NodePath): any; visitEnumSymbolBody?(this: Context & M, path: NodePath): any; visitEnumBooleanMember?(this: Context & M, path: NodePath): any; visitEnumNumberMember?(this: Context & M, path: NodePath): any; visitEnumStringMember?(this: Context & M, path: NodePath): any; visitEnumDefaultedMember?(this: Context & M, path: NodePath): any; visitExportDeclaration?(this: Context & M, path: NodePath): any; visitBlock?(this: Context & M, path: NodePath): any; visitLine?(this: Context & M, path: NodePath): any; visitNoop?(this: Context & M, path: NodePath): any; visitDoExpression?(this: Context & M, path: NodePath): any; visitBindExpression?(this: Context & M, path: NodePath): any; visitParenthesizedExpression?(this: Context & M, path: NodePath): any; visitExportNamespaceSpecifier?(this: Context & M, path: NodePath): any; visitExportDefaultSpecifier?(this: Context & M, path: NodePath): any; visitCommentBlock?(this: Context & M, path: NodePath): any; visitCommentLine?(this: Context & M, path: NodePath): any; visitDirective?(this: Context & M, path: NodePath): any; visitDirectiveLiteral?(this: Context & M, path: NodePath): any; visitInterpreterDirective?(this: Context & M, path: NodePath): any; visitStringLiteral?(this: Context & M, path: NodePath): any; visitNumericLiteral?(this: Context & M, path: NodePath): any; visitBigIntLiteral?(this: Context & M, path: NodePath): any; visitDecimalLiteral?(this: Context & M, path: NodePath): any; visitNullLiteral?(this: Context & M, path: NodePath): any; visitBooleanLiteral?(this: Context & M, path: NodePath): any; visitRegExpLiteral?(this: Context & M, path: NodePath): any; visitClassMethod?(this: Context & M, path: NodePath): any; visitClassPrivateMethod?(this: Context & M, path: NodePath): any; visitTSHasOptionalTypeAnnotation?(this: Context & M, path: NodePath): any; visitClassAccessorProperty?(this: Context & M, path: NodePath): any; visitRestProperty?(this: Context & M, path: NodePath): any; visitForAwaitStatement?(this: Context & M, path: NodePath): any; visitImport?(this: Context & M, path: NodePath): any; visitV8IntrinsicIdentifier?(this: Context & M, path: NodePath): any; visitTopicReference?(this: Context & M, path: NodePath): any; visitTSQualifiedName?(this: Context & M, path: NodePath): any; visitTSTypeReference?(this: Context & M, path: NodePath): any; visitTSHasOptionalTypeParameters?(this: Context & M, path: NodePath): any; visitTSAsExpression?(this: Context & M, path: NodePath): any; visitTSTypeCastExpression?(this: Context & M, path: NodePath): any; visitTSSatisfiesExpression?(this: Context & M, path: NodePath): any; visitTSNonNullExpression?(this: Context & M, path: NodePath): any; visitTSAnyKeyword?(this: Context & M, path: NodePath): any; visitTSBigIntKeyword?(this: Context & M, path: NodePath): any; visitTSBooleanKeyword?(this: Context & M, path: NodePath): any; visitTSNeverKeyword?(this: Context & M, path: NodePath): any; visitTSNullKeyword?(this: Context & M, path: NodePath): any; visitTSNumberKeyword?(this: Context & M, path: NodePath): any; visitTSObjectKeyword?(this: Context & M, path: NodePath): any; visitTSStringKeyword?(this: Context & M, path: NodePath): any; visitTSSymbolKeyword?(this: Context & M, path: NodePath): any; visitTSUndefinedKeyword?(this: Context & M, path: NodePath): any; visitTSUnknownKeyword?(this: Context & M, path: NodePath): any; visitTSVoidKeyword?(this: Context & M, path: NodePath): any; visitTSIntrinsicKeyword?(this: Context & M, path: NodePath): any; visitTSThisType?(this: Context & M, path: NodePath): any; visitTSArrayType?(this: Context & M, path: NodePath): any; visitTSLiteralType?(this: Context & M, path: NodePath): any; visitTSUnionType?(this: Context & M, path: NodePath): any; visitTSIntersectionType?(this: Context & M, path: NodePath): any; visitTSConditionalType?(this: Context & M, path: NodePath): any; visitTSInferType?(this: Context & M, path: NodePath): any; visitTSTypeParameter?(this: Context & M, path: NodePath): any; visitTSParenthesizedType?(this: Context & M, path: NodePath): any; visitTSFunctionType?(this: Context & M, path: NodePath): any; visitTSConstructorType?(this: Context & M, path: NodePath): any; visitTSDeclareFunction?(this: Context & M, path: NodePath): any; visitTSDeclareMethod?(this: Context & M, path: NodePath): any; visitTSMappedType?(this: Context & M, path: NodePath): any; visitTSTupleType?(this: Context & M, path: NodePath): any; visitTSNamedTupleMember?(this: Context & M, path: NodePath): any; visitTSRestType?(this: Context & M, path: NodePath): any; visitTSOptionalType?(this: Context & M, path: NodePath): any; visitTSIndexedAccessType?(this: Context & M, path: NodePath): any; visitTSTypeOperator?(this: Context & M, path: NodePath): any; visitTSIndexSignature?(this: Context & M, path: NodePath): any; visitTSPropertySignature?(this: Context & M, path: NodePath): any; visitTSMethodSignature?(this: Context & M, path: NodePath): any; visitTSTypePredicate?(this: Context & M, path: NodePath): any; visitTSCallSignatureDeclaration?(this: Context & M, path: NodePath): any; visitTSConstructSignatureDeclaration?( this: Context & M, path: NodePath ): any; visitTSEnumMember?(this: Context & M, path: NodePath): any; visitTSTypeQuery?(this: Context & M, path: NodePath): any; visitTSImportType?(this: Context & M, path: NodePath): any; visitTSTypeLiteral?(this: Context & M, path: NodePath): any; visitTSTypeAssertion?(this: Context & M, path: NodePath): any; visitTSInstantiationExpression?(this: Context & M, path: NodePath): any; visitTSEnumDeclaration?(this: Context & M, path: NodePath): any; visitTSTypeAliasDeclaration?(this: Context & M, path: NodePath): any; visitTSModuleBlock?(this: Context & M, path: NodePath): any; visitTSModuleDeclaration?(this: Context & M, path: NodePath): any; visitTSImportEqualsDeclaration?(this: Context & M, path: NodePath): any; visitTSExternalModuleReference?(this: Context & M, path: NodePath): any; visitTSExportAssignment?(this: Context & M, path: NodePath): any; visitTSNamespaceExportDeclaration?(this: Context & M, path: NodePath): any; visitTSInterfaceBody?(this: Context & M, path: NodePath): any; visitTSInterfaceDeclaration?(this: Context & M, path: NodePath): any; visitTSParameterProperty?(this: Context & M, path: NodePath): any; }ast-types-0.16.1/src/main.ts000066400000000000000000000026241434620737500156320ustar00rootroot00000000000000import fork from "./fork"; import esProposalsDef from "./def/es-proposals"; import jsxDef from "./def/jsx"; import flowDef from "./def/flow"; import esprimaDef from "./def/esprima"; import babelDef from "./def/babel"; import typescriptDef from "./def/typescript"; import { ASTNode, Type, AnyType, Field } from "./types"; import { NodePath } from "./node-path"; import { namedTypes } from "./gen/namedTypes"; import { builders } from "./gen/builders"; import { Visitor } from "./gen/visitor"; const { astNodesAreEquivalent, builders, builtInTypes, defineMethod, eachField, finalize, getBuilderName, getFieldNames, getFieldValue, getSupertypeNames, namedTypes: n, NodePath, Path, PathVisitor, someField, Type, use, visit, } = fork([ // Feel free to add to or remove from this list of extension modules to // configure the precise type hierarchy that you need. esProposalsDef, jsxDef, flowDef, esprimaDef, babelDef, typescriptDef, ]); // Populate the exported fields of the namedTypes namespace, while still // retaining its member types. Object.assign(namedTypes, n); export { AnyType, ASTNode, astNodesAreEquivalent, builders, builtInTypes, defineMethod, eachField, Field, finalize, getBuilderName, getFieldNames, getFieldValue, getSupertypeNames, namedTypes, NodePath, Path, PathVisitor, someField, Type, use, visit, Visitor, }; ast-types-0.16.1/src/modules.d.ts000066400000000000000000000002071434620737500165730ustar00rootroot00000000000000declare module "espree"; declare module "esprima-fb"; declare module "flow-parser"; declare module "recast"; declare module "reify/*"; ast-types-0.16.1/src/node-path.ts000066400000000000000000000327731434620737500165750ustar00rootroot00000000000000import typesPlugin, { ASTNode, Fork } from "./types"; import pathPlugin, { Path } from "./path"; import scopePlugin, { Scope } from "./scope"; import { namedTypes } from "./gen/namedTypes"; import { maybeSetModuleExports } from "./shared"; export interface NodePath extends Path { node: N; parent: any; scope: any; replace: Path['replace']; prune(...args: any[]): any; _computeNode(): any; _computeParent(): any; _computeScope(): Scope | null; getValueProperty(name: any): any; needsParens(assumeExpressionContext?: boolean): boolean; canBeFirstInStatement(): boolean; firstInStatement(): boolean; } export interface NodePathConstructor { new(value: any, parentPath?: any, name?: any): NodePath; } export default function nodePathPlugin(fork: Fork): NodePathConstructor { var types = fork.use(typesPlugin); var n = types.namedTypes; var b = types.builders; var isNumber = types.builtInTypes.number; var isArray = types.builtInTypes.array; var Path = fork.use(pathPlugin); var Scope = fork.use(scopePlugin); const NodePath = function NodePath(this: NodePath, value: any, parentPath?: any, name?: any) { if (!(this instanceof NodePath)) { throw new Error("NodePath constructor cannot be invoked without 'new'"); } Path.call(this, value, parentPath, name); } as any as NodePathConstructor; var NPp: NodePath = NodePath.prototype = Object.create(Path.prototype, { constructor: { value: NodePath, enumerable: false, writable: true, configurable: true } }); Object.defineProperties(NPp, { node: { get: function () { Object.defineProperty(this, "node", { configurable: true, // Enable deletion. value: this._computeNode() }); return this.node; } }, parent: { get: function () { Object.defineProperty(this, "parent", { configurable: true, // Enable deletion. value: this._computeParent() }); return this.parent; } }, scope: { get: function () { Object.defineProperty(this, "scope", { configurable: true, // Enable deletion. value: this._computeScope() }); return this.scope; } } }); NPp.replace = function () { delete this.node; delete this.parent; delete this.scope; return Path.prototype.replace.apply(this, arguments); }; NPp.prune = function () { var remainingNodePath = this.parent; this.replace(); return cleanUpNodesAfterPrune(remainingNodePath); }; // The value of the first ancestor Path whose value is a Node. NPp._computeNode = function () { var value = this.value; if (n.Node.check(value)) { return value; } var pp = this.parentPath; return pp && pp.node || null; }; // The first ancestor Path whose value is a Node distinct from this.node. NPp._computeParent = function () { var value = this.value; var pp = this.parentPath; if (!n.Node.check(value)) { while (pp && !n.Node.check(pp.value)) { pp = pp.parentPath; } if (pp) { pp = pp.parentPath; } } while (pp && !n.Node.check(pp.value)) { pp = pp.parentPath; } return pp || null; }; // The closest enclosing scope that governs this node. NPp._computeScope = function () { var value = this.value; var pp = this.parentPath; var scope = pp && pp.scope; if (n.Node.check(value) && Scope.isEstablishedBy(value)) { scope = new Scope(this, scope); } return scope || null; }; NPp.getValueProperty = function (name) { return types.getFieldValue(this.value, name); }; /** * Determine whether this.node needs to be wrapped in parentheses in order * for a parser to reproduce the same local AST structure. * * For instance, in the expression `(1 + 2) * 3`, the BinaryExpression * whose operator is "+" needs parentheses, because `1 + 2 * 3` would * parse differently. * * If assumeExpressionContext === true, we don't worry about edge cases * like an anonymous FunctionExpression appearing lexically first in its * enclosing statement and thus needing parentheses to avoid being parsed * as a FunctionDeclaration with a missing name. */ NPp.needsParens = function (assumeExpressionContext) { var pp = this.parentPath; if (!pp) { return false; } var node = this.value; // Only expressions need parentheses. if (!n.Expression.check(node)) { return false; } // Identifiers never need parentheses. if (node.type === "Identifier") { return false; } while (!n.Node.check(pp.value)) { pp = pp.parentPath; if (!pp) { return false; } } var parent = pp.value; switch (node.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return parent.type === "MemberExpression" && this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": switch (parent.type) { case "CallExpression": return this.name === "callee" && parent.callee === node; case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return true; case "MemberExpression": return this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": { const n = node as namedTypes.BinaryExpression | namedTypes.LogicalExpression; const po = parent.operator; const pp = PRECEDENCE[po]; const no = n.operator; const np = PRECEDENCE[no]; if (pp > np) { return true; } if (pp === np && this.name === "right") { if (parent.right !== n) { throw new Error("Nodes must be equal"); } return true; } } default: return false; } case "SequenceExpression": switch (parent.type) { case "ForStatement": // Although parentheses wouldn't hurt around sequence // expressions in the head of for loops, traditional style // dictates that e.g. i++, j++ should not be wrapped with // parentheses. return false; case "ExpressionStatement": return this.name !== "expression"; default: // Otherwise err on the side of overparenthesization, adding // explicit exceptions above if this proves overzealous. return true; } case "YieldExpression": switch (parent.type) { case "BinaryExpression": case "LogicalExpression": case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "CallExpression": case "MemberExpression": case "NewExpression": case "ConditionalExpression": case "YieldExpression": return true; default: return false; } case "Literal": return parent.type === "MemberExpression" && isNumber.check((node as namedTypes.Literal).value) && this.name === "object" && parent.object === node; case "AssignmentExpression": case "ConditionalExpression": switch (parent.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "BinaryExpression": case "LogicalExpression": return true; case "CallExpression": return this.name === "callee" && parent.callee === node; case "ConditionalExpression": return this.name === "test" && parent.test === node; case "MemberExpression": return this.name === "object" && parent.object === node; default: return false; } default: if (parent.type === "NewExpression" && this.name === "callee" && parent.callee === node) { return containsCallExpression(node); } } if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) return true; return false; }; function isBinary(node: any) { return n.BinaryExpression.check(node) || n.LogicalExpression.check(node); } // @ts-ignore 'isUnaryLike' is declared but its value is never read. [6133] function isUnaryLike(node: any) { return n.UnaryExpression.check(node) // I considered making SpreadElement and SpreadProperty subtypes // of UnaryExpression, but they're not really Expression nodes. || (n.SpreadElement && n.SpreadElement.check(node)) || (n.SpreadProperty && n.SpreadProperty.check(node)); } var PRECEDENCE: any = {}; [["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"] ].forEach(function (tier, i) { tier.forEach(function (op) { PRECEDENCE[op] = i; }); }); function containsCallExpression(node: any): any { if (n.CallExpression.check(node)) { return true; } if (isArray.check(node)) { return node.some(containsCallExpression); } if (n.Node.check(node)) { return types.someField(node, function (_name: any, child: any) { return containsCallExpression(child); }); } return false; } NPp.canBeFirstInStatement = function () { var node = this.node; return !n.FunctionExpression.check(node) && !n.ObjectExpression.check(node); }; NPp.firstInStatement = function () { return firstInStatement(this); }; function firstInStatement(path: any) { for (var node, parent; path.parent; path = path.parent) { node = path.node; parent = path.parent.node; if (n.BlockStatement.check(parent) && path.parent.name === "body" && path.name === 0) { if (parent.body[0] !== node) { throw new Error("Nodes must be equal"); } return true; } if (n.ExpressionStatement.check(parent) && path.name === "expression") { if (parent.expression !== node) { throw new Error("Nodes must be equal"); } return true; } if (n.SequenceExpression.check(parent) && path.parent.name === "expressions" && path.name === 0) { if (parent.expressions[0] !== node) { throw new Error("Nodes must be equal"); } continue; } if (n.CallExpression.check(parent) && path.name === "callee") { if (parent.callee !== node) { throw new Error("Nodes must be equal"); } continue; } if (n.MemberExpression.check(parent) && path.name === "object") { if (parent.object !== node) { throw new Error("Nodes must be equal"); } continue; } if (n.ConditionalExpression.check(parent) && path.name === "test") { if (parent.test !== node) { throw new Error("Nodes must be equal"); } continue; } if (isBinary(parent) && path.name === "left") { if (parent.left !== node) { throw new Error("Nodes must be equal"); } continue; } if (n.UnaryExpression.check(parent) && !parent.prefix && path.name === "argument") { if (parent.argument !== node) { throw new Error("Nodes must be equal"); } continue; } return false; } return true; } /** * Pruning certain nodes will result in empty or incomplete nodes, here we clean those nodes up. */ function cleanUpNodesAfterPrune(remainingNodePath: any) { if (n.VariableDeclaration.check(remainingNodePath.node)) { var declarations = remainingNodePath.get('declarations').value; if (!declarations || declarations.length === 0) { return remainingNodePath.prune(); } } else if (n.ExpressionStatement.check(remainingNodePath.node)) { if (!remainingNodePath.get('expression').value) { return remainingNodePath.prune(); } } else if (n.IfStatement.check(remainingNodePath.node)) { cleanUpIfStatementAfterPrune(remainingNodePath); } return remainingNodePath; } function cleanUpIfStatementAfterPrune(ifStatement: any) { var testExpression = ifStatement.get('test').value; var alternate = ifStatement.get('alternate').value; var consequent = ifStatement.get('consequent').value; if (!consequent && !alternate) { var testExpressionStatement = b.expressionStatement(testExpression); ifStatement.replace(testExpressionStatement); } else if (!consequent && alternate) { var negatedTestExpression: namedTypes.Expression = b.unaryExpression('!', testExpression, true); if (n.UnaryExpression.check(testExpression) && testExpression.operator === '!') { negatedTestExpression = testExpression.argument; } ifStatement.get("test").replace(negatedTestExpression); ifStatement.get("consequent").replace(alternate); ifStatement.get("alternate").replace(); } } return NodePath; }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/path-visitor.ts000066400000000000000000000324421434620737500173400ustar00rootroot00000000000000import typesPlugin, { ASTNode, Fork, Omit } from "./types"; import nodePathPlugin, { NodePath } from "./node-path"; import { maybeSetModuleExports } from "./shared"; var hasOwn = Object.prototype.hasOwnProperty; export interface PathVisitor { _reusableContextStack: any; _methodNameTable: any; _shouldVisitComments: any; Context: any; _visiting: any; _changeReported: any; _abortRequested: boolean; visit(...args: any[]): any; reset(...args: any[]): any; visitWithoutReset(path: any): any; AbortRequest: any; abort(): void; visitor: any; acquireContext(path: any): any; releaseContext(context: any): void; reportChanged(): void; wasChangeReported(): any; } export interface PathVisitorStatics { fromMethodsObject(methods?: any): Visitor; visit(node: ASTNode, methods?: import("./gen/visitor").Visitor): any; } export interface PathVisitorConstructor extends PathVisitorStatics { new(): PathVisitor; } export interface Visitor extends PathVisitor {} export interface VisitorConstructor extends PathVisitorStatics { new(): Visitor; } export interface VisitorMethods { [visitorMethod: string]: (path: NodePath) => any; } export interface SharedContextMethods { currentPath: any; needToCallTraverse: boolean; Context: any; visitor: any; reset(path: any, ...args: any[]): any; invokeVisitorMethod(methodName: string): any; traverse(path: any, newVisitor?: VisitorMethods): any; visit(path: any, newVisitor?: VisitorMethods): any; reportChanged(): void; abort(): void; } export interface Context extends Omit, SharedContextMethods {} export default function pathVisitorPlugin(fork: Fork) { var types = fork.use(typesPlugin); var NodePath = fork.use(nodePathPlugin); var isArray = types.builtInTypes.array; var isObject = types.builtInTypes.object; var isFunction = types.builtInTypes.function; var undefined: any; const PathVisitor = function PathVisitor(this: PathVisitor) { if (!(this instanceof PathVisitor)) { throw new Error( "PathVisitor constructor cannot be invoked without 'new'" ); } // Permanent state. this._reusableContextStack = []; this._methodNameTable = computeMethodNameTable(this); this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line"); this.Context = makeContextConstructor(this); // State reset every time PathVisitor.prototype.visit is called. this._visiting = false; this._changeReported = false; } as any as PathVisitorConstructor; function computeMethodNameTable(visitor: any) { var typeNames = Object.create(null); for (var methodName in visitor) { if (/^visit[A-Z]/.test(methodName)) { typeNames[methodName.slice("visit".length)] = true; } } var supertypeTable = types.computeSupertypeLookupTable(typeNames); var methodNameTable = Object.create(null); var typeNameKeys = Object.keys(supertypeTable); var typeNameCount = typeNameKeys.length; for (var i = 0; i < typeNameCount; ++i) { var typeName = typeNameKeys[i]; methodName = "visit" + supertypeTable[typeName]; if (isFunction.check(visitor[methodName])) { methodNameTable[typeName] = methodName; } } return methodNameTable; } PathVisitor.fromMethodsObject = function fromMethodsObject(methods) { if (methods instanceof PathVisitor) { return methods; } if (!isObject.check(methods)) { // An empty visitor? return new PathVisitor; } const Visitor = function Visitor(this: any) { if (!(this instanceof Visitor)) { throw new Error( "Visitor constructor cannot be invoked without 'new'" ); } PathVisitor.call(this); } as any as VisitorConstructor; var Vp = Visitor.prototype = Object.create(PVp); Vp.constructor = Visitor; extend(Vp, methods); extend(Visitor, PathVisitor); isFunction.assert(Visitor.fromMethodsObject); isFunction.assert(Visitor.visit); return new Visitor; }; function extend(target: any, source: any) { for (var property in source) { if (hasOwn.call(source, property)) { target[property] = source[property]; } } return target; } PathVisitor.visit = function visit(node, methods) { return PathVisitor.fromMethodsObject(methods).visit(node); }; var PVp: PathVisitor = PathVisitor.prototype; PVp.visit = function () { if (this._visiting) { throw new Error( "Recursively calling visitor.visit(path) resets visitor state. " + "Try this.visit(path) or this.traverse(path) instead." ); } // Private state that needs to be reset before every traversal. this._visiting = true; this._changeReported = false; this._abortRequested = false; var argc = arguments.length; var args = new Array(argc) for (var i = 0; i < argc; ++i) { args[i] = arguments[i]; } if (!(args[0] instanceof NodePath)) { args[0] = new NodePath({root: args[0]}).get("root"); } // Called with the same arguments as .visit. this.reset.apply(this, args); var didNotThrow; try { var root = this.visitWithoutReset(args[0]); didNotThrow = true; } finally { this._visiting = false; if (!didNotThrow && this._abortRequested) { // If this.visitWithoutReset threw an exception and // this._abortRequested was set to true, return the root of // the AST instead of letting the exception propagate, so that // client code does not have to provide a try-catch block to // intercept the AbortRequest exception. Other kinds of // exceptions will propagate without being intercepted and // rethrown by a catch block, so their stacks will accurately // reflect the original throwing context. return args[0].value; } } return root; }; PVp.AbortRequest = function AbortRequest() {}; PVp.abort = function () { var visitor = this; visitor._abortRequested = true; var request = new visitor.AbortRequest(); // If you decide to catch this exception and stop it from propagating, // make sure to call its cancel method to avoid silencing other // exceptions that might be thrown later in the traversal. request.cancel = function () { visitor._abortRequested = false; }; throw request; }; PVp.reset = function (_path/*, additional arguments */) { // Empty stub; may be reassigned or overridden by subclasses. }; PVp.visitWithoutReset = function (path) { if (this instanceof this.Context) { // Since this.Context.prototype === this, there's a chance we // might accidentally call context.visitWithoutReset. If that // happens, re-invoke the method against context.visitor. return this.visitor.visitWithoutReset(path); } if (!(path instanceof NodePath)) { throw new Error(""); } var value = path.value; var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type]; if (methodName) { var context = this.acquireContext(path); try { return context.invokeVisitorMethod(methodName); } finally { this.releaseContext(context); } } else { // If there was no visitor method to call, visit the children of // this node generically. return visitChildren(path, this); } }; function visitChildren(path: any, visitor: any) { if (!(path instanceof NodePath)) { throw new Error(""); } if (!(visitor instanceof PathVisitor)) { throw new Error(""); } var value = path.value; if (isArray.check(value)) { path.each(visitor.visitWithoutReset, visitor); } else if (!isObject.check(value)) { // No children to visit. } else { var childNames = types.getFieldNames(value); // The .comments field of the Node type is hidden, so we only // visit it if the visitor defines visitBlock or visitLine, and // value.comments is defined. if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) { childNames.push("comments"); } var childCount = childNames.length; var childPaths = []; for (var i = 0; i < childCount; ++i) { var childName = childNames[i]; if (!hasOwn.call(value, childName)) { value[childName] = types.getFieldValue(value, childName); } childPaths.push(path.get(childName)); } for (var i = 0; i < childCount; ++i) { visitor.visitWithoutReset(childPaths[i]); } } return path.value; } PVp.acquireContext = function (path) { if (this._reusableContextStack.length === 0) { return new this.Context(path); } return this._reusableContextStack.pop().reset(path); }; PVp.releaseContext = function (context) { if (!(context instanceof this.Context)) { throw new Error(""); } this._reusableContextStack.push(context); context.currentPath = null; }; PVp.reportChanged = function () { this._changeReported = true; }; PVp.wasChangeReported = function () { return this._changeReported; }; function makeContextConstructor(visitor: any) { function Context(this: Context, path: any) { if (!(this instanceof Context)) { throw new Error(""); } if (!(this instanceof PathVisitor)) { throw new Error(""); } if (!(path instanceof NodePath)) { throw new Error(""); } Object.defineProperty(this, "visitor", { value: visitor, writable: false, enumerable: true, configurable: false }); this.currentPath = path; this.needToCallTraverse = true; Object.seal(this); } if (!(visitor instanceof PathVisitor)) { throw new Error(""); } // Note that the visitor object is the prototype of Context.prototype, // so all visitor methods are inherited by context objects. var Cp = Context.prototype = Object.create(visitor); Cp.constructor = Context; extend(Cp, sharedContextProtoMethods); return Context; } // Every PathVisitor has a different this.Context constructor and // this.Context.prototype object, but those prototypes can all use the // same reset, invokeVisitorMethod, and traverse function objects. var sharedContextProtoMethods: SharedContextMethods = Object.create(null); sharedContextProtoMethods.reset = function reset(path) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path instanceof NodePath)) { throw new Error(""); } this.currentPath = path; this.needToCallTraverse = true; return this; }; sharedContextProtoMethods.invokeVisitorMethod = function invokeVisitorMethod(methodName) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } var result = this.visitor[methodName].call(this, this.currentPath); if (result === false) { // Visitor methods return false to indicate that they have handled // their own traversal needs, and we should not complain if // this.needToCallTraverse is still true. this.needToCallTraverse = false; } else if (result !== undefined) { // Any other non-undefined value returned from the visitor method // is interpreted as a replacement value. this.currentPath = this.currentPath.replace(result)[0]; if (this.needToCallTraverse) { // If this.traverse still hasn't been called, visit the // children of the replacement node. this.traverse(this.currentPath); } } if (this.needToCallTraverse !== false) { throw new Error( "Must either call this.traverse or return false in " + methodName ); } var path = this.currentPath; return path && path.value; }; sharedContextProtoMethods.traverse = function traverse(path, newVisitor) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path instanceof NodePath)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } this.needToCallTraverse = false; return visitChildren(path, PathVisitor.fromMethodsObject( newVisitor || this.visitor )); }; sharedContextProtoMethods.visit = function visit(path, newVisitor) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path instanceof NodePath)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } this.needToCallTraverse = false; return PathVisitor.fromMethodsObject( newVisitor || this.visitor ).visitWithoutReset(path); }; sharedContextProtoMethods.reportChanged = function reportChanged() { this.visitor.reportChanged(); }; sharedContextProtoMethods.abort = function abort() { this.needToCallTraverse = false; this.visitor.abort(); }; return PathVisitor; }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/path.ts000066400000000000000000000244031434620737500156410ustar00rootroot00000000000000import { maybeSetModuleExports } from "./shared"; import typesPlugin, { ASTNode, Fork } from "./types"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; export interface Path { value: V; parentPath: any; name: any; __childCache: object | null; getValueProperty(name: any): any; get(...names: any[]): any; each(callback: any, context?: any): any; map(callback: any, context?: any): any; filter(callback: any, context?: any): any; shift(): any; unshift(...args: any[]): any; push(...args: any[]): any; pop(): any; insertAt(index: number, ...args: any[]): any; insertBefore(...args: any[]): any; insertAfter(...args: any[]): any; replace(replacement?: ASTNode, ...args: ASTNode[]): any; } export interface PathConstructor { new(value: any, parentPath?: any, name?: any): Path; } export default function pathPlugin(fork: Fork): PathConstructor { var types = fork.use(typesPlugin); var isArray = types.builtInTypes.array; var isNumber = types.builtInTypes.number; const Path = function Path(this: Path, value: any, parentPath?: any, name?: any) { if (!(this instanceof Path)) { throw new Error("Path constructor cannot be invoked without 'new'"); } if (parentPath) { if (!(parentPath instanceof Path)) { throw new Error(""); } } else { parentPath = null; name = null; } // The value encapsulated by this Path, generally equal to // parentPath.value[name] if we have a parentPath. this.value = value; // The immediate parent Path of this Path. this.parentPath = parentPath; // The name of the property of parentPath.value through which this // Path's value was reached. this.name = name; // Calling path.get("child") multiple times always returns the same // child Path object, for both performance and consistency reasons. this.__childCache = null; } as any as PathConstructor; var Pp: Path = Path.prototype; function getChildCache(path: any) { // Lazily create the child cache. This also cheapens cache // invalidation, since you can just reset path.__childCache to null. return path.__childCache || (path.__childCache = Object.create(null)); } function getChildPath(path: any, name: any) { var cache = getChildCache(path); var actualChildValue = path.getValueProperty(name); var childPath = cache[name]; if (!hasOwn.call(cache, name) || // Ensure consistency between cache and reality. childPath.value !== actualChildValue) { childPath = cache[name] = new path.constructor( actualChildValue, path, name ); } return childPath; } // This method is designed to be overridden by subclasses that need to // handle missing properties, etc. Pp.getValueProperty = function getValueProperty(name) { return this.value[name]; }; Pp.get = function get(...names) { var path = this; var count = names.length; for (var i = 0; i < count; ++i) { path = getChildPath(path, names[i]); } return path; }; Pp.each = function each(callback, context) { var childPaths = []; var len = this.value.length; var i = 0; // Collect all the original child paths before invoking the callback. for (var i = 0; i < len; ++i) { if (hasOwn.call(this.value, i)) { childPaths[i] = this.get(i); } } // Invoke the callback on just the original child paths, regardless of // any modifications made to the array by the callback. I chose these // semantics over cleverly invoking the callback on new elements because // this way is much easier to reason about. context = context || this; for (i = 0; i < len; ++i) { if (hasOwn.call(childPaths, i)) { callback.call(context, childPaths[i]); } } }; Pp.map = function map(callback, context) { var result: any[] = []; this.each(function (this: any, childPath: any) { result.push(callback.call(this, childPath)); }, context); return result; }; Pp.filter = function filter(callback, context) { var result: any[] = []; this.each(function (this: any, childPath: any) { if (callback.call(this, childPath)) { result.push(childPath); } }, context); return result; }; function emptyMoves() {} function getMoves(path: any, offset: number, start?: any, end?: any) { isArray.assert(path.value); if (offset === 0) { return emptyMoves; } var length = path.value.length; if (length < 1) { return emptyMoves; } var argc = arguments.length; if (argc === 2) { start = 0; end = length; } else if (argc === 3) { start = Math.max(start, 0); end = length; } else { start = Math.max(start, 0); end = Math.min(end, length); } isNumber.assert(start); isNumber.assert(end); var moves = Object.create(null); var cache = getChildCache(path); for (var i = start; i < end; ++i) { if (hasOwn.call(path.value, i)) { var childPath = path.get(i); if (childPath.name !== i) { throw new Error(""); } var newIndex = i + offset; childPath.name = newIndex; moves[newIndex] = childPath; delete cache[i]; } } delete cache.length; return function () { for (var newIndex in moves) { var childPath = moves[newIndex]; if (childPath.name !== +newIndex) { throw new Error(""); } cache[newIndex] = childPath; path.value[newIndex] = childPath.value; } }; } Pp.shift = function shift() { var move = getMoves(this, -1); var result = this.value.shift(); move(); return result; }; Pp.unshift = function unshift(...args) { var move = getMoves(this, args.length); var result = this.value.unshift.apply(this.value, args); move(); return result; }; Pp.push = function push(...args) { isArray.assert(this.value); delete getChildCache(this).length return this.value.push.apply(this.value, args); }; Pp.pop = function pop() { isArray.assert(this.value); var cache = getChildCache(this); delete cache[this.value.length - 1]; delete cache.length; return this.value.pop(); }; Pp.insertAt = function insertAt(index) { var argc = arguments.length; var move = getMoves(this, argc - 1, index); if (move === emptyMoves && argc <= 1) { return this; } index = Math.max(index, 0); for (var i = 1; i < argc; ++i) { this.value[index + i - 1] = arguments[i]; } move(); return this; }; Pp.insertBefore = function insertBefore(...args) { var pp = this.parentPath; var argc = args.length; var insertAtArgs = [this.name]; for (var i = 0; i < argc; ++i) { insertAtArgs.push(args[i]); } return pp.insertAt.apply(pp, insertAtArgs); }; Pp.insertAfter = function insertAfter(...args) { var pp = this.parentPath; var argc = args.length; var insertAtArgs = [this.name + 1]; for (var i = 0; i < argc; ++i) { insertAtArgs.push(args[i]); } return pp.insertAt.apply(pp, insertAtArgs); }; function repairRelationshipWithParent(path: any) { if (!(path instanceof Path)) { throw new Error(""); } var pp = path.parentPath; if (!pp) { // Orphan paths have no relationship to repair. return path; } var parentValue = pp.value; var parentCache = getChildCache(pp); // Make sure parentCache[path.name] is populated. if (parentValue[path.name] === path.value) { parentCache[path.name] = path; } else if (isArray.check(parentValue)) { // Something caused path.name to become out of date, so attempt to // recover by searching for path.value in parentValue. var i = parentValue.indexOf(path.value); if (i >= 0) { parentCache[path.name = i] = path; } } else { // If path.value disagrees with parentValue[path.name], and // path.name is not an array index, let path.value become the new // parentValue[path.name] and update parentCache accordingly. parentValue[path.name] = path.value; parentCache[path.name] = path; } if (parentValue[path.name] !== path.value) { throw new Error(""); } if (path.parentPath.get(path.name) !== path) { throw new Error(""); } return path; } Pp.replace = function replace(replacement) { var results = []; var parentValue = this.parentPath.value; var parentCache = getChildCache(this.parentPath); var count = arguments.length; repairRelationshipWithParent(this); if (isArray.check(parentValue)) { var originalLength = parentValue.length; var move = getMoves(this.parentPath, count - 1, this.name + 1); var spliceArgs: [number, number, ...any[]] = [this.name, 1]; for (var i = 0; i < count; ++i) { spliceArgs.push(arguments[i]); } var splicedOut = parentValue.splice.apply(parentValue, spliceArgs); if (splicedOut[0] !== this.value) { throw new Error(""); } if (parentValue.length !== (originalLength - 1 + count)) { throw new Error(""); } move(); if (count === 0) { delete this.value; delete parentCache[this.name]; this.__childCache = null; } else { if (parentValue[this.name] !== replacement) { throw new Error(""); } if (this.value !== replacement) { this.value = replacement; this.__childCache = null; } for (i = 0; i < count; ++i) { results.push(this.parentPath.get(this.name + i)); } if (results[0] !== this) { throw new Error(""); } } } else if (count === 1) { if (this.value !== replacement) { this.__childCache = null; } this.value = parentValue[this.name] = replacement; results.push(this); } else if (count === 0) { delete parentValue[this.name]; delete this.value; this.__childCache = null; // Leave this path cached as parentCache[this.name], even though // it no longer has a value defined. } else { throw new Error("Could not replace path"); } return results; }; return Path; }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/scope.ts000066400000000000000000000325511434620737500160210ustar00rootroot00000000000000import { NodePath } from "./node-path"; import { maybeSetModuleExports } from "./shared"; import typesPlugin, { Fork } from "./types"; var hasOwn = Object.prototype.hasOwnProperty; export interface Scope { path: NodePath; node: any; isGlobal: boolean; depth: number; parent: any; bindings: any; types: any; didScan: boolean; declares(name: any): any declaresType(name: any): any declareTemporary(prefix?: any): any; injectTemporary(identifier: any, init: any): any; scan(force?: any): any; getBindings(): any; getTypes(): any; lookup(name: any): any; lookupType(name: any): any; getGlobalScope(): Scope; } export interface ScopeConstructor { new(path: NodePath, parentScope: any): Scope; isEstablishedBy(node: any): any; } export default function scopePlugin(fork: Fork) { var types = fork.use(typesPlugin); var Type = types.Type; var namedTypes = types.namedTypes; var Node = namedTypes.Node; var Expression = namedTypes.Expression; var isArray = types.builtInTypes.array; var b = types.builders; const Scope = function Scope(this: Scope, path: NodePath, parentScope: unknown) { if (!(this instanceof Scope)) { throw new Error("Scope constructor cannot be invoked without 'new'"); } if (!TypeParameterScopeType.check(path.value)) { ScopeType.assert(path.value); } var depth: number; if (parentScope) { if (!(parentScope instanceof Scope)) { throw new Error(""); } depth = (parentScope as Scope).depth + 1; } else { parentScope = null; depth = 0; } Object.defineProperties(this, { path: { value: path }, node: { value: path.value }, isGlobal: { value: !parentScope, enumerable: true }, depth: { value: depth }, parent: { value: parentScope }, bindings: { value: {} }, types: { value: {} }, }); } as any as ScopeConstructor; var ScopeType = Type.or( // Program nodes introduce global scopes. namedTypes.Program, // Function is the supertype of FunctionExpression, // FunctionDeclaration, ArrowExpression, etc. namedTypes.Function, // In case you didn't know, the caught parameter shadows any variable // of the same name in an outer scope. namedTypes.CatchClause ); // These types introduce scopes that are restricted to type parameters in // Flow (this doesn't apply to ECMAScript). var TypeParameterScopeType = Type.or( namedTypes.Function, namedTypes.ClassDeclaration, namedTypes.ClassExpression, namedTypes.InterfaceDeclaration, namedTypes.TSInterfaceDeclaration, namedTypes.TypeAlias, namedTypes.TSTypeAliasDeclaration, ); var FlowOrTSTypeParameterType = Type.or( namedTypes.TypeParameter, namedTypes.TSTypeParameter, ); Scope.isEstablishedBy = function(node) { return ScopeType.check(node) || TypeParameterScopeType.check(node); }; var Sp: Scope = Scope.prototype; // Will be overridden after an instance lazily calls scanScope. Sp.didScan = false; Sp.declares = function(name) { this.scan(); return hasOwn.call(this.bindings, name); }; Sp.declaresType = function(name) { this.scan(); return hasOwn.call(this.types, name); }; Sp.declareTemporary = function(prefix) { if (prefix) { if (!/^[a-z$_]/i.test(prefix)) { throw new Error(""); } } else { prefix = "t$"; } // Include this.depth in the name to make sure the name does not // collide with any variables in nested/enclosing scopes. prefix += this.depth.toString(36) + "$"; this.scan(); var index = 0; while (this.declares(prefix + index)) { ++index; } var name = prefix + index; return this.bindings[name] = types.builders.identifier(name); }; Sp.injectTemporary = function(identifier, init) { identifier || (identifier = this.declareTemporary()); var bodyPath = this.path.get("body"); if (namedTypes.BlockStatement.check(bodyPath.value)) { bodyPath = bodyPath.get("body"); } bodyPath.unshift( b.variableDeclaration( "var", [b.variableDeclarator(identifier, init || null)] ) ); return identifier; }; Sp.scan = function(force) { if (force || !this.didScan) { for (var name in this.bindings) { // Empty out this.bindings, just in cases. delete this.bindings[name]; } for (var name in this.types) { // Empty out this.types, just in cases. delete this.types[name]; } scanScope(this.path, this.bindings, this.types); this.didScan = true; } }; Sp.getBindings = function () { this.scan(); return this.bindings; }; Sp.getTypes = function () { this.scan(); return this.types; }; function scanScope(path: NodePath, bindings: any, scopeTypes: any) { var node = path.value; if (TypeParameterScopeType.check(node)) { const params = path.get('typeParameters', 'params'); if (isArray.check(params.value)) { params.each((childPath: NodePath) => { addTypeParameter(childPath, scopeTypes); }); } } if (ScopeType.check(node)) { if (namedTypes.CatchClause.check(node)) { // A catch clause establishes a new scope but the only variable // bound in that scope is the catch parameter. Any other // declarations create bindings in the outer scope. addPattern(path.get("param"), bindings); } else { recursiveScanScope(path, bindings, scopeTypes); } } } function recursiveScanScope(path: NodePath, bindings: any, scopeTypes: any) { var node = path.value; if (path.parent && namedTypes.FunctionExpression.check(path.parent.node) && path.parent.node.id) { addPattern(path.parent.get("id"), bindings); } if (!node) { // None of the remaining cases matter if node is falsy. } else if (isArray.check(node)) { path.each((childPath: NodePath) => { recursiveScanChild(childPath, bindings, scopeTypes); }); } else if (namedTypes.Function.check(node)) { path.get("params").each((paramPath: NodePath) => { addPattern(paramPath, bindings); }); recursiveScanChild(path.get("body"), bindings, scopeTypes); recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes); } else if ( (namedTypes.TypeAlias && namedTypes.TypeAlias.check(node)) || (namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node)) || (namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node)) || (namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) ) { addTypePattern(path.get("id"), scopeTypes); } else if (namedTypes.VariableDeclarator.check(node)) { addPattern(path.get("id"), bindings); recursiveScanChild(path.get("init"), bindings, scopeTypes); } else if (node.type === "ImportSpecifier" || node.type === "ImportNamespaceSpecifier" || node.type === "ImportDefaultSpecifier") { addPattern( // Esprima used to use the .name field to refer to the local // binding identifier for ImportSpecifier nodes, but .id for // ImportNamespaceSpecifier and ImportDefaultSpecifier nodes. // ESTree/Acorn/ESpree use .local for all three node types. path.get(node.local ? "local" : node.name ? "name" : "id"), bindings ); } else if (Node.check(node) && !Expression.check(node)) { types.eachField(node, function(name: any, child: any) { var childPath = path.get(name); if (!pathHasValue(childPath, child)) { throw new Error(""); } recursiveScanChild(childPath, bindings, scopeTypes); }); } } function pathHasValue(path: NodePath, value: any) { if (path.value === value) { return true; } // Empty arrays are probably produced by defaults.emptyArray, in which // case is makes sense to regard them as equivalent, if not ===. if (Array.isArray(path.value) && path.value.length === 0 && Array.isArray(value) && value.length === 0) { return true; } return false; } function recursiveScanChild(path: NodePath, bindings: any, scopeTypes: any) { var node = path.value; if (!node || Expression.check(node)) { // Ignore falsy values and Expressions. } else if (namedTypes.FunctionDeclaration.check(node) && node.id !== null) { addPattern(path.get("id"), bindings); } else if (namedTypes.ClassDeclaration && namedTypes.ClassDeclaration.check(node) && node.id !== null) { addPattern(path.get("id"), bindings); recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes); } else if ( (namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node)) || (namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) ) { addTypePattern(path.get("id"), scopeTypes); } else if (ScopeType.check(node)) { if ( namedTypes.CatchClause.check(node) && // TODO Broaden this to accept any pattern. namedTypes.Identifier.check(node.param) ) { var catchParamName = node.param.name; var hadBinding = hasOwn.call(bindings, catchParamName); // Any declarations that occur inside the catch body that do // not have the same name as the catch parameter should count // as bindings in the outer scope. recursiveScanScope(path.get("body"), bindings, scopeTypes); // If a new binding matching the catch parameter name was // created while scanning the catch body, ignore it because it // actually refers to the catch parameter and not the outer // scope that we're currently scanning. if (!hadBinding) { delete bindings[catchParamName]; } } } else { recursiveScanScope(path, bindings, scopeTypes); } } function addPattern(patternPath: NodePath, bindings: any) { var pattern = patternPath.value; namedTypes.Pattern.assert(pattern); if (namedTypes.Identifier.check(pattern)) { if (hasOwn.call(bindings, pattern.name)) { bindings[pattern.name].push(patternPath); } else { bindings[pattern.name] = [patternPath]; } } else if (namedTypes.AssignmentPattern && namedTypes.AssignmentPattern.check(pattern)) { addPattern(patternPath.get('left'), bindings); } else if ( namedTypes.ObjectPattern && namedTypes.ObjectPattern.check(pattern) ) { patternPath.get('properties').each(function(propertyPath: any) { var property = propertyPath.value; if (namedTypes.Pattern.check(property)) { addPattern(propertyPath, bindings); } else if ( namedTypes.Property.check(property) || (namedTypes.ObjectProperty && namedTypes.ObjectProperty.check(property)) ) { addPattern(propertyPath.get('value'), bindings); } else if ( namedTypes.SpreadProperty && namedTypes.SpreadProperty.check(property) ) { addPattern(propertyPath.get('argument'), bindings); } }); } else if ( namedTypes.ArrayPattern && namedTypes.ArrayPattern.check(pattern) ) { patternPath.get('elements').each(function(elementPath: any) { var element = elementPath.value; if (namedTypes.Pattern.check(element)) { addPattern(elementPath, bindings); } else if ( namedTypes.SpreadElement && namedTypes.SpreadElement.check(element) ) { addPattern(elementPath.get("argument"), bindings); } }); } else if ( namedTypes.PropertyPattern && namedTypes.PropertyPattern.check(pattern) ) { addPattern(patternPath.get('pattern'), bindings); } else if ( (namedTypes.SpreadElementPattern && namedTypes.SpreadElementPattern.check(pattern)) || (namedTypes.RestElement && namedTypes.RestElement.check(pattern)) || (namedTypes.SpreadPropertyPattern && namedTypes.SpreadPropertyPattern.check(pattern)) ) { addPattern(patternPath.get('argument'), bindings); } } function addTypePattern(patternPath: NodePath, types: any) { var pattern = patternPath.value; namedTypes.Pattern.assert(pattern); if (namedTypes.Identifier.check(pattern)) { if (hasOwn.call(types, pattern.name)) { types[pattern.name].push(patternPath); } else { types[pattern.name] = [patternPath]; } } } function addTypeParameter(parameterPath: NodePath, types: any) { var parameter = parameterPath.value; FlowOrTSTypeParameterType.assert(parameter); if (hasOwn.call(types, parameter.name)) { types[parameter.name].push(parameterPath); } else { types[parameter.name] = [parameterPath]; } } Sp.lookup = function(name) { for (var scope = this; scope; scope = scope.parent) if (scope.declares(name)) break; return scope; }; Sp.lookupType = function(name) { for (var scope = this; scope; scope = scope.parent) if (scope.declaresType(name)) break; return scope; }; Sp.getGlobalScope = function() { var scope = this; while (!scope.isGlobal) scope = scope.parent; return scope; }; return Scope; }; maybeSetModuleExports(() => module); ast-types-0.16.1/src/shared.ts000066400000000000000000000104711434620737500161530ustar00rootroot00000000000000import typesPlugin, { Fork } from "./types"; export default function (fork: Fork) { var types = fork.use(typesPlugin); var Type = types.Type; var builtin = types.builtInTypes; var isNumber = builtin.number; // An example of constructing a new type with arbitrary constraints from // an existing type. function geq(than: any) { return Type.from( (value: number) => isNumber.check(value) && value >= than, isNumber + " >= " + than, ); }; // Default value-returning functions that may optionally be passed as a // third argument to Def.prototype.field. const defaults = { // Functions were used because (among other reasons) that's the most // elegant way to allow for the emptyArray one always to give a new // array instance. "null": function () { return null }, "emptyArray": function () { return [] }, "false": function () { return false }, "true": function () { return true }, "undefined": function () {}, "use strict": function () { return "use strict"; } }; var naiveIsPrimitive = Type.or( builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined ); const isPrimitive = Type.from( (value: any) => { if (value === null) return true; var type = typeof value; if (type === "object" || type === "function") { return false; } return true; }, naiveIsPrimitive.toString(), ); return { geq, defaults, isPrimitive, }; }; // I would use `typeof module` for this, but that would add // // /// // // at the top of shared.d.ts, which pulls in @types/node, which we should try to // avoid unless absolutely necessary, due to the risk of conflict with other // copies of @types/node. interface NodeModule { exports: { default?: any; __esModule?: boolean; }; } // This function accepts a getter function that should return an object // conforming to the NodeModule interface above. Typically, this means calling // maybeSetModuleExports(() => module) at the very end of any module that has a // default export, so the default export value can replace module.exports and // thus CommonJS consumers can continue to rely on require("./that/module") // returning the default-exported value, rather than always returning an exports // object with a default property equal to that value. This function should help // preserve backwards compatibility for CommonJS consumers, as a replacement for // the ts-add-module-exports package. export function maybeSetModuleExports( moduleGetter: () => NodeModule, ) { try { var nodeModule = moduleGetter(); var originalExports = nodeModule.exports; var defaultExport = originalExports["default"]; } catch { // It's normal/acceptable for this code to throw a ReferenceError due to // the moduleGetter function attempting to access a non-existent global // `module` variable. That's the reason we use a getter function here: // so the calling code doesn't have to do its own typeof module === // "object" checking (because it's always safe to pass `() => module` as // an argument, even when `module` is not defined in the calling scope). return; } if (defaultExport && defaultExport !== originalExports && typeof originalExports === "object" ) { // Make all properties found in originalExports properties of the // default export, including the default property itself, so that // require(nodeModule.id).default === require(nodeModule.id). Object.assign(defaultExport, originalExports, { "default": defaultExport }); // Object.assign only transfers enumerable properties, and // __esModule is (and should remain) non-enumerable. if (originalExports.__esModule) { Object.defineProperty(defaultExport, "__esModule", { value: true }); } // This line allows require(nodeModule.id) === defaultExport, rather // than (only) require(nodeModule.id).default === defaultExport. nodeModule.exports = defaultExport; } } ast-types-0.16.1/src/test/000077500000000000000000000000001434620737500153115ustar00rootroot00000000000000ast-types-0.16.1/src/test/api.ts000066400000000000000000000024171434620737500164360ustar00rootroot00000000000000import assert from "assert"; import { namedTypes, builders } from "../main"; import * as types from "../main"; describe("namedTypes", function () { it("should work as a namespace", function () { const id = builders.identifier("oyez"); namedTypes.Identifier.assert(id); }); it("should work as a type", function () { function getIdName(id: namedTypes.Identifier) { return id.name; } assert.strictEqual( getIdName(builders.identifier("oyez")), "oyez", ); }); it("should work as a value", function () { assert.strictEqual(typeof namedTypes, "object"); assert.strictEqual(typeof namedTypes.IfStatement, "object"); }); }); describe("types.namedTypes", function () { it("should work as a namespace", function () { const id = types.builders.identifier("oyez"); types.namedTypes.Identifier.assert(id); }); it("should work as a type", function () { function getIdName(id: types.namedTypes.Identifier) { return id.name; } assert.strictEqual( getIdName(types.builders.identifier("oyez")), "oyez", ); }); it("should work as a value", function () { assert.strictEqual(typeof types.namedTypes, "object"); assert.strictEqual(typeof types.namedTypes.IfStatement, "object"); }); }); ast-types-0.16.1/src/test/data/000077500000000000000000000000001434620737500162225ustar00rootroot00000000000000ast-types-0.16.1/src/test/data/backbone.js000066400000000000000000001643761434620737500203450ustar00rootroot00000000000000// Backbone.js 1.0.0 // (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc. // (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://backbonejs.org (function(){ // Initial Setup // ------------- // Save a reference to the global object (`window` in the browser, `exports` // on the server). var root = this; // Save the previous value of the `Backbone` variable, so that it can be // restored later on, if `noConflict` is used. var previousBackbone = root.Backbone; // Create local references to array methods we'll want to use later. var array = []; var push = array.push; var slice = array.slice; var splice = array.splice; // The top-level namespace. All public Backbone classes and modules will // be attached to this. Exported for both the browser and the server. var Backbone; if (typeof exports !== 'undefined') { Backbone = exports; } else { Backbone = root.Backbone = {}; } // Current version of the library. Keep in sync with `package.json`. Backbone.VERSION = '1.0.0'; // Require Underscore, if we're on the server, and it's not already present. var _ = root._; if (!_ && (typeof require !== 'undefined')) _ = require('underscore'); // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns // the `$` variable. Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$; // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable // to its previous owner. Returns a reference to this Backbone object. Backbone.noConflict = function() { root.Backbone = previousBackbone; return this; }; // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and // set a `X-Http-Method-Override` header. Backbone.emulateHTTP = false; // Turn on `emulateJSON` to support legacy servers that can't deal with direct // `application/json` requests ... will encode the body as // `application/x-www-form-urlencoded` instead and will send the model in a // form param named `model`. Backbone.emulateJSON = false; // Backbone.Events // --------------- // A module that can be mixed in to *any object* in order to provide it with // custom events. You may bind with `on` or remove with `off` callback // functions to an event; `trigger`-ing an event fires all callbacks in // succession. // // var object = {}; // _.extend(object, Backbone.Events); // object.on('expand', function(){ alert('expanded'); }); // object.trigger('expand'); // var Events = Backbone.Events = { // Bind an event to a `callback` function. Passing `"all"` will bind // the callback to all events fired. on: function(name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; this._events || (this._events = {}); var events = this._events[name] || (this._events[name] = []); events.push({callback: callback, context: context, ctx: context || this}); return this; }, // Bind an event to only be triggered a single time. After the first time // the callback is invoked, it will be removed. once: function(name, callback, context) { if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; var self = this; var once = _.once(function() { self.off(name, once); callback.apply(this, arguments); }); once._callback = callback; return this.on(name, once, context); }, // Remove one or many callbacks. If `context` is null, removes all // callbacks with that function. If `callback` is null, removes all // callbacks for the event. If `name` is null, removes all bound // callbacks for all events. off: function(name, callback, context) { var retain, ev, events, names, i, l, j, k; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { this._events = {}; return this; } names = name ? [name] : _.keys(this._events); for (i = 0, l = names.length; i < l; i++) { name = names[i]; if (events = this._events[name]) { this._events[name] = retain = []; if (callback || context) { for (j = 0, k = events.length; j < k; j++) { ev = events[j]; if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) { retain.push(ev); } } } if (!retain.length) delete this._events[name]; } } return this; }, // Trigger one or many events, firing all bound callbacks. Callbacks are // passed the same arguments as `trigger` is, apart from the event name // (unless you're listening on `"all"`, which will cause your callback to // receive the true name of the event as the first argument). trigger: function(name) { if (!this._events) return this; var args = slice.call(arguments, 1); if (!eventsApi(this, 'trigger', name, args)) return this; var events = this._events[name]; var allEvents = this._events.all; if (events) triggerEvents(events, args); if (allEvents) triggerEvents(allEvents, arguments); return this; }, // Tell this object to stop listening to either specific events ... or // to every object it's currently listening to. stopListening: function(obj, name, callback) { var listeners = this._listeners; if (!listeners) return this; var deleteListener = !name && !callback; if (typeof name === 'object') callback = this; if (obj) (listeners = {})[obj._listenerId] = obj; for (var id in listeners) { listeners[id].off(name, callback, this); if (deleteListener) delete this._listeners[id]; } return this; } }; // Regular expression used to split event strings. var eventSplitter = /\s+/; // Implement fancy features of the Events API such as multiple event // names `"change blur"` and jQuery-style event maps `{change: action}` // in terms of the existing API. var eventsApi = function(obj, action, name, rest) { if (!name) return true; // Handle event maps. if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } // Handle space separated event names. if (eventSplitter.test(name)) { var names = name.split(eventSplitter); for (var i = 0, l = names.length; i < l; i++) { obj[action].apply(obj, [names[i]].concat(rest)); } return false; } return true; }; // A difficult-to-believe, but optimized internal dispatch function for // triggering events. Tries to keep the usual cases speedy (most internal // Backbone events have 3 arguments). var triggerEvents = function(events, args) { var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; switch (args.length) { case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); } }; var listenMethods = {listenTo: 'on', listenToOnce: 'once'}; // Inversion-of-control versions of `on` and `once`. Tell *this* object to // listen to an event in another object ... keeping track of what it's // listening to. _.each(listenMethods, function(implementation, method) { Events[method] = function(obj, name, callback) { var listeners = this._listeners || (this._listeners = {}); var id = obj._listenerId || (obj._listenerId = _.uniqueId('l')); listeners[id] = obj; if (typeof name === 'object') callback = this; obj[implementation](name, callback, this); return this; }; }); // Aliases for backwards compatibility. Events.bind = Events.on; Events.unbind = Events.off; // Allow the `Backbone` object to serve as a global event bus, for folks who // want global "pubsub" in a convenient place. _.extend(Backbone, Events); // Backbone.Model // -------------- // Backbone **Models** are the basic data object in the framework -- // frequently representing a row in a table in a database on your server. // A discrete chunk of data and a bunch of useful, related methods for // performing computations and transformations on that data. // Create a new model with the specified attributes. A client id (`cid`) // is automatically generated and assigned for you. var Model = Backbone.Model = function(attributes, options) { var defaults; var attrs = attributes || {}; options || (options = {}); this.cid = _.uniqueId('c'); this.attributes = {}; if (options.collection) this.collection = options.collection; if (options.parse) attrs = this.parse(attrs, options) || {}; options._attrs = attrs; if (defaults = _.result(this, 'defaults')) { attrs = _.defaults({}, attrs, defaults); } this.set(attrs, options); this.changed = {}; this.initialize.apply(this, arguments); }; // Attach all inheritable methods to the Model prototype. _.extend(Model.prototype, Events, { // A hash of attributes whose current and previous value differ. changed: null, // The value returned during the last failed validation. validationError: null, // The default name for the JSON `id` attribute is `"id"`. MongoDB and // CouchDB users may want to set this to `"_id"`. idAttribute: 'id', // Initialize is an empty function by default. Override it with your own // initialization logic. initialize: function(){}, // Return a copy of the model's `attributes` object. toJSON: function(options) { return _.clone(this.attributes); }, // Proxy `Backbone.sync` by default -- but override this if you need // custom syncing semantics for *this* particular model. sync: function() { return Backbone.sync.apply(this, arguments); }, // Get the value of an attribute. get: function(attr) { return this.attributes[attr]; }, // Get the HTML-escaped value of an attribute. escape: function(attr) { return _.escape(this.get(attr)); }, // Returns `true` if the attribute contains a value that is not null // or undefined. has: function(attr) { return this.get(attr) != null; }, // Set a hash of model attributes on the object, firing `"change"`. This is // the core primitive operation of a model, updating the data and notifying // anyone who needs to know about the change in state. The heart of the beast. set: function(key, val, options) { var attr, attrs, unset, changes, silent, changing, prev, current; if (key == null) return this; // Handle both `"key", value` and `{key: value}` -style arguments. if (typeof key === 'object') { attrs = key; options = val; } else { (attrs = {})[key] = val; } options || (options = {}); // Run validation. if (!this._validate(attrs, options)) return false; // Extract attributes and options. unset = options.unset; silent = options.silent; changes = []; changing = this._changing; this._changing = true; if (!changing) { this._previousAttributes = _.clone(this.attributes); this.changed = {}; } current = this.attributes, prev = this._previousAttributes; // Check for changes of `id`. if (this.idAttribute in attrs) this.id = attrs[this.idAttribute]; // For each `set` attribute, update or delete the current value. for (attr in attrs) { val = attrs[attr]; if (!_.isEqual(current[attr], val)) changes.push(attr); if (!_.isEqual(prev[attr], val)) { this.changed[attr] = val; } else { delete this.changed[attr]; } unset ? delete current[attr] : current[attr] = val; } // Trigger all relevant attribute changes. if (!silent) { if (changes.length) this._pending = true; for (var i = 0, l = changes.length; i < l; i++) { this.trigger('change:' + changes[i], this, current[changes[i]], options); } } // You might be wondering why there's a `while` loop here. Changes can // be recursively nested within `"change"` events. if (changing) return this; if (!silent) { while (this._pending) { this._pending = false; this.trigger('change', this, options); } } this._pending = false; this._changing = false; return this; }, // Remove an attribute from the model, firing `"change"`. `unset` is a noop // if the attribute doesn't exist. unset: function(attr, options) { return this.set(attr, void 0, _.extend({}, options, {unset: true})); }, // Clear all attributes on the model, firing `"change"`. clear: function(options) { var attrs = {}; for (var key in this.attributes) attrs[key] = void 0; return this.set(attrs, _.extend({}, options, {unset: true})); }, // Determine if the model has changed since the last `"change"` event. // If you specify an attribute name, determine if that attribute has changed. hasChanged: function(attr) { if (attr == null) return !_.isEmpty(this.changed); return _.has(this.changed, attr); }, // Return an object containing all the attributes that have changed, or // false if there are no changed attributes. Useful for determining what // parts of a view need to be updated and/or what attributes need to be // persisted to the server. Unset attributes will be set to undefined. // You can also pass an attributes object to diff against the model, // determining if there *would be* a change. changedAttributes: function(diff) { if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; var val, changed = false; var old = this._changing ? this._previousAttributes : this.attributes; for (var attr in diff) { if (_.isEqual(old[attr], (val = diff[attr]))) continue; (changed || (changed = {}))[attr] = val; } return changed; }, // Get the previous value of an attribute, recorded at the time the last // `"change"` event was fired. previous: function(attr) { if (attr == null || !this._previousAttributes) return null; return this._previousAttributes[attr]; }, // Get all of the attributes of the model at the time of the previous // `"change"` event. previousAttributes: function() { return _.clone(this._previousAttributes); }, // Fetch the model from the server. If the server's representation of the // model differs from its current attributes, they will be overridden, // triggering a `"change"` event. fetch: function(options) { options = options ? _.clone(options) : {}; if (options.parse === void 0) options.parse = true; var model = this; var success = options.success; options.success = function(resp) { if (!model.set(model.parse(resp, options), options)) return false; if (success) success(model, resp, options); model.trigger('sync', model, resp, options); }; wrapError(this, options); return this.sync('read', this, options); }, // Set a hash of model attributes, and sync the model to the server. // If the server returns an attributes hash that differs, the model's // state will be `set` again. save: function(key, val, options) { var attrs, method, xhr, attributes = this.attributes; // Handle both `"key", value` and `{key: value}` -style arguments. if (key == null || typeof key === 'object') { attrs = key; options = val; } else { (attrs = {})[key] = val; } options = _.extend({validate: true}, options); // If we're not waiting and attributes exist, save acts as // `set(attr).save(null, opts)` with validation. Otherwise, check if // the model will be valid when the attributes, if any, are set. if (attrs && !options.wait) { if (!this.set(attrs, options)) return false; } else { if (!this._validate(attrs, options)) return false; } // Set temporary attributes if `{wait: true}`. if (attrs && options.wait) { this.attributes = _.extend({}, attributes, attrs); } // After a successful server-side save, the client is (optionally) // updated with the server-side state. if (options.parse === void 0) options.parse = true; var model = this; var success = options.success; options.success = function(resp) { // Ensure attributes are restored during synchronous saves. model.attributes = attributes; var serverAttrs = model.parse(resp, options); if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs); if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) { return false; } if (success) success(model, resp, options); model.trigger('sync', model, resp, options); }; wrapError(this, options); method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); if (method === 'patch') options.attrs = attrs; xhr = this.sync(method, this, options); // Restore attributes. if (attrs && options.wait) this.attributes = attributes; return xhr; }, // Destroy this model on the server if it was already persisted. // Optimistically removes the model from its collection, if it has one. // If `wait: true` is passed, waits for the server to respond before removal. destroy: function(options) { options = options ? _.clone(options) : {}; var model = this; var success = options.success; var destroy = function() { model.trigger('destroy', model, model.collection, options); }; options.success = function(resp) { if (options.wait || model.isNew()) destroy(); if (success) success(model, resp, options); if (!model.isNew()) model.trigger('sync', model, resp, options); }; if (this.isNew()) { options.success(); return false; } wrapError(this, options); var xhr = this.sync('delete', this, options); if (!options.wait) destroy(); return xhr; }, // Default URL for the model's representation on the server -- if you're // using Backbone's restful methods, override this to change the endpoint // that will be called. url: function() { var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError(); if (this.isNew()) return base; return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id); }, // **parse** converts a response into the hash of attributes to be `set` on // the model. The default implementation is just to pass the response along. parse: function(resp, options) { return resp; }, // Create a new model with identical attributes to this one. clone: function() { return new this.constructor(this.attributes); }, // A model is new if it has never been saved to the server, and lacks an id. isNew: function() { return this.id == null; }, // Check if the model is currently in a valid state. isValid: function(options) { return this._validate({}, _.extend(options || {}, { validate: true })); }, // Run validation against the next complete set of model attributes, // returning `true` if all is well. Otherwise, fire an `"invalid"` event. _validate: function(attrs, options) { if (!options.validate || !this.validate) return true; attrs = _.extend({}, this.attributes, attrs); var error = this.validationError = this.validate(attrs, options) || null; if (!error) return true; this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error})); return false; } }); // Underscore methods that we want to implement on the Model. var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit']; // Mix in each Underscore method as a proxy to `Model#attributes`. _.each(modelMethods, function(method) { Model.prototype[method] = function() { var args = slice.call(arguments); args.unshift(this.attributes); return _[method].apply(_, args); }; }); // Backbone.Collection // ------------------- // If models tend to represent a single row of data, a Backbone Collection is // more analagous to a table full of data ... or a small slice or page of that // table, or a collection of rows that belong together for a particular reason // -- all of the messages in this particular folder, all of the documents // belonging to this particular author, and so on. Collections maintain // indexes of their models, both in order, and for lookup by `id`. // Create a new **Collection**, perhaps to contain a specific type of `model`. // If a `comparator` is specified, the Collection will maintain // its models in sort order, as they're added and removed. var Collection = Backbone.Collection = function(models, options) { options || (options = {}); if (options.model) this.model = options.model; if (options.comparator !== void 0) this.comparator = options.comparator; this._reset(); this.initialize.apply(this, arguments); if (models) this.reset(models, _.extend({silent: true}, options)); }; // Default options for `Collection#set`. var setOptions = {add: true, remove: true, merge: true}; var addOptions = {add: true, merge: false, remove: false}; // Define the Collection's inheritable methods. _.extend(Collection.prototype, Events, { // The default model for a collection is just a **Backbone.Model**. // This should be overridden in most cases. model: Model, // Initialize is an empty function by default. Override it with your own // initialization logic. initialize: function(){}, // The JSON representation of a Collection is an array of the // models' attributes. toJSON: function(options) { return this.map(function(model){ return model.toJSON(options); }); }, // Proxy `Backbone.sync` by default. sync: function() { return Backbone.sync.apply(this, arguments); }, // Add a model, or list of models to the set. add: function(models, options) { return this.set(models, _.defaults(options || {}, addOptions)); }, // Remove a model, or a list of models from the set. remove: function(models, options) { models = _.isArray(models) ? models.slice() : [models]; options || (options = {}); var i, l, index, model; for (i = 0, l = models.length; i < l; i++) { model = this.get(models[i]); if (!model) continue; delete this._byId[model.id]; delete this._byId[model.cid]; index = this.indexOf(model); this.models.splice(index, 1); this.length--; if (!options.silent) { options.index = index; model.trigger('remove', model, this, options); } this._removeReference(model); } return this; }, // Update a collection by `set`-ing a new list of models, adding new ones, // removing models that are no longer present, and merging models that // already exist in the collection, as necessary. Similar to **Model#set**, // the core operation for updating the data contained by the collection. set: function(models, options) { options = _.defaults(options || {}, setOptions); if (options.parse) models = this.parse(models, options); if (!_.isArray(models)) models = models ? [models] : []; var i, l, model, attrs, existing, sort; var at = options.at; var sortable = this.comparator && (at == null) && options.sort !== false; var sortAttr = _.isString(this.comparator) ? this.comparator : null; var toAdd = [], toRemove = [], modelMap = {}; var add = options.add, merge = options.merge, remove = options.remove; var order = !sortable && add && remove ? [] : false; // Turn bare objects into model references, and prevent invalid models // from being added. for (i = 0, l = models.length; i < l; i++) { if (!(model = this._prepareModel(attrs = models[i], options))) continue; // If a duplicate is found, prevent it from being added and // optionally merge it into the existing model. if (existing = this.get(model)) { if (remove) modelMap[existing.cid] = true; if (merge) { attrs = attrs === model ? model.attributes : options._attrs; existing.set(attrs, options); if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true; } // This is a new model, push it to the `toAdd` list. } else if (add) { toAdd.push(model); // Listen to added models' events, and index models for lookup by // `id` and by `cid`. model.on('all', this._onModelEvent, this); this._byId[model.cid] = model; if (model.id != null) this._byId[model.id] = model; } if (order) order.push(existing || model); } // Remove nonexistent models if appropriate. if (remove) { for (i = 0, l = this.length; i < l; ++i) { if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model); } if (toRemove.length) this.remove(toRemove, options); } // See if sorting is needed, update `length` and splice in new models. if (toAdd.length || (order && order.length)) { if (sortable) sort = true; this.length += toAdd.length; if (at != null) { splice.apply(this.models, [at, 0].concat(toAdd)); } else { if (order) this.models.length = 0; push.apply(this.models, order || toAdd); } } // Silently sort the collection if appropriate. if (sort) this.sort({silent: true}); if (options.silent) return this; // Trigger `add` events. for (i = 0, l = toAdd.length; i < l; i++) { (model = toAdd[i]).trigger('add', model, this, options); } // Trigger `sort` if the collection was sorted. if (sort || (order && order.length)) this.trigger('sort', this, options); return this; }, // When you have more items than you want to add or remove individually, // you can reset the entire set with a new list of models, without firing // any granular `add` or `remove` events. Fires `reset` when finished. // Useful for bulk operations and optimizations. reset: function(models, options) { options || (options = {}); for (var i = 0, l = this.models.length; i < l; i++) { this._removeReference(this.models[i]); } options.previousModels = this.models; this._reset(); this.add(models, _.extend({silent: true}, options)); if (!options.silent) this.trigger('reset', this, options); return this; }, // Add a model to the end of the collection. push: function(model, options) { model = this._prepareModel(model, options); this.add(model, _.extend({at: this.length}, options)); return model; }, // Remove a model from the end of the collection. pop: function(options) { var model = this.at(this.length - 1); this.remove(model, options); return model; }, // Add a model to the beginning of the collection. unshift: function(model, options) { model = this._prepareModel(model, options); this.add(model, _.extend({at: 0}, options)); return model; }, // Remove a model from the beginning of the collection. shift: function(options) { var model = this.at(0); this.remove(model, options); return model; }, // Slice out a sub-array of models from the collection. slice: function() { return slice.apply(this.models, arguments); }, // Get a model from the set by id. get: function(obj) { if (obj == null) return void 0; return this._byId[obj.id != null ? obj.id : obj.cid || obj]; }, // Get the model at the given index. at: function(index) { return this.models[index]; }, // Return models with matching attributes. Useful for simple cases of // `filter`. where: function(attrs, first) { if (_.isEmpty(attrs)) return first ? void 0 : []; return this[first ? 'find' : 'filter'](function(model) { for (var key in attrs) { if (attrs[key] !== model.get(key)) return false; } return true; }); }, // Return the first model with matching attributes. Useful for simple cases // of `find`. findWhere: function(attrs) { return this.where(attrs, true); }, // Force the collection to re-sort itself. You don't need to call this under // normal circumstances, as the set will maintain sort order as each item // is added. sort: function(options) { if (!this.comparator) throw new Error('Cannot sort a set without a comparator'); options || (options = {}); // Run sort based on type of `comparator`. if (_.isString(this.comparator) || this.comparator.length === 1) { this.models = this.sortBy(this.comparator, this); } else { this.models.sort(_.bind(this.comparator, this)); } if (!options.silent) this.trigger('sort', this, options); return this; }, // Figure out the smallest index at which a model should be inserted so as // to maintain order. sortedIndex: function(model, value, context) { value || (value = this.comparator); var iterator = _.isFunction(value) ? value : function(model) { return model.get(value); }; return _.sortedIndex(this.models, model, iterator, context); }, // Pluck an attribute from each model in the collection. pluck: function(attr) { return _.invoke(this.models, 'get', attr); }, // Fetch the default set of models for this collection, resetting the // collection when they arrive. If `reset: true` is passed, the response // data will be passed through the `reset` method instead of `set`. fetch: function(options) { options = options ? _.clone(options) : {}; if (options.parse === void 0) options.parse = true; var success = options.success; var collection = this; options.success = function(resp) { var method = options.reset ? 'reset' : 'set'; collection[method](resp, options); if (success) success(collection, resp, options); collection.trigger('sync', collection, resp, options); }; wrapError(this, options); return this.sync('read', this, options); }, // Create a new instance of a model in this collection. Add the model to the // collection immediately, unless `wait: true` is passed, in which case we // wait for the server to agree. create: function(model, options) { options = options ? _.clone(options) : {}; if (!(model = this._prepareModel(model, options))) return false; if (!options.wait) this.add(model, options); var collection = this; var success = options.success; options.success = function(resp) { if (options.wait) collection.add(model, options); if (success) success(model, resp, options); }; model.save(null, options); return model; }, // **parse** converts a response into a list of models to be added to the // collection. The default implementation is just to pass it through. parse: function(resp, options) { return resp; }, // Create a new collection with an identical list of models as this one. clone: function() { return new this.constructor(this.models); }, // Private method to reset all internal state. Called when the collection // is first initialized or reset. _reset: function() { this.length = 0; this.models = []; this._byId = {}; }, // Prepare a hash of attributes (or other model) to be added to this // collection. _prepareModel: function(attrs, options) { if (attrs instanceof Model) { if (!attrs.collection) attrs.collection = this; return attrs; } options || (options = {}); options.collection = this; var model = new this.model(attrs, options); if (!model._validate(attrs, options)) { this.trigger('invalid', this, attrs, options); return false; } return model; }, // Internal method to sever a model's ties to a collection. _removeReference: function(model) { if (this === model.collection) delete model.collection; model.off('all', this._onModelEvent, this); }, // Internal method called every time a model in the set fires an event. // Sets need to update their indexes when models change ids. All other // events simply proxy through. "add" and "remove" events that originate // in other collections are ignored. _onModelEvent: function(event, model, collection, options) { if ((event === 'add' || event === 'remove') && collection !== this) return; if (event === 'destroy') this.remove(model, options); if (model && event === 'change:' + model.idAttribute) { delete this._byId[model.previous(model.idAttribute)]; if (model.id != null) this._byId[model.id] = model; } this.trigger.apply(this, arguments); } }); // Underscore methods that we want to implement on the Collection. // 90% of the core usefulness of Backbone Collections is actually implemented // right here: var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl', 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke', 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest', 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf', 'isEmpty', 'chain']; // Mix in each Underscore method as a proxy to `Collection#models`. _.each(methods, function(method) { Collection.prototype[method] = function() { var args = slice.call(arguments); args.unshift(this.models); return _[method].apply(_, args); }; }); // Underscore methods that take a property name as an argument. var attributeMethods = ['groupBy', 'countBy', 'sortBy']; // Use attributes instead of properties. _.each(attributeMethods, function(method) { Collection.prototype[method] = function(value, context) { var iterator = _.isFunction(value) ? value : function(model) { return model.get(value); }; return _[method](this.models, iterator, context); }; }); // Backbone.View // ------------- // Backbone Views are almost more convention than they are actual code. A View // is simply a JavaScript object that represents a logical chunk of UI in the // DOM. This might be a single item, an entire list, a sidebar or panel, or // even the surrounding frame which wraps your whole app. Defining a chunk of // UI as a **View** allows you to define your DOM events declaratively, without // having to worry about render order ... and makes it easy for the view to // react to specific changes in the state of your models. // Options with special meaning *(e.g. model, collection, id, className)* are // attached directly to the view. See `viewOptions` for an exhaustive // list. // Creating a Backbone.View creates its initial element outside of the DOM, // if an existing element is not provided... var View = Backbone.View = function(options) { this.cid = _.uniqueId('view'); options || (options = {}); _.extend(this, _.pick(options, viewOptions)); this._ensureElement(); this.initialize.apply(this, arguments); this.delegateEvents(); }; // Cached regex to split keys for `delegate`. var delegateEventSplitter = /^(\S+)\s*(.*)$/; // List of view options to be merged as properties. var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; // Set up all inheritable **Backbone.View** properties and methods. _.extend(View.prototype, Events, { // The default `tagName` of a View's element is `"div"`. tagName: 'div', // jQuery delegate for element lookup, scoped to DOM elements within the // current view. This should be prefered to global lookups where possible. $: function(selector) { return this.$el.find(selector); }, // Initialize is an empty function by default. Override it with your own // initialization logic. initialize: function(){}, // **render** is the core function that your view should override, in order // to populate its element (`this.el`), with the appropriate HTML. The // convention is for **render** to always return `this`. render: function() { return this; }, // Remove this view by taking the element out of the DOM, and removing any // applicable Backbone.Events listeners. remove: function() { this.$el.remove(); this.stopListening(); return this; }, // Change the view's element (`this.el` property), including event // re-delegation. setElement: function(element, delegate) { if (this.$el) this.undelegateEvents(); this.$el = element instanceof Backbone.$ ? element : Backbone.$(element); this.el = this.$el[0]; if (delegate !== false) this.delegateEvents(); return this; }, // Set callbacks, where `this.events` is a hash of // // *{"event selector": "callback"}* // // { // 'mousedown .title': 'edit', // 'click .button': 'save' // 'click .open': function(e) { ... } // } // // pairs. Callbacks will be bound to the view, with `this` set properly. // Uses event delegation for efficiency. // Omitting the selector binds the event to `this.el`. // This only works for delegate-able events: not `focus`, `blur`, and // not `change`, `submit`, and `reset` in Internet Explorer. delegateEvents: function(events) { if (!(events || (events = _.result(this, 'events')))) return this; this.undelegateEvents(); for (var key in events) { var method = events[key]; if (!_.isFunction(method)) method = this[events[key]]; if (!method) continue; var match = key.match(delegateEventSplitter); var eventName = match[1], selector = match[2]; method = _.bind(method, this); eventName += '.delegateEvents' + this.cid; if (selector === '') { this.$el.on(eventName, method); } else { this.$el.on(eventName, selector, method); } } return this; }, // Clears all callbacks previously bound to the view with `delegateEvents`. // You usually don't need to use this, but may wish to if you have multiple // Backbone views attached to the same DOM element. undelegateEvents: function() { this.$el.off('.delegateEvents' + this.cid); return this; }, // Ensure that the View has a DOM element to render into. // If `this.el` is a string, pass it through `$()`, take the first // matching element, and re-assign it to `el`. Otherwise, create // an element from the `id`, `className` and `tagName` properties. _ensureElement: function() { if (!this.el) { var attrs = _.extend({}, _.result(this, 'attributes')); if (this.id) attrs.id = _.result(this, 'id'); if (this.className) attrs['class'] = _.result(this, 'className'); var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs); this.setElement($el, false); } else { this.setElement(_.result(this, 'el'), false); } } }); // Backbone.sync // ------------- // Override this function to change the manner in which Backbone persists // models to the server. You will be passed the type of request, and the // model in question. By default, makes a RESTful Ajax request // to the model's `url()`. Some possible customizations could be: // // * Use `setTimeout` to batch rapid-fire updates into a single request. // * Send up the models as XML instead of JSON. // * Persist models via WebSockets instead of Ajax. // // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests // as `POST`, with a `_method` parameter containing the true HTTP method, // as well as all requests with the body as `application/x-www-form-urlencoded` // instead of `application/json` with the model in a param named `model`. // Useful when interfacing with server-side languages like **PHP** that make // it difficult to read the body of `PUT` requests. Backbone.sync = function(method, model, options) { var type = methodMap[method]; // Default options, unless specified. _.defaults(options || (options = {}), { emulateHTTP: Backbone.emulateHTTP, emulateJSON: Backbone.emulateJSON }); // Default JSON-request options. var params = {type: type, dataType: 'json'}; // Ensure that we have a URL. if (!options.url) { params.url = _.result(model, 'url') || urlError(); } // Ensure that we have the appropriate request data. if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { params.contentType = 'application/json'; params.data = JSON.stringify(options.attrs || model.toJSON(options)); } // For older servers, emulate JSON by encoding the request into an HTML-form. if (options.emulateJSON) { params.contentType = 'application/x-www-form-urlencoded'; params.data = params.data ? {model: params.data} : {}; } // For older servers, emulate HTTP by mimicking the HTTP method with `_method` // And an `X-HTTP-Method-Override` header. if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { params.type = 'POST'; if (options.emulateJSON) params.data._method = type; var beforeSend = options.beforeSend; options.beforeSend = function(xhr) { xhr.setRequestHeader('X-HTTP-Method-Override', type); if (beforeSend) return beforeSend.apply(this, arguments); }; } // Don't process data on a non-GET request. if (params.type !== 'GET' && !options.emulateJSON) { params.processData = false; } // If we're sending a `PATCH` request, and we're in an old Internet Explorer // that still has ActiveX enabled by default, override jQuery to use that // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8. if (params.type === 'PATCH' && window.ActiveXObject && !(window.external && window.external.msActiveXFilteringEnabled)) { params.xhr = function() { return new ActiveXObject("Microsoft.XMLHTTP"); }; } // Make the request, allowing the user to override any Ajax options. var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); model.trigger('request', model, xhr, options); return xhr; }; // Map from CRUD to HTTP for our default `Backbone.sync` implementation. var methodMap = { 'create': 'POST', 'update': 'PUT', 'patch': 'PATCH', 'delete': 'DELETE', 'read': 'GET' }; // Set the default implementation of `Backbone.ajax` to proxy through to `$`. // Override this if you'd like to use a different library. Backbone.ajax = function() { return Backbone.$.ajax.apply(Backbone.$, arguments); }; // Backbone.Router // --------------- // Routers map faux-URLs to actions, and fire events when routes are // matched. Creating a new one sets its `routes` hash, if not set statically. var Router = Backbone.Router = function(options) { options || (options = {}); if (options.routes) this.routes = options.routes; this._bindRoutes(); this.initialize.apply(this, arguments); }; // Cached regular expressions for matching named param parts and splatted // parts of route strings. var optionalParam = /\((.*?)\)/g; var namedParam = /(\(\?)?:\w+/g; var splatParam = /\*\w+/g; var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; // Set up all inheritable **Backbone.Router** properties and methods. _.extend(Router.prototype, Events, { // Initialize is an empty function by default. Override it with your own // initialization logic. initialize: function(){}, // Manually bind a single named route to a callback. For example: // // this.route('search/:query/p:num', 'search', function(query, num) { // ... // }); // route: function(route, name, callback) { if (!_.isRegExp(route)) route = this._routeToRegExp(route); if (_.isFunction(name)) { callback = name; name = ''; } if (!callback) callback = this[name]; var router = this; Backbone.history.route(route, function(fragment) { var args = router._extractParameters(route, fragment); callback && callback.apply(router, args); router.trigger.apply(router, ['route:' + name].concat(args)); router.trigger('route', name, args); Backbone.history.trigger('route', router, name, args); }); return this; }, // Simple proxy to `Backbone.history` to save a fragment into the history. navigate: function(fragment, options) { Backbone.history.navigate(fragment, options); return this; }, // Bind all defined routes to `Backbone.history`. We have to reverse the // order of the routes here to support behavior where the most general // routes can be defined at the bottom of the route map. _bindRoutes: function() { if (!this.routes) return; this.routes = _.result(this, 'routes'); var route, routes = _.keys(this.routes); while ((route = routes.pop()) != null) { this.route(route, this.routes[route]); } }, // Convert a route string into a regular expression, suitable for matching // against the current location hash. _routeToRegExp: function(route) { route = route.replace(escapeRegExp, '\\$&') .replace(optionalParam, '(?:$1)?') .replace(namedParam, function(match, optional){ return optional ? match : '([^\/]+)'; }) .replace(splatParam, '(.*?)'); return new RegExp('^' + route + '$'); }, // Given a route, and a URL fragment that it matches, return the array of // extracted decoded parameters. Empty or unmatched parameters will be // treated as `null` to normalize cross-browser behavior. _extractParameters: function(route, fragment) { var params = route.exec(fragment).slice(1); return _.map(params, function(param) { return param ? decodeURIComponent(param) : null; }); } }); // Backbone.History // ---------------- // Handles cross-browser history management, based on either // [pushState](http://diveintohtml5.info/history.html) and real URLs, or // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) // and URL fragments. If the browser supports neither (old IE, natch), // falls back to polling. var History = Backbone.History = function() { this.handlers = []; _.bindAll(this, 'checkUrl'); // Ensure that `History` can be used outside of the browser. if (typeof window !== 'undefined') { this.location = window.location; this.history = window.history; } }; // Cached regex for stripping a leading hash/slash and trailing space. var routeStripper = /^[#\/]|\s+$/g; // Cached regex for stripping leading and trailing slashes. var rootStripper = /^\/+|\/+$/g; // Cached regex for detecting MSIE. var isExplorer = /msie [\w.]+/; // Cached regex for removing a trailing slash. var trailingSlash = /\/$/; // Has the history handling already been started? History.started = false; // Set up all inheritable **Backbone.History** properties and methods. _.extend(History.prototype, Events, { // The default interval to poll for hash changes, if necessary, is // twenty times a second. interval: 50, // Gets the true hash value. Cannot use location.hash directly due to bug // in Firefox where location.hash will always be decoded. getHash: function(window) { var match = (window || this).location.href.match(/#(.*)$/); return match ? match[1] : ''; }, // Get the cross-browser normalized URL fragment, either from the URL, // the hash, or the override. getFragment: function(fragment, forcePushState) { if (fragment == null) { if (this._hasPushState || !this._wantsHashChange || forcePushState) { fragment = this.location.pathname; var root = this.root.replace(trailingSlash, ''); if (!fragment.indexOf(root)) fragment = fragment.substr(root.length); } else { fragment = this.getHash(); } } return fragment.replace(routeStripper, ''); }, // Start the hash change handling, returning `true` if the current URL matches // an existing route, and `false` otherwise. start: function(options) { if (History.started) throw new Error("Backbone.history has already been started"); History.started = true; // Figure out the initial configuration. Do we need an iframe? // Is pushState desired ... is it available? this.options = _.extend({}, {root: '/'}, this.options, options); this.root = this.options.root; this._wantsHashChange = this.options.hashChange !== false; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); var fragment = this.getFragment(); var docMode = document.documentMode; var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); // Normalize root to always include a leading and trailing slash. this.root = ('/' + this.root + '/').replace(rootStripper, '/'); if (oldIE && this._wantsHashChange) { this.iframe = Backbone.$('