forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
67 lines (60 loc) · 2.24 KB
/
types.ts
File metadata and controls
67 lines (60 loc) · 2.24 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 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>(from: interfaces.ServiceIdentifier<T1>, to: 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[];
}