@ima/core
Version:
IMA.js framework for isomorphic javascript application
42 lines • 1.55 kB
TypeScript
import { Constructor } from 'type-fest';
import { OCInjectable } from './ObjectContainer';
export type EntryConstructor<T> = OCInjectable<T> | (() => T);
export type EntrySharedInstance<T> = T extends () => T ? T : Constructor<T>;
export type EntryOptions = {
writeable: boolean;
};
/**
* Object container entry, representing either a class, interface, constant or
* an alias.
*/
export declare class Entry<T = any> {
#private;
/**
* The constructor of the class represented by this entry, or the
* getter of the value of the constant represented by this entry.
*/
classConstructor: EntryConstructor<T>;
/**
* The shared instance of the class represented by this entry.
*/
sharedInstance: EntrySharedInstance<T> | null;
/**
* Initializes the entry.
*
* @param classConstructor The
* class constructor or constant value getter.
* @param dependencies The dependencies to pass into the
* constructor function.
* @param referrer Reference to part of application that created
* this entry.
* @param options The Entry options.
*/
constructor(classConstructor: EntryConstructor<T>, dependencies?: any[], referrer?: string, options?: EntryOptions);
set dependencies(dependencies: any[]);
get dependencies(): any[];
get referrer(): string | undefined;
get writeable(): boolean;
get options(): EntryOptions;
static from<TInfer>(entry: Entry<TInfer>): Entry<TInfer>;
}
//# sourceMappingURL=Entry.d.ts.map