import { UmbModalToken } from '../token/modal-token.js'; import type { UmbModalConfig, UmbModalType } from '../types.js'; import type { UmbControllerHost } from '../../../../libs/controller-api/index.js'; import type { UUIModalElement, UUIModalSidebarSize } from '../../../../external/uui/index.js'; import { UmbControllerBase } from '../../../../libs/class-api/index.js'; import { UmbViewController } from '../../view/index.js'; import type { ElementLoaderProperty } from '../../../../libs/extension-api/index.js'; import type { IRouterSlot } from '../../router/index.js'; export interface UmbModalRejectReason { type: string; } export type UmbModalContextClassArgs> = { router?: IRouterSlot | null; data?: ModalAliasTypeAsToken['DATA']; value?: ModalAliasTypeAsToken['VALUE']; modal?: UmbModalConfig; }; export declare class UmbModalContext extends UmbControllerBase { #private; readonly key: string; readonly data: ModalData; readonly type: UmbModalType; readonly element?: ElementLoaderProperty; readonly backdropBackground?: string; readonly router: IRouterSlot | null; readonly alias: string | UmbModalToken; readonly value: import("rxjs").Observable; readonly size: import("rxjs").Observable; readonly view: UmbViewController; constructor(host: UmbControllerHost, modalAlias: string | UmbModalToken, args: UmbModalContextClassArgs); _internal_setCurrentModalPath(path: string): void; _internal_removeCurrentModal(): Promise; forceResolve(): void; isResolved(): boolean; /** * Submits this modal, returning with a value to the initiator of the modal. * @public * @memberof UmbModalContext */ submit(): void; /** * Closes this modal * @param {UmbModalRejectReason} [reason] - The reason for rejecting the modal * @public * @memberof UmbModalContext */ reject(reason?: UmbModalRejectReason): void; /** * Gives a Promise which will be resolved when this modal is submitted. * @returns {Promise} A promise resolved with the modal's value on submit * @public * @memberof UmbModalContext */ onSubmit(): Promise; /** * Gives the current value of this modal. * @returns {ModalValue} The current value * @public * @memberof UmbModalContext */ getValue(): ModalValue; /** * Sets the current value of this modal. * @param {ModalValue} value - The new value * @public * @memberof UmbModalContext */ setValue(value: ModalValue): void; /** * Updates the current value of this modal. * @param {Partial} partialValue - The partial value to merge into the current value * @public * @memberof UmbModalContext */ updateValue(partialValue: Partial): void; /** * Updates the size this modal. * @param {UUIModalSidebarSize} size - The new modal size * @public * @memberof UmbModalContext */ setModalSize(size: UUIModalSidebarSize): void; destroy(): void; }