forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
44 lines (37 loc) · 2.1 KB
/
types.ts
File metadata and controls
44 lines (37 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { interfaces } from 'inversify';
//tslint:disable:callable-types
// tslint:disable-next-line:interface-name
export interface Newable<T> {
// tslint:disable-next-line:no-any
new(...args: any[]): T;
}
//tslint:enable:callable-types
// tslint:disable-next-line:interface-name
export interface Abstract<T> {
prototype: T;
}
//tslint:disable:callable-types
export type ClassType<T> = {
// tslint:disable-next-line:no-any
new(...args: any[]): T;
};
//tslint:enable:callable-types
export const IServiceManager = Symbol('IServiceManager');
export interface IServiceManager {
add<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, constructor: ClassType<T>, name?: string | number | symbol): void;
addSingleton<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, constructor: ClassType<T>, name?: string | number | symbol): void;
addSingletonInstance<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, instance: T, name?: string | number | symbol): void;
addFactory<T>(factoryIdentifier: interfaces.ServiceIdentifier<interfaces.Factory<T>>, factoryMethod: interfaces.FactoryCreator<T>): void;
addBinding<T1, T2>(serviceIdentifier1: interfaces.ServiceIdentifier<T1>, serviceIdentifier2: interfaces.ServiceIdentifier<T2>): void;
get<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, name?: string | number | symbol): T;
getAll<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, name?: string | number | symbol): T[];
rebind<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, constructor: ClassType<T>, name?: string | number | symbol): void;
rebindInstance<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, instance: T, name?: string | number | symbol): void;
}
export const IServiceContainer = Symbol('IServiceContainer');
export interface IServiceContainer {
get<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, name?: string | number | symbol): T;
getAll<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, name?: string | number | symbol): T[];
}