main
Last change
on this file since d565449 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 | |
---|
1 | import { Dispatch } from 'react';
|
---|
2 | import { IHookStateInitAction, IHookStateSetAction } from './misc/hookState';
|
---|
3 | interface 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 | }
|
---|
11 | export declare type UseStateHistoryReturn<S> = [S, Dispatch<IHookStateSetAction<S>>, HistoryState<S>];
|
---|
12 | export declare function useStateWithHistory<S, I extends S>(initialState: IHookStateInitAction<S>, capacity?: number, initialHistory?: I[]): UseStateHistoryReturn<S>;
|
---|
13 | export declare function useStateWithHistory<S = undefined>(): UseStateHistoryReturn<S | undefined>;
|
---|
14 | export {};
|
---|
Note:
See
TracBrowser
for help on using the repository browser.