import { METADATA_TYPE } from './../Constants'; import { ILookupRegistry } from '../../api/ILookupRegistry'; import { IEntityRef } from '../../api/IEntityRef'; import { IClassRef } from '../../api/IClassRef'; import { IPropertyRef } from '../../api/IPropertyRef'; import { LookupRegistry } from '../LookupRegistry'; import { Semaphore } from '@allgemein/base'; import { ISchemaRef } from '../../api/ISchemaRef'; import { IRegistryOptions } from './IRegistryOptions'; /** * Registry for metadata of classes and there properties */ export declare abstract class AbstractRegistry implements ILookupRegistry { protected readonly namespace: string; private _lock; readonly options: IRegistryOptions; constructor(namespace: string, options?: IRegistryOptions); get lock(): Semaphore; ready(timeout?: number): Promise; getOptions(): IRegistryOptions; /** * Return all registered schema references * * @param ref * @return ISchemaRef[] */ getSchemaRefs(filter?: (x: ISchemaRef) => boolean): (T | ISchemaRef)[]; /** * Return schema references for an given entity or class reference * * @param ref * @return ISchemaRef[] */ getSchemaRefsFor(ref: string): T | ISchemaRef; /** * TODO * * @param filter */ getEntityRefs(filter?: (x: IEntityRef) => boolean): (T | IEntityRef)[]; /** * Can get get entity ref for function. * * @param fn */ getEntityRefFor(fn: string | object | Function, skipNsCheck?: boolean): (T | IEntityRef); /** * Returns the used instance of lookup registry handler */ getLookupRegistry(namespace?: string): LookupRegistry; /** * Method for returning class ref * * @param object * @param type */ getClassRefFor(object: string | Function | IClassRef, type: METADATA_TYPE): IClassRef; /** * Returns property by name for a given class or entity ref * * @param filter */ getPropertyRef(ref: IClassRef | IEntityRef, name: string): (T | IPropertyRef); /** * Returns all properties for given class or entity ref * * @param ref */ getPropertyRefs(ref: IClassRef | IEntityRef): (T | IPropertyRef)[]; getPropertyRefsFor(fn: string | object | Function): (T | IPropertyRef)[]; list(type: METADATA_TYPE, filter?: (x: any) => boolean): X[]; listEntities(filter?: (x: IEntityRef) => boolean): IEntityRef[]; listProperties(filter?: (x: IPropertyRef) => boolean): IPropertyRef[]; create(context: string, options: any): T; /** * TODO */ add(context: string, entry: T, ns?: string): T; /** * TODO */ filter(context: string, search: (x: any) => boolean, ns?: string): T[]; /** * TODO */ find(context: string, search: any, ns?: string): T; /** * TODO */ remove(context: string, search: any, ns?: string): T[]; /** * reset current registry */ reset(): void; /** * Remove namespace from LookupRegistry and also remove semaphore lock if exists */ clear(): void; }