about summary refs log tree commit diff
path: root/src/components/Dialog/types.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-02-28 13:27:54 -0600
committerGitHub <noreply@github.com>2024-02-28 11:27:54 -0800
commitd2c6edacb6464b52513dbe467c8b5713abd6a9fc (patch)
tree05c5bfb188c129b0d682d2e99597f55b53176292 /src/components/Dialog/types.ts
parent0c3d55db6ff03cf38b5033c0ae9851e8cd5ea5f7 (diff)
downloadvoidsky-d2c6edacb6464b52513dbe467c8b5713abd6a9fc.tar.zst
Protect against non functions being passed to close callback (#3019)
Diffstat (limited to 'src/components/Dialog/types.ts')
-rw-r--r--src/components/Dialog/types.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts
index 75ba825ac..161c03734 100644
--- a/src/components/Dialog/types.ts
+++ b/src/components/Dialog/types.ts
@@ -6,8 +6,13 @@ import {ViewStyleProp} from '#/alf'
 
 type A11yProps = Required<AccessibilityProps>
 
+export type DialogControlProps = {
+  open: (options?: DialogControlOpenOptions) => void
+  close: (callback?: () => void) => void
+}
+
 export type DialogContextProps = {
-  close: () => void
+  close: DialogControlProps['close']
 }
 
 export type DialogControlOpenOptions = {
@@ -20,11 +25,6 @@ export type DialogControlOpenOptions = {
   index?: number
 }
 
-export type DialogControlProps = {
-  open: (options?: DialogControlOpenOptions) => void
-  close: (callback?: () => void) => void
-}
-
 export type DialogOuterProps = {
   control: {
     ref: React.RefObject<DialogControlProps>