use TypeScript 2.1.5

pull/2748/head
Johannes Rieken 8 years ago
parent 8cbd548f8e
commit f5f4706596

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -10,7 +10,7 @@ import Emitter = monaco.Emitter;
import IEvent = monaco.IEvent;
import IDisposable = monaco.IDisposable;
declare var require:<T>(moduleId:[string], callback:(module:T)=>void)=>void;
declare var require: <T>(moduleId: [string], callback: (module: T) => void) => void;
// --- TypeScript configuration and defaults ---------
@ -29,7 +29,7 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.
this.setDiagnosticsOptions(diagnosticsOptions);
}
get onDidChange(): IEvent<monaco.languages.typescript.LanguageServiceDefaults>{
get onDidChange(): IEvent<monaco.languages.typescript.LanguageServiceDefaults> {
return this._onDidChange.event;
}
@ -99,34 +99,45 @@ enum ModuleKind {
AMD = 2,
UMD = 3,
System = 4,
ES6 = 5,
ES2015 = 5,
}
enum JsxEmit {
None = 0,
Preserve = 1,
React = 2,
}
enum NewLineKind {
CarriageReturnLineFeed = 0,
LineFeed = 1,
}
interface LineAndCharacter {
line: number;
character: number;
}
enum ScriptKind {
Unknown = 0,
JS = 1,
JSX = 2,
TS = 3,
TSX = 4,
}
enum ScriptTarget {
ES3 = 0,
ES5 = 1,
ES6 = 2,
ES2015 = 2,
Latest = 2,
ES2016 = 3,
ES2017 = 4,
ESNext = 5,
Latest = 5,
}
enum LanguageVariant {
Standard = 0,
JSX = 1,
}
enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2,
}
// --- END enums copied from typescript to prevent loading the entire typescriptServices ---
const typescriptDefaults = new LanguageServiceDefaultsImpl(
@ -139,20 +150,20 @@ const javascriptDefaults = new LanguageServiceDefaultsImpl(
function getTypeScriptWorker(): monaco.Promise<any> {
return new monaco.Promise((resolve, reject) => {
withMode((mode) => {
mode.getTypeScriptWorker()
.then(resolve, reject);
});
});
withMode((mode) => {
mode.getTypeScriptWorker()
.then(resolve, reject);
});
});
}
function getJavaScriptWorker(): monaco.Promise<any> {
return new monaco.Promise((resolve, reject) => {
withMode((mode) => {
mode.getJavaScriptWorker()
.then(resolve, reject);
});
});
withMode((mode) => {
mode.getJavaScriptWorker()
.then(resolve, reject);
});
});
}
// Export API
@ -173,7 +184,7 @@ monaco.languages.typescript = createAPI();
// --- Registration to monaco editor ---
function withMode(callback:(module:typeof mode)=>void): void {
function withMode(callback: (module: typeof mode) => void): void {
require<typeof mode>(['vs/language/typescript/src/mode'], callback);
}

75
src/monaco.d.ts vendored

@ -1,33 +1,32 @@
declare module monaco.languages.typescript {
export enum ModuleKind {
enum ModuleKind {
None = 0,
CommonJS = 1,
AMD = 2,
UMD = 3,
System = 4,
ES6 = 5,
ES2015 = 5,
}
export enum JsxEmit {
enum JsxEmit {
None = 0,
Preserve = 1,
React = 2,
}
export enum NewLineKind {
enum NewLineKind {
CarriageReturnLineFeed = 0,
LineFeed = 1,
}
export enum ScriptTarget {
enum ScriptTarget {
ES3 = 0,
ES5 = 1,
ES6 = 2,
ES2015 = 2,
Latest = 2,
ES2016 = 3,
ES2017 = 4,
ESNext = 5,
Latest = 5,
}
export enum ModuleResolutionKind {
@ -35,58 +34,70 @@ declare module monaco.languages.typescript {
NodeJs = 2,
}
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[];
interface CompilerOptions {
allowNonTsExtensions?: boolean;
allowJs?: boolean;
allowSyntheticDefaultImports?: boolean;
allowUnreachableCode?: boolean;
allowUnusedLabels?: boolean;
alwaysStrict?: boolean;
baseUrl?: string;
charset?: string;
declaration?: boolean;
diagnostics?: boolean;
declarationDir?: string;
disableSizeLimit?: boolean;
emitBOM?: boolean;
help?: boolean;
init?: boolean;
emitDecoratorMetadata?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
importHelpers?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit;
reactNamespace?: string;
listFiles?: boolean;
lib?: string[];
locale?: string;
mapRoot?: string;
maxNodeModuleJsDepth?: number;
module?: ModuleKind;
moduleResolution?: ModuleResolutionKind;
newLine?: NewLineKind;
noEmit?: boolean;
noEmitHelpers?: boolean;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
noFallthroughCasesInSwitch?: boolean;
noImplicitAny?: boolean;
noImplicitReturns?: boolean;
noImplicitThis?: boolean;
noUnusedLocals?: boolean;
noUnusedParameters?: boolean;
noImplicitUseStrict?: boolean;
noLib?: boolean;
noResolve?: boolean;
out?: string;
outFile?: string;
outDir?: string;
outFile?: string;
preserveConstEnums?: boolean;
project?: string;
reactNamespace?: string;
jsxFactory?: string;
removeComments?: boolean;
rootDir?: string;
rootDirs?: string[];
skipLibCheck?: boolean;
skipDefaultLibCheck?: boolean;
sourceMap?: boolean;
sourceRoot?: string;
strictNullChecks?: boolean;
suppressExcessPropertyErrors?: boolean;
suppressImplicitAnyIndexErrors?: boolean;
target?: ScriptTarget;
version?: boolean;
watch?: boolean;
isolatedModules?: boolean;
experimentalDecorators?: boolean;
emitDecoratorMetadata?: boolean;
moduleResolution?: ModuleResolutionKind;
allowUnusedLabels?: boolean;
allowUnreachableCode?: boolean;
noImplicitReturns?: boolean;
noFallthroughCasesInSwitch?: boolean;
forceConsistentCasingInFileNames?: boolean;
allowSyntheticDefaultImports?: boolean;
allowJs?: boolean;
noImplicitUseStrict?: boolean;
disableSizeLimit?: boolean;
[option: string]: string | number | boolean;
traceResolution?: boolean;
types?: string[];
/** Paths used to compute primary types search locations */
typeRoots?: string[];
[option: string]: CompilerOptionsValue | undefined;
}
export interface DiagnosticsOptions {

Loading…
Cancel
Save