Changeset View
Changeset View
Standalone View
Standalone View
lib/flow-typed/npm/focus-trap-react_vx.x.x.js
- This file was added.
// flow-typed signature: 29231f6b72f5876f5692b592dce3c754 | |||||
// flow-typed version: <<STUB>>/focus-trap-react_v10.1.4/flow_v0.182.0 | |||||
/** | |||||
* This is an autogenerated libdef stub for: | |||||
* | |||||
* 'focus-trap-react' | |||||
* | |||||
* Fill this stub out by replacing all the `any` types. | |||||
* | |||||
* Once filled out, we encourage you to share your work with the | |||||
* community by sending a pull request to: | |||||
* https://github.com/flowtype/flow-typed | |||||
*/ | |||||
declare module 'focus-trap-react' { | |||||
import type { Node } from 'react'; | |||||
declare type FocusTargetValue = HTMLElement | string; | |||||
declare type FocusTargetValueOrFalse = FocusTargetValue | false; | |||||
declare type FocusTarget = FocusTargetValue | (() => FocusTargetValue); | |||||
declare type FocusTargetOrFalse = FocusTargetValueOrFalse | (() => FocusTargetValueOrFalse); | |||||
declare type MouseEventToBoolean = (event: MouseEvent | TouchEvent) => boolean; | |||||
declare type KeyboardEventToBoolean = (event: KeyboardEvent) => boolean; | |||||
declare type FocusTrapOptions = { | |||||
onActivate?: () => void, | |||||
onPostActivate?: () => void, | |||||
onPause?: () => void, | |||||
onPostPause?: () => void, | |||||
onUnpause?: () => void, | |||||
onPostUnpause?: () => void, | |||||
onDeactivate?: () => void, | |||||
onPostDeactivate?: () => void, | |||||
checkCanReturnFocus?: (trigger: HTMLElement) => Promise<void>, | |||||
initialFocus?: FocusTargetOrFalse, | |||||
fallbackFocus?: FocusTarget, | |||||
returnFocusOnDeactivate?: boolean, | |||||
setReturnFocus?: FocusTargetValueOrFalse | ((nodeFocusedBeforeActivation: HTMLElement) => FocusTargetValueOrFalse), | |||||
escapeDeactivates?: boolean | KeyboardEventToBoolean, | |||||
clickOutsideDeactivates?: boolean | MouseEventToBoolean, | |||||
allowOutsideClick?: boolean | MouseEventToBoolean, | |||||
preventScroll?: boolean, | |||||
delayInitialFocus?: boolean, | |||||
document?: Document, | |||||
isKeyForward?: KeyboardEventToBoolean, | |||||
isKeyBackward?: KeyboardEventToBoolean, | |||||
}; | |||||
declare type FocusTrapProps = { | |||||
+children?: Node, | |||||
+active?: boolean, | |||||
+paused?: boolean, | |||||
+focusTrapOptions?: FocusTrapOptions, | |||||
+containerElements?: $ReadOnlyArray<HTMLElement>, | |||||
}; | |||||
declare module.exports: FocusTrapProps => Node; | |||||
} |