@flint.fyi/typescript-language 0.0.0 → 0.18.1
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/LICENSE.md +20 -0
- package/lib/_virtual/_rolldown/runtime.js +13 -0
- package/lib/collectReferencedFilePaths.js +9 -10
- package/lib/convertTypeScriptDiagnosticToLanguageReport.d.ts +18 -0
- package/lib/{convertTypeScriptDiagnosticToLanguageFileDiagnostic.js → convertTypeScriptDiagnosticToLanguageReport.js} +13 -10
- package/lib/createTypeScriptServerHost.d.ts +4 -0
- package/lib/createTypeScriptServerHost.js +99 -0
- package/lib/directives/parseDirectivesFromTypeScriptFile.js +33 -3
- package/lib/getFirstEnumValues.js +1 -1
- package/lib/getTSNodeRange.js +1 -1
- package/lib/getTypeScriptFileCacheImpacts.d.ts +4 -0
- package/lib/getTypeScriptFileCacheImpacts.js +9 -0
- package/lib/index.d.ts +8 -9
- package/lib/index.js +6 -8
- package/lib/language.d.ts +211 -5
- package/lib/language.js +108 -14
- package/lib/nodes.d.ts +3 -1
- package/lib/normalizeRange.js +1 -2
- package/lib/package.js +7 -0
- package/lib/types/ast.d.ts +2 -2
- package/lib/utils/createRuleTesterTSConfig.d.ts +8 -0
- package/lib/utils/createRuleTesterTSConfig.js +18 -0
- package/lib/utils/declarationIncludesGlobal.js +1 -1
- package/lib/utils/declarationsIncludeGlobal.js +1 -2
- package/lib/utils/getDeclarationsIfGlobal.d.ts +4 -5
- package/lib/utils/getDeclarationsIfGlobal.js +1 -2
- package/lib/utils/getModifyingReferences.d.ts +1 -3
- package/lib/utils/getModifyingReferences.js +13 -11
- package/lib/utils/hasSameTokens.d.ts +2 -2
- package/lib/utils/hasSameTokens.js +4 -5
- package/lib/utils/isBuiltinArrayMethod.d.ts +2 -3
- package/lib/utils/isBuiltinArrayMethod.js +1 -2
- package/lib/utils/isFunction.d.ts +2 -4
- package/lib/utils/isFunction.js +1 -1
- package/lib/utils/isGlobalDeclaration.d.ts +2 -4
- package/lib/utils/isGlobalDeclaration.js +1 -2
- package/lib/utils/isGlobalDeclarationOfName.d.ts +1 -2
- package/lib/utils/isGlobalDeclarationOfName.js +1 -2
- package/lib/utils/isGlobalVariable.d.ts +2 -5
- package/lib/utils/isGlobalVariable.js +1 -2
- package/lib/utils/isInlineArrayCreation.d.ts +0 -1
- package/lib/utils/isInlineArrayCreation.js +1 -2
- package/lib/utils/unwrapParentParenthesizedExpressions.d.ts +2 -2
- package/lib/utils/unwrapParentParenthesizedExpressions.js +4 -5
- package/lib/utils/unwrapParenthesizedNode.d.ts +7 -0
- package/lib/utils/unwrapParenthesizedNode.js +9 -0
- package/package.json +45 -52
- package/lib/_virtual/rolldown_runtime.js +0 -18
- package/lib/convertTypeScriptDiagnosticToLanguageFileDiagnostic.d.ts +0 -18
- package/lib/createTypeScriptFileFromProgram.d.ts +0 -12
- package/lib/createTypeScriptFileFromProgram.js +0 -41
- package/lib/createTypeScriptFileFromProjectService.d.ts +0 -8
- package/lib/createTypeScriptFileFromProjectService.js +0 -16
- package/lib/lib/convertTypeScriptDiagnosticToLanguageFileDiagnostic.d.ts +0 -2
- package/lib/lib/createTypeScriptFileFromProgram.d.ts +0 -5
- package/lib/lib/directives/parseDirectivesFromTypeScriptFile.d.ts +0 -2
- package/lib/lib/getTSNodeRange.d.ts +0 -3
- package/lib/lib/index.d.ts +0 -21
- package/lib/lib/language.d.ts +0 -5
- package/lib/lib/nodes.d.ts +0 -1
- package/lib/lib/prepareTypeScriptBasedLanguage.d.ts +0 -2
- package/lib/lib/types/ast.d.ts +0 -2066
- package/lib/lib/types/checker.d.ts +0 -23
- package/lib/lib/utils/declarationIncludesGlobal.d.ts +0 -1
- package/lib/lib/utils/getDeclarationsIfGlobal.d.ts +0 -2
- package/lib/lib/utils/getModifyingReferences.d.ts +0 -3
- package/lib/lib/utils/hasSameTokens.d.ts +0 -1
- package/lib/lib/utils/isBuiltinArrayMethod.d.ts +0 -2
- package/lib/lib/utils/isFunction.d.ts +0 -1
- package/lib/lib/utils/isGlobalDeclaration.d.ts +0 -1
- package/lib/lib/utils/isGlobalDeclarationOfName.d.ts +0 -2
- package/lib/lib/utils/isGlobalVariable.d.ts +0 -1
- package/lib/lib/utils/isInlineArrayCreation.d.ts +0 -1
- package/lib/lib/utils/unwrapParentParenthesizedExpressions.d.ts +0 -1
- package/lib/lib/utils/unwrapParenthesizedExpression.d.ts +0 -1
- package/lib/prepareTypeScriptBasedLanguage.d.ts +0 -16
- package/lib/prepareTypeScriptBasedLanguage.js +0 -55
- package/lib/prepareTypeScriptFile.d.ts +0 -14
- package/lib/prepareTypeScriptFile.js +0 -18
- package/lib/utils/unwrapParenthesizedExpression.d.ts +0 -7
- package/lib/utils/unwrapParenthesizedExpression.js +0 -10
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { nullThrows } from "@flint.fyi/utils";
|
|
3
|
-
import * as path$1 from "node:path";
|
|
4
3
|
import * as tsutils from "ts-api-utils";
|
|
5
|
-
|
|
4
|
+
import * as path$1 from "node:path";
|
|
6
5
|
//#region src/collectReferencedFilePaths.ts
|
|
7
6
|
function collectReferencedFilePaths(program, sourceFile) {
|
|
8
7
|
const modulePaths = /* @__PURE__ */ new Set();
|
|
@@ -11,12 +10,12 @@ function collectReferencedFilePaths(program, sourceFile) {
|
|
|
11
10
|
if (resolved.resolvedModule?.isExternalLibraryImport === false) return path$1.relative(process.cwd(), resolved.resolvedModule.resolvedFileName);
|
|
12
11
|
}
|
|
13
12
|
function visit(node) {
|
|
14
|
-
let path
|
|
15
|
-
if (isImportDeclaration(node)) path
|
|
16
|
-
else if (isImportCall(node)) path
|
|
17
|
-
else if (isAwaitImportCall(node)) path
|
|
18
|
-
else if (isImportTypeNode(node)) path
|
|
19
|
-
const resolvedPath = path
|
|
13
|
+
let path;
|
|
14
|
+
if (isImportDeclaration(node)) path = node.moduleSpecifier.text;
|
|
15
|
+
else if (isImportCall(node)) path = node.arguments[0].text;
|
|
16
|
+
else if (isAwaitImportCall(node)) path = node.expression.arguments[0].text;
|
|
17
|
+
else if (isImportTypeNode(node)) path = node.argument.literal.text;
|
|
18
|
+
const resolvedPath = path && resolveModulePath(path);
|
|
20
19
|
if (resolvedPath) modulePaths.add(resolvedPath);
|
|
21
20
|
ts.forEachChild(node, visit);
|
|
22
21
|
}
|
|
@@ -27,7 +26,7 @@ function isAwaitImportCall(node) {
|
|
|
27
26
|
return ts.isAwaitExpression(node) && isImportCall(node.expression);
|
|
28
27
|
}
|
|
29
28
|
function isImportCall(node) {
|
|
30
|
-
return ts.isCallExpression(node) && tsutils.isImportExpression(node.expression) && node.arguments.length
|
|
29
|
+
return ts.isCallExpression(node) && tsutils.isImportExpression(node.expression) && !!node.arguments.length && ts.isStringLiteral(nullThrows(node.arguments[0], "First argument is expected to be present by prior length check"));
|
|
31
30
|
}
|
|
32
31
|
function isImportDeclaration(node) {
|
|
33
32
|
return ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier);
|
|
@@ -35,7 +34,7 @@ function isImportDeclaration(node) {
|
|
|
35
34
|
function isImportTypeNode(node) {
|
|
36
35
|
return ts.isImportTypeNode(node) && ts.isLiteralTypeNode(node.argument) && ts.isStringLiteral(node.argument.literal);
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
38
|
export { collectReferencedFilePaths };
|
|
39
|
+
|
|
41
40
|
//# sourceMappingURL=collectReferencedFilePaths.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LanguageReport, SourceFileWithLineMapAndFileName } from "@flint.fyi/core";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/convertTypeScriptDiagnosticToLanguageReport.d.ts
|
|
5
|
+
interface TSDiagnostic extends TSDiagnosticRelatedInformation {
|
|
6
|
+
relatedInformation?: TSDiagnosticRelatedInformation[];
|
|
7
|
+
}
|
|
8
|
+
interface TSDiagnosticRelatedInformation {
|
|
9
|
+
code: number;
|
|
10
|
+
file: SourceFileWithLineMapAndFileName | undefined;
|
|
11
|
+
length: number | undefined;
|
|
12
|
+
messageText: string | ts.DiagnosticMessageChain;
|
|
13
|
+
start: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
declare function convertTypeScriptDiagnosticToLanguageReport(diagnostic: TSDiagnostic): LanguageReport;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { convertTypeScriptDiagnosticToLanguageReport };
|
|
18
|
+
//# sourceMappingURL=convertTypeScriptDiagnosticToLanguageReport.d.ts.map
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { getColumnAndLineOfPosition, getPositionOfColumnAndLine } from "@flint.fyi/core";
|
|
2
|
-
import ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function convertTypeScriptDiagnosticToLanguageFileDiagnostic(diagnostic) {
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
//#region src/convertTypeScriptDiagnosticToLanguageReport.ts
|
|
4
|
+
function convertTypeScriptDiagnosticToLanguageReport(diagnostic) {
|
|
6
5
|
return {
|
|
7
6
|
code: `TS${diagnostic.code}`,
|
|
8
|
-
text:
|
|
7
|
+
text: formatReport(diagnostic),
|
|
8
|
+
...diagnostic.file !== void 0 && diagnostic.start !== void 0 && { range: {
|
|
9
|
+
begin: diagnostic.start,
|
|
10
|
+
end: diagnostic.start + (diagnostic.length ?? 0)
|
|
11
|
+
} }
|
|
9
12
|
};
|
|
10
13
|
}
|
|
11
14
|
function color(text, formatStyle) {
|
|
12
15
|
return formatStyle + text + resetEscapeSequence;
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function formatReport(diagnostic) {
|
|
15
18
|
let output = "";
|
|
16
19
|
if (diagnostic.file !== void 0) {
|
|
17
20
|
output += formatLocation(diagnostic.file, diagnostic.start);
|
|
@@ -34,7 +37,7 @@ function formatDiagnostic(diagnostic) {
|
|
|
34
37
|
output += formatCodeSpan(file, start, length, indent, COLOR.Cyan);
|
|
35
38
|
}
|
|
36
39
|
output += "\n";
|
|
37
|
-
output += indent + flattenDiagnosticMessageText(messageText, "\n");
|
|
40
|
+
output += indent + ts.flattenDiagnosticMessageText(messageText, "\n");
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
return output;
|
|
@@ -104,7 +107,7 @@ function formatLocation(file, start) {
|
|
|
104
107
|
output += color(`${column + 1}`, COLOR.Yellow);
|
|
105
108
|
return output;
|
|
106
109
|
}
|
|
107
|
-
|
|
108
110
|
//#endregion
|
|
109
|
-
export {
|
|
110
|
-
|
|
111
|
+
export { convertTypeScriptDiagnosticToLanguageReport };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=convertTypeScriptDiagnosticToLanguageReport.js.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { FlintAssertionError, assert } from "@flint.fyi/utils";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import timers from "node:timers";
|
|
6
|
+
//#region src/createTypeScriptServerHost.ts
|
|
7
|
+
function serverHostMethodNotImplemented(methodName) {
|
|
8
|
+
throw new FlintAssertionError(`ts.ServerHost's method '${methodName}' is not implemented.`);
|
|
9
|
+
}
|
|
10
|
+
const UV_DIRENT_TYPE = {
|
|
11
|
+
UV_DIRENT_DIR: 2,
|
|
12
|
+
UV_DIRENT_FILE: 1
|
|
13
|
+
};
|
|
14
|
+
const DirentCtor = fs.Dirent;
|
|
15
|
+
function createTypeScriptServerHost(host) {
|
|
16
|
+
return {
|
|
17
|
+
...ts.sys,
|
|
18
|
+
args: [],
|
|
19
|
+
clearImmediate: timers.clearImmediate,
|
|
20
|
+
clearTimeout: timers.clearTimeout,
|
|
21
|
+
createDirectory() {
|
|
22
|
+
serverHostMethodNotImplemented("createDirectory");
|
|
23
|
+
},
|
|
24
|
+
directoryExists(directoryPath) {
|
|
25
|
+
return host.fileTypeSync(path.resolve(host.getCurrentDirectory(), directoryPath)) === "directory";
|
|
26
|
+
},
|
|
27
|
+
exit() {
|
|
28
|
+
serverHostMethodNotImplemented("exit");
|
|
29
|
+
},
|
|
30
|
+
fileExists(filePath) {
|
|
31
|
+
return host.fileTypeSync(path.resolve(host.getCurrentDirectory(), filePath)) === "file";
|
|
32
|
+
},
|
|
33
|
+
readDirectory(directoryPath, extensions, exclude, include, depth) {
|
|
34
|
+
const originalCwd = process.cwd.bind(process);
|
|
35
|
+
process.cwd = () => host.getCurrentDirectory();
|
|
36
|
+
const originalReadDirSync = fs.readdirSync;
|
|
37
|
+
const patchedReaddirSync = (readPath, options) => {
|
|
38
|
+
assert(typeof options === "object" && options != null && Object.keys(options).length === 1 && options.withFileTypes === true, `ts.sys.readDirectory passed unexpected options to fs.readdirSync: ${JSON.stringify(options)}`);
|
|
39
|
+
assert(typeof readPath === "string", "ts.sys.readDirectory passed unexpected path to fs.readdirSync");
|
|
40
|
+
try {
|
|
41
|
+
fs.readdirSync = originalReadDirSync;
|
|
42
|
+
return host.readDirectorySync(path.resolve(host.getCurrentDirectory(), readPath)).map((dirent) => new DirentCtor(dirent.name, dirent.type === "file" ? UV_DIRENT_TYPE.UV_DIRENT_FILE : UV_DIRENT_TYPE.UV_DIRENT_DIR, readPath));
|
|
43
|
+
} finally {
|
|
44
|
+
fs.readdirSync = patchedReaddirSync;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
fs.readdirSync = patchedReaddirSync;
|
|
48
|
+
try {
|
|
49
|
+
return ts.sys.readDirectory(directoryPath, extensions, exclude, include, depth);
|
|
50
|
+
} finally {
|
|
51
|
+
process.cwd = originalCwd;
|
|
52
|
+
fs.readdirSync = originalReadDirSync;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
readFile(filePath) {
|
|
56
|
+
return host.readFileSync(path.resolve(host.getCurrentDirectory(), filePath));
|
|
57
|
+
},
|
|
58
|
+
setImmediate: timers.setImmediate,
|
|
59
|
+
setTimeout: timers.setTimeout,
|
|
60
|
+
watchDirectory(directoryPath, callback, recursive = false) {
|
|
61
|
+
const watcher = host.watchDirectorySync(path.resolve(host.getCurrentDirectory(), directoryPath), (filePathAbsolute) => {
|
|
62
|
+
callback(filePathAbsolute);
|
|
63
|
+
}, { recursive });
|
|
64
|
+
return { close() {
|
|
65
|
+
watcher[Symbol.dispose]();
|
|
66
|
+
} };
|
|
67
|
+
},
|
|
68
|
+
watchFile(filePath, callback) {
|
|
69
|
+
const watcher = host.watchFileSync(path.resolve(host.getCurrentDirectory(), filePath), (event) => {
|
|
70
|
+
let eventKind;
|
|
71
|
+
switch (event) {
|
|
72
|
+
case "changed":
|
|
73
|
+
eventKind = ts.FileWatcherEventKind.Changed;
|
|
74
|
+
break;
|
|
75
|
+
case "created":
|
|
76
|
+
eventKind = ts.FileWatcherEventKind.Created;
|
|
77
|
+
break;
|
|
78
|
+
case "deleted":
|
|
79
|
+
eventKind = ts.FileWatcherEventKind.Deleted;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
callback(filePath, eventKind);
|
|
83
|
+
});
|
|
84
|
+
return { close() {
|
|
85
|
+
watcher[Symbol.dispose]();
|
|
86
|
+
} };
|
|
87
|
+
},
|
|
88
|
+
write() {
|
|
89
|
+
serverHostMethodNotImplemented("write");
|
|
90
|
+
},
|
|
91
|
+
writeFile() {
|
|
92
|
+
serverHostMethodNotImplemented("writeFile");
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { createTypeScriptServerHost };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=createTypeScriptServerHost.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalizeRange } from "../normalizeRange.js";
|
|
2
2
|
import { DirectivesCollector } from "@flint.fyi/core";
|
|
3
|
+
import ts from "typescript";
|
|
3
4
|
import { nullThrows } from "@flint.fyi/utils";
|
|
4
5
|
import * as tsutils from "ts-api-utils";
|
|
5
|
-
|
|
6
6
|
//#region src/directives/parseDirectivesFromTypeScriptFile.ts
|
|
7
7
|
function extractDirectivesFromTypeScriptFile(sourceFile) {
|
|
8
8
|
const directives = [];
|
|
@@ -10,13 +10,14 @@ function extractDirectivesFromTypeScriptFile(sourceFile) {
|
|
|
10
10
|
const commentText = fullText.slice(sourceRange.pos, sourceRange.end);
|
|
11
11
|
const match = /^\/\/\s*flint-(\S+)(?:\s+(.+))?/.exec(commentText);
|
|
12
12
|
if (!match) return;
|
|
13
|
-
|
|
13
|
+
let range = normalizeRange({
|
|
14
14
|
begin: sourceRange.pos,
|
|
15
15
|
end: sourceRange.end
|
|
16
16
|
}, sourceFile);
|
|
17
17
|
const matches = match.slice(1);
|
|
18
18
|
const type = nullThrows(matches[0], "First match is expected to be present by the regex match");
|
|
19
19
|
const selection = matches[1] ?? "";
|
|
20
|
+
if (type === "disable-next-line") range = extendRangeToNextCodeLine(sourceFile, range);
|
|
20
21
|
directives.push({
|
|
21
22
|
range,
|
|
22
23
|
selection,
|
|
@@ -30,7 +31,36 @@ function parseDirectivesFromTypeScriptFile(sourceFile) {
|
|
|
30
31
|
for (const { range, selection, type } of extractDirectivesFromTypeScriptFile(sourceFile)) collector.add(range, selection, type);
|
|
31
32
|
return collector.collect();
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
function computeNextCodeLine(sourceFile, directiveLine) {
|
|
35
|
+
const lineStarts = sourceFile.getLineStarts();
|
|
36
|
+
const nextLineStart = lineStarts[directiveLine + 1];
|
|
37
|
+
if (nextLineStart === void 0) return;
|
|
38
|
+
const scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.languageVariant, sourceFile.text, void 0, nextLineStart);
|
|
39
|
+
if (scanner.scan() === ts.SyntaxKind.EndOfFileToken) return;
|
|
40
|
+
const tokenPos = scanner.getTokenStart();
|
|
41
|
+
const codeLine = sourceFile.getLineAndCharacterOfPosition(tokenPos).line;
|
|
42
|
+
for (let line = directiveLine + 1; line < codeLine; line++) {
|
|
43
|
+
const start = lineStarts[line];
|
|
44
|
+
const end = lineStarts[line + 1] ?? sourceFile.text.length;
|
|
45
|
+
if (sourceFile.text.slice(start, end).trim() === "") return;
|
|
46
|
+
}
|
|
47
|
+
return codeLine;
|
|
48
|
+
}
|
|
49
|
+
function extendRangeToNextCodeLine(sourceFile, range) {
|
|
50
|
+
const codeLine = computeNextCodeLine(sourceFile, range.begin.line);
|
|
51
|
+
if (codeLine === void 0 || codeLine <= range.end.line + 1) return range;
|
|
52
|
+
const endPosition = nullThrows(sourceFile.getLineStarts()[codeLine], "Code line start is expected to be present by the computed code line") - 1;
|
|
53
|
+
const { character, line } = sourceFile.getLineAndCharacterOfPosition(endPosition);
|
|
54
|
+
return {
|
|
55
|
+
...range,
|
|
56
|
+
end: {
|
|
57
|
+
column: character,
|
|
58
|
+
line,
|
|
59
|
+
raw: endPosition
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
34
63
|
//#endregion
|
|
35
64
|
export { extractDirectivesFromTypeScriptFile, parseDirectivesFromTypeScriptFile };
|
|
65
|
+
|
|
36
66
|
//# sourceMappingURL=parseDirectivesFromTypeScriptFile.js.map
|
package/lib/getTSNodeRange.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LanguageFile, LanguageFileCacheImpacts } from "@flint.fyi/core";
|
|
2
|
+
import type { TypeScriptFileServices } from "./language.ts";
|
|
3
|
+
export declare function getTypeScriptFileCacheImpacts(file: LanguageFile<TypeScriptFileServices>): LanguageFileCacheImpacts;
|
|
4
|
+
//# sourceMappingURL=getTypeScriptFileCacheImpacts.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { collectReferencedFilePaths } from "./collectReferencedFilePaths.js";
|
|
2
|
+
//#region src/getTypeScriptFileCacheImpacts.ts
|
|
3
|
+
function getTypeScriptFileCacheImpacts(file) {
|
|
4
|
+
return { dependencies: ["tsconfig.json", ...collectReferencedFilePaths(file.services.program, file.services.sourceFile)] };
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getTypeScriptFileCacheImpacts };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=getTypeScriptFileCacheImpacts.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { convertTypeScriptDiagnosticToLanguageReport } from "./convertTypeScriptDiagnosticToLanguageReport.js";
|
|
2
2
|
import { ast_d_exports } from "./types/ast.js";
|
|
3
|
-
import { TypeScriptNodesByName } from "./nodes.js";
|
|
4
|
-
import { Checker } from "./types/checker.js";
|
|
5
|
-
import { TypeScriptFileServices, typescriptLanguage } from "./language.js";
|
|
6
|
-
import { NodeSyntaxKinds, collectTypeScriptFileCacheImpacts } from "./createTypeScriptFileFromProgram.js";
|
|
7
3
|
import { ExtractedDirective, extractDirectivesFromTypeScriptFile } from "./directives/parseDirectivesFromTypeScriptFile.js";
|
|
8
4
|
import { getTSNodeRange } from "./getTSNodeRange.js";
|
|
9
|
-
import {
|
|
5
|
+
import { TypeScriptNodeVisitors, TypeScriptNodesByName } from "./nodes.js";
|
|
6
|
+
import { Checker } from "./types/checker.js";
|
|
7
|
+
import { NodeSyntaxKinds, TypeScriptFileServices, setVolarCreateFile, throwUnknownLanguageExtension, typescriptLanguage } from "./language.js";
|
|
8
|
+
import { createRuleTesterTSConfig } from "./utils/createRuleTesterTSConfig.js";
|
|
10
9
|
import { declarationIncludesGlobal } from "./utils/declarationIncludesGlobal.js";
|
|
11
10
|
import { getDeclarationsIfGlobal } from "./utils/getDeclarationsIfGlobal.js";
|
|
12
11
|
import { getModifyingReferences } from "./utils/getModifyingReferences.js";
|
|
@@ -17,6 +16,6 @@ import { isGlobalDeclaration } from "./utils/isGlobalDeclaration.js";
|
|
|
17
16
|
import { isGlobalDeclarationOfName } from "./utils/isGlobalDeclarationOfName.js";
|
|
18
17
|
import { isGlobalVariable } from "./utils/isGlobalVariable.js";
|
|
19
18
|
import { isInlineArrayCreation } from "./utils/isInlineArrayCreation.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
export { type ast_d_exports as AST, type Checker, type ExtractedDirective, NodeSyntaxKinds,
|
|
19
|
+
import { unwrapParenthesizedNode } from "./utils/unwrapParenthesizedNode.js";
|
|
20
|
+
import { unwrapParentParenthesizedExpressions } from "./utils/unwrapParentParenthesizedExpressions.js";
|
|
21
|
+
export { type ast_d_exports as AST, type Checker, type ExtractedDirective, NodeSyntaxKinds, TypeScriptFileServices, TypeScriptNodeVisitors, type TypeScriptNodesByName, convertTypeScriptDiagnosticToLanguageReport, createRuleTesterTSConfig, declarationIncludesGlobal, extractDirectivesFromTypeScriptFile, getDeclarationsIfGlobal, getModifyingReferences, getTSNodeRange, hasSameTokens, isBuiltinArrayMethod, isFunction, isGlobalDeclaration, isGlobalDeclarationOfName, isGlobalVariable, isInlineArrayCreation, setVolarCreateFile, throwUnknownLanguageExtension, typescriptLanguage, unwrapParentParenthesizedExpressions, unwrapParenthesizedNode };
|
package/lib/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NodeSyntaxKinds, collectTypeScriptFileCacheImpacts } from "./createTypeScriptFileFromProgram.js";
|
|
1
|
+
import { convertTypeScriptDiagnosticToLanguageReport } from "./convertTypeScriptDiagnosticToLanguageReport.js";
|
|
3
2
|
import { extractDirectivesFromTypeScriptFile } from "./directives/parseDirectivesFromTypeScriptFile.js";
|
|
4
3
|
import { getTSNodeRange } from "./getTSNodeRange.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { NodeSyntaxKinds, setVolarCreateFile, throwUnknownLanguageExtension, typescriptLanguage } from "./language.js";
|
|
5
|
+
import { createRuleTesterTSConfig } from "./utils/createRuleTesterTSConfig.js";
|
|
7
6
|
import { declarationIncludesGlobal } from "./utils/declarationIncludesGlobal.js";
|
|
8
7
|
import { getDeclarationsIfGlobal } from "./utils/getDeclarationsIfGlobal.js";
|
|
9
8
|
import { getModifyingReferences } from "./utils/getModifyingReferences.js";
|
|
10
|
-
import {
|
|
9
|
+
import { unwrapParenthesizedNode } from "./utils/unwrapParenthesizedNode.js";
|
|
11
10
|
import { hasSameTokens } from "./utils/hasSameTokens.js";
|
|
12
11
|
import { isBuiltinArrayMethod } from "./utils/isBuiltinArrayMethod.js";
|
|
13
12
|
import { isFunction } from "./utils/isFunction.js";
|
|
@@ -15,6 +14,5 @@ import { isGlobalDeclaration } from "./utils/isGlobalDeclaration.js";
|
|
|
15
14
|
import { isGlobalDeclarationOfName } from "./utils/isGlobalDeclarationOfName.js";
|
|
16
15
|
import { isGlobalVariable } from "./utils/isGlobalVariable.js";
|
|
17
16
|
import { isInlineArrayCreation } from "./utils/isInlineArrayCreation.js";
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
export { NodeSyntaxKinds, collectTypeScriptFileCacheImpacts, convertTypeScriptDiagnosticToLanguageFileDiagnostic, declarationIncludesGlobal, extractDirectivesFromTypeScriptFile, getDeclarationsIfGlobal, getModifyingReferences, getTSNodeRange, hasSameTokens, isBuiltinArrayMethod, isFunction, isGlobalDeclaration, isGlobalDeclarationOfName, isGlobalVariable, isInlineArrayCreation, prepareTypeScriptBasedLanguage, typescriptLanguage, unwrapParenthesizedExpression, unwrapParenthesizedExpressionsParent };
|
|
17
|
+
import { unwrapParentParenthesizedExpressions } from "./utils/unwrapParentParenthesizedExpressions.js";
|
|
18
|
+
export { NodeSyntaxKinds, convertTypeScriptDiagnosticToLanguageReport, createRuleTesterTSConfig, declarationIncludesGlobal, extractDirectivesFromTypeScriptFile, getDeclarationsIfGlobal, getModifyingReferences, getTSNodeRange, hasSameTokens, isBuiltinArrayMethod, isFunction, isGlobalDeclaration, isGlobalDeclarationOfName, isGlobalVariable, isInlineArrayCreation, setVolarCreateFile, throwUnknownLanguageExtension, typescriptLanguage, unwrapParentParenthesizedExpressions, unwrapParenthesizedNode };
|
package/lib/language.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SourceFile } from "./types/ast.js";
|
|
2
|
-
import { TypeScriptNodesByName } from "./nodes.js";
|
|
1
|
+
import { AnyKeyword, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction, AsExpression, AwaitExpression, BigIntKeyword, BigIntLiteral, BinaryExpression, BindingElement, Block, BooleanKeyword, BreakStatement, CallExpression, CallSignatureDeclaration, CaseBlock, CaseClause, CatchClause, ClassDeclaration, ClassExpression, ClassStaticBlockDeclaration, CommaListExpression, ComputedPropertyName, ConditionalExpression, ConditionalTypeNode, ConstructSignatureDeclaration, ConstructorDeclaration, ConstructorTypeNode, ContinueStatement, DebuggerStatement, Decorator, DefaultClause, DeleteExpression, DoStatement, ElementAccessExpression, EmptyStatement, EnumDeclaration, EnumMember, ExportAssignment, ExportDeclaration, ExportSpecifier, ExpressionStatement, ExpressionWithTypeArguments, ExternalModuleReference, FalseLiteral, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, FunctionTypeNode, GetAccessorDeclaration, HeritageClause, Identifier, IfStatement, ImportAttribute, ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, ImportExpression, ImportSpecifier, ImportTypeNode, IndexSignatureDeclaration, IndexedAccessTypeNode, InferTypeNode, InterfaceDeclaration, IntersectionTypeNode, IntrinsicKeyword, JSDocAllType, JSDocFunctionType, JSDocLink, JSDocLinkCode, JSDocLinkPlain, JSDocMemberName, JSDocNamepathType, JSDocNonNullableType, JSDocNullableType, JSDocOptionalType, JSDocParameterTag, JSDocPropertyTag, JSDocReturnTag, JSDocSignature, JSDocTemplateTag, JSDocText, JSDocTypeExpression, JSDocTypeLiteral, JSDocUnknownType, JSDocVariadicType, JsxAttribute, JsxAttributes, JsxClosingElement, JsxClosingFragment, JsxElement, JsxExpression, JsxFragment, JsxNamespacedName, JsxOpeningElement, JsxOpeningFragment, JsxSelfClosingElement, JsxSpreadAttribute, JsxText, LabeledStatement, LiteralTypeNode, MappedTypeNode, MetaProperty, MethodDeclaration, MethodSignature, MissingDeclaration, ModuleBlock, ModuleDeclaration, NamedExports, NamedImports, NamedTupleMember, NamespaceExport, NamespaceExportDeclaration, NamespaceImport, NeverKeyword, NewExpression, NoSubstitutionTemplateLiteral, NonNullExpression, NotEmittedStatement, NotEmittedTypeElement, NullLiteral, NumberKeyword, NumericLiteral, ObjectBindingPattern, ObjectKeyword, ObjectLiteralExpression, OmittedExpression, OptionalTypeNode, ParameterDeclaration, ParenthesizedExpression, ParenthesizedTypeNode, PartiallyEmittedExpression, PostfixUnaryExpression, PrefixUnaryExpression, PrivateIdentifier, PropertyAccessExpression, PropertyAssignment, PropertyDeclaration, PropertySignature, QualifiedName, RegularExpressionLiteral, RestTypeNode, ReturnStatement, SatisfiesExpression, SemicolonClassElement, SetAccessorDeclaration, ShorthandPropertyAssignment, SourceFile, SpreadAssignment, SpreadElement, StringKeyword, StringLiteral, SuperExpression, SwitchStatement, SymbolKeyword, SyntheticExpression, TaggedTemplateExpression, TemplateExpression, TemplateHead, TemplateLiteralTypeNode, TemplateLiteralTypeSpan, TemplateMiddle, TemplateSpan, TemplateTail, ThisExpression, ThisTypeNode, ThrowStatement, TrueLiteral, TryStatement, TupleTypeNode, TypeAliasDeclaration, TypeAssertion, TypeLiteralNode, TypeOfExpression, TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UndefinedKeyword, UnionTypeNode, UnknownKeyword, VariableDeclaration, VariableDeclarationList, VariableStatement, VoidExpression, VoidKeyword, WhileStatement, WithStatement, YieldExpression } from "./types/ast.js";
|
|
2
|
+
import { TypeScriptNodeVisitors, TypeScriptNodesByName } from "./nodes.js";
|
|
3
3
|
import { Checker } from "./types/checker.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _flint_fyi_core0 from "@flint.fyi/core";
|
|
5
|
+
import { AnyOptionalSchema, FileAboutData, InferredOutputObject, LanguageFile, LanguageFileDefinition, LanguageReports, RuleRuntime } from "@flint.fyi/core";
|
|
5
6
|
import * as ts$1 from "typescript";
|
|
6
7
|
|
|
7
8
|
//#region src/language.d.ts
|
|
@@ -10,7 +11,212 @@ interface TypeScriptFileServices {
|
|
|
10
11
|
sourceFile: SourceFile;
|
|
11
12
|
typeChecker: Checker;
|
|
12
13
|
}
|
|
13
|
-
declare const
|
|
14
|
+
declare const NodeSyntaxKinds: typeof ts$1.SyntaxKind;
|
|
15
|
+
type VolarCreateFile = (data: FileAboutData, program: ts$1.Program, sourceFile: SourceFile) => VolarLanguageFileDefinition;
|
|
16
|
+
type VolarLanguageFileDefinition = LanguageFileDefinition<object> & {
|
|
17
|
+
__volarServices: {
|
|
18
|
+
getLanguageReports(): LanguageReports;
|
|
19
|
+
runVisitors(file: LanguageFile<TypeScriptFileServices>, options: InferredOutputObject<AnyOptionalSchema | undefined>, runtime: RuleRuntime<TypeScriptNodeVisitors, TypeScriptFileServices>): void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
declare function setVolarCreateFile(create: VolarCreateFile): void;
|
|
23
|
+
declare const typescriptLanguage: _flint_fyi_core0.Language<_flint_fyi_core0.Simplify<TypeScriptNodesByName & {
|
|
24
|
+
"AnyKeyword:exit"?: AnyKeyword;
|
|
25
|
+
"ArrayBindingPattern:exit"?: ArrayBindingPattern;
|
|
26
|
+
"ArrayLiteralExpression:exit"?: ArrayLiteralExpression;
|
|
27
|
+
"ArrayType:exit"?: ArrayTypeNode;
|
|
28
|
+
"ArrowFunction:exit"?: ArrowFunction;
|
|
29
|
+
"AsExpression:exit"?: AsExpression;
|
|
30
|
+
"AwaitExpression:exit"?: AwaitExpression;
|
|
31
|
+
"BigIntKeyword:exit"?: BigIntKeyword;
|
|
32
|
+
"BigIntLiteral:exit"?: BigIntLiteral;
|
|
33
|
+
"BinaryExpression:exit"?: BinaryExpression;
|
|
34
|
+
"BindingElement:exit"?: BindingElement;
|
|
35
|
+
"Block:exit"?: Block;
|
|
36
|
+
"BooleanKeyword:exit"?: BooleanKeyword;
|
|
37
|
+
"BreakStatement:exit"?: BreakStatement;
|
|
38
|
+
"CallExpression:exit"?: CallExpression;
|
|
39
|
+
"CallSignature:exit"?: CallSignatureDeclaration;
|
|
40
|
+
"CaseBlock:exit"?: CaseBlock;
|
|
41
|
+
"CaseClause:exit"?: CaseClause;
|
|
42
|
+
"CatchClause:exit"?: CatchClause;
|
|
43
|
+
"ClassDeclaration:exit"?: ClassDeclaration;
|
|
44
|
+
"ClassExpression:exit"?: ClassExpression;
|
|
45
|
+
"ClassStaticBlockDeclaration:exit"?: ClassStaticBlockDeclaration;
|
|
46
|
+
"CommaListExpression:exit"?: CommaListExpression;
|
|
47
|
+
"ComputedPropertyName:exit"?: ComputedPropertyName;
|
|
48
|
+
"ConditionalExpression:exit"?: ConditionalExpression;
|
|
49
|
+
"ConditionalType:exit"?: ConditionalTypeNode;
|
|
50
|
+
"Constructor:exit"?: ConstructorDeclaration;
|
|
51
|
+
"ConstructorType:exit"?: ConstructorTypeNode;
|
|
52
|
+
"ConstructSignature:exit"?: ConstructSignatureDeclaration;
|
|
53
|
+
"ContinueStatement:exit"?: ContinueStatement;
|
|
54
|
+
"DebuggerStatement:exit"?: DebuggerStatement;
|
|
55
|
+
"Decorator:exit"?: Decorator;
|
|
56
|
+
"DefaultClause:exit"?: DefaultClause;
|
|
57
|
+
"DeleteExpression:exit"?: DeleteExpression;
|
|
58
|
+
"DoStatement:exit"?: DoStatement;
|
|
59
|
+
"ElementAccessExpression:exit"?: ElementAccessExpression;
|
|
60
|
+
"EmptyStatement:exit"?: EmptyStatement;
|
|
61
|
+
"EnumDeclaration:exit"?: EnumDeclaration;
|
|
62
|
+
"EnumMember:exit"?: EnumMember;
|
|
63
|
+
"ExportAssignment:exit"?: ExportAssignment;
|
|
64
|
+
"ExportDeclaration:exit"?: ExportDeclaration;
|
|
65
|
+
"ExportSpecifier:exit"?: ExportSpecifier;
|
|
66
|
+
"ExpressionStatement:exit"?: ExpressionStatement;
|
|
67
|
+
"ExpressionWithTypeArguments:exit"?: ExpressionWithTypeArguments;
|
|
68
|
+
"ExternalModuleReference:exit"?: ExternalModuleReference;
|
|
69
|
+
"FalseKeyword:exit"?: FalseLiteral;
|
|
70
|
+
"ForInStatement:exit"?: ForInStatement;
|
|
71
|
+
"ForOfStatement:exit"?: ForOfStatement;
|
|
72
|
+
"ForStatement:exit"?: ForStatement;
|
|
73
|
+
"FunctionDeclaration:exit"?: FunctionDeclaration;
|
|
74
|
+
"FunctionExpression:exit"?: FunctionExpression;
|
|
75
|
+
"FunctionType:exit"?: FunctionTypeNode;
|
|
76
|
+
"GetAccessor:exit"?: GetAccessorDeclaration;
|
|
77
|
+
"HeritageClause:exit"?: HeritageClause;
|
|
78
|
+
"Identifier:exit"?: Identifier;
|
|
79
|
+
"IfStatement:exit"?: IfStatement;
|
|
80
|
+
"ImportAttribute:exit"?: ImportAttribute;
|
|
81
|
+
"ImportAttributes:exit"?: ImportAttributes;
|
|
82
|
+
"ImportClause:exit"?: ImportClause;
|
|
83
|
+
"ImportDeclaration:exit"?: ImportDeclaration;
|
|
84
|
+
"ImportEqualsDeclaration:exit"?: ImportEqualsDeclaration;
|
|
85
|
+
"ImportKeyword:exit"?: ImportExpression;
|
|
86
|
+
"ImportSpecifier:exit"?: ImportSpecifier;
|
|
87
|
+
"ImportType:exit"?: ImportTypeNode;
|
|
88
|
+
"IndexedAccessType:exit"?: IndexedAccessTypeNode;
|
|
89
|
+
"IndexSignature:exit"?: IndexSignatureDeclaration;
|
|
90
|
+
"InferType:exit"?: InferTypeNode;
|
|
91
|
+
"InterfaceDeclaration:exit"?: InterfaceDeclaration;
|
|
92
|
+
"IntersectionType:exit"?: IntersectionTypeNode;
|
|
93
|
+
"IntrinsicKeyword:exit"?: IntrinsicKeyword;
|
|
94
|
+
"JSDocAllType:exit"?: JSDocAllType;
|
|
95
|
+
"JSDocFunctionType:exit"?: JSDocFunctionType;
|
|
96
|
+
"JSDocLink:exit"?: JSDocLink;
|
|
97
|
+
"JSDocLinkCode:exit"?: JSDocLinkCode;
|
|
98
|
+
"JSDocLinkPlain:exit"?: JSDocLinkPlain;
|
|
99
|
+
"JSDocMemberName:exit"?: JSDocMemberName;
|
|
100
|
+
"JSDocNamepathType:exit"?: JSDocNamepathType;
|
|
101
|
+
"JSDocNonNullableType:exit"?: JSDocNonNullableType;
|
|
102
|
+
"JSDocNullableType:exit"?: JSDocNullableType;
|
|
103
|
+
"JSDocOptionalType:exit"?: JSDocOptionalType;
|
|
104
|
+
"JSDocParameterTag:exit"?: JSDocParameterTag;
|
|
105
|
+
"JSDocPropertyTag:exit"?: JSDocPropertyTag;
|
|
106
|
+
"JSDocReturnTag:exit"?: JSDocReturnTag;
|
|
107
|
+
"JSDocSignature:exit"?: JSDocSignature;
|
|
108
|
+
"JSDocTemplateTag:exit"?: JSDocTemplateTag;
|
|
109
|
+
"JSDocText:exit"?: JSDocText;
|
|
110
|
+
"JSDocTypeExpression:exit"?: JSDocTypeExpression;
|
|
111
|
+
"JSDocTypeLiteral:exit"?: JSDocTypeLiteral;
|
|
112
|
+
"JSDocUnknownType:exit"?: JSDocUnknownType;
|
|
113
|
+
"JSDocVariadicType:exit"?: JSDocVariadicType;
|
|
114
|
+
"JsxAttribute:exit"?: JsxAttribute;
|
|
115
|
+
"JsxAttributes:exit"?: JsxAttributes;
|
|
116
|
+
"JsxClosingElement:exit"?: JsxClosingElement;
|
|
117
|
+
"JsxClosingFragment:exit"?: JsxClosingFragment;
|
|
118
|
+
"JsxElement:exit"?: JsxElement;
|
|
119
|
+
"JsxExpression:exit"?: JsxExpression;
|
|
120
|
+
"JsxFragment:exit"?: JsxFragment;
|
|
121
|
+
"JsxNamespacedName:exit"?: JsxNamespacedName;
|
|
122
|
+
"JsxOpeningElement:exit"?: JsxOpeningElement;
|
|
123
|
+
"JsxOpeningFragment:exit"?: JsxOpeningFragment;
|
|
124
|
+
"JsxSelfClosingElement:exit"?: JsxSelfClosingElement;
|
|
125
|
+
"JsxSpreadAttribute:exit"?: JsxSpreadAttribute;
|
|
126
|
+
"JsxText:exit"?: JsxText;
|
|
127
|
+
"LabeledStatement:exit"?: LabeledStatement;
|
|
128
|
+
"LiteralType:exit"?: LiteralTypeNode;
|
|
129
|
+
"MappedType:exit"?: MappedTypeNode;
|
|
130
|
+
"MetaProperty:exit"?: MetaProperty;
|
|
131
|
+
"MethodDeclaration:exit"?: MethodDeclaration;
|
|
132
|
+
"MethodSignature:exit"?: MethodSignature;
|
|
133
|
+
"MissingDeclaration:exit"?: MissingDeclaration;
|
|
134
|
+
"ModuleBlock:exit"?: ModuleBlock;
|
|
135
|
+
"ModuleDeclaration:exit"?: ModuleDeclaration;
|
|
136
|
+
"NamedExports:exit"?: NamedExports;
|
|
137
|
+
"NamedImports:exit"?: NamedImports;
|
|
138
|
+
"NamedTupleMember:exit"?: NamedTupleMember;
|
|
139
|
+
"NamespaceExport:exit"?: NamespaceExport;
|
|
140
|
+
"NamespaceExportDeclaration:exit"?: NamespaceExportDeclaration;
|
|
141
|
+
"NamespaceImport:exit"?: NamespaceImport;
|
|
142
|
+
"NeverKeyword:exit"?: NeverKeyword;
|
|
143
|
+
"NewExpression:exit"?: NewExpression;
|
|
144
|
+
"NonNullExpression:exit"?: NonNullExpression;
|
|
145
|
+
"NoSubstitutionTemplateLiteral:exit"?: NoSubstitutionTemplateLiteral;
|
|
146
|
+
"NotEmittedStatement:exit"?: NotEmittedStatement;
|
|
147
|
+
"NotEmittedTypeElement:exit"?: NotEmittedTypeElement;
|
|
148
|
+
"NullKeyword:exit"?: NullLiteral;
|
|
149
|
+
"NumberKeyword:exit"?: NumberKeyword;
|
|
150
|
+
"NumericLiteral:exit"?: NumericLiteral;
|
|
151
|
+
"ObjectBindingPattern:exit"?: ObjectBindingPattern;
|
|
152
|
+
"ObjectKeyword:exit"?: ObjectKeyword;
|
|
153
|
+
"ObjectLiteralExpression:exit"?: ObjectLiteralExpression;
|
|
154
|
+
"OmittedExpression:exit"?: OmittedExpression;
|
|
155
|
+
"OptionalType:exit"?: OptionalTypeNode;
|
|
156
|
+
"Parameter:exit"?: ParameterDeclaration;
|
|
157
|
+
"ParenthesizedExpression:exit"?: ParenthesizedExpression;
|
|
158
|
+
"ParenthesizedType:exit"?: ParenthesizedTypeNode;
|
|
159
|
+
"PartiallyEmittedExpression:exit"?: PartiallyEmittedExpression;
|
|
160
|
+
"PostfixUnaryExpression:exit"?: PostfixUnaryExpression;
|
|
161
|
+
"PrefixUnaryExpression:exit"?: PrefixUnaryExpression;
|
|
162
|
+
"PrivateIdentifier:exit"?: PrivateIdentifier;
|
|
163
|
+
"PropertyAccessExpression:exit"?: PropertyAccessExpression;
|
|
164
|
+
"PropertyAssignment:exit"?: PropertyAssignment;
|
|
165
|
+
"PropertyDeclaration:exit"?: PropertyDeclaration;
|
|
166
|
+
"PropertySignature:exit"?: PropertySignature;
|
|
167
|
+
"QualifiedName:exit"?: QualifiedName;
|
|
168
|
+
"RegularExpressionLiteral:exit"?: RegularExpressionLiteral;
|
|
169
|
+
"RestType:exit"?: RestTypeNode;
|
|
170
|
+
"ReturnStatement:exit"?: ReturnStatement;
|
|
171
|
+
"SatisfiesExpression:exit"?: SatisfiesExpression;
|
|
172
|
+
"SemicolonClassElement:exit"?: SemicolonClassElement;
|
|
173
|
+
"SetAccessor:exit"?: SetAccessorDeclaration;
|
|
174
|
+
"ShorthandPropertyAssignment:exit"?: ShorthandPropertyAssignment;
|
|
175
|
+
"SourceFile:exit"?: SourceFile;
|
|
176
|
+
"SpreadAssignment:exit"?: SpreadAssignment;
|
|
177
|
+
"SpreadElement:exit"?: SpreadElement;
|
|
178
|
+
"StringKeyword:exit"?: StringKeyword;
|
|
179
|
+
"StringLiteral:exit"?: StringLiteral;
|
|
180
|
+
"SuperKeyword:exit"?: SuperExpression;
|
|
181
|
+
"SwitchStatement:exit"?: SwitchStatement;
|
|
182
|
+
"SymbolKeyword:exit"?: SymbolKeyword;
|
|
183
|
+
"SyntheticExpression:exit"?: SyntheticExpression;
|
|
184
|
+
"TaggedTemplateExpression:exit"?: TaggedTemplateExpression;
|
|
185
|
+
"TemplateExpression:exit"?: TemplateExpression;
|
|
186
|
+
"TemplateHead:exit"?: TemplateHead;
|
|
187
|
+
"TemplateLiteralType:exit"?: TemplateLiteralTypeNode;
|
|
188
|
+
"TemplateLiteralTypeSpan:exit"?: TemplateLiteralTypeSpan;
|
|
189
|
+
"TemplateMiddle:exit"?: TemplateMiddle;
|
|
190
|
+
"TemplateSpan:exit"?: TemplateSpan;
|
|
191
|
+
"TemplateTail:exit"?: TemplateTail;
|
|
192
|
+
"ThisKeyword:exit"?: ThisExpression;
|
|
193
|
+
"ThisType:exit"?: ThisTypeNode;
|
|
194
|
+
"ThrowStatement:exit"?: ThrowStatement;
|
|
195
|
+
"TrueKeyword:exit"?: TrueLiteral;
|
|
196
|
+
"TryStatement:exit"?: TryStatement;
|
|
197
|
+
"TupleType:exit"?: TupleTypeNode;
|
|
198
|
+
"TypeAliasDeclaration:exit"?: TypeAliasDeclaration;
|
|
199
|
+
"TypeAssertionExpression:exit"?: TypeAssertion;
|
|
200
|
+
"TypeLiteral:exit"?: TypeLiteralNode;
|
|
201
|
+
"TypeOfExpression:exit"?: TypeOfExpression;
|
|
202
|
+
"TypeOperator:exit"?: TypeOperatorNode;
|
|
203
|
+
"TypeParameter:exit"?: TypeParameterDeclaration;
|
|
204
|
+
"TypePredicate:exit"?: TypePredicateNode;
|
|
205
|
+
"TypeQuery:exit"?: TypeQueryNode;
|
|
206
|
+
"TypeReference:exit"?: TypeReferenceNode;
|
|
207
|
+
"UndefinedKeyword:exit"?: UndefinedKeyword;
|
|
208
|
+
"UnionType:exit"?: UnionTypeNode;
|
|
209
|
+
"UnknownKeyword:exit"?: UnknownKeyword;
|
|
210
|
+
"VariableDeclaration:exit"?: VariableDeclaration;
|
|
211
|
+
"VariableDeclarationList:exit"?: VariableDeclarationList;
|
|
212
|
+
"VariableStatement:exit"?: VariableStatement;
|
|
213
|
+
"VoidExpression:exit"?: VoidExpression;
|
|
214
|
+
"VoidKeyword:exit"?: VoidKeyword;
|
|
215
|
+
"WhileStatement:exit"?: WhileStatement;
|
|
216
|
+
"WithStatement:exit"?: WithStatement;
|
|
217
|
+
"YieldExpression:exit"?: YieldExpression;
|
|
218
|
+
}>, TypeScriptFileServices>;
|
|
219
|
+
declare function throwUnknownLanguageExtension(filename: string): never;
|
|
14
220
|
//#endregion
|
|
15
|
-
export { TypeScriptFileServices, typescriptLanguage };
|
|
221
|
+
export { NodeSyntaxKinds, TypeScriptFileServices, setVolarCreateFile, throwUnknownLanguageExtension, typescriptLanguage };
|
|
16
222
|
//# sourceMappingURL=language.d.ts.map
|