UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

30 lines 1.06 kB
declare type CounterHandler = { decrement: () => void; decrementBy: (amount: number) => void; increment: () => void; incrementBy: (amount: number) => void; reset: () => void; value: number; }; /** * * @typedef handler * @type {object} * @property {number} value The value of the counter * @property {Function} increment Increment counter value by 1 * @property {Function} decrement Decrement counter value by 1 * @property {Function} incrementBy Increment counter by incrAmount * @property {Function} decrementBy Decrement counter by decrAmount * @property {Function} reset Reset counter to initialValue * @see {@link https://react-hooks.org/docs/useCounter} */ /** * Counter hook * * @param {number} initialValue The initial value of the counter * @returns {handler} A handler to interact with the counter * @see https://react-hooks.org/docs/useCounter */ declare function useCounter(initialValue: number): CounterHandler; export { useCounter }; //# sourceMappingURL=useCounter.d.ts.map