add `Partial<GestureResponderEvent>` to `.open()` (#3227)
parent
8ac5144a58
commit
2a5b0ab2ac
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import type {AccessibilityProps} from 'react-native'
|
import type {AccessibilityProps, GestureResponderEvent} from 'react-native'
|
||||||
import {BottomSheetProps} from '@gorhom/bottom-sheet'
|
import {BottomSheetProps} from '@gorhom/bottom-sheet'
|
||||||
|
|
||||||
import {ViewStyleProp} from '#/alf'
|
import {ViewStyleProp} from '#/alf'
|
||||||
|
@ -10,9 +10,15 @@ type A11yProps = Required<AccessibilityProps>
|
||||||
* Mutated by useImperativeHandle to provide a public API for controlling the
|
* Mutated by useImperativeHandle to provide a public API for controlling the
|
||||||
* dialog. The methods here will actually become the handlers defined within
|
* dialog. The methods here will actually become the handlers defined within
|
||||||
* the `Dialog.Outer` component.
|
* the `Dialog.Outer` component.
|
||||||
|
*
|
||||||
|
* `Partial<GestureResponderEvent>` here allows us to add this directly to the
|
||||||
|
* `onPress` prop of a button, for example. If this type was not added, we
|
||||||
|
* would need to create a function to wrap `.open()` with.
|
||||||
*/
|
*/
|
||||||
export type DialogControlRefProps = {
|
export type DialogControlRefProps = {
|
||||||
open: (options?: DialogControlOpenOptions) => void
|
open: (
|
||||||
|
options?: DialogControlOpenOptions & Partial<GestureResponderEvent>,
|
||||||
|
) => void
|
||||||
close: (callback?: () => void) => void
|
close: (callback?: () => void) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue