import { CustomSignalClass, Signal } from "typescene-async"; import Component from "../Component"; import DropCardContainer from "./DropCardContainer"; import { Block } from "../"; import { TextButton } from "../Controls/Button"; import { ComponentFactory, ValueOrAsync } from "../ComponentFactory"; import { ActionHandler } from "../DOMEvents"; /** Represents a modal dialog container */ export declare class DialogContainer extends DropCardContainer { /** Create a new modal dialog with given content, if any */ constructor(content?: Block[], width?: string); /** Initialize a drawer factory with given values */ static with: (values: DialogContainer.Initializer) => ComponentFactory; /** Initialize a drawer factory with given content */ static withContent: (content: ComponentFactory.SpecList2) => ComponentFactory; /** Initialize with given (observable) values; returns this */ initializeWith: (values: DialogContainer.Initializer) => this; /** Max dialog width (CSS value, observed), can be set to "auto" */ width: string; /** Remove the dialog from screen (does not emit Closing signal); returns this */ close(): this; /** Use given UI component as a drag handle for this dialog (and releases handle currently in use; defaults to .header) */ setDragHandle(handle: Component | null): void; /** Signal emitted when user clicks outside dialog, presses esc or clicks DialogContainer.TopCloseButton; if any handler throws an error then the dialog will not close */ readonly Closing: CustomSignalClass>; /** Signal emitted when this dialog has been closed */ readonly Closed: CustomSignalClass>; private _dragHandleConnection; private _dragHandleSet; } export declare namespace DialogContainer { /** Initializer for .with({ ... }) */ interface Initializer extends DropCardContainer.Initializer { /** Property initializer */ width?: ValueOrAsync; /** Signal initializer: method name or handler */ Closing?: string | ActionHandler; /** Signal initializer: method name or handler */ Closed?: string | ActionHandler; } } export declare namespace DialogContainer { /** Shortcut for a modal close button ("X") control */ class TopCloseButton extends TextButton { /** Create a close button component */ constructor(); protected render(): void; label: string; } } export default DialogContainer;