import { Observer } from './observer/observer';
import { Subject } from './subject/subject-interface';
/**
 * The ChangeManager is a class that allows observers to register themselves to a subject
 * and notify the observer if signaled by subject
 *
 * @requires Subject
 * @requires Observer
 * @property {Map<Subject, Observer<unknown>[]>} pubSubMap - the map of subject to observers
 */
declare class ChangeManager {
  private pubSubMap;
  /**
   * If the subject is already in the map, add the observer to the list of observers for that subject. If the subject is not
   * in the map, add the subject to the map and add the observer to the list of observers for that subject
   *
   * @param {Subject} subject - The subject of the event.
   * @param {Observer<unknown>} observer - The observer that will be registered.
   */
  register(subject: Subject, observer: Observer<unknown>): void;
  /**
   * If the subject is in the map, remove the observer from the list of observers for that subject
   *
   * @param {Subject} subject - The subject of the event.
   * @param {Observer<unknown>} observer - The observer to be unregistered.
   */
  unregister(subject: Subject, observer: Observer<unknown>): void;
  /**
   * The function clears the observers for a given subject in a pub-sub map.
   *
   * @param {Subject} subject - The subject parameter is an object that represents the subject of the observer pattern. It is used as a key to identify the observers that are subscribed to it.
   */
  clearObserversBySubject(subject: Subject): void;
  /**
   * If the subject is in the map, then notify all observers of the subject
   *
   * @param {Subject} subject - Subject
   * @param {unknown} payload - The payload to be sent to the observer.
   */
  notify(subject: Subject, payload: unknown): void;
}
declare const _default: ChangeManager;
export default _default;
