Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ function convertConfigFileToObject(sourceFile: JsonSourceFile, errors: Push<Diag
/**
* Convert the json syntax tree into the json value
*/
export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any {
export function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]): any {
return convertToObjectWorker(sourceFile, sourceFile.statements[0]?.expression, errors, /*returnValue*/ true, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);
}

Expand Down Expand Up @@ -3177,7 +3177,7 @@ function parseConfig(
basePath: string,
configFileName: string | undefined,
resolutionStack: string[],
errors: Push<Diagnostic>,
errors: Diagnostic[],
extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>
): ParsedTsconfig {
basePath = normalizeSlashes(basePath);
Expand Down Expand Up @@ -3432,7 +3432,7 @@ function getExtendedConfig(
extendedConfigPath: string,
host: ParseConfigHost,
resolutionStack: string[],
errors: Push<Diagnostic>,
errors: Diagnostic[],
extendedConfigCache: Map<string, ExtendedConfigCacheEntry> | undefined,
result: ExtendsResult
): ParsedTsconfig | undefined {
Expand Down
8 changes: 6 additions & 2 deletions src/compiler/corePublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ export interface Collection<K> extends ReadonlyCollection<K> {
clear(): void;
}

/** Array that is only intended to be pushed to, never read. */
/**
* Array that is only intended to be pushed to, never read.
*
* @internal
*/
export interface Push<T> {
push(...values: T[]): void;
/** @internal */ readonly length: number;
readonly length: number;
}

/** @internal */
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/utilitiesPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ export const supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "
export function validateLocaleAndSetLanguage(
locale: string,
sys: { getExecutingFilePath(): string, resolvePath(path: string): string, fileExists(fileName: string): boolean, readFile(fileName: string): string | undefined },
errors?: Push<Diagnostic>) {
errors?: Diagnostic[]) {
const lowerCaseLocale = locale.toLowerCase();
const matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(lowerCaseLocale);

Expand Down
8 changes: 2 additions & 6 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3966,10 +3966,6 @@ declare namespace ts {
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
/** Array that is only intended to be pushed to, never read. */
interface Push<T> {
push(...values: T[]): void;
}
type Path = string & {
__pathBrand: any;
};
Expand Down Expand Up @@ -8558,7 +8554,7 @@ declare namespace ts {
resolvePath(path: string): string;
fileExists(fileName: string): boolean;
readFile(fileName: string): string | undefined;
}, errors?: Push<Diagnostic>): void;
}, errors?: Diagnostic[]): void;
function getOriginalNode(node: Node): Node;
function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
function getOriginalNode(node: Node | undefined): Node | undefined;
Expand Down Expand Up @@ -9138,7 +9134,7 @@ declare namespace ts {
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
Expand Down
8 changes: 2 additions & 6 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ declare namespace ts {
interface SortedArray<T> extends Array<T> {
" __sortedArrayBrand": any;
}
/** Array that is only intended to be pushed to, never read. */
interface Push<T> {
push(...values: T[]): void;
}
type Path = string & {
__pathBrand: any;
};
Expand Down Expand Up @@ -4623,7 +4619,7 @@ declare namespace ts {
resolvePath(path: string): string;
fileExists(fileName: string): boolean;
readFile(fileName: string): string | undefined;
}, errors?: Push<Diagnostic>): void;
}, errors?: Diagnostic[]): void;
function getOriginalNode(node: Node): Node;
function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
function getOriginalNode(node: Node | undefined): Node | undefined;
Expand Down Expand Up @@ -5203,7 +5199,7 @@ declare namespace ts {
/**
* Convert the json syntax tree into the json value
*/
function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any;
function convertToObject(sourceFile: JsonSourceFile, errors: Diagnostic[]): any;
/**
* Parse the contents of a config file (tsconfig.json).
* @param json The contents of the config file to parse
Expand Down