Skip to content

Commit

Permalink
Extract BrandedService type
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Sep 28, 2019
1 parent 42b59f5 commit 74e4847
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/vs/platform/instantiation/common/instantiation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,42 @@ export namespace _util {

// --- interfaces ------

type BrandedService = { _serviceBrand: undefined };

export interface IConstructorSignature0<T> {
new(...services: { _serviceBrand: undefined; }[]): T;
new(...services: BrandedService[]): T;
}

export interface IConstructorSignature1<A1, T> {
new(first: A1, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, ...services: BrandedService[]): T;
}

export interface IConstructorSignature2<A1, A2, T> {
new(first: A1, second: A2, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, ...services: BrandedService[]): T;
}

export interface IConstructorSignature3<A1, A2, A3, T> {
new(first: A1, second: A2, third: A3, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, ...services: BrandedService[]): T;
}

export interface IConstructorSignature4<A1, A2, A3, A4, T> {
new(first: A1, second: A2, third: A3, fourth: A4, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, ...services: BrandedService[]): T;
}

export interface IConstructorSignature5<A1, A2, A3, A4, A5, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, ...services: BrandedService[]): T;
}

export interface IConstructorSignature6<A1, A2, A3, A4, A5, A6, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, ...services: BrandedService[]): T;
}

export interface IConstructorSignature7<A1, A2, A3, A4, A5, A6, A7, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: BrandedService[]): T;
}

export interface IConstructorSignature8<A1, A2, A3, A4, A5, A6, A7, A8, T> {
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: undefined; }[]): T;
new(first: A1, second: A2, third: A3, fourth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: BrandedService[]): T;
}

export interface ServicesAccessor {
Expand Down

0 comments on commit 74e4847

Please sign in to comment.