mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Expose readConfigFile and parseConfigFile
This commit is contained in:
parent
e13dc1d354
commit
18d8fedbf5
1
Jakefile
1
Jakefile
@ -111,6 +111,7 @@ var definitionsRoots = [
|
||||
"compiler/parser.d.ts",
|
||||
"compiler/checker.d.ts",
|
||||
"compiler/program.d.ts",
|
||||
"compiler/commandLineParser.d.ts",
|
||||
"services/services.d.ts",
|
||||
];
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
/// <reference path="scanner.ts"/>
|
||||
|
||||
module ts {
|
||||
/* @internal */
|
||||
export var optionDeclarations: CommandLineOption[] = [
|
||||
{
|
||||
name: "charset",
|
||||
@ -153,7 +154,8 @@ module ts {
|
||||
description: Diagnostics.Watch_input_files,
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
/* @internal */
|
||||
export function parseCommandLine(commandLine: string[]): ParsedCommandLine {
|
||||
var options: CompilerOptions = {};
|
||||
var fileNames: string[] = [];
|
||||
@ -263,6 +265,10 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
export function readConfigFile(fileName: string): any {
|
||||
try {
|
||||
var text = sys.readFile(fileName);
|
||||
@ -272,6 +278,12 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine {
|
||||
var errors: Diagnostic[] = [];
|
||||
|
||||
|
||||
@ -1489,6 +1489,20 @@ declare module "typescript" {
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -4796,6 +4796,27 @@ declare module "typescript" {
|
||||
>CompilerHost : CompilerHost
|
||||
>Program : Program
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
>readConfigFile : (fileName: string) => any
|
||||
>fileName : string
|
||||
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
>parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine
|
||||
>json : any
|
||||
>basePath : string
|
||||
>ParsedCommandLine : ParsedCommandLine
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -1520,6 +1520,20 @@ declare module "typescript" {
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -4942,6 +4942,27 @@ declare module "typescript" {
|
||||
>CompilerHost : CompilerHost
|
||||
>Program : Program
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
>readConfigFile : (fileName: string) => any
|
||||
>fileName : string
|
||||
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
>parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine
|
||||
>json : any
|
||||
>basePath : string
|
||||
>ParsedCommandLine : ParsedCommandLine
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -1521,6 +1521,20 @@ declare module "typescript" {
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -4892,6 +4892,27 @@ declare module "typescript" {
|
||||
>CompilerHost : CompilerHost
|
||||
>Program : Program
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
>readConfigFile : (fileName: string) => any
|
||||
>fileName : string
|
||||
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
>parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine
|
||||
>json : any
|
||||
>basePath : string
|
||||
>ParsedCommandLine : ParsedCommandLine
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -1558,6 +1558,20 @@ declare module "typescript" {
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
@ -5065,6 +5065,27 @@ declare module "typescript" {
|
||||
>CompilerHost : CompilerHost
|
||||
>Program : Program
|
||||
}
|
||||
declare module "typescript" {
|
||||
/**
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
function readConfigFile(fileName: string): any;
|
||||
>readConfigFile : (fileName: string) => any
|
||||
>fileName : string
|
||||
|
||||
/**
|
||||
* Parse the contents of a config file (tsconfig.json).
|
||||
* @param json The contents of the config file to parse
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
function parseConfigFile(json: any, basePath?: string): ParsedCommandLine;
|
||||
>parseConfigFile : (json: any, basePath?: string) => ParsedCommandLine
|
||||
>json : any
|
||||
>basePath : string
|
||||
>ParsedCommandLine : ParsedCommandLine
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the language service API */
|
||||
let servicesVersion: string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user