/** * The ChangesObserver module is an object that represents a disposable resource * provided by the ChangesObservable module. * * @class ChangesObserver */ export declare class ChangesObserver { #private; /** * Internal storage map for local hook callbacks, keyed by hook name. */ _localHooks: Record; /** * Registers a callback function for the given local hook name. */ addLocalHook: (key: string, callback: Function) => this; /** * Triggers all callbacks registered under the given local hook name. */ runLocalHooks: (key: string, ...args: unknown[]) => void; /** * Removes all locally registered hook callbacks from this observer instance. */ clearLocalHooks: () => this; /** * Subscribes to the observer. * * @param {Function} callback A function that will be called when the new changes will appear. * @returns {ChangesObserver} */ subscribe(callback: Function): this; /** * Unsubscribes all subscriptions. After the method call, the observer would not produce * any new events. * * @returns {ChangesObserver} */ unsubscribe(): this; /** * The write method is executed by the ChangesObservable module. The module produces all * changes events that are distributed further by the observer. * * @private * @param {object} changes The chunk of changes produced by the ChangesObservable module. * @returns {ChangesObserver} */ _write(changes: unknown[]): this; /** * The write method is executed by the ChangesObservable module. The module produces initial * changes that will be used to notify new subscribers. * * @private * @param {object} initialChanges The chunk of changes produced by the ChangesObservable module. */ _writeInitialChanges(initialChanges: unknown[]): void; }