import Model from "../../model.js"; import type { ModelName, ModuleDatabase } from "../../types.js"; export declare const ARRAY_ASKING_RELATIONSHIPS: Set; export type RelationshipType = "BelongsTo" | "OneToOne" | "HasMany" | "ManyToMany"; export type RelationshipCache = WeakMap; export interface RelationshipMetadata { RelationshipClass: typeof Model; RelationshipCache: RelationshipCache; relationshipName: string; relationshipType: RelationshipType; foreignKeyColumnName: null | string; SourceClass: typeof Model; ReverseRelationshipCache: RelationshipCache; reverseRelationshipName: string; reverseRelationshipType: RelationshipType; reverseRelationshipForeignKeyColumnName: null | string; } export interface BelongsToRelationshipMetadata extends RelationshipMetadata { foreignKeyColumnName: string; reverseRelationshipForeignKeyColumnName: null; } export interface HasOneRelationshipMetadata extends RelationshipMetadata { foreignKeyColumnName: null; reverseRelationshipForeignKeyColumnName: string; } export interface HasManyRelationshipMetadata extends RelationshipMetadata { foreignKeyColumnName: null; reverseRelationshipForeignKeyColumnName: string; } export interface RelationshipTable { [relationshipName: string]: RelationshipMetadata; } export interface ReverseRelationshipsTable { ModelName: RelationshipMetadata[]; } interface BelongsToColumnTable { [belongsToColumnForeignKeyName: string]: RelationshipMetadata; } export interface RelationshipSummary { [relationshipName: string]: typeof Model | Array; } export default class RelationshipSchema { static _relationshipTable: Map; static getRelationshipTable(Class: typeof Model, relationshipTypeFilter?: RelationshipType): RelationshipTable; static _reverseRelationshipTables: ModuleDatabase; static getReverseRelationshipsTable(Class: typeof Model): ReverseRelationshipsTable; static getRelationshipMetadataFor(Class: typeof Model, relationshipName: string): RelationshipMetadata; static _belongsToColumnTable: ModuleDatabase; static getBelongsToColumnTable(Class: typeof Model): BelongsToColumnTable; static _belongsToColumnNames: ModuleDatabase>; static getBelongsToColumnNames(Class: typeof Model): Set; static get relationshipsSummary(): ModuleDatabase; static resetSchema(Class?: typeof Model): typeof RelationshipSchema; } export {};