import { BaseActionObject, State, StateMachine } from 'xstate';
export interface CounterMachineCtx {
    count: number;
    prevCount: number;
    min: number;
    max: number;
    onChange?: (val: number, prev?: number) => void;
    saveAsync?: (val: number, prev?: number) => Promise<void>;
}
export type CounterMachineEvent = {
    type: 'INC';
} | {
    type: 'DEC';
} | {
    type: 'UPDATE_MAX';
    payload: number;
} | {
    type: 'UPDATE_MIN';
    payload: number;
};
export type States = 'active' | 'changed' | 'success' | 'failure';
export type CounterMachineServices = {
    handleChange: {
        data: unknown;
    };
};
export type CounterStateMachine = StateMachine<CounterMachineCtx, any, CounterMachineEvent, {
    value: States;
    context: CounterMachineCtx;
}, BaseActionObject, CounterMachineServices, any>;
export type CounterState = State<CounterMachineCtx, CounterMachineEvent>;
type MachineOptions = {
    id: string;
    min: number;
    max: number;
    start: number;
    onChange?: (val: number) => void;
    saveAsync?: (val: number) => Promise<void>;
};
export default function buildCounterMachine(options: MachineOptions): CounterStateMachine;
export {};
//# sourceMappingURL=counter.machine.d.ts.map