import * as React from 'react'; export interface ModalState { data: TData | null; isOpen?: boolean; } export interface CreateModalConfig { contextName: string; } export type ContextValue = { onOpen: (anchorRef: React.RefObject, data: TData) => void; onClose: () => void; isOpen: boolean; /** * The data associated with the currently open modal, or null if the modal is closed. */ data: TData | null; /** * A component can subscribe to a modal close event and react to it * e.g. Closing the `MoreEventsPopover` when an `EventDialog` closes */ subscribeCloseHandler: (handler: () => void) => () => void; }; export interface ProviderProps { children: React.ReactNode; /** * Render function for the modal. */ render: (props: { isOpen: boolean; anchorRef: React.RefObject; data: TData; onClose: () => void; }) => React.ReactNode; onOpen?: (data: TData) => void; onClose?: () => void; } export interface TriggerProps { children: React.ReactNode; data: TData; onClick?: React.MouseEventHandler; }