UNPKG

@amo-tm/wsc

Version:

The amo WSC component of the amo JS SDK

25 lines (24 loc) 942 B
import { Provider } from './provider'; import { Component } from './component'; import { Name } from './types'; /** * ComponentContainer that provides Providers for service name T, e.g. `wsc`, `wsc-connector-internal` */ export declare class ComponentContainer { readonly name: string; private readonly providers; constructor(name: string); /** * @param component Component being added * @description When a component with the same name has already been registered throw an exception */ addComponent<T extends Name>(component: Component<T>): void; /** * getProvider provides a type safe interface where it can only be called with a field name * present in NameServiceMapping interface. * * Amo SDKs providing services should extend NameServiceMapping interface to register * themselves. */ getProvider<T extends Name>(name: T): Provider<T>; }