export declare type EntityType = 'model' | 'controller' | 'seeder' | 'migration' | 'store' | 'service'; export declare type EntityMetadata = any; export interface RegistryEntityConstructor { constructor: RegistryEntityStatic; } export interface RegistryEntityStatic extends Function { __metadata?: M; getMetadata?(): M; } export declare class RegistryEntity { constructor(); /** The metadata associated with the class instance */ static __metadata: EntityMetadata; /** The default metadata associated with the class instance */ static __metadataDefault: EntityMetadata; /** * Get the metadata for the model (static side) * @returns {ModelMetadata} */ static getMetadata(): EntityMetadata; /** * Get the metadata for the model (instance side) * Note this is the same as Model.getMetadata(), but more convenient if you don't know or have * access to the model name * @returns {ModelMetadata} */ getMetadata(): M; } /** * The EntityRegistry is the core register for all entities that are annotated with the entity * decorators: * * [[Model|@Model]] * * [[Controller|@Controller]] * * [[Seeder|@Seeder]] * * [[Migration|@Migration]] * * [[Store|@Store]] * * [[Service|@Service]] * * Both the static classes and any associated metatadata are assigned to the registry by the * decorators */ export declare class EntityRegistry { static root: EntityRegistry; /** The internal registry */ protected registry: Map>>; constructor(); static register(type: EntityType, entity: RegistryEntityStatic, metadata?: any): EntityRegistry; static clearAll(): EntityRegistry; /** * Associate an entity class with a type and any metadata if present * @param type * @param entity * @param metadata * @returns {EntityRegistry} */ register(type: EntityType, entity: RegistryEntityStatic, metadata?: any): this; /** * Retrieve all entities associated with the given type * @param type * @returns {any} */ getAllOfType(type: EntityType): Map>; /** * Remove all of a given type * @param type * @returns {EntityRegistry} */ clearType(type: EntityType): this; /** * Clear the registry * @returns {EntityRegistry} */ clearAll(): this; /** * Remove a specific entity by type * @param type * @param name * @returns {boolean} */ removeByType(type: EntityType, name: string): boolean; /** * Check if an entity is already present in the registry * @param type * @param name * @returns {boolean} */ hasEntity(type: EntityType, name: string): boolean; /** * Find an entity given a known type and class name * @param type * @param name * @returns {RegistryEntityStatic} */ findByType(type: EntityType, name: string): RegistryEntityStatic; /** * Find all entities with a given class name * @param name * @returns {any} */ findAllWithName(name: string): Map> | null; }