@lingxia/types 0.1.1 → 0.3.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/device/actions.d.ts +8 -0
- package/dist/device/actions.d.ts.map +1 -0
- package/dist/device/actions.js +7 -0
- package/dist/device/actions.js.map +1 -0
- package/dist/device/index.d.ts +4 -37
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +18 -4
- package/dist/device/index.js.map +1 -1
- package/dist/device/info.d.ts +17 -0
- package/dist/device/info.d.ts.map +1 -0
- package/dist/device/info.js +7 -0
- package/dist/device/info.js.map +1 -0
- package/dist/device/network.d.ts +13 -0
- package/dist/device/network.d.ts.map +1 -0
- package/dist/device/network.js +7 -0
- package/dist/device/network.js.map +1 -0
- package/dist/device/wifi.d.ts +21 -0
- package/dist/device/wifi.d.ts.map +1 -0
- package/dist/device/wifi.js +7 -0
- package/dist/device/wifi.js.map +1 -0
- package/dist/display/index.d.ts +11 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +7 -0
- package/dist/display/index.js.map +1 -0
- package/dist/document/index.d.ts +10 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +7 -0
- package/dist/document/index.js.map +1 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/media/index.d.ts +133 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/navigator/index.d.ts +10 -0
- package/dist/navigator/index.d.ts.map +1 -0
- package/dist/navigator/index.js +7 -0
- package/dist/navigator/index.js.map +1 -0
- package/dist/storage/index.d.ts +2 -7
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -2
- package/dist/system/index.d.ts +1 -11
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +1 -1
- package/dist/update/index.d.ts +10 -0
- package/dist/update/index.d.ts.map +1 -0
- package/dist/update/index.js +7 -0
- package/dist/update/index.js.map +1 -0
- package/package.json +21 -1
- package/src/device/actions.ts +8 -0
- package/src/device/index.ts +4 -46
- package/src/device/info.ts +18 -0
- package/src/device/network.ts +24 -0
- package/src/device/wifi.ts +24 -0
- package/src/display/index.ts +12 -0
- package/src/document/index.ts +10 -0
- package/src/index.ts +29 -5
- package/src/media/index.ts +140 -0
- package/src/navigator/index.ts +10 -0
- package/src/storage/index.ts +2 -8
- package/src/system/index.ts +1 -13
- package/src/update/index.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/device/actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/device/actions.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/dist/device/index.d.ts
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
export interface DeviceInfo {
|
|
6
|
-
brand: string;
|
|
7
|
-
model: string;
|
|
8
|
-
marketName: string;
|
|
9
|
-
system: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ScreenInfo {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
scale: number;
|
|
15
|
-
}
|
|
16
|
-
export interface MakePhoneCallOptions {
|
|
17
|
-
phoneNumber: string;
|
|
18
|
-
}
|
|
19
|
-
export interface WifiInfo {
|
|
20
|
-
SSID: string;
|
|
21
|
-
BSSID?: string;
|
|
22
|
-
secure: boolean;
|
|
23
|
-
signalStrength: number;
|
|
24
|
-
frequency?: number;
|
|
25
|
-
}
|
|
26
|
-
export interface ConnectWifiOptions {
|
|
27
|
-
SSID: string;
|
|
28
|
-
password?: string;
|
|
29
|
-
}
|
|
30
|
-
export type WifiConnectedCallback = (info: WifiInfo) => void;
|
|
31
|
-
export interface AppOrientationInfo {
|
|
32
|
-
orientation: string;
|
|
33
|
-
}
|
|
34
|
-
export interface SetAppOrientationOptions {
|
|
35
|
-
orientation: string;
|
|
36
|
-
}
|
|
37
|
-
export type { KeyEvent, KeyEventCallback } from '../input';
|
|
1
|
+
export * from './info';
|
|
2
|
+
export * from './actions';
|
|
3
|
+
export * from './wifi';
|
|
4
|
+
export * from './network';
|
|
38
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
package/dist/device/index.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
6
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./info"), exports);
|
|
18
|
+
__exportStar(require("./actions"), exports);
|
|
19
|
+
__exportStar(require("./wifi"), exports);
|
|
20
|
+
__exportStar(require("./network"), exports);
|
|
7
21
|
//# sourceMappingURL=index.js.map
|
package/dist/device/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/device/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,4CAA0B;AAC1B,yCAAuB;AACvB,4CAA0B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device info APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/info.rs
|
|
4
|
+
*/
|
|
5
|
+
export interface DeviceInfo {
|
|
6
|
+
brand: string;
|
|
7
|
+
model: string;
|
|
8
|
+
marketName: string;
|
|
9
|
+
osName: string;
|
|
10
|
+
osVersion: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ScreenInfo {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
scale: number;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../src/device/info.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/device/info.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/network.rs
|
|
4
|
+
*/
|
|
5
|
+
export type NetworkType = 'none' | 'unknown' | 'wifi' | '2g' | '3g' | '4g' | '5g' | 'ethernet';
|
|
6
|
+
export interface NetworkInfo {
|
|
7
|
+
isConnected: boolean;
|
|
8
|
+
networkType: NetworkType;
|
|
9
|
+
ipv4: string[];
|
|
10
|
+
ipv6: string[];
|
|
11
|
+
}
|
|
12
|
+
export type NetworkChangeCallback = (info: NetworkInfo) => void;
|
|
13
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/device/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,SAAS,GACT,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,UAAU,CAAC;AAEf,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/device/network.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WiFi APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/wifi.rs
|
|
4
|
+
*/
|
|
5
|
+
export interface WifiInfo {
|
|
6
|
+
SSID: string;
|
|
7
|
+
BSSID?: string;
|
|
8
|
+
secure: boolean;
|
|
9
|
+
signalStrength: number;
|
|
10
|
+
frequency?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface WifiConnectedInfo extends WifiInfo {
|
|
13
|
+
connected: boolean;
|
|
14
|
+
state: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ConnectWifiOptions {
|
|
17
|
+
SSID: string;
|
|
18
|
+
password?: string;
|
|
19
|
+
}
|
|
20
|
+
export type WifiConnectedCallback = (info: WifiConnectedInfo) => void;
|
|
21
|
+
//# sourceMappingURL=wifi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wifi.d.ts","sourceRoot":"","sources":["../../src/device/wifi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wifi.js","sourceRoot":"","sources":["../../src/device/wifi.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/document/index.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,19 +5,27 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from './app';
|
|
7
7
|
export * from './device';
|
|
8
|
+
export * from './display';
|
|
8
9
|
export * from './input';
|
|
9
10
|
export * from './storage';
|
|
11
|
+
export * from './document';
|
|
10
12
|
export * from './location';
|
|
13
|
+
export * from './navigator';
|
|
11
14
|
export * from './system';
|
|
15
|
+
export * from './update';
|
|
12
16
|
export * from './media';
|
|
13
17
|
export * from './ui';
|
|
14
18
|
import type { AppConfig, AppInstance, PageConfig, PageInstance } from './app';
|
|
15
|
-
import type { DeviceInfo, ScreenInfo, MakePhoneCallOptions, WifiInfo, ConnectWifiOptions, WifiConnectedCallback,
|
|
19
|
+
import type { DeviceInfo, ScreenInfo, MakePhoneCallOptions, WifiInfo, ConnectWifiOptions, WifiConnectedCallback, NetworkInfo, NetworkChangeCallback } from './device';
|
|
16
20
|
import type { KeyEventCallback } from './input';
|
|
17
|
-
import type { LxEnv, Storage
|
|
21
|
+
import type { LxEnv, Storage } from './storage';
|
|
22
|
+
import type { OpenDocumentOptions } from './document';
|
|
23
|
+
import type { AppOrientationInfo, SetAppOrientationOptions } from './display';
|
|
18
24
|
import type { GetLocationOptions, LocationInfo } from './location';
|
|
19
|
-
import type { AppBaseInfo, SystemSettingInfo, OpenURLOptions
|
|
20
|
-
import type {
|
|
25
|
+
import type { AppBaseInfo, SystemSettingInfo, OpenURLOptions } from './system';
|
|
26
|
+
import type { NavigateToLxAppOptions } from './navigator';
|
|
27
|
+
import type { UpdateManager } from './update';
|
|
28
|
+
import type { GetImageInfoOptions, ImageInfo, CompressImageOptions, CompressImageResult, CompressVideoOptions, CompressVideoResult, GetVideoInfoOptions, VideoInfo, ExtractVideoThumbnailOptions, ExtractVideoThumbnailResult, ChooseMediaOptions, ChosenMediaEntry, PreviewMediaOptions, SaveMediaOptions, ScanCodeOptions, ScanCodeResult, VideoContext } from './media';
|
|
21
29
|
import type { ShowToastOptions, ShowModalOptions, ModalResult, ShowActionSheetOptions, ActionSheetResult, NavigateToOptions, NavigateToResult, NavigateBackOptions, RedirectToOptions, SwitchTabOptions, ReLaunchOptions, SetNavigationBarTitleOptions, SetNavigationBarColorOptions, TabBarRedDotOptions, SetTabBarBadgeOptions, RemoveTabBarBadgeOptions, SetTabBarStyleOptions, SetTabBarItemOptions, ShowPopupOptions, ShowPopupResult, CapsuleRect } from './ui';
|
|
22
30
|
export interface Lx {
|
|
23
31
|
env: LxEnv;
|
|
@@ -33,6 +41,9 @@ export interface Lx {
|
|
|
33
41
|
getConnectedWifi(): Promise<WifiInfo>;
|
|
34
42
|
onWifiConnected(callback: WifiConnectedCallback): void;
|
|
35
43
|
offWifiConnected(callback?: WifiConnectedCallback): void;
|
|
44
|
+
getNetworkInfo(): Promise<NetworkInfo>;
|
|
45
|
+
onNetworkChange(callback: NetworkChangeCallback): void;
|
|
46
|
+
offNetworkChange(callback?: NetworkChangeCallback): void;
|
|
36
47
|
getAppOrientation(): AppOrientationInfo;
|
|
37
48
|
setAppOrientation(options: SetAppOrientationOptions): boolean;
|
|
38
49
|
openDocument(options: OpenDocumentOptions): void;
|
|
@@ -46,6 +57,9 @@ export interface Lx {
|
|
|
46
57
|
getUpdateManager(): UpdateManager;
|
|
47
58
|
getImageInfo(options: GetImageInfoOptions): Promise<ImageInfo>;
|
|
48
59
|
compressImage(options: CompressImageOptions): Promise<CompressImageResult>;
|
|
60
|
+
compressVideo(options: CompressVideoOptions): Promise<CompressVideoResult>;
|
|
61
|
+
getVideoInfo(options: GetVideoInfoOptions): Promise<VideoInfo>;
|
|
62
|
+
extractVideoThumbnail(options: ExtractVideoThumbnailOptions): Promise<ExtractVideoThumbnailResult>;
|
|
49
63
|
chooseMedia(options?: ChooseMediaOptions): Promise<ChosenMediaEntry[]>;
|
|
50
64
|
previewMedia(options: PreviewMediaOptions): void;
|
|
51
65
|
saveImageToPhotosAlbum(options: SaveMediaOptions): Promise<void>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AAErB,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACb,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
__exportStar(require("./app"), exports);
|
|
23
23
|
__exportStar(require("./device"), exports);
|
|
24
|
+
__exportStar(require("./display"), exports);
|
|
24
25
|
__exportStar(require("./input"), exports);
|
|
25
26
|
__exportStar(require("./storage"), exports);
|
|
27
|
+
__exportStar(require("./document"), exports);
|
|
26
28
|
__exportStar(require("./location"), exports);
|
|
29
|
+
__exportStar(require("./navigator"), exports);
|
|
27
30
|
__exportStar(require("./system"), exports);
|
|
31
|
+
__exportStar(require("./update"), exports);
|
|
28
32
|
__exportStar(require("./media"), exports);
|
|
29
33
|
__exportStar(require("./ui"), exports);
|
|
30
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,wCAAsB;AACtB,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,uCAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,wCAAsB;AACtB,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,uCAAqB"}
|
package/dist/media/index.d.ts
CHANGED
|
@@ -20,6 +20,139 @@ export interface CompressImageOptions {
|
|
|
20
20
|
export interface CompressImageResult {
|
|
21
21
|
tempFilePath: string;
|
|
22
22
|
}
|
|
23
|
+
export type VideoCompressQuality = 'low' | 'medium' | 'high';
|
|
24
|
+
export interface CompressVideoOptions {
|
|
25
|
+
/**
|
|
26
|
+
* Source video path or `lx://` URI.
|
|
27
|
+
*/
|
|
28
|
+
path: string;
|
|
29
|
+
/**
|
|
30
|
+
* Cross-platform note: video compression parameters are best-effort and may map to
|
|
31
|
+
* native presets instead of exact encoder settings.
|
|
32
|
+
*
|
|
33
|
+
* Compression quality preset.
|
|
34
|
+
* When provided, `bitrate`, `fps`, and `resolution` are ignored.
|
|
35
|
+
*/
|
|
36
|
+
quality?: VideoCompressQuality;
|
|
37
|
+
/**
|
|
38
|
+
* Preferred target video bitrate in kbps.
|
|
39
|
+
* May be adjusted or ignored by platform codec/runtime limitations.
|
|
40
|
+
*/
|
|
41
|
+
bitrate?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Preferred target frame rate in fps.
|
|
44
|
+
* Some platforms may ignore this option.
|
|
45
|
+
*/
|
|
46
|
+
fps?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Target resolution scale ratio relative to source size, in range `(0, 1]`.
|
|
49
|
+
* May be approximated or ignored by platform transcoder capabilities.
|
|
50
|
+
*/
|
|
51
|
+
resolution?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Optional output path for compressed file.
|
|
54
|
+
*/
|
|
55
|
+
outputPath?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CompressVideoResult {
|
|
58
|
+
tempFilePath: string;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
durationMs: number;
|
|
62
|
+
/**
|
|
63
|
+
* Output file size in bytes.
|
|
64
|
+
* Could be close to source size when platform falls back to source content.
|
|
65
|
+
*/
|
|
66
|
+
size: number;
|
|
67
|
+
type: string;
|
|
68
|
+
}
|
|
69
|
+
export interface GetVideoInfoOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Video file path or `lx://` URI.
|
|
72
|
+
*/
|
|
73
|
+
path: string;
|
|
74
|
+
}
|
|
75
|
+
export interface VideoInfo {
|
|
76
|
+
/**
|
|
77
|
+
* Encoded display width in pixels.
|
|
78
|
+
*/
|
|
79
|
+
width: number;
|
|
80
|
+
/**
|
|
81
|
+
* Encoded display height in pixels.
|
|
82
|
+
*/
|
|
83
|
+
height: number;
|
|
84
|
+
/**
|
|
85
|
+
* Video duration in milliseconds.
|
|
86
|
+
*/
|
|
87
|
+
durationMs: number;
|
|
88
|
+
/**
|
|
89
|
+
* Clockwise rotation in degrees (usually `0 | 90 | 180 | 270`).
|
|
90
|
+
*/
|
|
91
|
+
rotation?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Average bitrate in bits per second (bps).
|
|
94
|
+
*/
|
|
95
|
+
bitrate?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Frame rate in frames per second (fps).
|
|
98
|
+
*/
|
|
99
|
+
fps?: number;
|
|
100
|
+
/**
|
|
101
|
+
* MIME type, e.g. `video/mp4`.
|
|
102
|
+
*/
|
|
103
|
+
type?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Resolved path used by runtime (typically `lx://...`).
|
|
106
|
+
*/
|
|
107
|
+
path: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ExtractVideoThumbnailOptions {
|
|
110
|
+
/**
|
|
111
|
+
* Source video path or `lx://` URI.
|
|
112
|
+
*/
|
|
113
|
+
path: string;
|
|
114
|
+
/**
|
|
115
|
+
* Optional output image path. If omitted, runtime chooses a temporary path.
|
|
116
|
+
*/
|
|
117
|
+
outputPath?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Max output width in pixels.
|
|
120
|
+
* Optional; when set with/without `maxHeight`, output keeps aspect ratio (no cropping).
|
|
121
|
+
*/
|
|
122
|
+
maxWidth?: number;
|
|
123
|
+
/**
|
|
124
|
+
* Max output height in pixels.
|
|
125
|
+
* Optional; when set with/without `maxWidth`, output keeps aspect ratio (no cropping).
|
|
126
|
+
*/
|
|
127
|
+
maxHeight?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Target frame time in milliseconds from video start.
|
|
130
|
+
* `0` means first frame.
|
|
131
|
+
*/
|
|
132
|
+
timeMs?: number;
|
|
133
|
+
/**
|
|
134
|
+
* JPEG quality in range `0-100`.
|
|
135
|
+
*/
|
|
136
|
+
quality?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface ExtractVideoThumbnailResult {
|
|
139
|
+
/**
|
|
140
|
+
* Generated thumbnail file path.
|
|
141
|
+
*/
|
|
142
|
+
tempFilePath: string;
|
|
143
|
+
/**
|
|
144
|
+
* Output image width in pixels.
|
|
145
|
+
*/
|
|
146
|
+
width: number;
|
|
147
|
+
/**
|
|
148
|
+
* Output image height in pixels.
|
|
149
|
+
*/
|
|
150
|
+
height: number;
|
|
151
|
+
/**
|
|
152
|
+
* Output MIME type, usually `image/jpeg`.
|
|
153
|
+
*/
|
|
154
|
+
type: string;
|
|
155
|
+
}
|
|
23
156
|
export interface ChooseMediaOptions {
|
|
24
157
|
count?: number;
|
|
25
158
|
mediaType?: ('image' | 'video')[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,OAAO,GA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/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigator/index.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Storage
|
|
3
|
-
* Corresponds to: lingxia-logic/src/storage.rs,
|
|
2
|
+
* Storage APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/storage.rs, env.rs
|
|
4
4
|
*/
|
|
5
5
|
export interface LxEnv {
|
|
6
6
|
USER_DATA_PATH: string;
|
|
@@ -15,9 +15,4 @@ export interface Storage {
|
|
|
15
15
|
has(key: string): boolean;
|
|
16
16
|
size(): number;
|
|
17
17
|
}
|
|
18
|
-
export interface OpenDocumentOptions {
|
|
19
|
-
filePath: string;
|
|
20
|
-
fileType?: string;
|
|
21
|
-
showMenu?: boolean;
|
|
22
|
-
}
|
|
23
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,IAAI,IAAI,MAAM,CAAC;CAChB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,IAAI,IAAI,MAAM,CAAC;CAChB"}
|
package/dist/storage/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Storage
|
|
4
|
-
* Corresponds to: lingxia-logic/src/storage.rs,
|
|
3
|
+
* Storage APIs
|
|
4
|
+
* Corresponds to: lingxia-logic/src/storage.rs, env.rs
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* System APIs
|
|
3
|
-
* Corresponds to: lingxia-logic/src/system.rs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/system.rs
|
|
4
4
|
*/
|
|
5
5
|
export interface AppBaseInfo {
|
|
6
6
|
language: string;
|
|
@@ -16,14 +16,4 @@ export interface OpenURLOptions {
|
|
|
16
16
|
url: string;
|
|
17
17
|
openIn?: 'external' | 'internal';
|
|
18
18
|
}
|
|
19
|
-
export interface NavigateToLxAppOptions {
|
|
20
|
-
appId: string;
|
|
21
|
-
path?: string;
|
|
22
|
-
envVersion?: 'develop' | 'trial' | 'release';
|
|
23
|
-
}
|
|
24
|
-
export interface UpdateManager {
|
|
25
|
-
applyUpdate(): void;
|
|
26
|
-
onUpdateReady(callback: () => void): void;
|
|
27
|
-
onUpdateFailed(callback: () => void): void;
|
|
28
|
-
}
|
|
29
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAClC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAClC"}
|
package/dist/system/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/update.rs
|
|
4
|
+
*/
|
|
5
|
+
export interface UpdateManager {
|
|
6
|
+
applyUpdate(): void;
|
|
7
|
+
onUpdateReady(callback: () => void): void;
|
|
8
|
+
onUpdateFailed(callback: () => void): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/update/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,WAAW,IAAI,IAAI,CAAC;IACpB,aAAa,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC1C,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/update/index.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingxia/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript type definitions for the LingXia JS API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"import": "./dist/device/index.js",
|
|
27
27
|
"require": "./dist/device/index.js"
|
|
28
28
|
},
|
|
29
|
+
"./display": {
|
|
30
|
+
"types": "./dist/display/index.d.ts",
|
|
31
|
+
"import": "./dist/display/index.js",
|
|
32
|
+
"require": "./dist/display/index.js"
|
|
33
|
+
},
|
|
29
34
|
"./input": {
|
|
30
35
|
"types": "./dist/input/index.d.ts",
|
|
31
36
|
"import": "./dist/input/index.js",
|
|
@@ -36,16 +41,31 @@
|
|
|
36
41
|
"import": "./dist/storage/index.js",
|
|
37
42
|
"require": "./dist/storage/index.js"
|
|
38
43
|
},
|
|
44
|
+
"./document": {
|
|
45
|
+
"types": "./dist/document/index.d.ts",
|
|
46
|
+
"import": "./dist/document/index.js",
|
|
47
|
+
"require": "./dist/document/index.js"
|
|
48
|
+
},
|
|
39
49
|
"./location": {
|
|
40
50
|
"types": "./dist/location/index.d.ts",
|
|
41
51
|
"import": "./dist/location/index.js",
|
|
42
52
|
"require": "./dist/location/index.js"
|
|
43
53
|
},
|
|
54
|
+
"./navigator": {
|
|
55
|
+
"types": "./dist/navigator/index.d.ts",
|
|
56
|
+
"import": "./dist/navigator/index.js",
|
|
57
|
+
"require": "./dist/navigator/index.js"
|
|
58
|
+
},
|
|
44
59
|
"./system": {
|
|
45
60
|
"types": "./dist/system/index.d.ts",
|
|
46
61
|
"import": "./dist/system/index.js",
|
|
47
62
|
"require": "./dist/system/index.js"
|
|
48
63
|
},
|
|
64
|
+
"./update": {
|
|
65
|
+
"types": "./dist/update/index.d.ts",
|
|
66
|
+
"import": "./dist/update/index.js",
|
|
67
|
+
"require": "./dist/update/index.js"
|
|
68
|
+
},
|
|
49
69
|
"./media": {
|
|
50
70
|
"types": "./dist/media/index.d.ts",
|
|
51
71
|
"import": "./dist/media/index.js",
|
package/src/device/index.ts
CHANGED
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export interface DeviceInfo {
|
|
7
|
-
brand: string;
|
|
8
|
-
model: string;
|
|
9
|
-
marketName: string;
|
|
10
|
-
system: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ScreenInfo {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
scale: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface MakePhoneCallOptions {
|
|
20
|
-
phoneNumber: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface WifiInfo {
|
|
24
|
-
SSID: string;
|
|
25
|
-
BSSID?: string;
|
|
26
|
-
secure: boolean;
|
|
27
|
-
signalStrength: number;
|
|
28
|
-
frequency?: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ConnectWifiOptions {
|
|
32
|
-
SSID: string;
|
|
33
|
-
password?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type WifiConnectedCallback = (info: WifiInfo) => void;
|
|
37
|
-
|
|
38
|
-
export interface AppOrientationInfo {
|
|
39
|
-
orientation: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface SetAppOrientationOptions {
|
|
43
|
-
orientation: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type { KeyEvent, KeyEventCallback } from '../input';
|
|
1
|
+
export * from './info';
|
|
2
|
+
export * from './actions';
|
|
3
|
+
export * from './wifi';
|
|
4
|
+
export * from './network';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device info APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/info.rs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface DeviceInfo {
|
|
7
|
+
brand: string;
|
|
8
|
+
model: string;
|
|
9
|
+
marketName: string;
|
|
10
|
+
osName: string;
|
|
11
|
+
osVersion: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ScreenInfo {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
scale: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/network.rs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Matches mini-program style where possible: wifi/2g/3g/4g/5g/none/unknown.
|
|
7
|
+
export type NetworkType =
|
|
8
|
+
| 'none'
|
|
9
|
+
| 'unknown'
|
|
10
|
+
| 'wifi'
|
|
11
|
+
| '2g'
|
|
12
|
+
| '3g'
|
|
13
|
+
| '4g'
|
|
14
|
+
| '5g'
|
|
15
|
+
| 'ethernet';
|
|
16
|
+
|
|
17
|
+
export interface NetworkInfo {
|
|
18
|
+
isConnected: boolean;
|
|
19
|
+
networkType: NetworkType;
|
|
20
|
+
ipv4: string[];
|
|
21
|
+
ipv6: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type NetworkChangeCallback = (info: NetworkInfo) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WiFi APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/device/wifi.rs
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface WifiInfo {
|
|
7
|
+
SSID: string;
|
|
8
|
+
BSSID?: string;
|
|
9
|
+
secure: boolean;
|
|
10
|
+
signalStrength: number;
|
|
11
|
+
frequency?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface WifiConnectedInfo extends WifiInfo {
|
|
15
|
+
connected: boolean;
|
|
16
|
+
state: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ConnectWifiOptions {
|
|
20
|
+
SSID: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type WifiConnectedCallback = (info: WifiConnectedInfo) => void;
|
package/src/index.ts
CHANGED
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
export * from './app';
|
|
8
8
|
export * from './device';
|
|
9
|
+
export * from './display';
|
|
9
10
|
export * from './input';
|
|
10
11
|
export * from './storage';
|
|
12
|
+
export * from './document';
|
|
11
13
|
export * from './location';
|
|
14
|
+
export * from './navigator';
|
|
12
15
|
export * from './system';
|
|
16
|
+
export * from './update';
|
|
13
17
|
export * from './media';
|
|
14
18
|
export * from './ui';
|
|
15
19
|
|
|
@@ -27,8 +31,8 @@ import type {
|
|
|
27
31
|
WifiInfo,
|
|
28
32
|
ConnectWifiOptions,
|
|
29
33
|
WifiConnectedCallback,
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
NetworkInfo,
|
|
35
|
+
NetworkChangeCallback,
|
|
32
36
|
} from './device';
|
|
33
37
|
|
|
34
38
|
import type { KeyEventCallback } from './input';
|
|
@@ -36,9 +40,15 @@ import type { KeyEventCallback } from './input';
|
|
|
36
40
|
import type {
|
|
37
41
|
LxEnv,
|
|
38
42
|
Storage,
|
|
39
|
-
OpenDocumentOptions,
|
|
40
43
|
} from './storage';
|
|
41
44
|
|
|
45
|
+
import type { OpenDocumentOptions } from './document';
|
|
46
|
+
|
|
47
|
+
import type {
|
|
48
|
+
AppOrientationInfo,
|
|
49
|
+
SetAppOrientationOptions,
|
|
50
|
+
} from './display';
|
|
51
|
+
|
|
42
52
|
import type {
|
|
43
53
|
GetLocationOptions,
|
|
44
54
|
LocationInfo,
|
|
@@ -48,15 +58,23 @@ import type {
|
|
|
48
58
|
AppBaseInfo,
|
|
49
59
|
SystemSettingInfo,
|
|
50
60
|
OpenURLOptions,
|
|
51
|
-
NavigateToLxAppOptions,
|
|
52
|
-
UpdateManager,
|
|
53
61
|
} from './system';
|
|
54
62
|
|
|
63
|
+
import type { NavigateToLxAppOptions } from './navigator';
|
|
64
|
+
|
|
65
|
+
import type { UpdateManager } from './update';
|
|
66
|
+
|
|
55
67
|
import type {
|
|
56
68
|
GetImageInfoOptions,
|
|
57
69
|
ImageInfo,
|
|
58
70
|
CompressImageOptions,
|
|
59
71
|
CompressImageResult,
|
|
72
|
+
CompressVideoOptions,
|
|
73
|
+
CompressVideoResult,
|
|
74
|
+
GetVideoInfoOptions,
|
|
75
|
+
VideoInfo,
|
|
76
|
+
ExtractVideoThumbnailOptions,
|
|
77
|
+
ExtractVideoThumbnailResult,
|
|
60
78
|
ChooseMediaOptions,
|
|
61
79
|
ChosenMediaEntry,
|
|
62
80
|
PreviewMediaOptions,
|
|
@@ -106,6 +124,9 @@ export interface Lx {
|
|
|
106
124
|
getConnectedWifi(): Promise<WifiInfo>;
|
|
107
125
|
onWifiConnected(callback: WifiConnectedCallback): void;
|
|
108
126
|
offWifiConnected(callback?: WifiConnectedCallback): void;
|
|
127
|
+
getNetworkInfo(): Promise<NetworkInfo>;
|
|
128
|
+
onNetworkChange(callback: NetworkChangeCallback): void;
|
|
129
|
+
offNetworkChange(callback?: NetworkChangeCallback): void;
|
|
109
130
|
|
|
110
131
|
getAppOrientation(): AppOrientationInfo;
|
|
111
132
|
setAppOrientation(options: SetAppOrientationOptions): boolean;
|
|
@@ -127,6 +148,9 @@ export interface Lx {
|
|
|
127
148
|
|
|
128
149
|
getImageInfo(options: GetImageInfoOptions): Promise<ImageInfo>;
|
|
129
150
|
compressImage(options: CompressImageOptions): Promise<CompressImageResult>;
|
|
151
|
+
compressVideo(options: CompressVideoOptions): Promise<CompressVideoResult>;
|
|
152
|
+
getVideoInfo(options: GetVideoInfoOptions): Promise<VideoInfo>;
|
|
153
|
+
extractVideoThumbnail(options: ExtractVideoThumbnailOptions): Promise<ExtractVideoThumbnailResult>;
|
|
130
154
|
|
|
131
155
|
chooseMedia(options?: ChooseMediaOptions): Promise<ChosenMediaEntry[]>;
|
|
132
156
|
|
package/src/media/index.ts
CHANGED
|
@@ -25,6 +25,146 @@ export interface CompressImageResult {
|
|
|
25
25
|
tempFilePath: string;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export type VideoCompressQuality = 'low' | 'medium' | 'high';
|
|
29
|
+
|
|
30
|
+
export interface CompressVideoOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Source video path or `lx://` URI.
|
|
33
|
+
*/
|
|
34
|
+
path: string;
|
|
35
|
+
/**
|
|
36
|
+
* Cross-platform note: video compression parameters are best-effort and may map to
|
|
37
|
+
* native presets instead of exact encoder settings.
|
|
38
|
+
*
|
|
39
|
+
* Compression quality preset.
|
|
40
|
+
* When provided, `bitrate`, `fps`, and `resolution` are ignored.
|
|
41
|
+
*/
|
|
42
|
+
quality?: VideoCompressQuality;
|
|
43
|
+
/**
|
|
44
|
+
* Preferred target video bitrate in kbps.
|
|
45
|
+
* May be adjusted or ignored by platform codec/runtime limitations.
|
|
46
|
+
*/
|
|
47
|
+
bitrate?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Preferred target frame rate in fps.
|
|
50
|
+
* Some platforms may ignore this option.
|
|
51
|
+
*/
|
|
52
|
+
fps?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Target resolution scale ratio relative to source size, in range `(0, 1]`.
|
|
55
|
+
* May be approximated or ignored by platform transcoder capabilities.
|
|
56
|
+
*/
|
|
57
|
+
resolution?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Optional output path for compressed file.
|
|
60
|
+
*/
|
|
61
|
+
outputPath?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CompressVideoResult {
|
|
65
|
+
tempFilePath: string;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
durationMs: number;
|
|
69
|
+
/**
|
|
70
|
+
* Output file size in bytes.
|
|
71
|
+
* Could be close to source size when platform falls back to source content.
|
|
72
|
+
*/
|
|
73
|
+
size: number;
|
|
74
|
+
type: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface GetVideoInfoOptions {
|
|
78
|
+
/**
|
|
79
|
+
* Video file path or `lx://` URI.
|
|
80
|
+
*/
|
|
81
|
+
path: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface VideoInfo {
|
|
85
|
+
/**
|
|
86
|
+
* Encoded display width in pixels.
|
|
87
|
+
*/
|
|
88
|
+
width: number;
|
|
89
|
+
/**
|
|
90
|
+
* Encoded display height in pixels.
|
|
91
|
+
*/
|
|
92
|
+
height: number;
|
|
93
|
+
/**
|
|
94
|
+
* Video duration in milliseconds.
|
|
95
|
+
*/
|
|
96
|
+
durationMs: number;
|
|
97
|
+
/**
|
|
98
|
+
* Clockwise rotation in degrees (usually `0 | 90 | 180 | 270`).
|
|
99
|
+
*/
|
|
100
|
+
rotation?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Average bitrate in bits per second (bps).
|
|
103
|
+
*/
|
|
104
|
+
bitrate?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Frame rate in frames per second (fps).
|
|
107
|
+
*/
|
|
108
|
+
fps?: number;
|
|
109
|
+
/**
|
|
110
|
+
* MIME type, e.g. `video/mp4`.
|
|
111
|
+
*/
|
|
112
|
+
type?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Resolved path used by runtime (typically `lx://...`).
|
|
115
|
+
*/
|
|
116
|
+
path: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ExtractVideoThumbnailOptions {
|
|
120
|
+
/**
|
|
121
|
+
* Source video path or `lx://` URI.
|
|
122
|
+
*/
|
|
123
|
+
path: string;
|
|
124
|
+
/**
|
|
125
|
+
* Optional output image path. If omitted, runtime chooses a temporary path.
|
|
126
|
+
*/
|
|
127
|
+
outputPath?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Max output width in pixels.
|
|
130
|
+
* Optional; when set with/without `maxHeight`, output keeps aspect ratio (no cropping).
|
|
131
|
+
*/
|
|
132
|
+
maxWidth?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Max output height in pixels.
|
|
135
|
+
* Optional; when set with/without `maxWidth`, output keeps aspect ratio (no cropping).
|
|
136
|
+
*/
|
|
137
|
+
maxHeight?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Target frame time in milliseconds from video start.
|
|
140
|
+
* `0` means first frame.
|
|
141
|
+
*/
|
|
142
|
+
timeMs?: number;
|
|
143
|
+
/**
|
|
144
|
+
* JPEG quality in range `0-100`.
|
|
145
|
+
*/
|
|
146
|
+
quality?: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface ExtractVideoThumbnailResult {
|
|
150
|
+
/**
|
|
151
|
+
* Generated thumbnail file path.
|
|
152
|
+
*/
|
|
153
|
+
tempFilePath: string;
|
|
154
|
+
/**
|
|
155
|
+
* Output image width in pixels.
|
|
156
|
+
*/
|
|
157
|
+
width: number;
|
|
158
|
+
/**
|
|
159
|
+
* Output image height in pixels.
|
|
160
|
+
*/
|
|
161
|
+
height: number;
|
|
162
|
+
/**
|
|
163
|
+
* Output MIME type, usually `image/jpeg`.
|
|
164
|
+
*/
|
|
165
|
+
type: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
28
168
|
export interface ChooseMediaOptions {
|
|
29
169
|
count?: number;
|
|
30
170
|
mediaType?: ('image' | 'video')[];
|
package/src/storage/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Storage
|
|
3
|
-
* Corresponds to: lingxia-logic/src/storage.rs,
|
|
2
|
+
* Storage APIs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/storage.rs, env.rs
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface LxEnv {
|
|
@@ -17,9 +17,3 @@ export interface Storage {
|
|
|
17
17
|
has(key: string): boolean;
|
|
18
18
|
size(): number;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
export interface OpenDocumentOptions {
|
|
22
|
-
filePath: string;
|
|
23
|
-
fileType?: string;
|
|
24
|
-
showMenu?: boolean;
|
|
25
|
-
}
|
package/src/system/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* System APIs
|
|
3
|
-
* Corresponds to: lingxia-logic/src/system.rs
|
|
3
|
+
* Corresponds to: lingxia-logic/src/system.rs
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface AppBaseInfo {
|
|
@@ -19,15 +19,3 @@ export interface OpenURLOptions {
|
|
|
19
19
|
url: string;
|
|
20
20
|
openIn?: 'external' | 'internal';
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
export interface NavigateToLxAppOptions {
|
|
24
|
-
appId: string;
|
|
25
|
-
path?: string;
|
|
26
|
-
envVersion?: 'develop' | 'trial' | 'release';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface UpdateManager {
|
|
30
|
-
applyUpdate(): void;
|
|
31
|
-
onUpdateReady(callback: () => void): void;
|
|
32
|
-
onUpdateFailed(callback: () => void): void;
|
|
33
|
-
}
|