vulcain-corejs
Version:
Vulcain micro-service framework
65 lines (64 loc) • 1.75 kB
TypeScript
import 'reflect-metadata';
/**
* List of default service names
*
* @export
* @class DefaultServiceNames
*/
export declare class DefaultServiceNames {
static TokenService: string;
static ScopesPolicy: string;
static ScopesDescriptor: string;
static ServiceDescriptors: string;
static "Authentication": string;
static "Logger": string;
static "Provider": string;
static "EventBusAdapter": string;
static "ActionBusAdapter": string;
static "Domain": string;
static "Application": string;
static "ServerAdapter": string;
static Container: string;
static ProviderFactory: string;
static TestUser: string;
static RequestContext: string;
static Metrics: string;
static ApiKeyService: string;
}
/**
* Component life time
*
* @export
* @enum {number}
*/
export declare enum LifeTime {
/**
* Only one instance
*/
Singleton = 1,
/**
* Create a new instance every time
*/
Transient = 2,
/**
* Create one instance per request
*/
Scoped = 4,
}
/**
* Used to initialize a constructor parameter with a component
*
* @export
* @param {string} component name
* @param {boolean} [optional] True to not raise an exception if component doesn't exist
*/
export declare function Inject(name: string, optional?: boolean): (target: any, key: any, i: any) => void;
/**
* Used to declare a component.
*
* @export
* @param {LifeTime} lifeTime of the component
* @param {string} [name] - By default this is the class name
* @param {enableOnTestOnly} Active this component only in an test environment
*/
export declare function Injectable(lifeTime: LifeTime, name?: string, enableOnTestOnly?: boolean): (target: any) => void;