@microsoft/teams.apps
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.apps" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.apps/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.apps?activeTab=code
38 lines (37 loc) • 979 B
TypeScript
import 'reflect-metadata';
import { Provider } from './provider';
/**
* @private
* any singleton registry
*/
export interface IContainer {
/**
* does the container have the
* provided key
* @param key the singleton key
*/
has(key: string): boolean;
/**
* register a singleton
* @param key the singleton key
* @param value the singleton value
*/
register<T = any>(key: string, provider: Provider<T>): void;
/**
* resolve a singleton
* @param key the singleton key
*/
resolve<T = any>(key: string): T | undefined;
}
/**
* @private
* a singleton container
*/
export declare class Container implements IContainer {
protected readonly values: Map<string, any>;
protected readonly providers: Map<string, Provider<any>>;
has(key: string): boolean;
register<T = any>(key: string, provider: Provider<T>): void;
resolve<T = any>(key: string): T | undefined;
toString(): string;
}