How to use the inversify.multiInject function in inversify

To help you get started, we’ve selected a few inversify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atrauzzi / protoculture / src / ServiceProvider.ts View on Github external
protected bindConstructorParameter(symbol: symbol | symbol[], staticType: any, position: number) {

        if (_.isArray(symbol)) {

            decorate(multiInject(symbol[0]) as ParameterDecorator, staticType, position);
        }
        else {

            decorate(inject(symbol) as ParameterDecorator, staticType, position);
        }
    }
}
github DonJayamanne / pythonVSCode / src / client / debugger / extension / hooks / eventHandlerDispatcher.ts View on Github external
    constructor(@multiInject(IDebugSessionEventHandlers) private readonly eventHandlers: IDebugSessionEventHandlers[],
        @inject(IDebugService) private readonly debugService: IDebugService,
        @inject(IDisposableRegistry) private readonly disposables: IDisposableRegistry) { }
    public registerEventHandlers() {
github eclipsesource / graphical-lsp / client / packages / theia-integration / src / browser / language / glsp-client-contribution.ts View on Github external
abstract readonly id: string;
    abstract readonly name: string;
    abstract readonly fileExtensions: string[];

    protected _glspClient: GLSPClient | undefined;

    protected resolveReady: (glspClient: GLSPClient) => void;
    protected ready: Promise;

    @inject(WorkspaceService) protected readonly workspaceService: WorkspaceService;
    @inject(MessageService) protected readonly messageService: MessageService;
    @inject(WebSocketConnectionProvider) protected readonly connectionProvider: WebSocketConnectionProvider;
    @inject(GLSPClientFactory) protected readonly languageClientFactory: GLSPClientFactory;
    @inject(CommandRegistry) protected readonly registry: CommandRegistry;
    @inject(EditorManager) protected readonly editorManager: EditorManager;
    @multiInject(DiagramManagerProvider) protected diagramManagerProviders: DiagramManagerProvider[];

    constructor() {
        this.waitForReady();
    }

    get glspClient(): Promise {
        return this._glspClient ? Promise.resolve(this._glspClient) : this.ready;
    }

    waitForActivation(app: FrontendApplication): Promise {
        const activationPromises: Promise[] = [];
        const workspaceContains = this.workspaceContains;
        if (workspaceContains.length !== 0) {
            activationPromises.push(this.waitForItemInWorkspace());
        }
        const fileExtensions = this.fileExtensions;
github eclipsesource / graphical-lsp / client / packages / sprotty-client / src / features / context-menu / menu-providers.ts View on Github external
    constructor(@multiInject(GLSP_TYPES.IContextMenuProvider) @optional() protected menuProviders: IContextMenuItemProvider[] = []) { }
github danielgerlag / workflow-es / core / src / services / workflow-host.ts View on Github external
import { WorkflowInstance, WorkflowStatus, ExecutionPointer, EventSubscription, Event } from "../models";
import { WorkflowBase, IWorkflowRegistry, IPersistenceProvider, IWorkflowHost, IQueueProvider, QueueType, IDistributedLockProvider, IBackgroundWorker, TYPES, ILogger, IExecutionPointerFactory } from "../abstractions";
import { WorkflowQueueWorker } from "./workflow-queue-worker";

import { MemoryPersistenceProvider } from "./memory-persistence-provider";
import { SingleNodeLockProvider } from "./single-node-lock-provider";
import { SingleNodeQueueProvider } from "./single-node-queue-provider";
import { NullLogger } from "./null-logger";

@injectable()
export class WorkflowHost implements IWorkflowHost {

    @inject(TYPES.IWorkflowRegistry)
    private registry : IWorkflowRegistry;

    @multiInject(TYPES.IBackgroundWorker)
    private workers: IBackgroundWorker[];

    @inject(TYPES.IPersistenceProvider)
    private persistence: IPersistenceProvider;

    @inject(TYPES.IDistributedLockProvider)
    private lockProvider: IDistributedLockProvider;
    
    @inject(TYPES.IQueueProvider)
    private queueProvider:  IQueueProvider = new SingleNodeQueueProvider();

    @inject(TYPES.IExecutionPointerFactory)
    private pointerFactory : IExecutionPointerFactory;

    @inject(TYPES.ILogger)
    private logger: ILogger;
github tierratelematics / ninjagoat / scripts / commands / CommandDispatcherEnricher.ts View on Github external
constructor(@inject("CommandDispatcher") private commandDispatcher:ICommandDispatcher,
                @multiInject("IMetadataEnricher") private enrichers?:IMetadataEnricher[]) {

    }
github eclipse / sprotty / src / base / views / mouse-tool.ts View on Github external
    constructor(@multiInject(TYPES.MouseListener) @optional() protected mouseListeners: MouseListener[] = []) { }
github DonJayamanne / pythonVSCode / src / client / datascience / datascience.ts View on Github external
constructor(
        @inject(IServiceContainer) private serviceContainer: IServiceContainer,
        @inject(ICommandManager) private commandManager: ICommandManager,
        @inject(IDisposableRegistry) private disposableRegistry: IDisposableRegistry,
        @inject(IExtensionContext) private extensionContext: IExtensionContext,
        @inject(IDataScienceCodeLensProvider) private dataScienceCodeLensProvider: IDataScienceCodeLensProvider,
        @inject(IConfigurationService) private configuration: IConfigurationService,
        @inject(IDocumentManager) private documentManager: IDocumentManager,
        @inject(IWorkspaceService) private workspace: IWorkspaceService,
        @multiInject(IDataScienceCommandListener) @optional() private commandListeners: IDataScienceCommandListener[] | undefined,
        @inject(INotebookEditorProvider) private notebookProvider: INotebookEditorProvider,
        @inject(IDebugService) private debugService: IDebugService,
        @inject(IMemento) @named(GLOBAL_MEMENTO) private globalState: vscode.Memento,
        @inject(IJupyterSessionManagerFactory) private jupyterSessionManagerFactory: IJupyterSessionManagerFactory,
        @inject(IMultiStepInputFactory) private readonly multiStepFactory: IMultiStepInputFactory,
        @inject(KernelSelector) private kernelSelector: KernelSelector,
        @inject(IOutputChannel) @named(JUPYTER_OUTPUT_CHANNEL) private jupyterOutput: IOutputChannel
    ) {
        this.dataScienceSurveyBanner = this.serviceContainer.get(IPythonExtensionBanner, BANNER_NAME_DS_SURVEY);
    }