import { S as Subject } from './core-BR8gTRyy.js'; /** * Helper utilities for Subject - tree-shakeable * Import only the helpers you need to keep bundle size minimal */ /** * Object assign helper for Subject. * Merges a partial value with the current value. * * @param subject - The subject to update * @param newValue - Partial value to merge * @throws Error if the current value is not an object * * @example * ```typescript * import { nextAssign } from 'subjecto/helpers' * * const subject = new Subject({ a: 1, b: 2 }) * nextAssign(subject, { b: 3 }) // { a: 1, b: 3 } * ``` */ declare function nextAssign(subject: Subject, newValue: Partial): void; /** * Push helper for Subject with array values. * Appends a new item to the array. * * @param subject - The subject with array value * @param value - Value to push * @throws Error if the current value is not an array * * @example * ```typescript * import { nextPush } from 'subjecto/helpers' * * const subject = new Subject([1, 2, 3]) * nextPush(subject, 4) // [1, 2, 3, 4] * ``` */ declare function nextPush(subject: Subject, value: T): void; /** * Toggle helper for Subject with boolean values. * Flips the boolean value. * * @param subject - The subject with boolean value * @throws Error if the current value is not a boolean * * @example * ```typescript * import { toggle } from 'subjecto/helpers' * * const subject = new Subject(false) * toggle(subject) // true * toggle(subject) // false * ``` */ declare function toggle(subject: Subject): void; /** * Subscribe once helper. * Calls the callback a single time with the subject's current value, then * automatically unsubscribes (even if the callback throws). It does not wait * for a future change — it fires synchronously, like a one-shot `subscribe`. * * @param subject - The subject to subscribe to * @param callback - Callback function to call once * * @example * ```typescript * import { once } from 'subjecto/helpers' * * const subject = new Subject(0) * once(subject, (value) => { * console.log('Called once with the current value:', value) // 0 * }) * ``` */ declare function once(subject: Subject, callback: (value: T) => void): void; /** * Complete helper. * Unsubscribes all subscribers from the subject. * * @param subject - The subject to complete * * @example * ```typescript * import { complete } from 'subjecto/helpers' * * const subject = new Subject(0) * complete(subject) // Removes all subscribers * ``` */ declare function complete(subject: Subject): void; export { complete, nextAssign, nextPush, once, toggle };