type SubjectSubscription = (value: T) => void; type SubscriptionHandle = { unsubscribe: () => void; id: symbol; }; interface SubjectConstructorOptions { name?: string; updateIfStrictlyEqual?: boolean; } declare const DEFAULT_NAME = "noName"; declare const DEFAULT_UPDATE_IF_STRICTLY_EQUAL = true; declare const ERROR_MESSAGES: { VALUE_NOT_OBJECT: string; VALUE_NOT_ARRAY: string; VALUE_NOT_BOOLEAN: string; }; declare const INFO_MESSAGES: { SHOULD_USE_A_NAME: string; }; declare class Subject { private value; /** * The list of all the subscribers */ subscribers: Map>; /** * Enables debug logs (only works in development mode) */ debug: boolean | ((nextValue: T) => void); /** * A function that is called before the value changes. Can be used to check/process/format the new value before updating the subscribers. */ before: (nextValue: T) => T; /** * Count the number of value updates. */ count: number; /** * Subject options */ options: SubjectConstructorOptions; constructor(initialValue: T, options?: SubjectConstructorOptions); /** * Object assign wrap for the `next` method. */ nextAssign(newValue: Partial): void; /** * Push a new item to the subject if it is an array. */ nextPush(value: unknown): void; /** * Toggles a boolean value. */ toggle(): void; /** * A subscription that is called once with the current value, then * unsubscribed automatically. The unsubscription happens even if the * callback throws, so a throwing callback can never fire twice. */ once(subscription: SubjectSubscription): void; /** * Unsubscribes all the subscribers. */ complete(): void; /** * Assign a new value to the subject. */ next(nextValue: T): void; /** * Subscribe to the subject. */ subscribe(subscription: SubjectSubscription): SubscriptionHandle; /** * Unsubscribe a subscription. Returns a boolean indicating if the unsubscription was successful. */ unsubscribe(id: symbol): boolean; getValue(): T; } export { DEFAULT_NAME as D, ERROR_MESSAGES as E, INFO_MESSAGES as I, Subject as S, DEFAULT_UPDATE_IF_STRICTLY_EQUAL as a, type SubjectConstructorOptions as b, type SubjectSubscription as c, type SubscriptionHandle as d };