import { Resolver } from "awilix"; export interface PluginDescriptor { alias: string; pkg: any; defaults?: any; extends?: string; register(container: IContainer, options?: any): Promise; deregister?(container: IContainer, options?: any): Promise; } export interface PluginConfig { name: string; version: string; options: { [key: string]: any; }; plugin: T; } export interface IContainer { silentShutdown: boolean; isReady: boolean; setUp(version: string, variables: any, options?: any): Promise; getConfig(): any; /** * Tear down the app. * @return {Promise} */ tearDown(): Promise; /** * Add a new registration. */ register(name: string, resolver: Resolver): this; /** * Resolve a registration. * @param {string} key * @return {Object} * @throws {Error} */ resolve(key: any): T; /** * Resolve a plugin. * @param {string} key * @return {Object} * @throws {Error} */ resolvePlugin(key: any): T; /** * Resolve the options of a plugin. Available before a plugin mounts. * @param {string} key * @return {Object} * @throws {Error} */ resolveOptions(key: any): any; /** * Determine if the given registration exists. * @param {String} key * @return {Boolean} */ has(key: any): boolean; /** * Force the container to exit and print the given message and associated error. */ forceExit(message: string, error?: Error): void; /** * Exit the container with the given exitCode, message and associated error. */ exit(exitCode: number, message: string, error?: Error): void; /** * Get the application git commit hash. * @throws {String} */ getHashid(): string; /** * Get the application version. * @throws {String} */ getVersion(): string; /** * Set the application version. * @param {String} version * @return {void} */ setVersion(version: any): void; }