source: imaps-frontend/node_modules/react-use/esm/useStateWithHistory.d.ts

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 698 bytes
Line 
1import { Dispatch } from 'react';
2import { IHookStateInitAction, IHookStateSetAction } from './misc/hookState';
3interface HistoryState<S> {
4 history: S[];
5 position: number;
6 capacity: number;
7 back: (amount?: number) => void;
8 forward: (amount?: number) => void;
9 go: (position: number) => void;
10}
11export declare type UseStateHistoryReturn<S> = [S, Dispatch<IHookStateSetAction<S>>, HistoryState<S>];
12export declare function useStateWithHistory<S, I extends S>(initialState: IHookStateInitAction<S>, capacity?: number, initialHistory?: I[]): UseStateHistoryReturn<S>;
13export declare function useStateWithHistory<S = undefined>(): UseStateHistoryReturn<S | undefined>;
14export {};
Note: See TracBrowser for help on using the repository browser.