import type * as z from 'zod'; import type { ModelDefinition, RelationConfig } from './types'; /** * Define a model with its schema and relations * * Creates a model definition that can be used for type-safe queries * and eager loading of relations. * * @param config - Model configuration * @returns The model definition * * @example * ```typescript * const League = defineModel({ * name: 'League', * table: 'leagues', * schema: LeagueSchema, * relations: { * posts: { * type: 'hasMany', * target: 'posts', * foreignKey: 'league_id', * primaryKey: 'id', * }, * country: { * type: 'belongsTo', * target: 'countries', * foreignKey: 'country_id', * primaryKey: 'id', * }, * }, * }); * ``` */ export declare function defineModel(config: { name: string; table: string; schema: T; primaryKey?: string; relations?: Record; }): ModelDefinition; /** * Get a registered model by name * * @param name - Model name * @returns The model definition or undefined * * @example * ```typescript * const League = getModel('League'); * if (League) { * // Use the model * } * ``` */ export declare function getModel(name: string): ModelDefinition | undefined; /** * Check if a model has a specific relation * * @param model - Model definition * @param relationName - Name of the relation to check * @returns True if the relation exists * * @example * ```typescript * if (hasRelation(League, 'posts')) { * // League has posts relation * } * ``` */ export declare function hasRelation(model: ModelDefinition, relationName: string): boolean; /** * Get a relation configuration from a model * * @param model - Model definition * @param relationName - Name of the relation * @returns The relation configuration or undefined * * @example * ```typescript * const postsRelation = getRelation(League, 'posts'); * if (postsRelation?.type === 'hasMany') { * // Handle hasMany relation * } * ``` */ export declare function getRelation(model: ModelDefinition, relationName: string): RelationConfig | undefined; /** * Get all relation names for a model * * @param model - Model definition * @returns Array of relation names */ export declare function getRelationNames(model: ModelDefinition): string[]; /** * Clear the model registry (useful for testing) */ export declare function clearModelRegistry(): void; /** * Get all registered models */ export declare function getAllModels(): ReadonlyMap; //# sourceMappingURL=define.d.ts.map