46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { IModalSettings } from "./IModalSettings";
|
|
|
|
export interface ILayout {
|
|
|
|
currentMousePosition: MouseEvent;
|
|
|
|
hotkeysEnabled: boolean;
|
|
|
|
/**
|
|
* Opens a Popup
|
|
*
|
|
* @param {IModalSettings} settings
|
|
* @return {*} {() => void}
|
|
* @memberof ILayout
|
|
*/
|
|
openPopup(settings: IModalSettings): () => void;
|
|
|
|
/**
|
|
* Opens a Popup and awaits the result. Therefore the Componenten
|
|
* which is rendered must implement use the functions onSubmit(data)
|
|
* and onCancel(error) to cancel.
|
|
*
|
|
* @template T
|
|
* @param {IModalSettings} settings
|
|
* @return {*} {Promise<T>}
|
|
* @memberof ILayout
|
|
*/
|
|
getDialogData<T = any>(settings: IModalSettings): Promise<T>;
|
|
|
|
/**
|
|
* Helper Function to render a Toast.
|
|
* @param message The Message of the Toast
|
|
* @param type The Type.
|
|
* @param timeout A Timeout in [ms], after which the Toast should disapear. 0 = infinity
|
|
*/
|
|
showToast(message: string, type?: "info" | "warning" | "success" | "error" | "default" | "dark" | "light" | "dark", autoClose?: number): void;
|
|
|
|
/**
|
|
* Trys to rerender the widget with the given id
|
|
*
|
|
* @author M.Karkowski
|
|
* @param {string} widget the ID of the widget
|
|
* @memberof ILayout
|
|
*/
|
|
refresh(widget: string): void;
|
|
} |