How to use the inversify.named 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 RiseVision / rise-node / packages / core-consensus-dpos / src / apis / delegatesAPI.ts View on Github external
import { As } from 'type-tagger';
import * as z_schema from 'z-schema';
import { DposConstantsType, dPoSSymbols, Slots } from '../helpers/';
import { Accounts2DelegatesModel, AccountsModelForDPOS } from '../models';
import { BaseDelegateData, DelegatesModule, ForgeModule } from '../modules';

// tslint:disable-next-line
const schema = require('../../schema/delegates.json');
// tslint:disable max-line-length
@JsonController('/api/delegates')
@injectable()
@IoCSymbol(dPoSSymbols.delegatesAPI)
export class DelegatesAPI {
  // other apis
  @inject(APISymbols.class)
  @named(BlocksSymbols.api.api)
  public blocksAPI: BlocksAPI;

  @inject(Symbols.generic.zschema)
  public schema: z_schema;
  @inject(dPoSSymbols.constants)
  public dposConstants: DposConstantsType;
  @inject(Symbols.generic.constants)
  public constants: ConstantsType;
  @inject(Symbols.modules.accounts)
  private accounts: IAccountsModule;
  @inject(Symbols.modules.blocks)
  private blocks: IBlocksModule;
  @inject(dPoSSymbols.modules.delegates)
  private delegatesModule: DelegatesModule;
  @inject(Symbols.generic.crypto)
  private crypto: ICrypto;
github theia-ide / theia-sprotty-example / theia-dsl-extension / src / browser / language / language-client-contribution.ts View on Github external
constructor(
        @inject(Workspace) workspace: Workspace,
        @inject(Languages) languages: Languages,
        @inject(LanguageClientFactory) languageClientFactory: LanguageClientFactory,
        @inject(DiagramManagerProvider)@named('flow') protected flowDiagramManagerProvider: DiagramManagerProvider,
        @inject(DiagramManagerProvider)@named('processor') protected processorDiagramManagerProvider: DiagramManagerProvider
    ) {
        super(workspace, languages, languageClientFactory)
    }
github DonJayamanne / pythonVSCode / src / client / debugger / extension / configuration / resolvers / launch.ts View on Github external
constructor(
        @inject(IWorkspaceService) workspaceService: IWorkspaceService,
        @inject(IDocumentManager) documentManager: IDocumentManager,
        @inject(IDiagnosticsService) @named(InvalidPythonPathInDebuggerServiceId) private readonly invalidPythonPathInDebuggerService: IInvalidPythonPathInDebuggerService,
        @inject(IPlatformService) platformService: IPlatformService,
        @inject(IConfigurationService) configurationService: IConfigurationService,
        @inject(IDebugEnvironmentVariablesService) private readonly debugEnvHelper: IDebugEnvironmentVariablesService,
        @inject(ILaunchDebugConfigurationResolverExperiment) private readonly configExperiment: ILaunchDebugConfigurationResolverExperiment
    ) {
        super(workspaceService, documentManager, platformService, configurationService);
    }
    public async resolveDebugConfiguration(
github eclipse-theia / theia / packages / navigator / src / browser / navigator-decorator-service.ts View on Github external
    constructor(@inject(ContributionProvider) @named(NavigatorTreeDecorator) protected readonly contributions: ContributionProvider) {
        super(contributions.getContributions());
    }
github eclipse-theia / theia / packages / scm / src / browser / scm-group-command-registry.ts View on Github external
export interface ScmGroupCommandContribution {
    registerScmGroupCommands(registry: ScmGroupCommandRegistry): void;
}

export interface ScmGroupItem {
    command: string;
    group?: string;
}

@injectable()
export class ScmGroupCommandRegistry implements FrontendApplicationContribution {
    private items: Map = new Map();

    @inject(ContributionProvider)
    @named(ScmGroupCommandContribution)
    protected readonly contributionProvider: ContributionProvider;

    onStart(): void {
        const contributions = this.contributionProvider.getContributions();
        for (const contribution of contributions) {
            contribution.registerScmGroupCommands(this);
        }
    }

    registerItems(groupId: string, items: ScmGroupItem[]): void {
        const savedItems = this.items.get(groupId);
        if (savedItems) {
            items.forEach(item => savedItems.push(item));
            this.items.set(groupId, savedItems);
        } else {
            this.items.set(groupId, items);
github RiseVision / rise-node / packages / core-consensus-dpos / src / hooks / subscribers / delegatesHooks.ts View on Github external
const Extendable = WPHooksSubscriber(Object);
decorate(injectable(), Extendable);

@injectable()
export class DelegatesHooks extends Extendable {
  @inject(Symbols.generic.hookSystem)
  public hookSystem: WordPressHookSystem;
  @inject(ModelSymbols.model)
  @named(dPoSSymbols.models.delegates)
  private delegatesModel: typeof DelegatesModel;
  @inject(ModelSymbols.model)
  @named(AccountsSymbols.model)
  private accountsModel: typeof AccountsModelForDPOS;
  @inject(ModelSymbols.model)
  @named(dPoSSymbols.models.delegatesRound)
  private delegatesRoundModel: typeof DelegatesRoundModel;

  @inject(Symbols.helpers.logger)
  private logger: ILogger;

  @inject(dPoSSymbols.helpers.slots)
  private slots: Slots;

  @inject(BlocksSymbols.constants)
  private blocksConstants: BlocksConstantsType;

  @inject(dPoSSymbols.modules.delegates)
  private delegatesModule: DelegatesModule;

  @inject(dPoSSymbols.constants)
  private dposConstants: DposConstantsType;
github DonJayamanne / pythonVSCode / src / client / interpreter / virtualEnvs / virtualEnvPrompt.ts View on Github external
constructor(
        @inject(IInterpreterWatcherBuilder) private readonly builder: IInterpreterWatcherBuilder,
        @inject(IPersistentStateFactory) private readonly persistentStateFactory: IPersistentStateFactory,
        @inject(IInterpreterHelper) private readonly helper: IInterpreterHelper,
        @inject(IPythonPathUpdaterServiceManager) private readonly pythonPathUpdaterService: IPythonPathUpdaterServiceManager,
        @inject(IInterpreterLocatorService) @named(WORKSPACE_VIRTUAL_ENV_SERVICE) private readonly locator: IInterpreterLocatorService,
        @inject(IDisposableRegistry) private readonly disposableRegistry: Disposable[],
        @inject(IApplicationShell) private readonly appShell: IApplicationShell) { }
github eclipse-theia / theia / packages / plugin-ext / src / hosted / node / hosted-plugin-process.ts View on Github external
}

@injectable()
export class HostedPluginProcess implements ServerPluginRunner {

    @inject(ILogger)
    protected readonly logger: ILogger;

    @inject(HostedPluginCliContribution)
    protected readonly cli: HostedPluginCliContribution;

    @inject(HostedPluginProcessesCache)
    protected readonly pluginProcessCache: HostedPluginProcessesCache;

    @inject(ContributionProvider)
    @named(PluginHostEnvironmentVariable)
    protected readonly pluginHostEnvironmentVariables: ContributionProvider;

    @inject(MessageService)
    protected readonly messageService: MessageService;

    private childProcess: cp.ChildProcess | undefined;

    private client: HostedPluginClient;

    private terminatingPluginServer = false;

    private async getClientId(): Promise {
        return await this.pluginProcessCache.getLazyClientId(this.client);
    }

    public setClient(client: HostedPluginClient): void {
github RiseVision / rise-node / packages / core-transactions / src / PoolManager.ts View on Github external
import { WordPressHookSystem } from 'mangiafuoco';
import { TXAppConfig, TxConstantsType } from './helpers/';
import { OnNewUnconfirmedTransation } from './hooks/actions';
import { TxExpireTimeout } from './hooks/filters';
import { PostTransactionsRequest } from './p2p';
import { TransactionLogic } from './TransactionLogic';
import { TransactionsModule } from './TransactionModule';
import { TransactionPool } from './TransactionPool';
import { TXSymbols } from './txSymbols';

@injectable()
export class PoolManager {
  @inject(Symbols.generic.hookSystem)
  public hookSystem: WordPressHookSystem;
  @inject(Symbols.helpers.sequence)
  @named(Symbols.names.helpers.balancesSequence)
  public balancesSequence: ISequence;
  @inject(Symbols.generic.appConfig)
  private config: TXAppConfig;
  @inject(TXSymbols.constants)
  private constants: TxConstantsType;

  @inject(Symbols.helpers.logger)
  private logger: ILogger;
  @inject(Symbols.helpers.jobsQueue)
  private jobsQueue: IJobsQueue;
  @inject(Symbols.logic.broadcaster)
  private broadcasterLogic: BroadcasterLogic;
  @inject(Symbols.modules.accounts)
  private accountsModule: IAccountsModule;

  @inject(TXSymbols.module)
github RiseVision / rise-node / packages / core-consensus-dpos / src / hooks / subscribers / delegatesHooks.ts View on Github external
DelegatesRoundModel,
} from '../../models';
import { DelegatesModule } from '../../modules';

const Extendable = WPHooksSubscriber(Object);
decorate(injectable(), Extendable);

@injectable()
export class DelegatesHooks extends Extendable {
  @inject(Symbols.generic.hookSystem)
  public hookSystem: WordPressHookSystem;
  @inject(ModelSymbols.model)
  @named(dPoSSymbols.models.delegates)
  private delegatesModel: typeof DelegatesModel;
  @inject(ModelSymbols.model)
  @named(AccountsSymbols.model)
  private accountsModel: typeof AccountsModelForDPOS;
  @inject(ModelSymbols.model)
  @named(dPoSSymbols.models.delegatesRound)
  private delegatesRoundModel: typeof DelegatesRoundModel;

  @inject(Symbols.helpers.logger)
  private logger: ILogger;

  @inject(dPoSSymbols.helpers.slots)
  private slots: Slots;

  @inject(BlocksSymbols.constants)
  private blocksConstants: BlocksConstantsType;

  @inject(dPoSSymbols.modules.delegates)
  private delegatesModule: DelegatesModule;