uicore-ts
Version:
UICore is a library to build native-like user interfaces using pure Typescript. No HTML is needed at all. Components are described as TS classes and all user interactions are handled explicitly. This library is strongly inspired by the UIKit framework tha
61 lines (60 loc) • 3 kB
TypeScript
import { UIDialogView } from "./UIDialogView";
import { UIRoute } from "./UIRoute";
import { UIView } from "./UIView";
import { UIViewController } from "./UIViewController";
export interface UIRootViewControllerLazyViewControllerObject<T extends typeof UIViewController> {
instance: InstanceType<T>;
class: T;
shouldShow: () => (Promise<boolean> | boolean);
isInitialized: boolean;
deleteOnUnload: boolean;
deleteOnLogout: boolean;
/** Only applicable when the VC is registered in detailsViewControllers.
* When YES, pressing Escape will dismiss the details dialog. */
dismissesOnEscape: boolean;
deleteInstance: () => void;
}
export interface UIRootViewControllerLazyViewControllersObject {
[x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>;
}
export interface UIRootViewControllerLazyContentViewControllersObject extends UIRootViewControllerLazyViewControllersObject {
mainViewController: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>;
}
export declare class UIRootViewController extends UIViewController {
topBarView?: UIView;
backgroundView: UIView;
bottomBarView?: UIView;
_contentViewController?: UIViewController;
contentViewControllers: UIRootViewControllerLazyContentViewControllersObject;
_detailsDialogView: UIDialogView;
_detailsViewController?: UIViewController;
detailsViewControllers: UIRootViewControllerLazyViewControllersObject;
constructor(view: UIView);
lazyViewControllerObjectWithClass<T extends typeof UIViewController>(classObject: T, options?: {
shouldShow?: () => (Promise<boolean> | boolean);
deleteOnUnload?: boolean;
deleteOnLogout?: boolean;
/** Only applicable when the VC is registered in detailsViewControllers.
* When YES, pressing Escape will dismiss the details dialog. */
dismissesOnEscape?: boolean;
}): UIRootViewControllerLazyViewControllerObject<T>;
handleRoute(route: UIRoute): Promise<void>;
setContentViewControllerForRoute(route: UIRoute): Promise<void>;
setDetailsViewControllerForRoute(route: UIRoute): Promise<void>;
get contentViewController(): UIViewController | undefined;
set contentViewController(controller: UIViewController);
get detailsViewController(): UIViewController | undefined;
set detailsViewController(controller: UIViewController | undefined);
updatePageScale({ minScaleWidth, maxScaleWidth, minScale, maxScale }?: {
minScaleWidth?: number | undefined;
maxScaleWidth?: number | undefined;
minScale?: number | undefined;
maxScale?: number | undefined;
}): void;
performDefaultLayout({ paddingLength, contentViewMaxWidth, topBarHeight, bottomBarMinHeight }?: {
paddingLength?: number | undefined;
contentViewMaxWidth?: number | undefined;
topBarHeight?: number | undefined;
bottomBarMinHeight?: number | undefined;
}): void;
}