Skip to content

Commit b4fe221

Browse files
authored
Cherry-pick #56489 into release-5.3 (#56490)
1 parent f750eb3 commit b4fe221

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

Diff for: src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7404,7 +7404,7 @@ export interface CommandLineOptionBase {
74047404
isFilePath?: boolean; // True if option value is a path or fileName
74057405
shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'
74067406
description?: DiagnosticMessage; // The message describing what the command line switch does.
7407-
defaultValueDescription?: string | number | boolean | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
7407+
defaultValueDescription?: string | number | boolean | DiagnosticMessage | undefined; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
74087408
paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter
74097409
isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file
74107410
isCommandLineOnly?: boolean;

Diff for: src/server/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
347347
readonly realpath?: (path: string) => string;
348348

349349
/** @internal */
350-
hasInvalidatedResolutions: HasInvalidatedResolutions | undefined;
350+
hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined;
351351

352352
/** @internal */
353353
hasInvalidatedLibResolutions: HasInvalidatedLibResolutions | undefined;

Diff for: src/services/types.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
337337
*/
338338
readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
339339
realpath?(path: string): string;
340-
/** @internal */ createHash?(data: string): string;
340+
/** @internal */ createHash?: ((data: string) => string) | undefined;
341341

342342
/*
343343
* Unlike `realpath and `readDirectory`, `readFile` and `fileExists` are now _required_
@@ -390,9 +390,9 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
390390
* If provided along with custom resolveLibrary, used to determine if we should redo library resolutions
391391
* @internal
392392
*/
393-
hasInvalidatedLibResolutions?(libFileName: string): boolean;
393+
hasInvalidatedLibResolutions?: ((libFileName: string) => boolean) | undefined;
394394

395-
/** @internal */ hasInvalidatedResolutions?: HasInvalidatedResolutions;
395+
/** @internal */ hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined;
396396
/** @internal */ hasChangedAutomaticTypeDirectiveNames?: HasChangedAutomaticTypeDirectiveNames;
397397
/** @internal */ getGlobalTypingsCacheLocation?(): string | undefined;
398398
/** @internal */ getSymlinkCache?(files?: readonly SourceFile[]): SymlinkCache;
@@ -429,7 +429,7 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
429429
/** @internal */ onReleaseParsedCommandLine?(configFileName: string, oldResolvedRef: ResolvedProjectReference | undefined, optionOptions: CompilerOptions): void;
430430
/** @internal */ getIncompleteCompletionsCache?(): IncompleteCompletionsCache;
431431

432-
jsDocParsingMode?: JSDocParsingMode;
432+
jsDocParsingMode?: JSDocParsingMode | undefined;
433433
}
434434

435435
/** @internal */

Diff for: tests/baselines/reference/api/typescript.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10418,7 +10418,7 @@ declare namespace ts {
1041810418
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
1041910419
writeFile?(fileName: string, content: string): void;
1042010420
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
10421-
jsDocParsingMode?: JSDocParsingMode;
10421+
jsDocParsingMode?: JSDocParsingMode | undefined;
1042210422
}
1042310423
type WithMetadata<T> = T & {
1042410424
metadata?: unknown;

Diff for: tests/cases/compiler/APILibCheck.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// @noImplicitAny: true
33
// @strictNullChecks: true
44
// @lib: es2018
5+
// @exactOptionalPropertyTypes: true
56

67
// @filename: node_modules/typescript/package.json
78
{

0 commit comments

Comments
 (0)