connection contribution point (#880)

* init

* finished compile erros

* fixed all merge conflicts

* fix dialog problems

* formatting

* fix opening dialog on first open

* fix various problems with connectiondialog

* formatting

* fix tests

* added connection contrib

* formatting

* formatting and adding capabilities to shutdown

* fix connection buffering

* formatting

* fix tests
This commit is contained in:
Anthony Dresser
2018-03-28 10:58:47 -07:00
committed by GitHub
parent a14c0351ba
commit 22c54a9917
23 changed files with 1210 additions and 660 deletions

View File

@@ -111,3 +111,14 @@ export class TrieMap<E> {
return result;
}
}
export function toObject<V>(map: Map<string, V>): { [key: string]: V } {
if (map) {
let rt: { [key: string]: V } = Object.create(null);
map.forEach((v, k) => {
rt[k] = v;
});
return rt;
}
return {};
}

View File

@@ -38,7 +38,7 @@ export function mixin(destination: any, source: any, overwrite: boolean = true,
if (overwrite) {
if (Types.isObject(destination[key]) && Types.isObject(source[key])) {
mixin(destination[key], source[key], overwrite, fn);
} else if(fn) {
} else if (fn) {
destination[key] = fn(destination[key], source[key], overwrite);
} else {
destination[key] = source[key];
@@ -50,4 +50,12 @@ export function mixin(destination: any, source: any, overwrite: boolean = true,
});
}
return destination;
}
}
export function entries<T>(o: { [key: string]: T }): [string, T][] {
return Object.entries(o);
}
export function values<T>(o: { [key: string]: T }): T[] {
return Object.values(o);
}

View File

@@ -17,4 +17,10 @@ export class Deferred<T> {
this.reject = reject;
});
}
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult> | void): Thenable<TResult> {
return this.promise.then(onfulfilled, onrejected);
}
}