jupyterlab-emrys
Version:
A computational environment for Jupyter. Powered by Emrys
65 lines (64 loc) • 1.57 kB
TypeScript
/**
* A button applied to a dialog.
*/
export interface IButtonItem {
/**
* The text for the button.
*/
text: string;
/**
* The icon class for the button.
*/
icon?: string;
/**
* The extra class name to associate with the button.
*/
className?: string;
}
/**
* A default confirmation button.
*/
export declare const okButton: IButtonItem;
/**
* A default cancel button.
*/
export declare const cancelButton: IButtonItem;
/**
* The options used to create a dialog.
*/
export interface IDialogOptions {
/**
* The tope level text for the dialog (defaults to an empty string).
*/
title?: string;
/**
* The main body element for the dialog or a message to display.
*
* #### Notes
* If a `string` is provided, it will be used as the `HTMLContent` of
* a `<span>`. If an `<input>` or `<select>` element is provided,
* they will be styled.
*/
body?: HTMLElement | string;
/**
* The host element for the dialog (defaults to `document.body`).
*/
host?: HTMLElement;
/**
* A list of button times to display (defaults to [[okButton]] and
* [[cancelButton]]).
*/
buttons?: IButtonItem[];
/**
* The confirmation text for the OK button (defaults to 'OK').
*/
okText?: string;
}
/**
* Create a dialog and show it.
*
* @param options - The dialog setup options.
*
* @returns The button item that was selected.
*/
export declare function showDialog(options?: IDialogOptions): Promise<IButtonItem>;