1 | export interface Options {
|
2 | min?: number;
|
3 | max?: number;
|
4 | }
|
5 | export interface Actions {
|
6 | inc: (delta?: number) => void;
|
7 | dec: (delta?: number) => void;
|
8 | set: (value: number | ((c: number) => number)) => void;
|
9 | reset: () => void;
|
10 | }
|
11 | export type ValueParam = number | ((c: number) => number);
|
12 | declare function useCounter(initialValue?: number, options?: Options): readonly [number, {
|
13 | readonly inc: (delta?: number) => void;
|
14 | readonly dec: (delta?: number) => void;
|
15 | readonly set: (value: ValueParam) => void;
|
16 | readonly reset: () => void;
|
17 | }];
|
18 | export default useCounter;
|