diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-02-29 13:05:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 13:05:45 +0900 |
commit | 200c4c1d379e591e82d6d1bd065a443f6abc03f5 (patch) | |
tree | db7257f0178b2d9514642a7faf3e003d60d2b418 /src/components/Dialog/types.ts | |
parent | a1127bfcfc7ad080a5bd6210c6561788f1643db8 (diff) | |
parent | a35976cdc9b6467ad8b6e0c4ff46ba684fee9064 (diff) | |
download | voidsky-200c4c1d379e591e82d6d1bd065a443f6abc03f5.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/components/Dialog/types.ts')
-rw-r--r-- | src/components/Dialog/types.ts | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index 161c03734..78dfedf5a 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -6,11 +6,24 @@ import {ViewStyleProp} from '#/alf' type A11yProps = Required<AccessibilityProps> -export type DialogControlProps = { +/** + * Mutated by useImperativeHandle to provide a public API for controlling the + * dialog. The methods here will actually become the handlers defined within + * the `Dialog.Outer` component. + */ +export type DialogControlRefProps = { open: (options?: DialogControlOpenOptions) => void close: (callback?: () => void) => void } +/** + * The return type of the useDialogControl hook. + */ +export type DialogControlProps = DialogControlRefProps & { + id: string + ref: React.RefObject<DialogControlRefProps> +} + export type DialogContextProps = { close: DialogControlProps['close'] } @@ -26,9 +39,7 @@ export type DialogControlOpenOptions = { } export type DialogOuterProps = { - control: { - ref: React.RefObject<DialogControlProps> - } & DialogControlProps + control: DialogControlProps onClose?: () => void nativeOptions?: { sheet?: Omit<BottomSheetProps, 'children'> |