interface UnloadOptions { includeChildren?: boolean; [key: string]: unknown; } export default class Store { static instance: Store | undefined; data: Map>; /** * Set by Orm during init — resolves memory flag for a model name. */ _memoryResolver: ((modelName: string) => boolean) | null; /** * Set by Orm during init — reference to the SQL adapter instance for on-demand queries. */ _sqlDb: { findRecord(modelName: string, id: unknown): Promise; findAll(modelName: string, conditions?: Record): Promise; } | null; constructor(); /** * Synchronous memory-only access. * Returns the record if it exists in the in-memory store, undefined otherwise. * Does NOT query the database. For memory:false models, use find() instead. */ get(key: string): Map | undefined; get(key: string, id: number | string): unknown; /** * Async authoritative read. Always queries the SQL database for memory: false models. * For memory: true models, returns from store (already loaded on boot). */ find(modelName: string, id: number | string): Promise; /** * Async read for all records of a model. Always queries MySQL for memory: false models. * For memory: true models, returns from store. */ findAll(modelName: string, conditions?: Record): Promise; /** * Async query — always hits MySQL, never reads from memory cache. * Use for complex queries, aggregations, or when you need guaranteed freshness. */ query(modelName: string, conditions?: Record): Promise; /** * Check if a model is configured for in-memory storage. * @private */ private _isMemoryModel; set(key: string, value: Map): void; remove(key: string, id?: number | string): void; unloadRecord(model: string, id: unknown, options?: UnloadOptions): void; unloadAllRecords(model: string, options?: UnloadOptions): void; private _removeFromHasManyArrays; private _nullifyBelongsToReferences; private _cleanupRelationshipRegistries; /** * Extracts hasMany and non-bidirectional belongsTo children from a record * @private */ private _getChildren; private _isBidirectionalRelationship; private _buildUnloadQueue; } export {};