import { EntityFieldType } from './EntityFieldType'; export interface EntityField { name: string; column?: string; type: EntityFieldType | string; nullable?: boolean; primary?: boolean; readonly?: boolean; default?: any; description?: string; } export interface EntityViewDefinition { name: string; description?: string; select?: string[]; where?: any; orderBy?: { field: string; direction?: 'asc' | 'desc'; }[]; pageSize?: number; search?: string[]; extend?: (q: any, params: ParsedViewParams, runtime: BuildRuntimeContext) => any; } export interface EntitySchema { name: string; table: string; description?: string; fields: EntityField[]; defaultView?: string; views?: EntityViewDefinition[]; defaultFields?: string[]; relations?: EntityRelation[]; } export interface ParsedViewParams { select?: string[]; filter?: any; orderBy?: { field: string; direction: 'asc' | 'desc'; }[]; top?: number; skip?: number; search?: string; } export interface BuildRuntimeContext { entity: EntitySchema; view?: EntityViewDefinition; db: any; args: any; contextMap: (obj: any, src: any) => any; } export type EntityRelationType = 'oneToMany' | 'manyToOne' | 'manyToMany'; export interface EntityRelation { name: string; type: EntityRelationType; target: string; foreignKey?: string; localKey?: string; joinTable?: string; joinSourceKey?: string; joinTargetKey?: string; cascade?: { insert?: boolean; update?: boolean; delete?: boolean; }; description?: string; } //# sourceMappingURL=EntityTypes.d.ts.map