import { IAutoUpdatedClientObjectBase, MongoId, IsData, IAutoUpdateManager, Constructor, EventEmitter3, LoggersType, DEMCache, DEMErrorCode } from "./CommonTypes.js"; import "reflect-metadata"; export declare abstract class AutoUpdateManager> = Record>> implements IAutoUpdateManager { protected abstract objects_: { [_id: string]: T; }; protected isLoaded_: boolean; readonly socket: unknown; protected classParam: Constructor; protected properties: string[]; readonly className: string; readonly cache: DEMCache; readonly managers: M; protected preloaded: boolean; protected waitingToResolveReferences: { [_id: string]: string; }; protected loggers: LoggersType; protected emitter: EventEmitter3; /** * Initializes the base AutoUpdateManager instance. * Extracts registered property metadata from the class prototype. * * @param classParam - The constructor function of the managed object class. * @param className - The name identifier of the managed class. * @param socket - The socket instance (client Socket.IO or server Server). * @param loggers - Logging interfaces for info, debug, warn, and error levels. * @param managers - Registry of sibling managers. * @param emitter - Event emitter for manager and lifecycle events. * @throws {DEMError} Throws DEMErrorCode.MISSING_ARGUMENT when classParam is omitted. */ constructor(classParam: Constructor, className: string, socket: unknown, loggers: LoggersType, managers: M, emitter: EventEmitter3); /** * Indicates whether the manager has completed its initialization and reference loading. * * @returns True when the manager is fully loaded. */ get isLoaded(): boolean; /** * Closes the manager, purges cached objects, and disconnects the underlying socket. */ close(): void; /** * Asynchronously loads unresolved references across all managed objects. * Marks the manager as loaded upon completion. * * @returns A promise that resolves when all references are loaded. */ loadReferences(): Promise; /** * Deletes an object by its identifier, destroys the instance, and clears global caches. * * @param _id - The unique identifier of the object to delete. * @param isRemote - Whether the deletion originates from a remote source. * @returns A promise resolving to the deletion result object. */ deleteObject(_id: MongoId, isRemote?: boolean): Promise<{ success: boolean; message: string; code?: DEMErrorCode; }>; /** * Retrieves an array of all managed object string identifiers. * * @returns Array of object ID strings. */ get objectIDs(): string[]; /** * Fetches an object missing from local memory. * * @param _id - Identifier of the missing object. * @returns A promise resolving to the retrieved object instance. */ abstract handleGetMissingObject(_id: MongoId): Promise; /** * Creates a new object instance. * * @param data - Object initial data properties without the `_id` field. * @returns A promise resolving to the created object instance. */ abstract createObject(data: Omit, "_id">): Promise; /** * Retrieves a managed object from local state by ID. * * @param _id - Optional identifier of the object. * @returns The object instance, null, or undefined. */ abstract getObject(_id?: MongoId): T | null | undefined; /** * Retrieves the dictionary of all managed objects keyed by their identifier. * * @returns Map of objects keyed by string ID. */ abstract get objects(): { [_id: string]: T; }; /** * Retrieves all managed objects as an array. * * @returns Array containing all managed object instances. */ abstract get objectsAsArray(): T[]; }