UNPKG

hp-app-bundle-sdk

Version:

A comprehensive SDK for building mini-applications.

58 lines 1.93 kB
export interface UIModuleConfig { /** Default duration for toast messages in ms */ toastDuration: number; /** Default loading text */ loadingText: string; /** Default alert title */ alertTitle: string; /** Default confirm title */ confirmTitle: string; } export type ToastPosition = "top" | "center" | "bottom"; export interface ToastOptions { /** Duration in milliseconds */ duration?: number; /** Position of the toast */ position?: ToastPosition; } export interface AlertOptions { /** Title of the alert */ title?: string; /** Text for the button */ buttonText?: string; } export interface ConfirmOptions { /** Title of the confirmation dialog */ title?: string; /** Text for the confirm button */ confirmText?: string; /** Text for the cancel button */ cancelText?: string; } export interface ActionSheetOptions { /** Title of the action sheet */ title?: string; /** Array of option strings */ options: string[]; /** Text for the cancel button */ cancelText?: string; /** Index of destructive option (usually red) */ destructiveIndex?: number; } export interface LoadingOptions { /** Loading text to display */ text?: string; /** Whether the loading indicator can be canceled by user */ cancelable?: boolean; } export interface IUIModule { showToast(message: string, options?: ToastOptions): Promise<void>; showAlert(message: string, options?: AlertOptions): Promise<void>; showConfirm(message: string, options?: ConfirmOptions): Promise<boolean>; showActionSheet(options: ActionSheetOptions): Promise<string | null>; showLoading(options?: LoadingOptions): Promise<void>; hideLoading(): Promise<void>; setTitle(title: string): Promise<void>; setNavigationBarColor(color: string, textColor?: "light" | "dark"): Promise<void>; } //# sourceMappingURL=types.d.ts.map