@kitten-science/kitten-scientists
Version:
Add-on for the wonderful incremental browser game: https://kittensgame.com/web/
33 lines • 1.35 kB
TypeScript
import { Container } from "./Container.js";
import { UiComponent, type UiComponentInterface, type UiComponentOptions } from "./UiComponent.js";
export type DialogOptions = ThisType<Dialog> & UiComponentOptions & {
readonly hasCancel?: boolean;
readonly hasClose?: boolean;
readonly onCancel?: () => void;
readonly onConfirm?: (result: string) => void;
readonly prompt?: boolean;
readonly promptValue?: string;
};
export declare class Dialog extends UiComponent<HTMLDialogElement> {
readonly options: DialogOptions;
readonly container: Container;
readonly head: Container;
returnValue: string;
/**
* Constructs a dialog.
*
* @param host - A reference to the host.
* @param options - Options for the dialog.
*/
constructor(parent: UiComponent, options?: DialogOptions);
toString(): string;
addChildHead(child: UiComponentInterface): this;
addChildrenHead(children?: Iterable<UiComponentInterface>): this;
addChildContent(child: UiComponent): this;
addChildrenContent(children?: Iterable<UiComponentInterface>): this;
show(): void;
showModal(): void;
close(): void;
static prompt(parent: UiComponent, text: string, title?: string, initialValue?: string, explainer?: string): Promise<string | undefined>;
}
//# sourceMappingURL=Dialog.d.ts.map