@airplane/views
Version:
A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.
27 lines (26 loc) • 997 B
TypeScript
import { Dispatch } from "react";
import { ComponentType } from "../../../state/context/context";
import { Action } from "./reducer";
import { InitialNumberInputState, NumberInputState } from "./state";
export type InputHookOptions = {
initialState?: InitialNumberInputState;
focus?: () => void;
min?: number;
max?: number;
};
/**
* getUseNumberInputState returns hook that creates and manages state
* for NumberInput or Slider on the Airplane context
*/
export declare const getUseNumberInputState: (componentType: ComponentType.NumberInput | ComponentType.Slider) => (id: string, options?: InputHookOptions) => {
state: NumberInputState;
dispatch: Dispatch<Action>;
};
export declare const useNumberInputState: (id: string, options?: InputHookOptions) => {
state: NumberInputState;
dispatch: Dispatch<Action>;
};
export declare const useSliderState: (id: string, options?: InputHookOptions) => {
state: NumberInputState;
dispatch: Dispatch<Action>;
};