Closes a modal instance by ID, setting it to inactive and emitting the closed event.
Sets the modal active state to false and triggers onModalClosed listeners. The modal remains registered and can be reopened.
ID of the modal to close
Creates a new modal instance with a unique ID and registers it for management.
Generates a unique modal ID if not provided and automatically wraps the close handler to ensure proper cleanup. Returns the modal ID for later reference when opening or closing the modal.
Modal configuration (see TypeModalProps interface)
Unique modal ID, or undefined if modal has no content
Deletes a modal instance by ID and removes it from the registry.
Unregisters the modal from management and cleans up references. Should be called when the modal is no longer needed to free resources.
ID of the modal to delete
Unregisters a handler from modal closed events.
Previously registered callback to remove
Unregisters a handler from modal opened events.
Previously registered callback to remove
Registers a handler to be called when a modal is closed.
Function to execute when modal closed event is triggered
Registers a handler to be called when a modal is opened.
Function to execute when modal opened event is triggered
Opens a modal instance by ID, setting it to active and emitting the opened event.
Sets the modal active state to true and triggers onModalOpened listeners. Modal must be created and registered before opening.
ID of the modal to open
Manages modal instances, handles registration, state changes, and event emissions.
Provides APIs to create, open, close, and delete modals. Emits events when modals are opened or closed, allowing listeners to react to modal state changes.