@gechiui/components
Version:
UI components for GeChiUI.
48 lines • 2.04 kB
TypeScript
/**
* A float supported clamp function for a specific value.
*
* @param {number|null} value The value to clamp.
* @param {number} min The minimum value.
* @param {number} max The maximum value.
*
* @return {number} A (float) number
*/
export function floatClamp(value: number | null, min: number, max: number): number;
/**
* Hook to store a clamped value, derived from props.
*
* @param {Object} settings Hook settings.
* @param {number} settings.min The minimum value.
* @param {number} settings.max The maximum value.
* @param {number} settings.value The current value.
* @param {any} settings.initial The initial value.
*
* @return {[*, Function]} The controlled value and the value setter.
*/
export function useControlledRangeValue({ min, max, value: valueProp, initial, }: {
min: number;
max: number;
value: number;
initial: any;
}): [any, Function];
/**
* Hook to encapsulate the debouncing "hover" to better handle the showing
* and hiding of the Tooltip.
*
* @param {Object} settings Hook settings.
* @param {Function} [settings.onShow=noop] A callback function invoked when the element is shown.
* @param {Function} [settings.onHide=noop] A callback function invoked when the element is hidden.
* @param {Function} [settings.onMouseMove=noop] A callback function invoked when the mouse is moved.
* @param {Function} [settings.onMouseLeave=noop] A callback function invoked when the mouse is moved out of the element.
* @param {number} [settings.timeout=300] Timeout before the element is shown or hidden.
*
* @return {Object} Bound properties for use on a React.Node.
*/
export function useDebouncedHoverInteraction({ onHide, onMouseLeave, onMouseMove, onShow, timeout, }: {
onShow?: Function | undefined;
onHide?: Function | undefined;
onMouseMove?: Function | undefined;
onMouseLeave?: Function | undefined;
timeout?: number | undefined;
}): Object;
//# sourceMappingURL=utils.d.ts.map