mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-19 18:14:50 +01:00
property type TPromise.as, remove unwanted methods from Promise, #11771
This commit is contained in:
Vendored
+10
-5
@@ -28,17 +28,17 @@ export declare class Promise {
|
||||
|
||||
static join(promises: { [name: string]: Promise; }): Promise;
|
||||
static join(promises: Promise[]): Promise;
|
||||
static any(promises: Promise[]): Promise;
|
||||
// static any(promises: Promise[]): Promise;
|
||||
|
||||
// commented out to speed up adoption of TPromise
|
||||
// static timeout(delay:number):Promise;
|
||||
|
||||
static wrapError(error: any): Promise;
|
||||
static is(value: any): value is Thenable<any>;
|
||||
static addEventListener(type: string, fn: EventCallback): void;
|
||||
// static is(value: any): value is Thenable<any>;
|
||||
// static addEventListener(type: string, fn: EventCallback): void;
|
||||
|
||||
public then(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): Promise;
|
||||
public then<U>(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): TPromise<U>;
|
||||
// public then<U>(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): TPromise<U>;
|
||||
public done(success?: ValueCallback, error?: ErrorCallback, progress?: ProgressCallback): void;
|
||||
public cancel(): void;
|
||||
}
|
||||
@@ -78,7 +78,12 @@ export declare class TPromise<V> {
|
||||
public done(success?: (value: V) => void, error?: (err: any) => any, progress?: ProgressCallback): void;
|
||||
public cancel(): void;
|
||||
|
||||
public static as(value: null): TPromise<null>;
|
||||
public static as(value: undefined): TPromise<undefined>;
|
||||
public static as<ValueType>(value: TPromise<ValueType>): TPromise<ValueType>;
|
||||
public static as<ValueType>(value: Thenable<ValueType>): Thenable<ValueType>;
|
||||
public static as<ValueType>(value: ValueType): TPromise<ValueType>;
|
||||
|
||||
public static is(value: any): value is Thenable<any>;
|
||||
public static timeout(delay: number): TPromise<void>;
|
||||
public static join<ValueType>(promises: TPromise<ValueType>[]): TPromise<ValueType[]>;
|
||||
@@ -113,4 +118,4 @@ export declare class PPromise<C, P> extends TPromise<C> {
|
||||
public static join<C, P>(promises: { [n: string]: PPromise<C, P> }): PPromise<{ [n: string]: C }, P>;
|
||||
public static any<C, P>(promises: PPromise<C, P>[]): PPromise<{ key: string; value: PPromise<C, P>; }, P>;
|
||||
public static wrapError<V>(error: any): TPromise<V>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
|
||||
this.throttler.queue(() => {
|
||||
return state.validate(this.editor)
|
||||
? this.findDefinition(mouseEvent.target)
|
||||
: TPromise.as(null);
|
||||
: TPromise.as<Location[]>(null);
|
||||
|
||||
}).then(results => {
|
||||
if (!results || !results.length || !state.validate(this.editor)) {
|
||||
|
||||
Vendored
+5
@@ -74,7 +74,12 @@ declare module monaco {
|
||||
public done(success?: (value: V) => void, error?: (err: any) => any, progress?: ProgressCallback): void;
|
||||
public cancel(): void;
|
||||
|
||||
public static as(value: null): Promise<null>;
|
||||
public static as(value: undefined): Promise<undefined>;
|
||||
public static as<ValueType>(value: Promise<ValueType>): Promise<ValueType>;
|
||||
public static as<ValueType>(value: Thenable<ValueType>): Thenable<ValueType>;
|
||||
public static as<ValueType>(value: ValueType): Promise<ValueType>;
|
||||
|
||||
public static is(value: any): value is Thenable<any>;
|
||||
public static timeout(delay: number): Promise<void>;
|
||||
public static join<ValueType>(promises: Promise<ValueType>[]): Promise<ValueType[]>;
|
||||
|
||||
Reference in New Issue
Block a user