@tmorin/ceb-messaging-builder-inversion
Version:
The package is part of the `<ceb/>` library. It provides a builder to resolve and inject a bus from a container and then subscribe to event.
48 lines (47 loc) • 1.38 kB
TypeScript
import { Container, RegistryKey } from "@tmorin/ceb-inversion-core";
import { AbstractGatewayBuilder } from "@tmorin/ceb-messaging-builder-core";
/**
* Provider of the container.
*/
export interface ContainerProvider {
/**
* @return the container
*/
(): Container;
}
/**
* The builder injects a {@link Gateway} in Custom Elements.
*
* @template E the type of the Custom Element
*/
export declare class GatewayInversionBuilder<E extends HTMLElement> extends AbstractGatewayBuilder<E> {
private _key;
private _provider?;
private static DEFAULT_CONTAINER;
/**
* @internal
*/
protected constructor(_propName?: string, _key?: RegistryKey, _provider?: ContainerProvider | undefined);
/**
* Set the default {@link Container}.
* @param container the container
* @internal
*/
static setDefaultContainer(container: Container): void;
/**
* Provides a fresh builder.
* @param propName the property name
* @template E the type of the Custom Element
*/
static get<E extends HTMLElement>(propName?: string): GatewayInversionBuilder<E>;
/**
* Set the registry key.
* @param key the registry key
*/
key(key: RegistryKey): this;
/**
* Set the Container provider.
* @param provider the provider
*/
provider(provider: ContainerProvider): this;
}