import { FieldType, StoreLocation, FieldDefinition, CollectionConfig } from '../types'; interface RelationshipMetadata { fieldName: string; type: 'ManyToOne' | 'OneToOne' | 'OneToMany' | 'ManyToMany'; targetClassName: string; foreignKey?: string; required?: boolean; } interface CollectionMetadata { name: string; description?: string; database?: string; config?: CollectionConfig; } interface FieldMetadata { name: string; type: FieldType; description?: string; required?: boolean; indexed?: boolean; unique?: boolean; filterable?: boolean; vectorize?: boolean; default?: any; values?: any[]; storeIn?: StoreLocation[]; extractConfig?: { extract_text?: boolean; ocr_if_needed?: boolean; chunk_size?: number; chunk_overlap?: number; }; schema?: FieldDefinition[]; } export interface FieldOptions { type: FieldType; description?: string; required?: boolean; indexed?: boolean; unique?: boolean; filterable?: boolean; vectorize?: boolean; default?: any; values?: any[]; storeIn?: StoreLocation[]; extractConfig?: { extract_text?: boolean; ocr_if_needed?: boolean; chunk_size?: number; chunk_overlap?: number; }; schema?: FieldDefinition[]; } export interface CollectionOptions { name: string; description?: string; database?: string; config?: CollectionConfig; } export declare function Collection(options: CollectionOptions): (target: new () => object) => void; export declare function Field(options: FieldOptions): (target: any, propertyKey: string | symbol) => void; export declare function getCollectionMetadata(): Map; export declare function getFieldMetadata(target: new () => object): FieldMetadata[] | undefined; export declare function clearMetadata(): void; export declare function getRelationshipMetadata(target: new () => object): RelationshipMetadata[] | undefined; export declare function getAllRelationshipMetadata(): Map; export declare function fieldMetadataToDefinition(field: FieldMetadata): FieldDefinition; export interface RelationOptions { /** Target collection class */ target: () => new () => object; /** Description of the relationship */ description?: string; /** Whether this relationship is required */ required?: boolean; /** Index the foreign key field */ indexed?: boolean; /** Make this relationship available for filtering in vector searches */ filterable?: boolean; } export interface ManyToOneOptions extends RelationOptions { /** Name of the foreign key field (default: {propertyKey}_id) */ foreignKey?: string; } export interface OneToOneOptions extends RelationOptions { /** Name of the foreign key field (default: {propertyKey}_id) */ foreignKey?: string; /** Whether this is the owning side of the relationship */ owner?: boolean; } export interface OneToManyOptions { /** Target collection class */ target: () => new () => object; /** Name of the foreign key in the target collection */ foreignKey: string; /** Description of the relationship */ description?: string; } export interface ManyToManyOptions { /** Target collection class */ target: () => new () => object; /** Name of the join table (default: {collection1}_{collection2}) */ joinTable?: string; /** Description of the relationship */ description?: string; } /** * Many-to-One relationship (N:1) * * @example * ```typescript * @Collection({ name: "posts" }) * class Post { * @ManyToOne({ * target: () => User, * required: true, * indexed: true * }) * author!: User; // Creates author_id foreign key * } * ``` */ export declare function ManyToOne(options: ManyToOneOptions): (target: any, propertyKey: string | symbol) => void; /** * One-to-One relationship (1:1) * * @example * ```typescript * @Collection({ name: "users" }) * class User { * @OneToOne({ * target: () => Profile, * owner: true, * required: false * }) * profile?: Profile; // Creates profile_id foreign key * } * ``` */ export declare function OneToOne(options: OneToOneOptions): (target: any, propertyKey: string | symbol) => void; /** * One-to-Many relationship (1:N) * This is informational only - the foreign key exists on the "many" side * * @example * ```typescript * @Collection({ name: "users" }) * class User { * @OneToMany({ * target: () => Post, * foreignKey: "author_id" * }) * posts?: Post[]; // Virtual field, no FK created here * } * ``` */ export declare function OneToMany(options: OneToManyOptions): (target: any, propertyKey: string | symbol) => void; /** * Many-to-Many relationship (N:N) * Creates a join table to manage the relationship * * @example * ```typescript * @Collection({ name: "posts" }) * class Post { * @ManyToMany({ * target: () => Tag, * joinTable: "post_tags" * }) * tags?: Tag[]; // Join table: post_tags(post_id, tag_id) * } * ``` */ export declare function ManyToMany(options: ManyToManyOptions): (target: any, propertyKey: string | symbol) => void; export {}; //# sourceMappingURL=decorators.d.ts.map