declare namespace Superluminal { interface Association { /** * field on the inverse model to refer to the calling Model */ inverse: string; } interface JoinColumnOption { name: string; referencedColumnName: string; fieldName: string; } interface ManyToOne extends Association { joinColumns?: JoinColumnOption[]; onDelete?: string; } interface OneToOne extends Association { joinColumns?: JoinColumnOption; referencedColumn: string; } interface SerializeOptions { graphql?: boolean; } type ManyToOneMeta = { pair: string[]; onDelete?: string; }; type AssociationRecord = Record | undefined; type ManyToOneRecord = | Record | undefined; interface AssociationMapping { oneToManys: Record; manyToOnes: Record; } // helpers type ManyToOnes = Record; type OneToManys = Record; type OneToOnes = Record; interface Column { type: string; array?: boolean; dataType: string; primary?: boolean; name: string; default?: string | null; nullable: boolean; autoIncrement?: boolean; } type Columns = Record; interface Index { columns: Array; unique?: boolean; } interface Args { database?: string; host?: string; port?: number; schemas?: string; graphql?: boolean; output?: string; } type Config = { graphqlModels?: { exclude: Record | boolean>; excludeSchemas: Record | boolean>; }; excludeRelationships?: Record>; } & Args; type Indexes = Record; type JoinColumns = Record; interface Model { name: string; schema: string; oneToOnes?: OneToOnes; oneToManys?: OneToManys; manyToOnes?: ManyToOnes; manyToManys?: Record; columns: Columns; primaryKeys?: string[]; indexes?: Indexes; joinColumns?: JoinColumns; } interface Models { [name: string]: Model; } export interface TableMetadata { // ... existing properties ... indexes?: Array<{ name: string; unique: boolean; fields: string[]; }>; foreignKeys?: { [key: string]: { targetTable: string; sourceColumns: string[]; targetColumns: string[]; }; }; } }