/** * Base observable class that tracks concepts and connections for reactive state management. * Implements the observer pattern to notify subscribers when tracked data changes. */ export declare class DependencyObserver { /** List of subscriber callbacks */ subscribers: any[]; /** Primary concept ID being observed */ mainConcept: number; /** List of composition IDs */ compositionIds: number[]; /** List of concept IDs */ conceptIds: number[]; /** List of internal connection IDs */ internalConnections: number[]; /** List of reverse connection IDs */ reverse: number[]; /** List of linker connection IDs */ linkers: number[]; /** List of newly added IDs */ newIds: number[]; /** List of dependency IDs */ dependency: number[]; /** Whether initial data has been loaded */ isDataLoaded: boolean; /** Whether an update is currently in progress */ isUpdating: boolean; /** The observable data to be returned */ data: any; /** Whether data has been fetched */ fetched: boolean; /** Output format (NORMAL, DATAID, JUSTDATA, etc.) */ format: number; /** Map of concept IDs to their event handlers (string keys to support composite keys) */ eventHandlers: { [key: string]: (event: Event) => void; }; /** Map of handler keys to actual browser event names. */ private eventNames; /** Whether this observer has been disposed. */ protected isDisposed: boolean; /** * Registers a window listener and tracks enough metadata to remove it later. * The key identifies the logical subscription; eventName is the CustomEvent name. */ protected addTrackedEventListener(key: string | number, eventName: string | number, handler: (event: Event) => void): void; /** * Removes a previously tracked window listener by its logical key. */ protected removeTrackedEventListener(key: string | number): void; /** * Hook for subclasses that maintain additional subscriptions. */ protected onDispose(): void; /** * Removes all listeners owned by this observer. */ dispose(): void; /** * Listens to changes for a specific concept type and updates subscribers when new concepts of that type are created. * @param id - The type concept ID to track */ listenToEventType(id: number): void; /** * Listens to connection changes for a specific concept and updates subscribers when connections are modified. * @param id - The concept ID to track */ listenToEvent(id: number): void; /** * Removes an event listener for a specific concept ID. * @param id - The concept ID to stop tracking */ removeListenToEvent(id: number): void; /** * Listens to connection changes filtered by connection type for a specific concept. * @param id - The concept ID to track * @param connectionType - The connection type ID to filter by */ listenToEventConnectionType(id: number, connectionType: number): void; /** * Binds and refreshes the observable data. Override in subclasses to implement specific data fetching logic. * @returns The bound data */ bind(): Promise; /** * Executes the observable without subscribing. Override in subclasses for non-reactive data fetching. * @returns The executed data */ run(): Promise; /** * Forces a data refresh and notifies all subscribers. */ update(): Promise; /** * Subscribes a callback to receive data updates whenever tracked concepts/connections change. * @param callback - Function to call with (data, observer) when updates occur * @param errorCallback - Optional function to call when errors occur * @returns Result of calling the callback with current data */ subscribe(callback: any, errorCallback?: (error: Error) => void): any; /** * Executes the observable once without subscribing to updates. * @returns The executed data */ execute(): Promise; /** * Removes a callback from the subscriber list. * @param callback - The callback function to remove * @returns Number of remaining subscribers */ unsubscribe(callback: any): number; /** * Notifies all subscribers with the current data. */ notify(): void; }