@withjoy/joykit
Version:
UI Component Library for Joy web
25 lines (24 loc) • 999 B
TypeScript
import { OverlayContextRegisterFunction } from './OverlayContext';
declare type ShowOverlay = () => void;
declare type HideOverlay = () => void;
interface UseOverlayConfig {
/**
* Whether or not the overlay element should be unmounted when the parent component (at time of instantiation)
* is unmounted.
* @default true
*/
removeOnUnmount?: boolean;
/**
* Inputs that will prompt an update when changed.
*
* When provided, this overlay element is driven by inputs from the surrounding scope.
*
* When empty, it would suggest that the element is self sufficient - either it manages its own local state or it
* pulls from an external store (Apollo client, Redux, etc).
*
* @default []
*/
dependencies?: any[];
}
export declare const useOverlay: <T extends object>(registerFunctionArguments: OverlayContextRegisterFunction<T>, config?: UseOverlayConfig) => [ShowOverlay, HideOverlay];
export {};