import Component from "@glimmer/component"; import type { TOC } from "@ember/component/template-only"; import type { ModifierLike, WithBoundArgs } from "@glint/template"; declare const DialogElement: TOC<{ Element: HTMLDialogElement; Args: { /** * @internal */ open: boolean | undefined; /** * @internal */ onClose: () => void; /** * @internal */ register: ModifierLike<{ Element: HTMLDialogElement; }>; }; Blocks: { default: []; }; }>; export interface Signature { Args: { /** * Optionally set the open state of the `` * The state will still be managed internally, * so this does not need to be a maintained value, but whenever it changes, * the dialog element will reflect that change accordingly. */ open?: boolean; /** * When the `` is closed, this function will be called * and the ``'s `returnValue` will be passed. * * This can be used to determine which button was clicked to close the modal * * Note though that this value is only populated when using * `
` */ onClose?: (returnValue: string) => void; }; Blocks: { default: [ { /** * Represents the open state of the `` element. */ isOpen: boolean; /** * Closes the `` element * Will throw an error if `Dialog` is not rendered. */ close: () => void; /** * Opens the `` element. * Will throw an error if `Dialog` is not rendered. */ open: () => void; /** * This modifier should be applied to the button that opens the Dialog so that it can be re-focused when the dialog closes. * * Example: * * ```gjs * * ``` */ focusOnClose: ModifierLike<{ Element: HTMLElement; }>; /** * This is the `` element (with some defaults pre-wired). * This is required to be rendered. */ Dialog: WithBoundArgs; } ]; }; } declare class ModalDialog extends Component { #private; _isOpen: boolean; get isOpen(): boolean; set isOpen(val: boolean); refocus: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: unknown[]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: Element; }>; dialogElement: HTMLDialogElement | undefined; register: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: unknown[]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: HTMLDialogElement; }>; /** * Closes the dialog -- this will throw an error in development if the dialog element was not rendered */ close: () => void; /** * @internal * * handles the element's native close behavior. * listened to via addEventListener('close', ...); */ handleClose: () => void; /** * Opens the dialog -- this will throw an error in development if the dialog element was not rendered */ open: () => void; } export declare const Modal: typeof ModalDialog; export declare const Dialog: typeof ModalDialog; export default ModalDialog; //# sourceMappingURL=dialog.d.ts.map