diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6c20be235a88c200295a6494d4d877a02e60d6c1..3cbc93c7df464b842873ba0a27e8a4a63cc4d6bd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -562,9 +562,9 @@ "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-3.1.5.tgz" }, "windows-process-tree": { - "version": "0.1.1", - "from": "windows-process-tree@0.1.1", - "resolved": "https://registry.npmjs.org/windows-process-tree/-/windows-process-tree-0.1.1.tgz" + "version": "0.1.2", + "from": "windows-process-tree@0.1.2", + "resolved": "https://registry.npmjs.org/windows-process-tree/-/windows-process-tree-0.1.2.tgz" }, "winreg": { "version": "1.2.0", diff --git a/package.json b/package.json index a45e0462bf426f4751446e6259658d63bea4c4b9..c2423d5760f1aeeb034c0739e6033d30146a2e1c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "vscode-debugprotocol": "1.22.0", "vscode-ripgrep": "0.0.25", "vscode-textmate": "^3.1.5", - "windows-process-tree": "0.1.1", "winreg": "1.2.0", "xterm": "Tyriar/xterm.js#vscode-release/1.16", "yauzl": "2.8.0" @@ -127,6 +126,7 @@ "url": "https://github.com/Microsoft/vscode/issues" }, "optionalDependencies": { + "windows-process-tree": "0.1.2", "windows-foreground-love": "0.1.0", "windows-mutex": "^0.2.0", "fsevents": "0.3.8" diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 5c2aa437e4439464f593ebbf1aadef33a5a59bcd..97c8a13a94d5629db85afe15859ecb4ab6a35ae2 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -34,41 +34,49 @@ declare module monaco { - /** - * The value callback to complete a promise - */ - export interface TValueCallback { - (value: T | Thenable): void; - } + export type TValueCallback = (value: T | PromiseLike) => void; + export type ProgressCallback = (progress: TProgress) => void; - export interface ProgressCallback { - (progress: any): any; - } + export class Promise { + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason: any) => void, + progress: (progress: TProgress) => void) => void, + oncancel?: () => void); + + public then( + onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null, + onprogress?: (progress: TProgress) => void): Promise; - export class Promise { - // commented out because this conflicts with the native promise - // constructor(init: (complete: ValueCallback, error: ErrorCallback, progress: ProgressCallback) => void, oncancel?: any); + public done( + onfulfilled?: (value: T) => void, + onrejected?: (reason: any) => void, + onprogress?: (progress: TProgress) => void): void; - // commented out to speed up adoption of TPromise - // static as(value:any):Promise; + public cancel(): void; - // static join(promises: { [name: string]: Promise; }): Promise; - static join(promises: Promise[]): Promise; - // static any(promises: Promise[]): Promise; + public static as(value: null): Promise; + public static as(value: undefined): Promise; + public static as>(value: TPromise): TPromise; + public static as(value: T): Promise; - // commented out to speed up adoption of TPromise - // static timeout(delay:number):Promise; + public static is(value: any): value is PromiseLike; - // static wrapError(error: Error): Promise; - // static is(value: any): value is Thenable; - // static addEventListener(type: string, fn: EventCallback): void; + public static timeout(delay: number): Promise; - public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): Promise; - // public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): Promise; - public done(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): void; - public cancel(): void; + public static join(promises: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; + public static join(promises: (T | PromiseLike)[]): Promise; + public static join(promises: { [n: string]: T | PromiseLike }): Promise<{ [n: string]: T }>; + + public static any(promises: (T | PromiseLike)[]): Promise<{ key: string; value: Promise; }>; + + public static wrap(value: T | PromiseLike): Promise; + + public static wrapError(error: Error): Promise; } export class CancellationTokenSource { @@ -807,7 +815,7 @@ declare module monaco.editor { export function setModelMarkers(model: IModel, owner: string, markers: IMarkerData[]): void; /** - * Get markers for owner ant/or resource + * Get markers for owner and/or resource * @returns {IMarker[]} list of markers * @param filter */