mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Cleanup typings from vs code merge (#14267)
This commit is contained in:
@@ -6,13 +6,13 @@
|
|||||||
/**
|
/**
|
||||||
* Deferred promise
|
* Deferred promise
|
||||||
*/
|
*/
|
||||||
export class Deferred<T> {
|
export class Deferred<T = void> {
|
||||||
promise: Promise<T>;
|
promise: Promise<T>;
|
||||||
resolve!: (value?: T | PromiseLike<T>) => void;
|
resolve!: (value: T | PromiseLike<T>) => void;
|
||||||
reject!: (reason?: any) => void;
|
reject!: (reason?: any) => void;
|
||||||
constructor() {
|
constructor() {
|
||||||
this.promise = new Promise<T>((resolve, reject) => {
|
this.promise = new Promise<T>((resolve, reject) => {
|
||||||
this.resolve = <any>resolve;
|
this.resolve = resolve;
|
||||||
this.reject = reject;
|
this.reject = reject;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export function getDatabaseStateDisplayText(state: string): string {
|
|||||||
* @returns Promise resolving to the user's input if it passed validation,
|
* @returns Promise resolving to the user's input if it passed validation,
|
||||||
* or undefined if the input box was closed for any other reason
|
* or undefined if the input box was closed for any other reason
|
||||||
*/
|
*/
|
||||||
async function promptInputBox(title: string, options: vscode.InputBoxOptions): Promise<string> {
|
async function promptInputBox(title: string, options: vscode.InputBoxOptions): Promise<string | undefined> {
|
||||||
const inputBox = vscode.window.createInputBox();
|
const inputBox = vscode.window.createInputBox();
|
||||||
inputBox.title = title;
|
inputBox.title = title;
|
||||||
inputBox.prompt = options.prompt;
|
inputBox.prompt = options.prompt;
|
||||||
@@ -118,7 +118,7 @@ async function promptInputBox(title: string, options: vscode.InputBoxOptions): P
|
|||||||
inputBox.value = options.value ?? '';
|
inputBox.value = options.value ?? '';
|
||||||
inputBox.ignoreFocusOut = options.ignoreFocusOut ?? false;
|
inputBox.ignoreFocusOut = options.ignoreFocusOut ?? false;
|
||||||
|
|
||||||
return new Promise<any>(resolve => {
|
return new Promise(resolve => {
|
||||||
let valueAccepted = false;
|
let valueAccepted = false;
|
||||||
inputBox.onDidAccept(async () => {
|
inputBox.onDidAccept(async () => {
|
||||||
if (options.validateInput) {
|
if (options.validateInput) {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
/**
|
/**
|
||||||
* Deferred promise
|
* Deferred promise
|
||||||
*/
|
*/
|
||||||
export class Deferred<T> {
|
export class Deferred<T = void> {
|
||||||
promise: Promise<T>;
|
promise: Promise<T>;
|
||||||
resolve!: (value?: T | PromiseLike<T>) => void;
|
resolve!: (value: T | PromiseLike<T>) => void;
|
||||||
reject!: (reason?: any) => void;
|
reject!: (reason?: any) => void;
|
||||||
constructor() {
|
constructor() {
|
||||||
this.promise = new Promise<T>((resolve, reject) => {
|
this.promise = new Promise<T>((resolve, reject) => {
|
||||||
this.resolve = <any>resolve;
|
this.resolve = resolve;
|
||||||
this.reject = reject;
|
this.reject = reject;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ export function* splitInChunks(array: string[], maxChunkLength: number): Iterabl
|
|||||||
|
|
||||||
interface ILimitedTaskFactory<T> {
|
interface ILimitedTaskFactory<T> {
|
||||||
factory: () => Promise<T>;
|
factory: () => Promise<T>;
|
||||||
c: (value?: T | Promise<T>) => void;
|
c: (value: T | Promise<T>) => void;
|
||||||
e: (error?: any) => void;
|
e: (error?: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ export class Limiter<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
queue(factory: () => Promise<T>): Promise<T> {
|
queue(factory: () => Promise<T>): Promise<T> {
|
||||||
return new Promise<any>((c, e) => {
|
return new Promise((c, e) => {
|
||||||
this.outstandingPromises.push({ factory, c, e });
|
this.outstandingPromises.push({ factory, c, e });
|
||||||
this.consume();
|
this.consume();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ describe('BooksTreeViewTests', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('BookTreeViewProvider.getSections', function () {
|
describe('BookTreeViewProvider.getSections', function () {
|
||||||
@@ -659,10 +659,12 @@ describe('BooksTreeViewTests', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
after(async function (): Promise<void> {
|
after(async function (): Promise<void> {
|
||||||
if (await exists(rootFolderPath)) await promisify(rimraf)(rootFolderPath);
|
if (await exists(rootFolderPath)) {
|
||||||
|
await promisify(rimraf)(rootFolderPath);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('BookTreeViewProvider.Commands', function () {
|
describe('BookTreeViewProvider.Commands', function () {
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ export class TestChildProcessPromise<T> implements cp.ChildProcessPromise {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._promise = new Promise<T>((resolve, reject) => {
|
this._promise = new Promise<T>((resolve, reject) => {
|
||||||
this.resolve = <any>resolve;
|
this.resolve = resolve;
|
||||||
this.reject = reject;
|
this.reject = reject;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
resolve!: (value?: T | PromiseLike<T>) => void;
|
resolve!: (value: T | PromiseLike<T>) => void;
|
||||||
reject!: (reason?: any) => void;
|
reject!: (reason?: any) => void;
|
||||||
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2> {
|
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2> {
|
||||||
return this._promise.then(onFulfilled, onRejected);
|
return this._promise.then(onFulfilled, onRejected);
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
export class Deferred<T> {
|
export class Deferred<T = void> {
|
||||||
promise: Promise<T> = new Promise<T>((resolve, reject) => {
|
promise: Promise<T> = new Promise<T>((resolve, reject) => {
|
||||||
this.resolve = <any>resolve;
|
this.resolve = resolve;
|
||||||
this.reject = reject;
|
this.reject = reject;
|
||||||
});;
|
});;
|
||||||
resolve!: (value?: T | PromiseLike<T>) => void;
|
resolve!: (value: T | PromiseLike<T>) => void;
|
||||||
reject!: (reason?: any) => void;
|
reject!: (reason?: any) => void;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user