Interface IModal

Represents a modal component.

IModal

interface IModal {
    id: string;
    onInit?: (() => void | Promise<void>);
    onMount?: ((count: number, stack: IModal[]) => void | Promise<void>);
    onUnmount?: ((count: number, stack: IModal[]) => void | Promise<void>);
    render: ModalRender;
}

Properties

id: string
onInit?: (() => void | Promise<void>)

Function called when the component initializes.

Type declaration

    • (): void | Promise<void>
    • Returns void | Promise<void>

      Returns a Promise that resolves when the initialization is complete, or undefined if there is no need for an asynchronous operation.

onMount?: ((count: number, stack: IModal[]) => void | Promise<void>)

Function called when the component mounts.

Type declaration

    • (count, stack): void | Promise<void>
    • Parameters

      • count: number

        The count parameter for the onMount function.

      • stack: IModal[]

        The stack parameter for the onMount function.

      Returns void | Promise<void>

      • A Promise that resolves to void or a void value.
onUnmount?: ((count: number, stack: IModal[]) => void | Promise<void>)

Callback function called when unmounting occurs.

Type declaration

    • (count, stack): void | Promise<void>
    • Parameters

      • count: number

        The count value.

      • stack: IModal[]

        The stack of modals.

      Returns void | Promise<void>

      • A Promise that resolves when the function completes or void if no Promise is returned.
render: ModalRender