@schematics/angular 14.0.0-next.1 → 14.0.0-next.12
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/app-shell/index.js +10 -10
- package/app-shell/schema.d.ts +3 -3
- package/app-shell/schema.json +3 -3
- package/application/index.js +4 -7
- package/application/schema.d.ts +1 -1
- package/application/schema.json +1 -1
- package/class/schema.json +1 -2
- package/collection.json +1 -4
- package/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +1 -3
- package/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +5 -4
- package/component/index.js +14 -15
- package/component/schema.d.ts +4 -0
- package/component/schema.json +6 -0
- package/directive/files/__name@dasherize@if-flat__/__name@dasherize__.directive.ts.template +2 -1
- package/directive/index.js +14 -19
- package/directive/schema.d.ts +4 -0
- package/directive/schema.json +6 -0
- package/e2e/e2e-long.md +1 -1
- package/e2e/index.js +7 -1
- package/e2e/schema.d.ts +1 -1
- package/e2e/schema.json +1 -1
- package/interface/schema.json +0 -1
- package/library/index.js +3 -6
- package/migrations/migration-collection.json +10 -0
- package/migrations/update-14/remove-default-project-option.d.ts +10 -0
- package/migrations/update-14/remove-default-project-option.js +17 -0
- package/migrations/update-14/replace-default-collection-option.d.ts +10 -0
- package/migrations/update-14/replace-default-collection-option.js +32 -0
- package/module/index.js +13 -17
- package/ng-new/index.js +1 -1
- package/package.json +4 -4
- package/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template +2 -1
- package/pipe/index.js +13 -18
- package/pipe/schema.d.ts +4 -0
- package/pipe/schema.json +6 -0
- package/service-worker/index.js +8 -8
- package/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +7 -2
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +29 -16
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +4866 -3030
- package/universal/index.js +14 -9
- package/universal/schema.d.ts +1 -1
- package/universal/schema.json +1 -1
- package/utility/ast-utils.js +31 -27
- package/utility/find-module.d.ts +1 -0
- package/utility/find-module.js +5 -10
- package/utility/generate-from-files.js +2 -3
- package/utility/json-file.js +1 -7
- package/utility/latest-versions/package.json +7 -7
- package/utility/ng-ast-utils.js +7 -11
- package/utility/parse-name.js +0 -1
- package/utility/test/index.js +5 -1
- package/utility/validation.js +1 -3
- package/utility/workspace-models.d.ts +8 -6
- package/utility/workspace.js +1 -5
- package/web-worker/index.js +2 -2
- package/workspace/files/README.md.template +1 -1
- package/workspace/files/package.json.template +1 -2
- package/workspace/index.js +1 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const core_1 = require("@angular-devkit/core");
|
|
11
|
+
const workspace_1 = require("../../utility/workspace");
|
|
12
|
+
/** Migration to replace 'defaultCollection' option in angular.json. */
|
|
13
|
+
function default_1() {
|
|
14
|
+
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
15
|
+
// workspace level
|
|
16
|
+
replaceDefaultCollection(workspace.extensions['cli']);
|
|
17
|
+
// Project level
|
|
18
|
+
for (const project of workspace.projects.values()) {
|
|
19
|
+
replaceDefaultCollection(project.extensions['cli']);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.default = default_1;
|
|
24
|
+
function replaceDefaultCollection(cliExtension) {
|
|
25
|
+
if (cliExtension && (0, core_1.isJsonObject)(cliExtension) && cliExtension['defaultCollection']) {
|
|
26
|
+
// If `schematicsCollection` defined `defaultCollection` is ignored hence no need to warn.
|
|
27
|
+
if (!cliExtension['schematicCollections']) {
|
|
28
|
+
cliExtension['schematicCollections'] = [cliExtension['defaultCollection']];
|
|
29
|
+
}
|
|
30
|
+
delete cliExtension['defaultCollection'];
|
|
31
|
+
}
|
|
32
|
+
}
|
package/module/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -37,8 +41,8 @@ const workspace_1 = require("../utility/workspace");
|
|
|
37
41
|
const schema_1 = require("./schema");
|
|
38
42
|
function buildRelativeModulePath(options, modulePath) {
|
|
39
43
|
const importModulePath = (0, core_1.normalize)(`/${options.path}/` +
|
|
40
|
-
(options.flat ? '' :
|
|
41
|
-
|
|
44
|
+
(options.flat ? '' : schematics_1.strings.dasherize(options.name) + '/') +
|
|
45
|
+
schematics_1.strings.dasherize(options.name) +
|
|
42
46
|
'.module');
|
|
43
47
|
return (0, find_module_1.buildRelativePath)(modulePath, importModulePath);
|
|
44
48
|
}
|
|
@@ -48,14 +52,10 @@ function addDeclarationToNgModule(options) {
|
|
|
48
52
|
return host;
|
|
49
53
|
}
|
|
50
54
|
const modulePath = options.module;
|
|
51
|
-
const
|
|
52
|
-
if (text === null) {
|
|
53
|
-
throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
|
|
54
|
-
}
|
|
55
|
-
const sourceText = text.toString();
|
|
55
|
+
const sourceText = host.readText(modulePath);
|
|
56
56
|
const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
|
|
57
57
|
const relativePath = buildRelativeModulePath(options, modulePath);
|
|
58
|
-
const changes = (0, ast_utils_1.addImportToModule)(source, modulePath,
|
|
58
|
+
const changes = (0, ast_utils_1.addImportToModule)(source, modulePath, schematics_1.strings.classify(`${options.name}Module`), relativePath);
|
|
59
59
|
const recorder = host.beginUpdate(modulePath);
|
|
60
60
|
for (const change of changes) {
|
|
61
61
|
if (change instanceof change_1.InsertChange) {
|
|
@@ -81,11 +81,7 @@ function addRouteDeclarationToNgModule(options, routingModulePath) {
|
|
|
81
81
|
else {
|
|
82
82
|
path = options.module;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
if (!text) {
|
|
86
|
-
throw new Error(`Couldn't find the module nor its routing module.`);
|
|
87
|
-
}
|
|
88
|
-
const sourceText = text.toString();
|
|
84
|
+
const sourceText = host.readText(path);
|
|
89
85
|
const addDeclaration = (0, ast_utils_1.addRouteDeclarationToModule)(ts.createSourceFile(path, sourceText, ts.ScriptTarget.Latest, true), path, buildRoute(options, options.module));
|
|
90
86
|
const recorder = host.beginUpdate(path);
|
|
91
87
|
recorder.insertLeft(addDeclaration.pos, addDeclaration.toAdd);
|
|
@@ -101,7 +97,7 @@ function getRoutingModulePath(host, modulePath) {
|
|
|
101
97
|
}
|
|
102
98
|
function buildRoute(options, modulePath) {
|
|
103
99
|
const relativeModulePath = buildRelativeModulePath(options, modulePath);
|
|
104
|
-
const moduleName = `${
|
|
100
|
+
const moduleName = `${schematics_1.strings.classify(options.name)}Module`;
|
|
105
101
|
const loadChildren = `() => import('${relativeModulePath}').then(m => m.${moduleName})`;
|
|
106
102
|
return `{ path: '${options.route}', loadChildren: ${loadChildren} }`;
|
|
107
103
|
}
|
|
@@ -127,7 +123,7 @@ function default_1(options) {
|
|
|
127
123
|
? (0, schematics_1.noop)()
|
|
128
124
|
: (0, schematics_1.filter)((path) => !path.endsWith('-routing.module.ts.template')),
|
|
129
125
|
(0, schematics_1.applyTemplates)({
|
|
130
|
-
...
|
|
126
|
+
...schematics_1.strings,
|
|
131
127
|
'if-flat': (s) => (options.flat ? '' : s),
|
|
132
128
|
lazyRoute: isLazyLoadedModuleGen,
|
|
133
129
|
lazyRouteWithoutRouteModule: isLazyLoadedModuleGen && !routingModulePath,
|
|
@@ -136,7 +132,7 @@ function default_1(options) {
|
|
|
136
132
|
}),
|
|
137
133
|
(0, schematics_1.move)(parsedPath.path),
|
|
138
134
|
]);
|
|
139
|
-
const moduleDasherized =
|
|
135
|
+
const moduleDasherized = schematics_1.strings.dasherize(options.name);
|
|
140
136
|
const modulePath = `${!options.flat ? moduleDasherized + '/' : ''}${moduleDasherized}.module.ts`;
|
|
141
137
|
const componentOptions = {
|
|
142
138
|
module: modulePath,
|
package/ng-new/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
|
12
12
|
function default_1(options) {
|
|
13
13
|
if (!options.directory) {
|
|
14
14
|
// If scoped project (i.e. "@foo/bar"), convert directory to "foo/bar".
|
|
15
|
-
options.directory = options.name.startsWith('@') ? options.name.
|
|
15
|
+
options.directory = options.name.startsWith('@') ? options.name.slice(1) : options.name;
|
|
16
16
|
}
|
|
17
17
|
const workspaceOptions = {
|
|
18
18
|
name: options.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.12",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"schematics": "./collection.json",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@angular-devkit/core": "14.0.0-next.
|
|
19
|
-
"@angular-devkit/schematics": "14.0.0-next.
|
|
18
|
+
"@angular-devkit/core": "14.0.0-next.12",
|
|
19
|
+
"@angular-devkit/schematics": "14.0.0-next.12",
|
|
20
20
|
"jsonc-parser": "3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/angular/angular-cli.git"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": "^
|
|
27
|
+
"node": "^14.15.0 || >=16.10.0",
|
|
28
28
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
29
29
|
"yarn": ">= 1.13.0"
|
|
30
30
|
},
|
package/pipe/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -26,7 +30,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
30
|
return result;
|
|
27
31
|
};
|
|
28
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const core_1 = require("@angular-devkit/core");
|
|
30
33
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
31
34
|
const ts = __importStar(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
32
35
|
const ast_utils_1 = require("../utility/ast-utils");
|
|
@@ -36,22 +39,18 @@ const parse_name_1 = require("../utility/parse-name");
|
|
|
36
39
|
const workspace_1 = require("../utility/workspace");
|
|
37
40
|
function addDeclarationToNgModule(options) {
|
|
38
41
|
return (host) => {
|
|
39
|
-
if (options.skipImport || !options.module) {
|
|
42
|
+
if (options.skipImport || options.standalone || !options.module) {
|
|
40
43
|
return host;
|
|
41
44
|
}
|
|
42
45
|
const modulePath = options.module;
|
|
43
|
-
const
|
|
44
|
-
if (text === null) {
|
|
45
|
-
throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
|
|
46
|
-
}
|
|
47
|
-
const sourceText = text.toString('utf-8');
|
|
46
|
+
const sourceText = host.readText(modulePath);
|
|
48
47
|
const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
|
|
49
48
|
const pipePath = `/${options.path}/` +
|
|
50
|
-
(options.flat ? '' :
|
|
51
|
-
|
|
49
|
+
(options.flat ? '' : schematics_1.strings.dasherize(options.name) + '/') +
|
|
50
|
+
schematics_1.strings.dasherize(options.name) +
|
|
52
51
|
'.pipe';
|
|
53
52
|
const relativePath = (0, find_module_1.buildRelativePath)(modulePath, pipePath);
|
|
54
|
-
const changes = (0, ast_utils_1.addDeclarationToModule)(source, modulePath,
|
|
53
|
+
const changes = (0, ast_utils_1.addDeclarationToModule)(source, modulePath, schematics_1.strings.classify(`${options.name}Pipe`), relativePath);
|
|
55
54
|
const recorder = host.beginUpdate(modulePath);
|
|
56
55
|
for (const change of changes) {
|
|
57
56
|
if (change instanceof change_1.InsertChange) {
|
|
@@ -60,14 +59,10 @@ function addDeclarationToNgModule(options) {
|
|
|
60
59
|
}
|
|
61
60
|
host.commitUpdate(recorder);
|
|
62
61
|
if (options.export) {
|
|
63
|
-
const
|
|
64
|
-
if (text === null) {
|
|
65
|
-
throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
|
|
66
|
-
}
|
|
67
|
-
const sourceText = text.toString('utf-8');
|
|
62
|
+
const sourceText = host.readText(modulePath);
|
|
68
63
|
const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
|
|
69
64
|
const exportRecorder = host.beginUpdate(modulePath);
|
|
70
|
-
const exportChanges = (0, ast_utils_1.addExportToModule)(source, modulePath,
|
|
65
|
+
const exportChanges = (0, ast_utils_1.addExportToModule)(source, modulePath, schematics_1.strings.classify(`${options.name}Pipe`), relativePath);
|
|
71
66
|
for (const change of exportChanges) {
|
|
72
67
|
if (change instanceof change_1.InsertChange) {
|
|
73
68
|
exportRecorder.insertLeft(change.pos, change.toAdd);
|
|
@@ -90,7 +85,7 @@ function default_1(options) {
|
|
|
90
85
|
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
91
86
|
options.skipTests ? (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts.template')) : (0, schematics_1.noop)(),
|
|
92
87
|
(0, schematics_1.applyTemplates)({
|
|
93
|
-
...
|
|
88
|
+
...schematics_1.strings,
|
|
94
89
|
'if-flat': (s) => (options.flat ? '' : s),
|
|
95
90
|
...options,
|
|
96
91
|
}),
|
package/pipe/schema.d.ts
CHANGED
package/pipe/schema.json
CHANGED
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
"description": "Do not import this pipe into the owning NgModule.",
|
|
46
46
|
"x-user-analytics": 18
|
|
47
47
|
},
|
|
48
|
+
"standalone": {
|
|
49
|
+
"description": "Whether the generated pipe is standalone.",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": false,
|
|
52
|
+
"x-user-analytics": 15
|
|
53
|
+
},
|
|
48
54
|
"module": {
|
|
49
55
|
"type": "string",
|
|
50
56
|
"description": "The declaring NgModule.",
|
package/service-worker/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -89,11 +93,11 @@ function updateAppModule(mainPath) {
|
|
|
89
93
|
host.commitUpdate(recorder);
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
|
-
// register SW in
|
|
96
|
+
// register SW in application module
|
|
93
97
|
const importText = core_1.tags.stripIndent `
|
|
94
98
|
ServiceWorkerModule.register('ngsw-worker.js', {
|
|
95
99
|
enabled: ${importModule}.production,
|
|
96
|
-
// Register the ServiceWorker as soon as the
|
|
100
|
+
// Register the ServiceWorker as soon as the application is stable
|
|
97
101
|
// or after 30 seconds (whichever comes first).
|
|
98
102
|
registrationStrategy: 'registerWhenStable:30000'
|
|
99
103
|
})
|
|
@@ -109,11 +113,7 @@ function updateAppModule(mainPath) {
|
|
|
109
113
|
};
|
|
110
114
|
}
|
|
111
115
|
function getTsSourceFile(host, path) {
|
|
112
|
-
const
|
|
113
|
-
if (!buffer) {
|
|
114
|
-
throw new schematics_1.SchematicsException(`Could not read file (${path}).`);
|
|
115
|
-
}
|
|
116
|
-
const content = buffer.toString();
|
|
116
|
+
const content = host.readText(path);
|
|
117
117
|
const source = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
|
|
118
118
|
return source;
|
|
119
119
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
load("//tools:defaults.bzl", "ts_library")
|
|
2
2
|
|
|
3
|
-
# files fetched on
|
|
4
|
-
# https://github.com/microsoft/TypeScript/releases/tag/v4.
|
|
3
|
+
# files fetched on 2022-03-10 from
|
|
4
|
+
# https://github.com/microsoft/TypeScript/releases/tag/v4.6.2
|
|
5
|
+
|
|
6
|
+
# Commands to download:
|
|
7
|
+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.6.2/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
|
|
8
|
+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.6.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
|
|
9
|
+
|
|
5
10
|
licenses(["notice"]) # Apache 2.0
|
|
6
11
|
|
|
7
12
|
exports_files([
|
|
@@ -14,7 +14,7 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
declare namespace ts {
|
|
17
|
-
const versionMajorMinor = "4.
|
|
17
|
+
const versionMajorMinor = "4.6";
|
|
18
18
|
/** The version of the TypeScript compiler release */
|
|
19
19
|
const version: string;
|
|
20
20
|
/**
|
|
@@ -572,7 +572,7 @@ declare namespace ts {
|
|
|
572
572
|
}
|
|
573
573
|
export interface JSDocContainer {
|
|
574
574
|
}
|
|
575
|
-
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
|
|
575
|
+
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | EndOfFileToken;
|
|
576
576
|
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
|
|
577
577
|
export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
|
|
578
578
|
export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
|
|
@@ -897,7 +897,7 @@ declare namespace ts {
|
|
|
897
897
|
export interface TypePredicateNode extends TypeNode {
|
|
898
898
|
readonly kind: SyntaxKind.TypePredicate;
|
|
899
899
|
readonly parent: SignatureDeclaration | JSDocTypeExpression;
|
|
900
|
-
readonly assertsModifier?:
|
|
900
|
+
readonly assertsModifier?: AssertsKeyword;
|
|
901
901
|
readonly parameterName: Identifier | ThisTypeNode;
|
|
902
902
|
readonly type?: TypeNode;
|
|
903
903
|
}
|
|
@@ -968,7 +968,7 @@ declare namespace ts {
|
|
|
968
968
|
}
|
|
969
969
|
export interface MappedTypeNode extends TypeNode, Declaration {
|
|
970
970
|
readonly kind: SyntaxKind.MappedType;
|
|
971
|
-
readonly readonlyToken?:
|
|
971
|
+
readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken;
|
|
972
972
|
readonly typeParameter: TypeParameterDeclaration;
|
|
973
973
|
readonly nameType?: TypeNode;
|
|
974
974
|
readonly questionToken?: QuestionToken | PlusToken | MinusToken;
|
|
@@ -1465,7 +1465,7 @@ declare namespace ts {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
export interface ForOfStatement extends IterationStatement {
|
|
1467
1467
|
readonly kind: SyntaxKind.ForOfStatement;
|
|
1468
|
-
readonly awaitModifier?:
|
|
1468
|
+
readonly awaitModifier?: AwaitKeyword;
|
|
1469
1469
|
readonly initializer: ForInitializer;
|
|
1470
1470
|
readonly expression: Expression;
|
|
1471
1471
|
}
|
|
@@ -1652,7 +1652,7 @@ declare namespace ts {
|
|
|
1652
1652
|
readonly kind: SyntaxKind.AssertEntry;
|
|
1653
1653
|
readonly parent: AssertClause;
|
|
1654
1654
|
readonly name: AssertionKey;
|
|
1655
|
-
readonly value:
|
|
1655
|
+
readonly value: Expression;
|
|
1656
1656
|
}
|
|
1657
1657
|
export interface AssertClause extends Node {
|
|
1658
1658
|
readonly kind: SyntaxKind.AssertClause;
|
|
@@ -1702,7 +1702,7 @@ declare namespace ts {
|
|
|
1702
1702
|
readonly name: Identifier;
|
|
1703
1703
|
readonly isTypeOnly: boolean;
|
|
1704
1704
|
}
|
|
1705
|
-
export interface ExportSpecifier extends NamedDeclaration {
|
|
1705
|
+
export interface ExportSpecifier extends NamedDeclaration, JSDocContainer {
|
|
1706
1706
|
readonly kind: SyntaxKind.ExportSpecifier;
|
|
1707
1707
|
readonly parent: NamedExports;
|
|
1708
1708
|
readonly isTypeOnly: boolean;
|
|
@@ -1720,19 +1720,23 @@ declare namespace ts {
|
|
|
1720
1720
|
readonly parent: ImportClause & {
|
|
1721
1721
|
readonly isTypeOnly: true;
|
|
1722
1722
|
};
|
|
1723
|
-
} | ImportSpecifier & {
|
|
1723
|
+
} | ImportSpecifier & ({
|
|
1724
|
+
readonly isTypeOnly: true;
|
|
1725
|
+
} | {
|
|
1724
1726
|
readonly parent: NamedImports & {
|
|
1725
1727
|
readonly parent: ImportClause & {
|
|
1726
1728
|
readonly isTypeOnly: true;
|
|
1727
1729
|
};
|
|
1728
1730
|
};
|
|
1729
|
-
} | ExportSpecifier & {
|
|
1731
|
+
}) | ExportSpecifier & ({
|
|
1732
|
+
readonly isTypeOnly: true;
|
|
1733
|
+
} | {
|
|
1730
1734
|
readonly parent: NamedExports & {
|
|
1731
1735
|
readonly parent: ExportDeclaration & {
|
|
1732
1736
|
readonly isTypeOnly: true;
|
|
1733
1737
|
};
|
|
1734
1738
|
};
|
|
1735
|
-
};
|
|
1739
|
+
});
|
|
1736
1740
|
/**
|
|
1737
1741
|
* This is either an `export =` or an `export default` declaration.
|
|
1738
1742
|
* Unless `isExportEquals` is set, this node was parsed as an `export default`.
|
|
@@ -3078,6 +3082,7 @@ declare namespace ts {
|
|
|
3078
3082
|
ES2019 = 6,
|
|
3079
3083
|
ES2020 = 7,
|
|
3080
3084
|
ES2021 = 8,
|
|
3085
|
+
ES2022 = 9,
|
|
3081
3086
|
ESNext = 99,
|
|
3082
3087
|
JSON = 100,
|
|
3083
3088
|
Latest = 99
|
|
@@ -3343,7 +3348,7 @@ declare namespace ts {
|
|
|
3343
3348
|
createTrue(): TrueLiteral;
|
|
3344
3349
|
createFalse(): FalseLiteral;
|
|
3345
3350
|
createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
|
|
3346
|
-
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
|
|
3351
|
+
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
|
|
3347
3352
|
createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
|
|
3348
3353
|
updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
|
|
3349
3354
|
createComputedPropertyName(expression: Expression): ComputedPropertyName;
|
|
@@ -3575,8 +3580,8 @@ declare namespace ts {
|
|
|
3575
3580
|
updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
|
|
3576
3581
|
createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
|
|
3577
3582
|
updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
|
|
3578
|
-
createAssertEntry(name: AssertionKey, value:
|
|
3579
|
-
updateAssertEntry(node: AssertEntry, name: AssertionKey, value:
|
|
3583
|
+
createAssertEntry(name: AssertionKey, value: Expression): AssertEntry;
|
|
3584
|
+
updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry;
|
|
3580
3585
|
createNamespaceImport(name: Identifier): NamespaceImport;
|
|
3581
3586
|
updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
|
|
3582
3587
|
createNamespaceExport(name: Identifier): NamespaceExport;
|
|
@@ -5351,7 +5356,11 @@ declare namespace ts {
|
|
|
5351
5356
|
traceResolution?: boolean;
|
|
5352
5357
|
[option: string]: CompilerOptionsValue | undefined;
|
|
5353
5358
|
}
|
|
5354
|
-
type ReportEmitErrorSummary = (errorCount: number) => void;
|
|
5359
|
+
type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
|
|
5360
|
+
interface ReportFileInError {
|
|
5361
|
+
fileName: string;
|
|
5362
|
+
line: number;
|
|
5363
|
+
}
|
|
5355
5364
|
interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
|
|
5356
5365
|
createDirectory?(path: string): void;
|
|
5357
5366
|
/**
|
|
@@ -5559,6 +5568,7 @@ declare namespace ts {
|
|
|
5559
5568
|
isTypeParameter(): this is TypeParameter;
|
|
5560
5569
|
isClassOrInterface(): this is InterfaceType;
|
|
5561
5570
|
isClass(): this is InterfaceType;
|
|
5571
|
+
isIndexType(): this is IndexType;
|
|
5562
5572
|
}
|
|
5563
5573
|
interface TypeReference {
|
|
5564
5574
|
typeArguments?: readonly Type[];
|
|
@@ -5567,6 +5577,7 @@ declare namespace ts {
|
|
|
5567
5577
|
getDeclaration(): SignatureDeclaration;
|
|
5568
5578
|
getTypeParameters(): TypeParameter[] | undefined;
|
|
5569
5579
|
getParameters(): Symbol[];
|
|
5580
|
+
getTypeParameterAtPosition(pos: number): Type;
|
|
5570
5581
|
getReturnType(): Type;
|
|
5571
5582
|
getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
|
|
5572
5583
|
getJsDocTags(): JSDocTagInfo[];
|
|
@@ -5753,8 +5764,9 @@ declare namespace ts {
|
|
|
5753
5764
|
* @param position A zero-based index of the character where you want the entries
|
|
5754
5765
|
* @param options An object describing how the request was triggered and what kinds
|
|
5755
5766
|
* of code actions can be returned with the completions.
|
|
5767
|
+
* @param formattingSettings settings needed for calling formatting functions.
|
|
5756
5768
|
*/
|
|
5757
|
-
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
|
|
5769
|
+
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
|
|
5758
5770
|
/**
|
|
5759
5771
|
* Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
|
|
5760
5772
|
*
|
|
@@ -6586,6 +6598,7 @@ declare namespace ts {
|
|
|
6586
6598
|
externalModuleName = "external module name",
|
|
6587
6599
|
/**
|
|
6588
6600
|
* <JsxTagName attribute1 attribute2={0} />
|
|
6601
|
+
* @deprecated
|
|
6589
6602
|
*/
|
|
6590
6603
|
jsxAttribute = "JSX attribute",
|
|
6591
6604
|
/** String literal */
|
|
@@ -6855,7 +6868,7 @@ declare namespace ts {
|
|
|
6855
6868
|
/** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
|
|
6856
6869
|
const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
|
|
6857
6870
|
/** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
|
|
6858
|
-
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
|
|
6871
|
+
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[] | undefined;
|
|
6859
6872
|
/** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
|
|
6860
6873
|
const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
|
|
6861
6874
|
/** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */
|