nope/resources/ui/layout/interfaces/ILayout.ts

46 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-10-29 18:20:42 +00:00
import { IModalSettings } from "./IModalSettings";
export interface ILayout {
2020-10-30 18:30:59 +00:00
currentMousePosition: MouseEvent;
hotkeysEnabled: boolean;
2020-10-29 18:20:42 +00:00
/**
* 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
*/
2021-08-26 17:41:08 +00:00
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;
2020-10-29 18:20:42 +00:00
}