@@ -42,6 +42,8 @@ export class ServiceCollection {
|
||||
}
|
||||
|
||||
export class InstantiationService implements IInstantiationService {
|
||||
public serviceBrand: undefined;
|
||||
|
||||
private readonly _services: ServiceCollection = new ServiceCollection();
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -157,6 +157,8 @@ type GetLeadingNonServiceArgs<Args> =
|
||||
|
||||
export const IInstantiationService = createDecorator<IInstantiationService>('InstantiationService');
|
||||
export interface IInstantiationService {
|
||||
serviceBrand: undefined;
|
||||
|
||||
setService<T>(id: IServiceIdentifier<T>, instance: T): void;
|
||||
getService<T>(id: IServiceIdentifier<T>): T | undefined;
|
||||
createInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(t: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;
|
||||
|
||||
Reference in New Issue
Block a user