import { AnyEntity, Constructor, DeepPartial, Dictionary, EntityMetadata, EntityName, EntityProperty, ExpandProperty, NonFunctionPropertyNames } from '../typings'; import { EmbeddedOptions, EnumOptions, IndexOptions, ManyToManyOptions, ManyToOneOptions, OneToManyOptions, OneToOneOptions, PrimaryKeyOptions, PropertyOptions, SerializedPrimaryKeyOptions, UniqueOptions } from '../decorators'; import { EntityRepository } from '../entity'; import { ReferenceType } from '../enums'; import { Type } from '../types'; declare type TypeType = string | NumberConstructor | StringConstructor | BooleanConstructor | DateConstructor | ArrayConstructor | Constructor>; declare type TypeDef = { type: TypeType; } | { customType: Type; } | { entity: string | (() => string | EntityName); }; declare type Property = ({ reference: ReferenceType.MANY_TO_ONE | 'm:1'; } & TypeDef & ManyToOneOptions) | ({ reference: ReferenceType.ONE_TO_ONE | '1:1'; } & TypeDef & OneToOneOptions) | ({ reference: ReferenceType.ONE_TO_MANY | '1:m'; } & TypeDef & OneToManyOptions) | ({ reference: ReferenceType.MANY_TO_MANY | 'm:n'; } & TypeDef & ManyToManyOptions) | ({ reference: ReferenceType.EMBEDDED | 'embedded'; } & TypeDef & EmbeddedOptions & PropertyOptions) | ({ enum: true; } & EnumOptions) | (TypeDef & PropertyOptions); declare type PropertyKey = NonFunctionPropertyNames>; declare type Metadata = Omit>, 'name' | 'properties'> & ({ name: string; } | { class: Constructor; name?: string; }) & { properties?: { [K in PropertyKey & string]-?: Property>, T>; }; }; export declare class EntitySchema = AnyEntity, U extends AnyEntity | undefined = undefined> { private readonly _meta; private internal; private initialized; constructor(meta: Metadata); static fromMetadata = AnyEntity, U extends AnyEntity | undefined = undefined>(meta: EntityMetadata | DeepPartial>): EntitySchema; addProperty(name: string & keyof T, type?: TypeType, options?: PropertyOptions | EntityProperty): void; addEnum(name: string & keyof T, type?: TypeType, options?: EnumOptions): void; addVersion(name: string & keyof T, type: TypeType, options?: PropertyOptions): void; addPrimaryKey(name: string & keyof T, type: TypeType, options?: PrimaryKeyOptions): void; addSerializedPrimaryKey(name: string & keyof T, type: TypeType, options?: SerializedPrimaryKeyOptions): void; addEmbedded(name: string & keyof T, options: EmbeddedOptions): void; addManyToOne(name: string & keyof T, type: TypeType, options: ManyToOneOptions): void; addManyToMany(name: string & keyof T, type: TypeType, options: ManyToManyOptions): void; addOneToMany(name: string & keyof T, type: TypeType, options: OneToManyOptions): void; addOneToOne(name: string & keyof T, type: TypeType, options: OneToOneOptions): void; addIndex(options: Required, 'name' | 'type' | 'options'>> & { name?: string; type?: string; options?: Dictionary; }): void; addUnique(options: Required, 'name' | 'options'>> & { name?: string; options?: Dictionary; }): void; setCustomRepository(repository: () => Constructor>): void; setExtends(base: string): void; setClass(proto: Constructor): void; get meta(): EntityMetadata; get name(): EntityName; /** * @internal */ init(): this; private initProperties; private initPrimaryKeys; private normalizeType; private createProperty; } export {};