Repository URL to install this package:
|
Version:
3.0.4 ▾
|
import { ReactNode, ChangeEvent, FocusEvent, MouseEvent } from 'react';
export interface Handlers {
onValueChange?: (state: IncrementerStateType) => void;
}
export interface IncrementerProps extends Handlers {
className?: string;
children?: ReactNode;
title?: string;
nowrap?: boolean;
step?: number;
minValue?: number;
maxValue?: number;
state?: IncrementerStateType;
}
export interface IncrementerBoxProps extends Handlers {
state: IncrementerStateType;
}
export declare type InputChangeEvent = ChangeEvent<HTMLInputElement>;
export declare type InputFocusEvent = FocusEvent<HTMLInputElement>;
export declare type ClickEvent = MouseEvent<HTMLButtonElement>;
export interface ChangeHandler extends Handlers {
event: InputChangeEvent;
}
export interface ClickHandler extends Handlers {
event: ClickEvent;
}
export interface IncrementerStateType {
count: number;
shouldIncrement: boolean;
shouldDecrement: boolean;
incrementCount(props: ClickHandler): void;
decrementCount(props: ClickHandler): void;
handleChange(props: ChangeHandler): void;
handleBlur(event: InputFocusEvent): void;
update(props: IncrementerProps): void;
}