export type MessageType = 'request' | 'response' | 'command' | 'handshake'; export interface BridgeMessage { id: string; type: MessageType; action?: string; payload?: T; error?: string; } export interface BridgeOptions { timeout?: number; debug?: boolean; namespace?: string; } export declare class NativeWebBridge { private pendingRequests; private handlers; private listeners; private isNativeReady; private messageQueue; private readonly options; constructor(options?: BridgeOptions); private autoUnlockQueue; private setupGlobalReceiver; private encode; private decode; private handleIncoming; private processIncomingAction; private post; private flushQueue; private dispatchToNative; private log; request(action: string, payload?: any): Promise; sendCommand(action: string, payload?: any): void; on(action: string, callback: (payload: any) => void): () => boolean | undefined; register(action: string, handler: (payload: any) => any): void; } export declare const bridge: { core: { registerHandler: (action: string, handler: (payload: any) => any) => void; request: (action: string, payload?: any) => Promise; sendCommand: (action: string, payload?: any) => void; signalWebReady: () => void; }; info: { getComplete: () => Promise<{ appVersion: string; osName: string; osVersion: string; deviceName: string; deviceModel: string; platform: string; }>; }; device: { getLanguage: () => Promise; getBatteryLevel: () => Promise; }; screen: { setKeepScreenOn: (keepOn: boolean) => Promise; }; network: { getStatus: () => Promise<{ connected: boolean; type: "wifi" | "cellular" | "none"; }>; }; permissions: { check: (type: "camera" | "location" | "notifications" | "storage" | "contacts") => Promise; request: (type: "camera" | "location" | "notifications" | "storage" | "contacts") => Promise; }; contacts: { pick: () => Promise<{ name: string; phoneNumber: string; } | null>; }; location: { getCurrent: () => Promise<{ lat: number; lng: number; }>; }; file: { pick: () => Promise<{ name: string; base64: string; } | null>; }; audio: { playSystemSound: () => Promise; }; app: { openSettings: () => Promise; requestRating: () => Promise; forceUpdate: (storeUrl?: string) => Promise; exit: () => Promise; clearCaches: () => Promise; }; ui: { setTheme: (theme: "light" | "dark" | "system") => Promise; getTheme: () => Promise<"light" | "dark" | "system">; showToast: (message: string, duration?: "short" | "long") => Promise; showAlert: (title: string, message: string, buttonText?: string) => Promise; showConfirm: (title: string, message: string, okText?: string, cancelText?: string) => Promise; }; notifications: { getToken: () => Promise; setToken: (token: string) => Promise; }; media: { takePhoto: (options?: { base64?: boolean; }) => Promise<{ uri?: string; base64?: string; }>; pickImage: (options?: { base64?: boolean; }) => Promise<{ base64?: string; }>; downloadImage: (url: string) => Promise; }; share: { text: (text: string, title?: string) => Promise; link: (url: string, title?: string) => Promise; image: (base64Data: string, fileName?: string) => Promise; video: (base64Data: string, fileName?: string) => Promise; }; communication: { dialNumber: (phoneNumber: string) => Promise; openBrowser: (url: string) => Promise; }; hardware: { triggerHaptic: (style?: "light" | "medium" | "heavy") => Promise; toggleFlashlight: (on: boolean) => Promise; }; storage: { setItem: (key: string, value: any) => Promise; getItem: (key: string) => Promise; }; secureStorage: { setItem: (key: string, value: string) => Promise; getItem: (key: string) => Promise; }; biometrics: { authenticate: (reason?: string) => Promise; }; clipboard: { copy: (text: string) => Promise; read: () => Promise; }; custom: { /** Send a custom request to Native and await a response */ invoke: (action: string, payload?: any) => Promise; /** Fire a fire-and-forget custom command to Native */ send: (action: string, payload?: any) => void; /** Listen for a custom event fired by Native */ listen: (action: string, callback: (payload: any) => void) => () => boolean | undefined; }; events: { onAppPause: (callback: () => void) => () => boolean | undefined; onAppResume: (callback: () => void) => () => boolean | undefined; onThemeChanged: (callback: (payload: { theme: "light" | "dark"; }) => void) => () => boolean | undefined; onPushNotification: (callback: (payload: any) => void) => () => boolean | undefined; onBackButton: (callback: () => void) => () => boolean | undefined; onDeepLink: (callback: (payload: { url: string; }) => void) => () => boolean | undefined; onNetworkChanged: (callback: (payload: { connected: boolean; type: string; }) => void) => () => boolean | undefined; onKeyboardChanged: (callback: (payload: { isVisible: boolean; }) => void) => () => boolean | undefined; }; };