ModalProp
type ModalProp<P extends ModalfyParams, Props = unknown> = Props & {
modal: UsableModalProp<P>
}
// ------------------ INTERNAL TYPES ------------------ //
type ModalfyParams = { [key: string]: any }
interface UsableModalProp<
P extends ModalfyParams,
M extends Exclude<keyof P, symbol | number> = Exclude<
keyof P,
symbol | number
>
> {
closeAllModals: (callback?: () => void) => void
closeModal: (modalName?: M, callback?: () => void) => void
closeModals: (modalName: M, callback?: () => void) => boolean
currentModal: M | null
openModal: (modalName: M, params?: P[M], callback?: () => void) => void
}API reference
closeAllModals
closeAllModals closeModal
closeModal closeModals
closeModals currentModal
currentModal openModal
openModal Last updated