@lingxia/bridge 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boot.d.ts +10 -0
- package/dist/bridge.d.ts +5 -0
- package/dist/error.d.ts +4 -0
- package/dist/image-proxy.d.ts +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/nativecomponents/coverage-monitor.d.ts +7 -0
- package/dist/runtime-env.d.ts +11 -0
- package/dist/runtime.es2020.js +1663 -0
- package/dist/runtime.es5.js +1 -0
- package/dist/types.d.ts +164 -0
- package/dist/ui/action-sheet.d.ts +5 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/modal.d.ts +6 -0
- package/dist/ui/toast.d.ts +2 -0
- package/package.json +43 -0
package/dist/boot.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immediately initialize bridge and render error UI if present.
|
|
3
|
+
* Use this when DOM is already ready.
|
|
4
|
+
*/
|
|
5
|
+
export declare function boot(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Initialize bridge immediately, but wait for DOM to render error UI.
|
|
8
|
+
* Use this at page load time.
|
|
9
|
+
*/
|
|
10
|
+
export declare function bootWhenReady(): void;
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HostApi, LingXiaBridgeInterface } from "./types";
|
|
2
|
+
export declare function registerViewMethodHandler(method: string, handler: (params: unknown) => unknown | Promise<unknown>): void;
|
|
3
|
+
export declare const LingXiaBridge: LingXiaBridgeInterface;
|
|
4
|
+
export declare const host: HostApi;
|
|
5
|
+
export declare function initBridge(): void;
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupImageProxy(): void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LingXia Web Runtime
|
|
3
|
+
*
|
|
4
|
+
* Injected into SPA HTML to handle:
|
|
5
|
+
* - Bridge initialization for native communication
|
|
6
|
+
* - Error UI rendering when page cannot be loaded
|
|
7
|
+
*/
|
|
8
|
+
export type { BridgeConfig, CallOptions, ChannelOpenOptions, BridgeErrorCode, ChannelEventName, DataSubscriber, ErrorInfo, HostChannelApi, HostApi, LingXiaBridgeInterface, LxChannel, LxBridgeError, LxMethod, LxMethodParams, LxMethodResult, LxMethodStreamData, LxStream, NativeComponentMessage, NotifyOptions, StateInfo, StreamCallOptions, StreamEventName, } from './types';
|
|
9
|
+
export { LingXiaBridge, host, initBridge } from './bridge';
|
|
10
|
+
export { renderErrorUI, hasError, getErrorInfo } from './error';
|
|
11
|
+
export { boot, bootWhenReady } from './boot';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BridgeConfig } from './types';
|
|
2
|
+
export type CommunicationMethod = 'messageport' | 'jsinterface' | 'webkit' | 'unknown';
|
|
3
|
+
export type PlatformOS = NonNullable<BridgeConfig['os']> | 'unknown';
|
|
4
|
+
export declare const BRIDGE_CONFIG: BridgeConfig;
|
|
5
|
+
export declare function getPlatformOS(): PlatformOS;
|
|
6
|
+
export declare function isHarmony(): boolean;
|
|
7
|
+
export declare function isIOS(): boolean;
|
|
8
|
+
export declare function isAndroid(): boolean;
|
|
9
|
+
export declare function isMacOS(): boolean;
|
|
10
|
+
export declare function isDesktop(): boolean;
|
|
11
|
+
export declare function getCommunicationMethod(): CommunicationMethod;
|