@vtex/admin-ui
Version:
> VTEX admin component library
25 lines (24 loc) • 805 B
TypeScript
export declare function useReducedState(initialState?: boolean): ReducedState;
declare type InitialState<T> = T | (() => T);
/**
* React custom hook that returns the very first value passed to `initialState`,
* even if it changes between re-renders.
*/
export declare function useInitalState<T>(initialState: InitialState<T>): T;
export interface ReducedState {
/** If is reduced or not */
reduced: boolean;
/** Toggle button visibility */
toggleVisible: boolean;
/** Toggle reduced state */
toggle: () => void;
/** Reduce the nav */
reduce: () => void;
/** Expand the nav */
expand: () => void;
/** Enable button visibility */
showToggle: () => void;
/** Disable button visibility */
hideToggle: () => void;
}
export {};