UNPKG

@dapplets/dapplet-extension

Version:
39 lines (38 loc) 1.24 kB
import { Core } from './core'; type DappletConfig = { [contextName: string]: (context: any) => any[]; }; interface ModuleConstructor { new (...modules: ModuleInterface[]): ModuleInterface; } interface ModuleInterface { activate?(...modules: ModuleInterface[]): Promise<void>; deactivate?(): Promise<void>; attachConfig?(config: DappletConfig): void; detachConfig?(config: DappletConfig): void; } /** * @singleton */ export declare class Injector { private core; private _registry; private _constructorDeps; private _activateMethodsDeps; private _deactivateCallbacks; constructor(core: Core); activate(): Promise<{ runtime: { isActionHandler: boolean; isHomeHandler: boolean; }; }>; deactivate(): Promise<void>; injectableDecorator(constructor: ModuleConstructor): void; injectDecorator(name: string): (target: ModuleInterface | { constructor: ModuleConstructor; }, propertyOrMethodName: string | undefined, parameterIndex: number | undefined) => void; onEventDecorator(eventType: string): (_: any, __: any, descriptor: PropertyDescriptor) => PropertyDescriptor; private _getDependencyInstance; } export {};