cedro
Version:
Javascript library to build user interfece based on widgets.
57 lines (44 loc) • 1.28 kB
text/typescript
import Navigo from "navigo";
import { IScreen } from "./screen.interface";
import { IWidget, WUICallback, WUIEvent } from "./widget.interface";
import { Dialog } from "../ui/dialog";
import { Seo } from "../core/seo";
import { ThemeManager } from "../core/themes.core";
export interface IScreenSize {
minWidth: number;
maxWidth: number;
cb: (app: IApplication) => void;
}
export enum WUIThemes {
LIGHT = "light",
DARK = "dark",
}
export interface IApplication {
seo: Seo;
screen: IScreen;
root: IWidget;
router: Navigo;
alertDialog: Dialog;
confirmDialog: Dialog;
mediaQueries: Map<string, IScreenSize>;
subscribers: Map<string, WUICallback>;
theme: ThemeManager;
loadedModule: any;
attachWidget(guest: IWidget, host: IWidget): void;
subscribe: (cb: WUICallback) => void;
unsubscribe: (event: WUIEvent) => void;
run(eventId: WUIEvent): void;
addMediaQuery(
query: string,
minWidth: number,
maxWidth: number,
cb: (app: IApplication) => void
): void;
init(): void;
setRoot(root: IWidget): void;
getRoot(): IWidget;
confirm(msg: string): void;
alert(title: string, msg: string): void;
showLoading(): void;
hideLoading(): void;
}