@mantine/hooks
Version:
A collection of 50+ hooks for state and UI management
18 lines (17 loc) • 567 B
TypeScript
export interface UseCounterOptions {
min?: number;
max?: number;
}
export interface UseCounterHandlers {
increment: () => void;
decrement: () => void;
set: (value: number) => void;
reset: () => void;
}
export type UseCounterReturnValue = [number, UseCounterHandlers];
export declare function useCounter(initialValue?: number, options?: UseCounterOptions): UseCounterReturnValue;
export declare namespace useCounter {
type Options = UseCounterOptions;
type Handlers = UseCounterHandlers;
type ReturnValue = UseCounterReturnValue;
}