import { IRelationDescriptor } from './interfaces.js'; import { ModelBase } from './model.js'; import { OneToManyRelationList } from './relation-objects.js'; /** * Relation object for user metadata * Base class for all metadata related models. * * Metadata is used to store additional information about particular model, that we dont know at design time. */ export declare abstract class MetadataModel extends ModelBase> { protected _value: any; protected _key: string; Id: number; Type: 'number' | 'float' | 'string' | 'json' | 'boolean' | 'datetime'; get Value(): any; set Value(value: any); get Key(): string; set Key(value: string); protected getType(val: any): 'number' | 'float' | 'string' | 'json' | 'boolean' | 'datetime'; } /** * * Base class for all metadata related relations. * It allows to access metadata as relation object properties. use it for example like this: * * ```typescript * const user = await User.find(1); * user.Metadata['test:test'] = 'test'; * await user.Metadata.sync(); * ``` */ export declare class MetadataRelation, O extends ModelBase> extends OneToManyRelationList { [key: string]: any; /** * * Delete metadata by key in DB * * @param key key of the metadata to get * @returns */ delete(key: string): Promise; constructor(owner: O, relation: IRelationDescriptor, objects?: R[]); } //# sourceMappingURL=metadata.d.ts.map