import type { SubscribeListener, VanillaStore } from "../index.cjs"; export interface WithSubscribeContributes { /** * Subscribe to the store's state changes. * * @param listener - The listener to be called when the state changes. * @param sync - Whether to call the listener synchronously. * @param selector - A selector to select a part of the state to be passed to the listener. */ subscribe: (listener: SubscribeListener, sync?: boolean, selector?: (state: State) => object) => () => void; } /** * Enhance a store with the `subscribe` method. * * @param store - The store to be enhanced. * @returns The enhanced store. * * @since 0.2.0 * * @example * * ```ts * import { createVanilla, withSubscribe } from '@reactive-react/core' * * const store = withSubscribe(createVanilla({ count: 0 })) * * const unsubscribe = store.subscribe((state) => { * console.log(state.count) * }) * ``` * */ export declare function withSubscribe>(store: Store): Store & WithSubscribeContributes; //# sourceMappingURL=with-subscribe.d.cts.map