How to use the inversify.optional 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 tierratelematics / prettygoat / scripts / web / MiddlewareTransformer.ts View on Github external
    constructor(@multiInject("IMiddleware") @optional() private middlewares: IMiddleware[]) {

    }
github theia-ide / sprotty / client / src / base / views / viewer.tsx View on Github external
constructor(@inject(TYPES.ModelRendererFactory) modelRendererFactory: ModelRendererFactory,
                @multiInject(TYPES.IVNodeDecorator) @optional() protected decorators: IVNodeDecorator[],
                @multiInject(TYPES.HiddenVNodeDecorator) @optional() protected hiddenDecorators: IVNodeDecorator[],
                @multiInject(TYPES.PopupVNodeDecorator) @optional() protected popupDecorators: IVNodeDecorator[],
                @inject(TYPES.ViewerOptions) protected options: ViewerOptions,
                @inject(TYPES.ILogger) protected logger: ILogger,
                @inject(TYPES.IActionDispatcher) protected actiondispatcher: IActionDispatcher) {
        this.patcher = this.createPatcher();
        this.renderer = modelRendererFactory(decorators);
        this.hiddenRenderer = modelRendererFactory(hiddenDecorators);
        this.popupRenderer = modelRendererFactory(popupDecorators);
    }
github theia-ide / sprotty / client / src / features / select / select.ts View on Github external
    constructor(@inject(ButtonHandlerRegistry)@optional() protected buttonHandlerRegistry: ButtonHandlerRegistry) {
        super();
    }
github DonJayamanne / pythonVSCode / src / client / common / experiments.ts View on Github external
constructor(
        @inject(IPersistentStateFactory) private readonly persistentStateFactory: IPersistentStateFactory,
        @inject(IWorkspaceService) private readonly workspaceService: IWorkspaceService,
        @inject(IHttpClient) private readonly httpClient: IHttpClient,
        @inject(ICryptoUtils) private readonly crypto: ICryptoUtils,
        @inject(IApplicationEnvironment) private readonly appEnvironment: IApplicationEnvironment,
        @inject(IOutputChannel) @named(STANDARD_OUTPUT_CHANNEL) private readonly output: IOutputChannel,
        @inject(IFileSystem) private readonly fs: IFileSystem,
        @inject(IConfigurationService) configurationService: IConfigurationService,
        @optional() private experimentEffortTimeout: number = EXPERIMENTS_EFFORT_TIMEOUT_MS
    ) {
        this.isDownloadedStorageValid = this.persistentStateFactory.createGlobalPersistentState(isDownloadedStorageValidKey, false, EXPIRY_DURATION_MS);
        this.experimentStorage = this.persistentStateFactory.createGlobalPersistentState(experimentStorageKey, undefined);
        this.downloadedExperimentsStorage = this.persistentStateFactory.createGlobalPersistentState(downloadedExperimentStorageKey, undefined);
        this.enabled = configurationService.getSettings(undefined).experiments.enabled;
    }
github tierratelematics / ninjagoat / scripts / viewmodels / ViewModelFactory.ts View on Github external
constructor(@inject("IObjectContainer") private container: IObjectContainer,
                @multiInject("IViewModelFactoryExtender") @optional() private extenders: IViewModelFactoryExtender[] = []) {
    }
github eclipsesource / graphical-lsp / client / packages / sprotty-client / src / features / mouse-tool / mouse-tool.ts View on Github external
    constructor(@multiInject(TYPES.MouseListener) @optional() protected mouseListeners: MouseListener[] = []) {
        super(mouseListeners);
        this.rankedMouseListeners = groupBy(mouseListeners, listener => getRank(listener));
    }
github eclipsesource / graphical-lsp / client / packages / glsp-sprotty / src / base / model / update-model-command.ts View on Github external
constructor(@inject(TYPES.Action) action: UpdateModelAction,
        @inject(TYPES.ILogger) protected logger: ILogger,
        @inject(GLSP_TYPES.IFeedbackActionDispatcher) @optional() protected readonly feedbackActionDispatcher: IFeedbackActionDispatcher,
        @inject(TYPES.ActionHandlerRegistryProvider) protected actionHandlerRegistryProvider: () => Promise) {
        super(action);
    }
github theia-ide / sprotty / client / src / base / views / key-tool.ts View on Github external
constructor(@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher,
                @multiInject(TYPES.KeyListener)@optional() protected keyListeners: KeyListener[] = []) {}
github eclipse / sprotty / src / base / views / mouse-tool.ts View on Github external
    constructor(@multiInject(TYPES.PopupMouseListener) @optional() protected mouseListeners: MouseListener[] = []) {
        super(mouseListeners);
    }
}
github seagull-js / seagull / packages / seed / src / service.ts View on Github external
  constructor(@optional() protected testScope?: TestScope) {}
}