import { type Dispatch } from 'react'; type StateInitializerFN = () => State; type StateUpdaterFN = (previousState: PreviousState) => State; export type InitialState = State | StateInitializerFN; export type NextState = State | StateUpdaterFN; /** * Like `useState`, but every value set is passed through a mediator function * before the state is updated. The initial state is NOT mediated by default. * @template State The type of the state managed by the hook (after mediation). * @template RawState The type of the value passed to the setter (before mediation). Defaults to State. * @param initialState Initial state value or initializer function. Resolved value is used directly. * @param mediator Optional function that takes the resolved raw value and returns the final state value. Applied only on updates. */ export declare const useMediatedState: (initialState: InitialState, mediator?: (resolvedRawValue: RawState) => State) => [State, Dispatch>]; export type CounterActions = { /** * Returns the current value of the counter. (Getter removed, use state value directly) */ /** * Increment the counter by the given `delta`. Clamped by min/max. * @param delta Amount to increment by. Can be a number or function `(prevValue) => number`. Defaults to 1. */ inc: (delta?: NextState) => void; /** * Decrement the counter by the given `delta`. Clamped by min/max. * @param delta Amount to decrement by. Can be a number or function `(prevValue) => number`. Defaults to 1. */ dec: (delta?: NextState) => void; /** * Set the counter to any value. Clamped by min/max. * @param value New value or function `(prevValue) => number`. */ set: (value: NextState) => void; /** * Resets the counter to its originally resolved and clamped initial value. */ reset: () => void; }; /** * Tracks a numeric value with optional min/max boundaries and provides counter actions. * * @param initialValue The initial value (or initializer function). Defaults to 0. * @param max Optional maximum value. Initial value is clamped if needed. * @param min Optional minimum value. Initial value is clamped if needed. */ export declare const useCounter: (initialValue?: InitialState, max?: number, min?: number) => [number, CounterActions]; export {};