@marko/compiler 5.34.1 → 5.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel-plugin/index.js +1 -1
- package/dist/babel-plugin/parser.js +1 -1
- package/dist/babel-plugin/plugins/migrate.js +3 -3
- package/dist/babel-plugin/plugins/transform.js +3 -3
- package/dist/babel-types/generator/patch.js +27 -15
- package/dist/babel-types/traverse/patch.js +1 -1
- package/dist/babel-types/types/definitions.js +5 -5
- package/dist/babel-types/types/patch.js +1 -1
- package/dist/config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/taglib/index.js +3 -3
- package/dist/traverse.d.ts +90 -99
- package/dist/types.d.ts +29 -19
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ var _config = _interopRequireDefault(require("../taglib/config"));
|
|
|
12
12
|
var _tryLoadTranslator = _interopRequireDefault(require("../util/try-load-translator"));
|
|
13
13
|
var _shouldOptimize = _interopRequireDefault(require("../util/should-optimize"));
|
|
14
14
|
var _buildCodeFrame = require("../util/build-code-frame");
|
|
15
|
-
var _mergeErrors = _interopRequireDefault(require("../util/merge-errors"));function _getRequireWildcardCache(
|
|
15
|
+
var _mergeErrors = _interopRequireDefault(require("../util/merge-errors"));function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
16
16
|
|
|
17
17
|
const SOURCE_FILES = new WeakMap();var _default =
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";exports.__esModule = true;exports.parseMarko = parseMarko;var _htmljsParser = require("htmljs-parser");
|
|
2
2
|
var t = _interopRequireWildcard(require("../babel-types"));
|
|
3
|
-
var _babelUtils = require("@marko/babel-utils");function _getRequireWildcardCache(
|
|
3
|
+
var _babelUtils = require("@marko/babel-utils");function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";exports.__esModule = true;exports.visitor = void 0;var _babelUtils = require("@marko/babel-utils");
|
|
2
2
|
var t = _interopRequireWildcard(require("../../babel-types"));
|
|
3
|
-
var _pluginHooks = require("../util/plugin-hooks");function _getRequireWildcardCache(
|
|
3
|
+
var _pluginHooks = require("../util/plugin-hooks");function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Applies custom migrators on tags.
|
|
7
7
|
*/
|
|
8
|
-
const visitor = {
|
|
8
|
+
const visitor = exports.visitor = {
|
|
9
9
|
MarkoTag: {
|
|
10
10
|
enter(path) {
|
|
11
11
|
const migrators = getMigratorsForTag(path);
|
|
@@ -24,7 +24,7 @@ const visitor = {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
};
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
function getMigratorsForTag(path) {
|
|
30
30
|
const {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";exports.__esModule = true;exports.visitor = void 0;var _babelUtils = require("@marko/babel-utils");
|
|
2
2
|
var t = _interopRequireWildcard(require("../../babel-types"));
|
|
3
|
-
var _pluginHooks = require("../util/plugin-hooks");function _getRequireWildcardCache(
|
|
3
|
+
var _pluginHooks = require("../util/plugin-hooks");function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Applies custom transformers on tags.
|
|
7
7
|
*/
|
|
8
|
-
const visitor = {
|
|
8
|
+
const visitor = exports.visitor = {
|
|
9
9
|
MarkoTag: {
|
|
10
10
|
enter(path) {
|
|
11
11
|
const transformers = getTransformersForTag(path);
|
|
@@ -26,7 +26,7 @@ const visitor = {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
function getTransformersForTag(path) {
|
|
32
32
|
const {
|
|
@@ -2,17 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var t = _interopRequireWildcard(require("@babel/types"));
|
|
4
4
|
var _selfClosingTags = _interopRequireDefault(require("self-closing-tags"));
|
|
5
|
-
var _printer = _interopRequireDefault(require("@babel/generator/lib/printer"));function _getRequireWildcardCache(
|
|
6
|
-
|
|
7
|
-
const UNENCLOSED_WHITESPACE_TYPES = [
|
|
8
|
-
"LogicalExpression",
|
|
9
|
-
"AssignmentExpression",
|
|
10
|
-
"ConditionalExpression",
|
|
11
|
-
"BinaryExpression",
|
|
12
|
-
"NewExpression",
|
|
13
|
-
"Function",
|
|
14
|
-
"AssignmentExpression"];
|
|
15
|
-
|
|
5
|
+
var _printer = _interopRequireDefault(require("@babel/generator/lib/printer"));function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
16
6
|
|
|
17
7
|
Object.assign(_printer.default.prototype, {
|
|
18
8
|
MarkoParseError(node) {
|
|
@@ -61,7 +51,10 @@ Object.assign(_printer.default.prototype, {
|
|
|
61
51
|
|
|
62
52
|
this.token(`${node.static ? "static" : "$"} `);
|
|
63
53
|
|
|
64
|
-
if (
|
|
54
|
+
if (
|
|
55
|
+
node.body.length === 1 &&
|
|
56
|
+
!statementCouldHaveUnenclosedNewline(node.body[0]))
|
|
57
|
+
{
|
|
65
58
|
// TODO should determine if node has unenclosed newlines.
|
|
66
59
|
this.print(node.body[0], node);
|
|
67
60
|
} else {
|
|
@@ -242,7 +235,7 @@ function spaceSeparator() {
|
|
|
242
235
|
}
|
|
243
236
|
|
|
244
237
|
function printWithParansIfNeeded(value, parent) {
|
|
245
|
-
const needsParans =
|
|
238
|
+
const needsParans = expressionCouldHaveUnenclosedWhitespace(value);
|
|
246
239
|
|
|
247
240
|
if (needsParans) {
|
|
248
241
|
this.token("(");
|
|
@@ -255,6 +248,25 @@ function printWithParansIfNeeded(value, parent) {
|
|
|
255
248
|
}
|
|
256
249
|
}
|
|
257
250
|
|
|
258
|
-
function
|
|
259
|
-
|
|
251
|
+
function expressionCouldHaveUnenclosedWhitespace(node) {
|
|
252
|
+
switch (node.type) {
|
|
253
|
+
case "AssignmentExpression":
|
|
254
|
+
case "BinaryExpression":
|
|
255
|
+
case "ConditionalExpression":
|
|
256
|
+
case "Function":
|
|
257
|
+
case "LogicalExpression":
|
|
258
|
+
case "NewExpression":
|
|
259
|
+
return true;
|
|
260
|
+
default:
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function statementCouldHaveUnenclosedNewline(node) {
|
|
266
|
+
switch (node.type) {
|
|
267
|
+
case "VariableDeclaration":
|
|
268
|
+
return node.declarations.length > 1;
|
|
269
|
+
default:
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
260
272
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var t = _interopRequireWildcard(require("@babel/types"));
|
|
4
4
|
var _traverse = _interopRequireWildcard(require("@babel/traverse"));
|
|
5
|
-
var _definitions = require("../types/definitions");function _getRequireWildcardCache(
|
|
5
|
+
var _definitions = require("../types/definitions");function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
6
6
|
|
|
7
7
|
_definitions.MARKO_TYPES.forEach((typeName) => {
|
|
8
8
|
const checkKey = `is${typeName}`;
|
|
@@ -217,12 +217,12 @@ const MarkoDefinitions = {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
};var _default =
|
|
220
|
+
};var _default = exports.default =
|
|
221
221
|
|
|
222
|
-
MarkoDefinitions;
|
|
223
|
-
const MARKO_TYPES = Object.keys(MarkoDefinitions);
|
|
224
|
-
const MARKO_ALIAS_TYPES = Array.from(
|
|
222
|
+
MarkoDefinitions;
|
|
223
|
+
const MARKO_TYPES = exports.MARKO_TYPES = Object.keys(MarkoDefinitions);
|
|
224
|
+
const MARKO_ALIAS_TYPES = exports.MARKO_ALIAS_TYPES = Array.from(
|
|
225
225
|
new Set(
|
|
226
226
|
MARKO_TYPES.reduce((all, t) => all.concat(MarkoDefinitions[t].aliases), [])
|
|
227
227
|
)
|
|
228
|
-
);
|
|
228
|
+
);
|
|
@@ -4,7 +4,7 @@ var _utils = _interopRequireDefault(require("@babel/types/lib/definitions/utils"
|
|
|
4
4
|
var _validate = _interopRequireDefault(require("@babel/types/lib/validators/validate"));
|
|
5
5
|
var generatedValidators = _interopRequireWildcard(require("@babel/types/lib/validators/generated"));
|
|
6
6
|
var referencedValidators = _interopRequireWildcard(require("@babel/types/lib/validators/isReferenced"));
|
|
7
|
-
var _definitions = _interopRequireWildcard(require("./definitions"));function _getRequireWildcardCache(
|
|
7
|
+
var _definitions = _interopRequireWildcard(require("./definitions"));function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;} /* eslint-disable no-import-assign */
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
TYPES,
|
package/dist/config.js
CHANGED
|
@@ -228,4 +228,4 @@ var _config = _interopRequireDefault(require("./taglib/config"));const config =
|
|
|
228
228
|
* When the errorRecovery is true, any recoverable errors will be
|
|
229
229
|
* returned in the `meta.diagnostics` property of the compile result.
|
|
230
230
|
*/errorRecovery: false, // When supplied, any diagnostics which have a fix specified in the lookup will be applied to the source code.
|
|
231
|
-
applyFixes: undefined };if (process.env.MARKO_CONFIG) {Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));}var _default =
|
|
231
|
+
applyFixes: undefined };if (process.env.MARKO_CONFIG) {Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));}var _default = exports.default = config;_config.default.fs = config.fileSystem;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var taglib = _interopRequireWildcard(require("./taglib"));exports.taglib = tagli
|
|
|
11
11
|
var _shouldOptimize = _interopRequireDefault(require("./util/should-optimize"));
|
|
12
12
|
var _tryLoadTranslator = _interopRequireDefault(require("./util/try-load-translator"));
|
|
13
13
|
var _buildCodeFrame = require("./util/build-code-frame");
|
|
14
|
-
var _mergeErrors = _interopRequireDefault(require("./util/merge-errors"));function _getRequireWildcardCache(
|
|
14
|
+
var _mergeErrors = _interopRequireDefault(require("./util/merge-errors"));function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const CWD = process.cwd();
|
package/dist/taglib/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var _tryLoadTranslator = _interopRequireDefault(require("../util/try-load-transl
|
|
|
11
11
|
|
|
12
12
|
var _markoHtml = _interopRequireDefault(require("./marko-html.json"));
|
|
13
13
|
var _markoSvg = _interopRequireDefault(require("./marko-svg.json"));
|
|
14
|
-
var _markoMath = _interopRequireDefault(require("./marko-math.json"));const excludeDir =
|
|
14
|
+
var _markoMath = _interopRequireDefault(require("./marko-math.json"));const excludeDir = exports.excludeDir = _finder2.default.excludeDir;const excludePackage = exports.excludePackage = _finder2.default.excludePackage;
|
|
15
15
|
|
|
16
16
|
const registeredTaglibs = [];
|
|
17
17
|
const loadedTranslatorsTaglibs = new Map();
|
|
@@ -105,8 +105,8 @@ function clearCaches() {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Used by legacy compiler api.
|
|
108
|
-
const _loader =
|
|
109
|
-
const _finder =
|
|
108
|
+
const _loader = exports._loader = _loader2.default;
|
|
109
|
+
const _finder = exports._finder = _finder2.default;
|
|
110
110
|
|
|
111
111
|
function loadTaglib(id, props) {
|
|
112
112
|
return _loader2.default.loadTaglibFromProps(_loader2.default.createTaglib(id), props);
|
package/dist/traverse.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
// Type definitions for @babel/traverse 7.20
|
|
2
|
-
// Project: https://github.com/babel/babel/tree/main/packages/babel-traverse, https://babeljs.io
|
|
3
|
-
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
|
4
|
-
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
|
5
|
-
// Ryan Petrich <https://github.com/rpetrich>
|
|
6
|
-
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
|
7
|
-
// Dean L. <https://github.com/dlgrit>
|
|
8
|
-
// Ifiok Jr. <https://github.com/ifiokjr>
|
|
9
|
-
// ExE Boss <https://github.com/ExE-Boss>
|
|
10
|
-
// Daniel Tschinder <https://github.com/danez>
|
|
11
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
12
|
-
|
|
13
1
|
import * as t from './types';
|
|
14
2
|
type Node = t.Node
|
|
15
3
|
export import RemovePropertiesOptions = t.RemovePropertiesOptions;
|
|
@@ -33,7 +21,7 @@ declare const traverse: {
|
|
|
33
21
|
) => void;
|
|
34
22
|
clearNode: (node: Node, opts?: RemovePropertiesOptions) => void;
|
|
35
23
|
removeProperties: (tree: Node, opts?: RemovePropertiesOptions) => Node;
|
|
36
|
-
hasType: (tree: Node, type: Node[
|
|
24
|
+
hasType: (tree: Node, type: Node["type"], denylistTypes?: string[]) => boolean;
|
|
37
25
|
|
|
38
26
|
cache: typeof cache;
|
|
39
27
|
};
|
|
@@ -56,7 +44,7 @@ export namespace visitors {
|
|
|
56
44
|
function explode<S = unknown>(
|
|
57
45
|
visitor: Visitor<S>,
|
|
58
46
|
): {
|
|
59
|
-
[Type in Exclude<Node, t.DeprecatedAliases>[
|
|
47
|
+
[Type in Exclude<Node, t.DeprecatedAliases>["type"]]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
|
|
60
48
|
};
|
|
61
49
|
function verify(visitor: Visitor): void;
|
|
62
50
|
function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
|
|
@@ -203,7 +191,7 @@ export class Scope {
|
|
|
203
191
|
init?: t.Expression;
|
|
204
192
|
unique?: boolean;
|
|
205
193
|
_blockHoist?: number | undefined;
|
|
206
|
-
kind?:
|
|
194
|
+
kind?: "var" | "let" | "const";
|
|
207
195
|
}): void;
|
|
208
196
|
|
|
209
197
|
/** Walk up to the top of the scope tree and get the `Program`. */
|
|
@@ -248,9 +236,9 @@ export class Scope {
|
|
|
248
236
|
optsOrNoGlobals?:
|
|
249
237
|
| boolean
|
|
250
238
|
| {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
239
|
+
noGlobals?: boolean;
|
|
240
|
+
noUids?: boolean;
|
|
241
|
+
},
|
|
254
242
|
): boolean;
|
|
255
243
|
|
|
256
244
|
parentHasBinding(
|
|
@@ -269,7 +257,7 @@ export class Scope {
|
|
|
269
257
|
removeBinding(name: string): void;
|
|
270
258
|
}
|
|
271
259
|
|
|
272
|
-
export type BindingKind =
|
|
260
|
+
export type BindingKind = "var" | "let" | "const" | "module" | "hoisted" | "param" | "local" | "unknown";
|
|
273
261
|
|
|
274
262
|
/**
|
|
275
263
|
* This class is responsible for a binding inside of a scope.
|
|
@@ -308,24 +296,29 @@ export class Binding {
|
|
|
308
296
|
dereference(): void;
|
|
309
297
|
}
|
|
310
298
|
|
|
311
|
-
export type Visitor<S = unknown> =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
299
|
+
export type Visitor<S = unknown> =
|
|
300
|
+
& VisitNodeObject<S, Node>
|
|
301
|
+
& {
|
|
302
|
+
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type }>>;
|
|
303
|
+
}
|
|
304
|
+
& {
|
|
305
|
+
[K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;
|
|
306
|
+
}
|
|
307
|
+
& {
|
|
308
|
+
[K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]>;
|
|
309
|
+
}
|
|
310
|
+
& {
|
|
311
|
+
// Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
|
|
312
|
+
// too complex for TS. So we type it as a general visitor only if the key contains `|`
|
|
313
|
+
// this is good enough for non-visitor traverse options e.g. `noScope`
|
|
314
|
+
[k: `${string}|${string}`]: VisitNode<S, Node>;
|
|
315
|
+
};
|
|
323
316
|
|
|
324
317
|
export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
|
325
318
|
|
|
326
319
|
export type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>, state: S) => void;
|
|
327
320
|
|
|
328
|
-
type NodeType = Node[
|
|
321
|
+
type NodeType = Node["type"] | keyof t.Aliases;
|
|
329
322
|
|
|
330
323
|
export interface VisitNodeObject<S, P extends Node> {
|
|
331
324
|
enter?: VisitNodeFunction<S, P>;
|
|
@@ -342,8 +335,7 @@ export type NodeKeyOfNodes<T extends Node> = {
|
|
|
342
335
|
|
|
343
336
|
export type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[]
|
|
344
337
|
? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> }
|
|
345
|
-
: T extends Node
|
|
346
|
-
? [NodePath<T>]
|
|
338
|
+
: T extends Node ? [NodePath<T>]
|
|
347
339
|
: never;
|
|
348
340
|
|
|
349
341
|
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
|
|
@@ -366,7 +358,7 @@ export class NodePath<T = Node> {
|
|
|
366
358
|
listKey: string | null;
|
|
367
359
|
key: string | number | null;
|
|
368
360
|
node: T;
|
|
369
|
-
type: T extends Node ? T[
|
|
361
|
+
type: T extends Node ? T["type"] : T extends null | undefined ? undefined : Node["type"] | undefined;
|
|
370
362
|
shouldSkip: boolean;
|
|
371
363
|
shouldStop: boolean;
|
|
372
364
|
removed: boolean;
|
|
@@ -400,8 +392,8 @@ export class NodePath<T = Node> {
|
|
|
400
392
|
|
|
401
393
|
buildCodeFrameError(msg: string, Error?: ErrorConstructor): Error;
|
|
402
394
|
|
|
403
|
-
traverse<T>(visitor:
|
|
404
|
-
traverse(visitor:
|
|
395
|
+
traverse<T>(visitor: TraverseOptions<T>, state: T): void;
|
|
396
|
+
traverse(visitor: TraverseOptions): void;
|
|
405
397
|
|
|
406
398
|
set(key: string, node: any): void;
|
|
407
399
|
|
|
@@ -410,7 +402,7 @@ export class NodePath<T = Node> {
|
|
|
410
402
|
// Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
|
|
411
403
|
debug(buildMessage: () => string): void;
|
|
412
404
|
|
|
413
|
-
|
|
405
|
+
// #region ------------------------- ancestry -------------------------
|
|
414
406
|
/**
|
|
415
407
|
* Starting at the parent path of the current `NodePath` and going up the
|
|
416
408
|
* tree, return the first `NodePath` that causes the provided `callback`
|
|
@@ -465,9 +457,9 @@ export class NodePath<T = Node> {
|
|
|
465
457
|
isDescendant(maybeAncestor: NodePath): boolean;
|
|
466
458
|
|
|
467
459
|
inType(...candidateTypes: string[]): boolean;
|
|
468
|
-
|
|
460
|
+
// #endregion
|
|
469
461
|
|
|
470
|
-
|
|
462
|
+
// #region ------------------------- inference -------------------------
|
|
471
463
|
/** Infer the type of the current `NodePath`. */
|
|
472
464
|
getTypeAnnotation(): t.FlowType | t.TSType;
|
|
473
465
|
|
|
@@ -478,9 +470,9 @@ export class NodePath<T = Node> {
|
|
|
478
470
|
baseTypeStrictlyMatches(rightArg: NodePath): boolean;
|
|
479
471
|
|
|
480
472
|
isGenericType(genericName: string): boolean;
|
|
481
|
-
|
|
473
|
+
// #endregion
|
|
482
474
|
|
|
483
|
-
|
|
475
|
+
// #region ------------------------- replacement -------------------------
|
|
484
476
|
/**
|
|
485
477
|
* Replace a node with an array of multiple. This method performs the following steps:
|
|
486
478
|
*
|
|
@@ -511,9 +503,9 @@ export class NodePath<T = Node> {
|
|
|
511
503
|
replaceExpressionWithStatements(nodes: t.Statement[]): NodePaths<t.Expression | t.Statement>;
|
|
512
504
|
|
|
513
505
|
replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
514
|
-
|
|
506
|
+
// #endregion
|
|
515
507
|
|
|
516
|
-
|
|
508
|
+
// #region ------------------------- evaluation -------------------------
|
|
517
509
|
/**
|
|
518
510
|
* Walk the input `node` and statically evaluate if it's truthy.
|
|
519
511
|
*
|
|
@@ -537,16 +529,15 @@ export class NodePath<T = Node> {
|
|
|
537
529
|
* t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
|
|
538
530
|
* t.evaluate(parse("!true")) // { confident: true, value: false }
|
|
539
531
|
* t.evaluate(parse("foo + foo")) // { confident: false, value: undefined, deopt: NodePath }
|
|
540
|
-
*
|
|
541
532
|
*/
|
|
542
533
|
evaluate(): {
|
|
543
534
|
confident: boolean;
|
|
544
535
|
value: any;
|
|
545
536
|
deopt?: NodePath;
|
|
546
537
|
};
|
|
547
|
-
|
|
538
|
+
// #endregion
|
|
548
539
|
|
|
549
|
-
|
|
540
|
+
// #region ------------------------- introspection -------------------------
|
|
550
541
|
/**
|
|
551
542
|
* Match the current node if it matches the provided `pattern`.
|
|
552
543
|
*
|
|
@@ -625,9 +616,9 @@ export class NodePath<T = Node> {
|
|
|
625
616
|
isConstantExpression(): boolean;
|
|
626
617
|
|
|
627
618
|
isInStrictMode(): boolean;
|
|
628
|
-
|
|
619
|
+
// #endregion
|
|
629
620
|
|
|
630
|
-
|
|
621
|
+
// #region ------------------------- context -------------------------
|
|
631
622
|
call(key: string): boolean;
|
|
632
623
|
|
|
633
624
|
isDenylisted(): boolean;
|
|
@@ -659,13 +650,13 @@ export class NodePath<T = Node> {
|
|
|
659
650
|
pushContext(context: TraversalContext): void;
|
|
660
651
|
|
|
661
652
|
requeue(pathToQueue?: NodePath): void;
|
|
662
|
-
|
|
653
|
+
// #endregion
|
|
663
654
|
|
|
664
|
-
|
|
655
|
+
// #region ------------------------- removal -------------------------
|
|
665
656
|
remove(): void;
|
|
666
|
-
|
|
657
|
+
// #endregion
|
|
667
658
|
|
|
668
|
-
|
|
659
|
+
// #region ------------------------- conversion -------------------------
|
|
669
660
|
toComputedKey(): t.PrivateName | t.Expression;
|
|
670
661
|
|
|
671
662
|
/** @deprecated Use `arrowFunctionToExpression` */
|
|
@@ -702,9 +693,9 @@ export class NodePath<T = Node> {
|
|
|
702
693
|
body: t.BlockStatement;
|
|
703
694
|
}
|
|
704
695
|
>;
|
|
705
|
-
|
|
696
|
+
// #endregion
|
|
706
697
|
|
|
707
|
-
|
|
698
|
+
// #region ------------------------- modification -------------------------
|
|
708
699
|
/** Insert the provided nodes before the current one. */
|
|
709
700
|
insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
710
701
|
|
|
@@ -741,9 +732,9 @@ export class NodePath<T = Node> {
|
|
|
741
732
|
|
|
742
733
|
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
|
743
734
|
hoist(scope: Scope): void;
|
|
744
|
-
|
|
735
|
+
// #endregion
|
|
745
736
|
|
|
746
|
-
|
|
737
|
+
// #region ------------------------- family -------------------------
|
|
747
738
|
getOpposite(): NodePath | null;
|
|
748
739
|
|
|
749
740
|
getCompletionRecords(): NodePath[];
|
|
@@ -778,9 +769,9 @@ export class NodePath<T = Node> {
|
|
|
778
769
|
duplicates?: boolean,
|
|
779
770
|
outerOnly?: boolean,
|
|
780
771
|
): Record<string, NodePath<t.Identifier> | Array<NodePath<t.Identifier>>>;
|
|
781
|
-
|
|
772
|
+
// #endregion
|
|
782
773
|
|
|
783
|
-
|
|
774
|
+
// #region ------------------------- comments -------------------------
|
|
784
775
|
/** Share comments amongst siblings. */
|
|
785
776
|
shareCommentsWithSiblings(): void;
|
|
786
777
|
|
|
@@ -788,22 +779,22 @@ export class NodePath<T = Node> {
|
|
|
788
779
|
|
|
789
780
|
/** Give node `comments` of the specified `type`. */
|
|
790
781
|
addComments(type: t.CommentTypeShorthand, comments: t.Comment[]): void;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
isMarkoParseError(
|
|
795
|
-
isMarkoDocumentType(
|
|
796
|
-
isMarkoDeclaration(
|
|
797
|
-
isMarkoCDATA(
|
|
798
|
-
isMarkoComment(
|
|
799
|
-
isMarkoText(
|
|
800
|
-
isMarkoPlaceholder(
|
|
801
|
-
isMarkoScriptlet(
|
|
802
|
-
isMarkoClass(
|
|
803
|
-
isMarkoAttribute(
|
|
804
|
-
isMarkoSpreadAttribute(
|
|
805
|
-
isMarkoTagBody(
|
|
806
|
-
isMarkoTag(
|
|
782
|
+
// #endregion
|
|
783
|
+
|
|
784
|
+
// #region ------------------------- isXXX -------------------------
|
|
785
|
+
isMarkoParseError(opts?: object | null): this is NodePath<t.MarkoParseError>;
|
|
786
|
+
isMarkoDocumentType(opts?: object | null): this is NodePath<t.MarkoDocumentType>;
|
|
787
|
+
isMarkoDeclaration(opts?: object | null): this is NodePath<t.MarkoDeclaration>;
|
|
788
|
+
isMarkoCDATA(opts?: object | null): this is NodePath<t.MarkoCDATA>;
|
|
789
|
+
isMarkoComment(opts?: object | null): this is NodePath<t.MarkoComment>;
|
|
790
|
+
isMarkoText(opts?: object | null): this is NodePath<t.MarkoText>;
|
|
791
|
+
isMarkoPlaceholder(opts?: object | null): this is NodePath<t.MarkoPlaceholder>;
|
|
792
|
+
isMarkoScriptlet(opts?: object | null): this is NodePath<t.MarkoScriptlet>;
|
|
793
|
+
isMarkoClass(opts?: object | null): this is NodePath<t.MarkoClass>;
|
|
794
|
+
isMarkoAttribute(opts?: object | null): this is NodePath<t.MarkoAttribute>;
|
|
795
|
+
isMarkoSpreadAttribute(opts?: object | null): this is NodePath<t.MarkoSpreadAttribute>;
|
|
796
|
+
isMarkoTagBody(opts?: object | null): this is NodePath<t.MarkoTagBody>;
|
|
797
|
+
isMarkoTag(opts?: object | null): this is NodePath<t.MarkoTag>;
|
|
807
798
|
isAccessor(opts?: object): this is NodePath<t.Accessor>;
|
|
808
799
|
isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
|
|
809
800
|
isArgumentPlaceholder(opts?: object): this is NodePath<t.ArgumentPlaceholder>;
|
|
@@ -1115,39 +1106,39 @@ export class NodePath<T = Node> {
|
|
|
1115
1106
|
isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
|
|
1116
1107
|
isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
|
|
1117
1108
|
|
|
1118
|
-
isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1109
|
+
isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["BindingIdentifier"]>;
|
|
1119
1110
|
isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
|
|
1120
1111
|
|
|
1121
1112
|
/** @deprecated */
|
|
1122
|
-
isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1123
|
-
isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1113
|
+
isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases["ExistentialTypeParam"]>;
|
|
1114
|
+
isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases["ForAwaitStatement"]>;
|
|
1124
1115
|
isGenerated(opts?: object): boolean;
|
|
1125
1116
|
|
|
1126
1117
|
/** @deprecated */
|
|
1127
1118
|
isNumericLiteralTypeAnnotation(opts?: object): void;
|
|
1128
1119
|
isPure(opts?: object): boolean;
|
|
1129
1120
|
isReferenced(opts?: object): boolean;
|
|
1130
|
-
isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1131
|
-
isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1132
|
-
isScope(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1121
|
+
isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedIdentifier"]>;
|
|
1122
|
+
isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedMemberExpression"]>;
|
|
1123
|
+
isScope(opts?: object): this is NodePath<VirtualTypeAliases["Scope"]>;
|
|
1133
1124
|
isUser(opts?: object): boolean;
|
|
1134
|
-
isVar(opts?: object): this is NodePath<VirtualTypeAliases[
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
assertMarkoParseError(
|
|
1139
|
-
assertMarkoDocumentType(
|
|
1140
|
-
assertMarkoDeclaration(
|
|
1141
|
-
assertMarkoCDATA(
|
|
1142
|
-
assertMarkoComment(
|
|
1143
|
-
assertMarkoText(
|
|
1144
|
-
assertMarkoPlaceholder(
|
|
1145
|
-
assertMarkoScriptlet(
|
|
1146
|
-
assertMarkoClass(
|
|
1147
|
-
assertMarkoAttribute(
|
|
1148
|
-
assertMarkoSpreadAttribute(
|
|
1149
|
-
assertMarkoTagBody(
|
|
1150
|
-
assertMarkoTag(
|
|
1125
|
+
isVar(opts?: object): this is NodePath<VirtualTypeAliases["Var"]>;
|
|
1126
|
+
// #endregion
|
|
1127
|
+
|
|
1128
|
+
// #region ------------------------- assertXXX -------------------------
|
|
1129
|
+
assertMarkoParseError(opts?: object | null): void;
|
|
1130
|
+
assertMarkoDocumentType(opts?: object | null): void;
|
|
1131
|
+
assertMarkoDeclaration(opts?: object | null): void;
|
|
1132
|
+
assertMarkoCDATA(opts?: object | null): void;
|
|
1133
|
+
assertMarkoComment(opts?: object | null): void;
|
|
1134
|
+
assertMarkoText(opts?: object | null): void;
|
|
1135
|
+
assertMarkoPlaceholder(opts?: object | null): void;
|
|
1136
|
+
assertMarkoScriptlet(opts?: object | null): void;
|
|
1137
|
+
assertMarkoClass(opts?: object | null): void;
|
|
1138
|
+
assertMarkoAttribute(opts?: object | null): void;
|
|
1139
|
+
assertMarkoSpreadAttribute(opts?: object | null): void;
|
|
1140
|
+
assertMarkoTagBody(opts?: object | null): void;
|
|
1141
|
+
assertMarkoTag(opts?: object | null): void;
|
|
1151
1142
|
assertAccessor(opts?: object): asserts this is NodePath<t.Accessor>;
|
|
1152
1143
|
assertAnyTypeAnnotation(opts?: object): asserts this is NodePath<t.AnyTypeAnnotation>;
|
|
1153
1144
|
assertArgumentPlaceholder(opts?: object): asserts this is NodePath<t.ArgumentPlaceholder>;
|
|
@@ -1458,7 +1449,7 @@ export class NodePath<T = Node> {
|
|
|
1458
1449
|
assertWhileStatement(opts?: object): asserts this is NodePath<t.WhileStatement>;
|
|
1459
1450
|
assertWithStatement(opts?: object): asserts this is NodePath<t.WithStatement>;
|
|
1460
1451
|
assertYieldExpression(opts?: object): asserts this is NodePath<t.YieldExpression>;
|
|
1461
|
-
|
|
1452
|
+
// #endregion
|
|
1462
1453
|
}
|
|
1463
1454
|
|
|
1464
1455
|
export interface BabelFile {
|
package/dist/types.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface BaseNode {
|
|
|
42
42
|
extra?: Record<string, unknown>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
|
|
45
|
+
export type Node = Accessor | AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportOrExportDeclaration | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | Marko | MarkoAttribute | MarkoCDATA | MarkoClass | MarkoComment | MarkoDeclaration | MarkoDocumentType | MarkoParseError | MarkoPlaceholder | MarkoScriptlet | MarkoSpreadAttribute | MarkoTag | MarkoTagBody | MarkoText | MemberExpression | MetaProperty | Method | Miscellaneous | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | Scope | SequenceExpression | SpreadElement | SpreadProperty | Standardized | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeScript | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression;
|
|
46
46
|
|
|
47
47
|
export interface ArrayExpression extends BaseNode {
|
|
48
48
|
type: "ArrayExpression";
|
|
@@ -52,7 +52,7 @@ export interface ArrayExpression extends BaseNode {
|
|
|
52
52
|
export interface AssignmentExpression extends BaseNode {
|
|
53
53
|
type: "AssignmentExpression";
|
|
54
54
|
operator: string;
|
|
55
|
-
left: LVal;
|
|
55
|
+
left: LVal | OptionalMemberExpression;
|
|
56
56
|
right: Expression;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -428,7 +428,7 @@ export interface ClassExpression extends BaseNode {
|
|
|
428
428
|
|
|
429
429
|
export interface ClassDeclaration extends BaseNode {
|
|
430
430
|
type: "ClassDeclaration";
|
|
431
|
-
id: Identifier;
|
|
431
|
+
id: Identifier | null;
|
|
432
432
|
superClass: Expression | null;
|
|
433
433
|
body: ClassBody;
|
|
434
434
|
decorators: Array<Decorator> | null;
|
|
@@ -487,6 +487,7 @@ export interface ImportDeclaration extends BaseNode {
|
|
|
487
487
|
attributes: Array<ImportAttribute> | null;
|
|
488
488
|
importKind: "type" | "typeof" | "value" | null;
|
|
489
489
|
module: boolean | null;
|
|
490
|
+
phase: "source" | "defer" | null;
|
|
490
491
|
}
|
|
491
492
|
|
|
492
493
|
export interface ImportDefaultSpecifier extends BaseNode {
|
|
@@ -506,6 +507,13 @@ export interface ImportSpecifier extends BaseNode {
|
|
|
506
507
|
importKind: "type" | "typeof" | "value" | null;
|
|
507
508
|
}
|
|
508
509
|
|
|
510
|
+
export interface ImportExpression extends BaseNode {
|
|
511
|
+
type: "ImportExpression";
|
|
512
|
+
source: Expression;
|
|
513
|
+
options: Expression | null;
|
|
514
|
+
phase: "source" | "defer" | null;
|
|
515
|
+
}
|
|
516
|
+
|
|
509
517
|
export interface MetaProperty extends BaseNode {
|
|
510
518
|
type: "MetaProperty";
|
|
511
519
|
meta: Identifier;
|
|
@@ -1295,14 +1303,14 @@ export interface TSQualifiedName extends BaseNode {
|
|
|
1295
1303
|
export interface TSCallSignatureDeclaration extends BaseNode {
|
|
1296
1304
|
type: "TSCallSignatureDeclaration";
|
|
1297
1305
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
1298
|
-
parameters: Array<Identifier | RestElement>;
|
|
1306
|
+
parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
|
|
1299
1307
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1300
1308
|
}
|
|
1301
1309
|
|
|
1302
1310
|
export interface TSConstructSignatureDeclaration extends BaseNode {
|
|
1303
1311
|
type: "TSConstructSignatureDeclaration";
|
|
1304
1312
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
1305
|
-
parameters: Array<Identifier | RestElement>;
|
|
1313
|
+
parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
|
|
1306
1314
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1307
1315
|
}
|
|
1308
1316
|
|
|
@@ -1310,7 +1318,6 @@ export interface TSPropertySignature extends BaseNode {
|
|
|
1310
1318
|
type: "TSPropertySignature";
|
|
1311
1319
|
key: Expression;
|
|
1312
1320
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1313
|
-
initializer: Expression | null;
|
|
1314
1321
|
computed: boolean;
|
|
1315
1322
|
kind: "get" | "set";
|
|
1316
1323
|
optional: boolean | null;
|
|
@@ -1321,7 +1328,7 @@ export interface TSMethodSignature extends BaseNode {
|
|
|
1321
1328
|
type: "TSMethodSignature";
|
|
1322
1329
|
key: Expression;
|
|
1323
1330
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
1324
|
-
parameters: Array<Identifier | RestElement>;
|
|
1331
|
+
parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
|
|
1325
1332
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1326
1333
|
computed: boolean;
|
|
1327
1334
|
kind: "method" | "get" | "set";
|
|
@@ -1395,14 +1402,14 @@ export interface TSThisType extends BaseNode {
|
|
|
1395
1402
|
export interface TSFunctionType extends BaseNode {
|
|
1396
1403
|
type: "TSFunctionType";
|
|
1397
1404
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
1398
|
-
parameters: Array<Identifier | RestElement>;
|
|
1405
|
+
parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
|
|
1399
1406
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1400
1407
|
}
|
|
1401
1408
|
|
|
1402
1409
|
export interface TSConstructorType extends BaseNode {
|
|
1403
1410
|
type: "TSConstructorType";
|
|
1404
1411
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
1405
|
-
parameters: Array<Identifier | RestElement>;
|
|
1412
|
+
parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>;
|
|
1406
1413
|
typeAnnotation: TSTypeAnnotation | null;
|
|
1407
1414
|
abstract: boolean | null;
|
|
1408
1415
|
}
|
|
@@ -1754,8 +1761,8 @@ export type RestProperty = RestElement;
|
|
|
1754
1761
|
*/
|
|
1755
1762
|
export type SpreadProperty = SpreadElement;
|
|
1756
1763
|
|
|
1757
|
-
export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
|
|
1758
|
-
export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | MarkoParseError;
|
|
1764
|
+
export type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ImportExpression | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
|
|
1765
|
+
export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | ImportExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | MarkoParseError;
|
|
1759
1766
|
export type Binary = BinaryExpression | LogicalExpression;
|
|
1760
1767
|
export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
|
|
1761
1768
|
export type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock | MarkoTagBody;
|
|
@@ -1863,7 +1870,7 @@ export interface Aliases {
|
|
|
1863
1870
|
}
|
|
1864
1871
|
|
|
1865
1872
|
export function arrayExpression(elements?: Array<null | Expression | SpreadElement>): ArrayExpression;
|
|
1866
|
-
export function assignmentExpression(operator: string, left: LVal, right: Expression): AssignmentExpression;
|
|
1873
|
+
export function assignmentExpression(operator: string, left: LVal | OptionalMemberExpression, right: Expression): AssignmentExpression;
|
|
1867
1874
|
export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>", left: Expression | PrivateName, right: Expression): BinaryExpression;
|
|
1868
1875
|
export function interpreterDirective(value: string): InterpreterDirective;
|
|
1869
1876
|
export function directive(value: DirectiveLiteral): Directive;
|
|
@@ -1918,7 +1925,7 @@ export function arrayPattern(elements: Array<null | PatternLike | LVal>): ArrayP
|
|
|
1918
1925
|
export function arrowFunctionExpression(params: Array<Identifier | Pattern | RestElement>, body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression;
|
|
1919
1926
|
export function classBody(body: Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>): ClassBody;
|
|
1920
1927
|
export function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassExpression;
|
|
1921
|
-
export function classDeclaration(id: Identifier, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassDeclaration;
|
|
1928
|
+
export function classDeclaration(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassDeclaration;
|
|
1922
1929
|
export function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration;
|
|
1923
1930
|
export function exportDefaultDeclaration(declaration: TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression): ExportDefaultDeclaration;
|
|
1924
1931
|
export function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>, source?: StringLiteral | null): ExportNamedDeclaration;
|
|
@@ -1928,6 +1935,7 @@ export function importDeclaration(specifiers: Array<ImportSpecifier | ImportDefa
|
|
|
1928
1935
|
export function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier;
|
|
1929
1936
|
export function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier;
|
|
1930
1937
|
export function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier;
|
|
1938
|
+
export function importExpression(source: Expression, options?: Expression | null): ImportExpression;
|
|
1931
1939
|
export function metaProperty(meta: Identifier, property: Identifier): MetaProperty;
|
|
1932
1940
|
export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod;
|
|
1933
1941
|
export function objectPattern(properties: Array<RestElement | ObjectProperty>): ObjectPattern;
|
|
@@ -2052,10 +2060,10 @@ export function tsParameterProperty(parameter: Identifier | AssignmentPattern):
|
|
|
2052
2060
|
export function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction;
|
|
2053
2061
|
export function tsDeclareMethod(decorators: Array<Decorator> | null | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<Identifier | Pattern | RestElement | TSParameterProperty>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod;
|
|
2054
2062
|
export function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName;
|
|
2055
|
-
export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration;
|
|
2056
|
-
export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration;
|
|
2057
|
-
export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null
|
|
2058
|
-
export function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature;
|
|
2063
|
+
export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration;
|
|
2064
|
+
export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration;
|
|
2065
|
+
export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null): TSPropertySignature;
|
|
2066
|
+
export function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature;
|
|
2059
2067
|
export function tsIndexSignature(parameters: Array<Identifier>, typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature;
|
|
2060
2068
|
export function tsAnyKeyword(): TSAnyKeyword;
|
|
2061
2069
|
export function tsBooleanKeyword(): TSBooleanKeyword;
|
|
@@ -2071,8 +2079,8 @@ export function tsUndefinedKeyword(): TSUndefinedKeyword;
|
|
|
2071
2079
|
export function tsUnknownKeyword(): TSUnknownKeyword;
|
|
2072
2080
|
export function tsVoidKeyword(): TSVoidKeyword;
|
|
2073
2081
|
export function tsThisType(): TSThisType;
|
|
2074
|
-
export function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType;
|
|
2075
|
-
export function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<Identifier | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType;
|
|
2082
|
+
export function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType;
|
|
2083
|
+
export function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType;
|
|
2076
2084
|
export function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference;
|
|
2077
2085
|
export function tsTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation?: TSTypeAnnotation | null, asserts?: boolean | null): TSTypePredicate;
|
|
2078
2086
|
export function tsTypeQuery(exprName: TSEntityName | TSImportType, typeParameters?: TSTypeParameterInstantiation | null): TSTypeQuery;
|
|
@@ -2336,6 +2344,8 @@ export function isImportDeclaration(node: object | null | undefined, opts?: obje
|
|
|
2336
2344
|
export function assertImportDeclaration(node: object | null | undefined, opts?: object | null): void;
|
|
2337
2345
|
export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ImportDefaultSpecifier;
|
|
2338
2346
|
export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): void;
|
|
2347
|
+
export function isImportExpression(node: object | null | undefined, opts?: object | null): node is ImportExpression;
|
|
2348
|
+
export function assertImportExpression(node: object | null | undefined, opts?: object | null): void;
|
|
2339
2349
|
export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ImportNamespaceSpecifier;
|
|
2340
2350
|
export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): void;
|
|
2341
2351
|
export function isImportOrExportDeclaration(node: object | null | undefined, opts?: object | null): node is ImportOrExportDeclaration;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.34.
|
|
3
|
+
"version": "5.34.3",
|
|
4
4
|
"description": "Marko template to JS compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"strip-json-comments": "^3.1.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@marko/translator-default": "^5.31.
|
|
64
|
+
"@marko/translator-default": "^5.31.10"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|