@schematics/angular 14.0.0-rc.0 → 14.0.0-rc.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.
@@ -27,19 +27,16 @@
27
27
  },
28
28
  "main": {
29
29
  "type": "string",
30
- "format": "path",
31
30
  "description": "The name of the main entry-point file.",
32
31
  "default": "main.server.ts"
33
32
  },
34
33
  "appDir": {
35
34
  "type": "string",
36
- "format": "path",
37
35
  "description": "The name of the application directory.",
38
36
  "default": "app"
39
37
  },
40
38
  "rootModuleFileName": {
41
39
  "type": "string",
42
- "format": "path",
43
40
  "description": "The name of the root module file",
44
41
  "default": "app.server.module.ts"
45
42
  },
package/class/schema.json CHANGED
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the class, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
@@ -1,4 +1,4 @@
1
- import { Component, OnInit<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';<% if(standalone) {%>
1
+ import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%>Component, OnInit<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%> } from '@angular/core';<% if(standalone) {%>
2
2
  import { CommonModule } from '@angular/common';<% } %>
3
3
 
4
4
  @Component({<% if(!skipSelector) {%>
@@ -9,6 +9,9 @@
9
9
  "path": {
10
10
  "type": "string",
11
11
  "format": "path",
12
+ "$default": {
13
+ "$source": "workingDirectory"
14
+ },
12
15
  "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
13
16
  "visible": false
14
17
  },
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the interface that defines the directive, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
package/enum/schema.json CHANGED
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the enum definition, relative to the current workspace.",
22
25
  "visible": false
23
26
  },
package/guard/schema.json CHANGED
@@ -29,6 +29,9 @@
29
29
  "path": {
30
30
  "type": "string",
31
31
  "format": "path",
32
+ "$default": {
33
+ "$source": "workingDirectory"
34
+ },
32
35
  "description": "The path at which to create the interface that defines the guard, relative to the current workspace.",
33
36
  "visible": false
34
37
  },
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the interceptor, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the interface, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the NgModule, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "14.0.0-rc.0",
3
+ "version": "14.0.0-rc.3",
4
4
  "description": "Schematics specific to Angular",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "keywords": [
@@ -18,12 +18,13 @@
18
18
  "./utility": "./utility/index.js",
19
19
  "./utility/*": "./utility/*.js",
20
20
  "./migrations/migration-collection.json": "./migrations/migration-collection.json",
21
- "./*": "./*.js"
21
+ "./*": "./*.js",
22
+ "./private/components": "./private/components.js"
22
23
  },
23
24
  "schematics": "./collection.json",
24
25
  "dependencies": {
25
- "@angular-devkit/core": "14.0.0-rc.0",
26
- "@angular-devkit/schematics": "14.0.0-rc.0",
26
+ "@angular-devkit/core": "14.0.0-rc.3",
27
+ "@angular-devkit/schematics": "14.0.0-rc.3",
27
28
  "jsonc-parser": "3.0.0"
28
29
  },
29
30
  "repository": {
package/pipe/schema.json CHANGED
@@ -18,6 +18,9 @@
18
18
  "path": {
19
19
  "type": "string",
20
20
  "format": "path",
21
+ "$default": {
22
+ "$source": "workingDirectory"
23
+ },
21
24
  "description": "The path at which to create the pipe, relative to the workspace root.",
22
25
  "visible": false
23
26
  },
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export { addModuleImportToStandaloneBootstrap, findBootstrapApplicationCall, importsProvidersFrom, } from './standalone';
@@ -0,0 +1,14 @@
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
+ exports.importsProvidersFrom = exports.findBootstrapApplicationCall = exports.addModuleImportToStandaloneBootstrap = void 0;
11
+ var standalone_1 = require("./standalone");
12
+ Object.defineProperty(exports, "addModuleImportToStandaloneBootstrap", { enumerable: true, get: function () { return standalone_1.addModuleImportToStandaloneBootstrap; } });
13
+ Object.defineProperty(exports, "findBootstrapApplicationCall", { enumerable: true, get: function () { return standalone_1.findBootstrapApplicationCall; } });
14
+ Object.defineProperty(exports, "importsProvidersFrom", { enumerable: true, get: function () { return standalone_1.importsProvidersFrom; } });
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { Tree } from '@angular-devkit/schematics';
9
+ import ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
10
+ /**
11
+ * Checks whether the providers from a module are being imported in a `bootstrapApplication` call.
12
+ * @param tree File tree of the project.
13
+ * @param filePath Path of the file in which to check.
14
+ * @param className Class name of the module to search for.
15
+ */
16
+ export declare function importsProvidersFrom(tree: Tree, filePath: string, className: string): boolean;
17
+ /**
18
+ * Adds an `importProvidersFrom` call to the `bootstrapApplication` call.
19
+ * @param tree File tree of the project.
20
+ * @param filePath Path to the file that should be updated.
21
+ * @param moduleName Name of the module that should be imported.
22
+ * @param modulePath Path from which to import the module.
23
+ */
24
+ export declare function addModuleImportToStandaloneBootstrap(tree: Tree, filePath: string, moduleName: string, modulePath: string): void;
25
+ /** Finds the call to `bootstrapApplication` within a file. */
26
+ export declare function findBootstrapApplicationCall(sourceFile: ts.SourceFile): ts.CallExpression | null;
@@ -0,0 +1,193 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.findBootstrapApplicationCall = exports.addModuleImportToStandaloneBootstrap = exports.importsProvidersFrom = void 0;
14
+ const schematics_1 = require("@angular-devkit/schematics");
15
+ const typescript_1 = __importDefault(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
16
+ const ast_utils_1 = require("../utility/ast-utils");
17
+ const change_1 = require("../utility/change");
18
+ /**
19
+ * Checks whether the providers from a module are being imported in a `bootstrapApplication` call.
20
+ * @param tree File tree of the project.
21
+ * @param filePath Path of the file in which to check.
22
+ * @param className Class name of the module to search for.
23
+ */
24
+ function importsProvidersFrom(tree, filePath, className) {
25
+ const sourceFile = typescript_1.default.createSourceFile(filePath, tree.readText(filePath), typescript_1.default.ScriptTarget.Latest, true);
26
+ const bootstrapCall = findBootstrapApplicationCall(sourceFile);
27
+ const importProvidersFromCall = bootstrapCall ? findImportProvidersFromCall(bootstrapCall) : null;
28
+ return (!!importProvidersFromCall &&
29
+ importProvidersFromCall.arguments.some((arg) => typescript_1.default.isIdentifier(arg) && arg.text === className));
30
+ }
31
+ exports.importsProvidersFrom = importsProvidersFrom;
32
+ /**
33
+ * Adds an `importProvidersFrom` call to the `bootstrapApplication` call.
34
+ * @param tree File tree of the project.
35
+ * @param filePath Path to the file that should be updated.
36
+ * @param moduleName Name of the module that should be imported.
37
+ * @param modulePath Path from which to import the module.
38
+ */
39
+ function addModuleImportToStandaloneBootstrap(tree, filePath, moduleName, modulePath) {
40
+ const sourceFile = typescript_1.default.createSourceFile(filePath, tree.readText(filePath), typescript_1.default.ScriptTarget.Latest, true);
41
+ const bootstrapCall = findBootstrapApplicationCall(sourceFile);
42
+ if (!bootstrapCall) {
43
+ throw new schematics_1.SchematicsException(`Could not find bootstrapApplication call in ${filePath}`);
44
+ }
45
+ const recorder = tree.beginUpdate(filePath);
46
+ const importCall = findImportProvidersFromCall(bootstrapCall);
47
+ const printer = typescript_1.default.createPrinter();
48
+ const sourceText = sourceFile.getText();
49
+ // Add imports to the module being added and `importProvidersFrom`. We don't
50
+ // have to worry about duplicates, because `insertImport` handles them.
51
+ [
52
+ (0, ast_utils_1.insertImport)(sourceFile, sourceText, moduleName, modulePath),
53
+ (0, ast_utils_1.insertImport)(sourceFile, sourceText, 'importProvidersFrom', '@angular/core'),
54
+ ].forEach((change) => {
55
+ if (change instanceof change_1.InsertChange) {
56
+ recorder.insertLeft(change.pos, change.toAdd);
57
+ }
58
+ });
59
+ // If there is an `importProvidersFrom` call already, reuse it.
60
+ if (importCall) {
61
+ recorder.insertRight(importCall.arguments[importCall.arguments.length - 1].getEnd(), `, ${moduleName}`);
62
+ }
63
+ else if (bootstrapCall.arguments.length === 1) {
64
+ // Otherwise if there is no options parameter to `bootstrapApplication`,
65
+ // create an object literal with a `providers` array and the import.
66
+ const newCall = typescript_1.default.factory.updateCallExpression(bootstrapCall, bootstrapCall.expression, bootstrapCall.typeArguments, [
67
+ ...bootstrapCall.arguments,
68
+ typescript_1.default.factory.createObjectLiteralExpression([createProvidersAssignment(moduleName)], true),
69
+ ]);
70
+ recorder.remove(bootstrapCall.getStart(), bootstrapCall.getWidth());
71
+ recorder.insertRight(bootstrapCall.getStart(), printer.printNode(typescript_1.default.EmitHint.Unspecified, newCall, sourceFile));
72
+ }
73
+ else {
74
+ const providersLiteral = findProvidersLiteral(bootstrapCall);
75
+ if (providersLiteral) {
76
+ // If there's a `providers` array, add the import to it.
77
+ const newProvidersLiteral = typescript_1.default.factory.updateArrayLiteralExpression(providersLiteral, [
78
+ ...providersLiteral.elements,
79
+ createImportProvidersFromCall(moduleName),
80
+ ]);
81
+ recorder.remove(providersLiteral.getStart(), providersLiteral.getWidth());
82
+ recorder.insertRight(providersLiteral.getStart(), printer.printNode(typescript_1.default.EmitHint.Unspecified, newProvidersLiteral, sourceFile));
83
+ }
84
+ else {
85
+ // Otherwise add a `providers` array to the existing object literal.
86
+ const optionsLiteral = bootstrapCall.arguments[1];
87
+ const newOptionsLiteral = typescript_1.default.factory.updateObjectLiteralExpression(optionsLiteral, [
88
+ ...optionsLiteral.properties,
89
+ createProvidersAssignment(moduleName),
90
+ ]);
91
+ recorder.remove(optionsLiteral.getStart(), optionsLiteral.getWidth());
92
+ recorder.insertRight(optionsLiteral.getStart(), printer.printNode(typescript_1.default.EmitHint.Unspecified, newOptionsLiteral, sourceFile));
93
+ }
94
+ }
95
+ tree.commitUpdate(recorder);
96
+ }
97
+ exports.addModuleImportToStandaloneBootstrap = addModuleImportToStandaloneBootstrap;
98
+ /** Finds the call to `bootstrapApplication` within a file. */
99
+ function findBootstrapApplicationCall(sourceFile) {
100
+ const localName = findImportLocalName(sourceFile, 'bootstrapApplication', '@angular/platform-browser');
101
+ return localName ? findCall(sourceFile, localName) : null;
102
+ }
103
+ exports.findBootstrapApplicationCall = findBootstrapApplicationCall;
104
+ /** Find a call to `importProvidersFrom` within a `bootstrapApplication` call. */
105
+ function findImportProvidersFromCall(bootstrapCall) {
106
+ const providersLiteral = findProvidersLiteral(bootstrapCall);
107
+ const importProvidersName = findImportLocalName(bootstrapCall.getSourceFile(), 'importProvidersFrom', '@angular/core');
108
+ if (providersLiteral && importProvidersName) {
109
+ for (const element of providersLiteral.elements) {
110
+ // Look for an array element that calls the `importProvidersFrom` function.
111
+ if (typescript_1.default.isCallExpression(element) &&
112
+ typescript_1.default.isIdentifier(element.expression) &&
113
+ element.expression.text === importProvidersName) {
114
+ return element;
115
+ }
116
+ }
117
+ }
118
+ return null;
119
+ }
120
+ /** Finds the `providers` array literal within a `bootstrapApplication` call. */
121
+ function findProvidersLiteral(bootstrapCall) {
122
+ // The imports have to be in the second argument of
123
+ // the function which has to be an object literal.
124
+ if (bootstrapCall.arguments.length > 1 &&
125
+ typescript_1.default.isObjectLiteralExpression(bootstrapCall.arguments[1])) {
126
+ for (const prop of bootstrapCall.arguments[1].properties) {
127
+ if (typescript_1.default.isPropertyAssignment(prop) &&
128
+ typescript_1.default.isIdentifier(prop.name) &&
129
+ prop.name.text === 'providers' &&
130
+ typescript_1.default.isArrayLiteralExpression(prop.initializer)) {
131
+ return prop.initializer;
132
+ }
133
+ }
134
+ }
135
+ return null;
136
+ }
137
+ /**
138
+ * Finds the local name of an imported symbol. Could be the symbol name itself or its alias.
139
+ * @param sourceFile File within which to search for the import.
140
+ * @param name Actual name of the import, not its local alias.
141
+ * @param moduleName Name of the module from which the symbol is imported.
142
+ */
143
+ function findImportLocalName(sourceFile, name, moduleName) {
144
+ for (const node of sourceFile.statements) {
145
+ // Only look for top-level imports.
146
+ if (!typescript_1.default.isImportDeclaration(node) ||
147
+ !typescript_1.default.isStringLiteral(node.moduleSpecifier) ||
148
+ node.moduleSpecifier.text !== moduleName) {
149
+ continue;
150
+ }
151
+ // Filter out imports that don't have the right shape.
152
+ if (!node.importClause ||
153
+ !node.importClause.namedBindings ||
154
+ !typescript_1.default.isNamedImports(node.importClause.namedBindings)) {
155
+ continue;
156
+ }
157
+ // Look through the elements of the declaration for the specific import.
158
+ for (const element of node.importClause.namedBindings.elements) {
159
+ if ((element.propertyName || element.name).text === name) {
160
+ // The local name is always in `name`.
161
+ return element.name.text;
162
+ }
163
+ }
164
+ }
165
+ return null;
166
+ }
167
+ /**
168
+ * Finds a call to a function with a specific name.
169
+ * @param rootNode Node from which to start searching.
170
+ * @param name Name of the function to search for.
171
+ */
172
+ function findCall(rootNode, name) {
173
+ let result = null;
174
+ rootNode.forEachChild(function walk(node) {
175
+ if (typescript_1.default.isCallExpression(node) &&
176
+ typescript_1.default.isIdentifier(node.expression) &&
177
+ node.expression.text === name) {
178
+ result = node;
179
+ }
180
+ if (!result) {
181
+ node.forEachChild(walk);
182
+ }
183
+ });
184
+ return result;
185
+ }
186
+ /** Creates an `importProvidersFrom({{moduleName}})` call. */
187
+ function createImportProvidersFromCall(moduleName) {
188
+ return typescript_1.default.factory.createCallChain(typescript_1.default.factory.createIdentifier('importProvidersFrom'), undefined, undefined, [typescript_1.default.factory.createIdentifier(moduleName)]);
189
+ }
190
+ /** Creates a `providers: [importProvidersFrom({{moduleName}})]` property assignment. */
191
+ function createProvidersAssignment(moduleName) {
192
+ return typescript_1.default.factory.createPropertyAssignment('providers', typescript_1.default.factory.createArrayLiteralExpression([createImportProvidersFromCall(moduleName)]));
193
+ }
@@ -29,6 +29,9 @@
29
29
  "path": {
30
30
  "type": "string",
31
31
  "format": "path",
32
+ "$default": {
33
+ "$source": "workingDirectory"
34
+ },
32
35
  "description": "The path at which to create the interface that defines the resolver, relative to the current workspace.",
33
36
  "visible": false
34
37
  },
@@ -17,7 +17,9 @@
17
17
  },
18
18
  "path": {
19
19
  "type": "string",
20
- "format": "path",
20
+ "$default": {
21
+ "$source": "workingDirectory"
22
+ },
21
23
  "description": "The path at which to create the service, relative to the workspace root.",
22
24
  "visible": false
23
25
  },
@@ -1,11 +1,11 @@
1
1
  load("//tools:defaults.bzl", "ts_library")
2
2
 
3
- # files fetched on 2022-05-06 from
4
- # https://github.com/microsoft/TypeScript/releases/tag/v4.7-beta
3
+ # files fetched on 2022-05-25 from
4
+ # https://github.com/microsoft/TypeScript/releases/tag/v4.7.2
5
5
 
6
6
  # Commands to download:
7
- # curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.7-beta/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.7-beta/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
7
+ # curl https://raw.githubusercontent.com/microsoft/TypeScript/v4.7.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.7.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
9
9
 
10
10
  licenses(["notice"]) # Apache 2.0
11
11
 
@@ -2063,7 +2063,7 @@ declare namespace ts {
2063
2063
  hasNoDefaultLib: boolean;
2064
2064
  languageVersion: ScriptTarget;
2065
2065
  /**
2066
- * When `module` is `Node12` or `NodeNext`, this field controls whether the
2066
+ * When `module` is `Node16` or `NodeNext`, this field controls whether the
2067
2067
  * source file in question is an ESNext-output-format file, or a CommonJS-output-format
2068
2068
  * module. This is derived by the module resolver as it looks up the file, since
2069
2069
  * it is derived from either the file extension of the module, or the containing
@@ -2172,7 +2172,9 @@ declare namespace ts {
2172
2172
  export type ResolvedConfigFileName = string & {
2173
2173
  _isResolvedConfigFileName: never;
2174
2174
  };
2175
- export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void;
2175
+ export interface WriteFileCallbackData {
2176
+ }
2177
+ export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void;
2176
2178
  export class OperationCanceledException {
2177
2179
  }
2178
2180
  export interface CancellationToken {
@@ -2394,7 +2396,6 @@ declare namespace ts {
2394
2396
  UseAliasDefinedOutsideCurrentScope = 16384,
2395
2397
  UseSingleQuotesForStringLiteralType = 268435456,
2396
2398
  NoTypeReduction = 536870912,
2397
- NoUndefinedOptionalParameterType = 1073741824,
2398
2399
  AllowThisInObjectLiteral = 32768,
2399
2400
  AllowQualifiedNameInPlaceOfIdentifier = 65536,
2400
2401
  /** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
@@ -2892,7 +2893,7 @@ declare namespace ts {
2892
2893
  export enum ModuleResolutionKind {
2893
2894
  Classic = 1,
2894
2895
  NodeJs = 2,
2895
- Node12 = 3,
2896
+ Node16 = 3,
2896
2897
  NodeNext = 99
2897
2898
  }
2898
2899
  export enum ModuleDetectionKind {
@@ -2901,7 +2902,7 @@ declare namespace ts {
2901
2902
  */
2902
2903
  Legacy = 1,
2903
2904
  /**
2904
- * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+
2905
+ * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
2905
2906
  */
2906
2907
  Auto = 2,
2907
2908
  /**
@@ -3073,7 +3074,7 @@ declare namespace ts {
3073
3074
  ES2020 = 6,
3074
3075
  ES2022 = 7,
3075
3076
  ESNext = 99,
3076
- Node12 = 100,
3077
+ Node16 = 100,
3077
3078
  NodeNext = 199
3078
3079
  }
3079
3080
  export enum JsxEmit {
@@ -4817,7 +4818,7 @@ declare namespace ts {
4817
4818
  /**
4818
4819
  * Controls the format the file is detected as - this can be derived from only the path
4819
4820
  * and files on disk, but needs to be done with a module resolution cache in scope to be performant.
4820
- * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`.
4821
+ * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`.
4821
4822
  */
4822
4823
  impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
4823
4824
  /**
@@ -6434,7 +6435,18 @@ declare namespace ts {
6434
6435
  argumentIndex: number;
6435
6436
  argumentCount: number;
6436
6437
  }
6438
+ enum CompletionInfoFlags {
6439
+ None = 0,
6440
+ MayIncludeAutoImports = 1,
6441
+ IsImportStatementCompletion = 2,
6442
+ IsContinuation = 4,
6443
+ ResolvedModuleSpecifiers = 8,
6444
+ ResolvedModuleSpecifiersBeyondLimit = 16,
6445
+ MayIncludeMethodSnippets = 32
6446
+ }
6437
6447
  interface CompletionInfo {
6448
+ /** For performance telemetry. */
6449
+ flags?: CompletionInfoFlags;
6438
6450
  /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
6439
6451
  isGlobalCompletion: boolean;
6440
6452
  isMemberCompletion: boolean;
@@ -6810,7 +6822,7 @@ declare namespace ts {
6810
6822
  * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6811
6823
  * multiple copies of the same file for different compilation settings. A minimal
6812
6824
  * resolution cache is needed to fully define a source file's shape when
6813
- * the compilation settings include `module: node12`+, so providing a cache host
6825
+ * the compilation settings include `module: node16`+, so providing a cache host
6814
6826
  * object should be preferred. A common host is a language service `ConfiguredProject`.
6815
6827
  * @param scriptSnapshot Text of the file. Only used if the file was not found
6816
6828
  * in the registry and a new one was created.
@@ -6829,7 +6841,7 @@ declare namespace ts {
6829
6841
  * shape of a the resulting SourceFile. This allows the DocumentRegistry to store
6830
6842
  * multiple copies of the same file for different compilation settings. A minimal
6831
6843
  * resolution cache is needed to fully define a source file's shape when
6832
- * the compilation settings include `module: node12`+, so providing a cache host
6844
+ * the compilation settings include `module: node16`+, so providing a cache host
6833
6845
  * object should be preferred. A common host is a language service `ConfiguredProject`.
6834
6846
  * @param scriptSnapshot Text of the file.
6835
6847
  * @param version Current version of the file.