nope/resources/ui/layout/interfaces/ILayout.ts
2020-10-30 19:30:59 +01:00

38 lines
1.1 KiB
TypeScript

import { IModalSettings } from "./IModalSettings";
import { ITab } from './ITab';
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;
}