@lingxia/types 0.9.0 → 0.11.1

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.
Files changed (130) hide show
  1. package/dist/automation/index.d.ts +942 -0
  2. package/dist/automation/index.d.ts.map +1 -0
  3. package/dist/automation/index.js +13 -0
  4. package/dist/automation/index.js.map +1 -0
  5. package/dist/generated/i18n.d.ts +1 -1
  6. package/dist/generated/i18n.d.ts.map +1 -1
  7. package/dist/generated/i18n.js +44 -22
  8. package/dist/generated/i18n.js.map +1 -1
  9. package/dist/generated/logic-web.d.ts +305 -0
  10. package/dist/generated/logic.d.ts +1909 -0
  11. package/dist/generated/logic.d.ts.map +1 -0
  12. package/dist/generated/logic.js +5 -0
  13. package/dist/generated/logic.js.map +1 -0
  14. package/dist/index.d.ts +16 -139
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +3 -16
  17. package/dist/index.js.map +1 -1
  18. package/dist/logic-globals.d.ts +1 -0
  19. package/dist/process.d.ts +117 -0
  20. package/dist/process.d.ts.map +1 -0
  21. package/dist/process.js +10 -0
  22. package/dist/process.js.map +1 -0
  23. package/package.json +73 -47
  24. package/src/automation/index.ts +1074 -0
  25. package/src/generated/i18n.ts +44 -22
  26. package/src/generated/logic-web.d.ts +305 -0
  27. package/src/generated/logic.ts +2123 -0
  28. package/src/index.ts +18 -258
  29. package/src/logic-globals.d.ts +1 -0
  30. package/src/process.ts +135 -0
  31. package/dist/app/index.d.ts +0 -278
  32. package/dist/app/index.d.ts.map +0 -1
  33. package/dist/app/index.js +0 -6
  34. package/dist/app/index.js.map +0 -1
  35. package/dist/device/actions.d.ts +0 -7
  36. package/dist/device/actions.d.ts.map +0 -1
  37. package/dist/device/actions.js +0 -6
  38. package/dist/device/actions.js.map +0 -1
  39. package/dist/device/index.d.ts +0 -5
  40. package/dist/device/index.d.ts.map +0 -1
  41. package/dist/device/index.js +0 -21
  42. package/dist/device/index.js.map +0 -1
  43. package/dist/device/info.d.ts +0 -16
  44. package/dist/device/info.d.ts.map +0 -1
  45. package/dist/device/info.js +0 -6
  46. package/dist/device/info.js.map +0 -1
  47. package/dist/device/network.d.ts +0 -12
  48. package/dist/device/network.d.ts.map +0 -1
  49. package/dist/device/network.js +0 -6
  50. package/dist/device/network.js.map +0 -1
  51. package/dist/device/wifi.d.ts +0 -20
  52. package/dist/device/wifi.d.ts.map +0 -1
  53. package/dist/device/wifi.js +0 -6
  54. package/dist/device/wifi.js.map +0 -1
  55. package/dist/display/index.d.ts +0 -8
  56. package/dist/display/index.d.ts.map +0 -1
  57. package/dist/display/index.js +0 -6
  58. package/dist/display/index.js.map +0 -1
  59. package/dist/env/index.d.ts +0 -8
  60. package/dist/env/index.d.ts.map +0 -1
  61. package/dist/env/index.js +0 -6
  62. package/dist/env/index.js.map +0 -1
  63. package/dist/file/index.d.ts +0 -146
  64. package/dist/file/index.d.ts.map +0 -1
  65. package/dist/file/index.js +0 -6
  66. package/dist/file/index.js.map +0 -1
  67. package/dist/input/index.d.ts +0 -18
  68. package/dist/input/index.d.ts.map +0 -1
  69. package/dist/input/index.js +0 -8
  70. package/dist/input/index.js.map +0 -1
  71. package/dist/location/index.d.ts +0 -19
  72. package/dist/location/index.d.ts.map +0 -1
  73. package/dist/location/index.js +0 -6
  74. package/dist/location/index.js.map +0 -1
  75. package/dist/lxapp/index.d.ts +0 -11
  76. package/dist/lxapp/index.d.ts.map +0 -1
  77. package/dist/lxapp/index.js +0 -6
  78. package/dist/lxapp/index.js.map +0 -1
  79. package/dist/media/index.d.ts +0 -313
  80. package/dist/media/index.d.ts.map +0 -1
  81. package/dist/media/index.js +0 -6
  82. package/dist/media/index.js.map +0 -1
  83. package/dist/navigator/index.d.ts +0 -14
  84. package/dist/navigator/index.d.ts.map +0 -1
  85. package/dist/navigator/index.js +0 -6
  86. package/dist/navigator/index.js.map +0 -1
  87. package/dist/share/index.d.ts +0 -90
  88. package/dist/share/index.d.ts.map +0 -1
  89. package/dist/share/index.js +0 -6
  90. package/dist/share/index.js.map +0 -1
  91. package/dist/storage/index.d.ts +0 -13
  92. package/dist/storage/index.d.ts.map +0 -1
  93. package/dist/storage/index.js +0 -6
  94. package/dist/storage/index.js.map +0 -1
  95. package/dist/system/index.d.ts +0 -13
  96. package/dist/system/index.d.ts.map +0 -1
  97. package/dist/system/index.js +0 -6
  98. package/dist/system/index.js.map +0 -1
  99. package/dist/transfer/index.d.ts +0 -121
  100. package/dist/transfer/index.d.ts.map +0 -1
  101. package/dist/transfer/index.js +0 -6
  102. package/dist/transfer/index.js.map +0 -1
  103. package/dist/ui/index.d.ts +0 -147
  104. package/dist/ui/index.d.ts.map +0 -1
  105. package/dist/ui/index.js +0 -6
  106. package/dist/ui/index.js.map +0 -1
  107. package/dist/update/index.d.ts +0 -17
  108. package/dist/update/index.d.ts.map +0 -1
  109. package/dist/update/index.js +0 -6
  110. package/dist/update/index.js.map +0 -1
  111. package/src/app/index.ts +0 -323
  112. package/src/device/actions.ts +0 -7
  113. package/src/device/index.ts +0 -4
  114. package/src/device/info.ts +0 -17
  115. package/src/device/network.ts +0 -23
  116. package/src/device/wifi.ts +0 -23
  117. package/src/display/index.ts +0 -9
  118. package/src/env/index.ts +0 -8
  119. package/src/file/index.ts +0 -171
  120. package/src/input/index.ts +0 -19
  121. package/src/location/index.ts +0 -20
  122. package/src/lxapp/index.ts +0 -12
  123. package/src/media/index.ts +0 -343
  124. package/src/navigator/index.ts +0 -16
  125. package/src/share/index.ts +0 -97
  126. package/src/storage/index.ts +0 -13
  127. package/src/system/index.ts +0 -14
  128. package/src/transfer/index.ts +0 -136
  129. package/src/ui/index.ts +0 -180
  130. package/src/update/index.ts +0 -19
package/src/file/index.ts DELETED
@@ -1,171 +0,0 @@
1
- /**
2
- * File system APIs.
3
- */
4
-
5
- export interface OpenFileOptions {
6
- /** Local file path or runtime-managed temp path. */
7
- filePath: string;
8
- /** Optional coarse file type hint such as `pdf`, `docx`, or `xlsx`. */
9
- fileType?: string;
10
- /**
11
- * `auto`: prefer native review, then fall back to external open.
12
- * `review`: require native review UI and reject when unsupported.
13
- * `external`: hand off directly to the system / external app.
14
- */
15
- mode?: 'auto' | 'review' | 'external';
16
- /** Hint for whether the native review UI should expose its action menu when supported. */
17
- showMenu?: boolean;
18
- }
19
-
20
- export interface FileDialogFilter {
21
- /** Optional label shown in the native dialog. */
22
- name?: string;
23
- /** Allowed extensions without dots, e.g. ['pdf', 'txt']. */
24
- extensions: string[];
25
- }
26
-
27
- export interface ChooseFileOptions {
28
- /** Allow selecting multiple files. Default: false */
29
- multiple?: boolean;
30
- /** Optional file filters. Empty or omitted means all file types. */
31
- filters?: FileDialogFilter[];
32
- /**
33
- * Initial directory the dialog opens in.
34
- *
35
- * When this resolves to an app-local directory, LingXia may use its internal
36
- * file picker. When omitted, the platform system file picker is used.
37
- */
38
- defaultPath?: string;
39
- }
40
-
41
- export interface ChooseFileResult {
42
- /** True if the user dismissed the dialog without selecting. */
43
- canceled: boolean;
44
- /**
45
- * File paths returned by LingXia. Values may be app-local paths, `lx://...`
46
- * paths, or platform system-picker references. Treat them as opaque strings
47
- * and pass them back to LingXia APIs such as `lx.share`.
48
- */
49
- paths: string[];
50
- }
51
-
52
- export interface ChooseDirectoryOptions {
53
- /** Initial directory the dialog opens in. Platform default if omitted. */
54
- defaultPath?: string;
55
- }
56
-
57
- export interface ChooseDirectoryResult {
58
- /** True if the user dismissed the dialog without selecting. */
59
- canceled: boolean;
60
- /** Native-consumable directory reference (path or URI). Undefined when canceled. */
61
- path?: string;
62
- }
63
-
64
- export interface ExistsOptions {
65
- path: string;
66
- }
67
-
68
- export interface StatOptions {
69
- path: string;
70
- }
71
-
72
- export interface FileStats {
73
- isFile: boolean;
74
- isDirectory: boolean;
75
- isSymlink: boolean;
76
- size: number;
77
- lastModifiedTime?: number;
78
- lastAccessedTime?: number;
79
- createTime?: number;
80
- }
81
-
82
- export interface ReadDirOptions {
83
- path: string;
84
- }
85
-
86
- export interface DirEntry {
87
- name: string;
88
- isFile: boolean;
89
- isDirectory: boolean;
90
- isSymlink: boolean;
91
- }
92
-
93
- export interface MkdirOptions {
94
- path: string;
95
- recursive?: boolean;
96
- }
97
-
98
- export interface ReadTextFileOptions {
99
- filePath: string;
100
- encoding: 'utf8' | 'base64';
101
- }
102
-
103
- export interface ReadBinaryFileOptions {
104
- filePath: string;
105
- encoding?: undefined;
106
- }
107
-
108
- export type ReadFileOptions = ReadTextFileOptions | ReadBinaryFileOptions;
109
-
110
- export interface ReadTextFileResult {
111
- data: string;
112
- }
113
-
114
- export interface ReadBinaryFileResult {
115
- data: ArrayBuffer;
116
- }
117
-
118
- export type ReadFileResult = ReadTextFileResult | ReadBinaryFileResult;
119
-
120
- export type BinaryFileData = ArrayBuffer | ArrayBufferView;
121
-
122
- export interface WriteTextFileOptions {
123
- filePath: string;
124
- data: string;
125
- encoding?: 'utf8' | 'base64';
126
- /** Defaults to false. */
127
- overwrite?: boolean;
128
- }
129
-
130
- export interface WriteBinaryFileOptions {
131
- filePath: string;
132
- data: BinaryFileData;
133
- encoding?: never;
134
- /** Defaults to false. */
135
- overwrite?: boolean;
136
- }
137
-
138
- export type WriteFileOptions = WriteTextFileOptions | WriteBinaryFileOptions;
139
-
140
- export interface CopyFileOptions {
141
- srcPath: string;
142
- destPath: string;
143
- /** Defaults to false. */
144
- overwrite?: boolean;
145
- }
146
-
147
- export interface RenameOptions {
148
- oldPath: string;
149
- newPath: string;
150
- /** Defaults to false. */
151
- overwrite?: boolean;
152
- }
153
-
154
- export interface RemoveOptions {
155
- path: string;
156
- recursive?: boolean;
157
- }
158
-
159
- export interface FileManager {
160
- exists(options: ExistsOptions): Promise<boolean>;
161
- stat(options: StatOptions): Promise<FileStats>;
162
- readDir(options: ReadDirOptions): Promise<AsyncIterableIterator<DirEntry>>;
163
- mkdir(options: MkdirOptions): Promise<void>;
164
- readFile(options: ReadTextFileOptions): Promise<ReadTextFileResult>;
165
- readFile(options: ReadBinaryFileOptions): Promise<ReadBinaryFileResult>;
166
- readFile(options: ReadFileOptions): Promise<ReadFileResult>;
167
- writeFile(options: WriteFileOptions): Promise<void>;
168
- copyFile(options: CopyFileOptions): Promise<void>;
169
- rename(options: RenameOptions): Promise<void>;
170
- remove(options: RemoveOptions): Promise<void>;
171
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * Input event APIs.
3
- *
4
- * Platform support: Android only
5
- */
6
-
7
- export interface KeyEvent {
8
- /** Key value following W3C naming (e.g. "Enter", "ArrowLeft", "a") */
9
- key: string;
10
- /** Physical key code (e.g. "ENTER", "DPAD_LEFT") */
11
- code: string;
12
- altKey?: boolean;
13
- ctrlKey?: boolean;
14
- shiftKey?: boolean;
15
- metaKey?: boolean;
16
- repeat?: boolean;
17
- }
18
-
19
- export type KeyEventCallback = (event: KeyEvent) => void;
@@ -1,20 +0,0 @@
1
- /**
2
- * Location APIs.
3
- */
4
-
5
- export interface GetLocationOptions {
6
- type?: 'wgs84' | 'gcj02';
7
- altitude?: boolean;
8
- isHighAccuracy?: boolean;
9
- highAccuracyExpireTime?: number;
10
- }
11
-
12
- export interface LocationInfo {
13
- latitude: number;
14
- longitude: number;
15
- speed?: number;
16
- accuracy?: number;
17
- altitude?: number;
18
- verticalAccuracy?: number;
19
- horizontalAccuracy?: number;
20
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * LxApp metadata APIs.
3
- */
4
-
5
- export type LxAppReleaseType = 'release' | 'preview' | 'developer';
6
-
7
- export interface LxAppInfo {
8
- appId: string;
9
- appName: string;
10
- version: string;
11
- releaseType: LxAppReleaseType;
12
- }
@@ -1,343 +0,0 @@
1
- /**
2
- * Media picker, preview, scan, and file processing APIs.
3
- */
4
-
5
- export interface GetImageInfoOptions {
6
- path: string;
7
- }
8
-
9
- export interface ImageInfo {
10
- width: number;
11
- height: number;
12
- type: string;
13
- path: string;
14
- }
15
-
16
- export interface CompressImageOptions {
17
- path: string;
18
- quality?: number;
19
- compressedWidth?: number;
20
- compressedHeight?: number;
21
- }
22
-
23
- export interface CompressImageResult {
24
- tempFilePath: string;
25
- }
26
-
27
- export type VideoCompressQuality = 'low' | 'medium' | 'high';
28
-
29
- export interface CompressVideoOptions {
30
- /**
31
- * Source video path or `lx://` URI.
32
- */
33
- path: string;
34
- /**
35
- * Cross-platform note: video compression parameters are best-effort and may map to
36
- * native presets instead of exact encoder settings.
37
- *
38
- * Compression quality preset.
39
- * When provided, `bitrate`, `fps`, and `resolution` are ignored.
40
- */
41
- quality?: VideoCompressQuality;
42
- /**
43
- * Preferred target video bitrate in kbps.
44
- * May be adjusted or ignored by platform codec/runtime limitations.
45
- */
46
- bitrate?: number;
47
- /**
48
- * Preferred target frame rate in fps.
49
- * Some platforms may ignore this option.
50
- */
51
- fps?: number;
52
- /**
53
- * Target resolution scale ratio relative to source size, in range `(0, 1]`.
54
- * May be approximated or ignored by platform transcoder capabilities.
55
- */
56
- resolution?: number;
57
- /**
58
- * Optional output path for compressed file.
59
- */
60
- outputPath?: string;
61
- }
62
-
63
- export interface CompressVideoResult {
64
- tempFilePath: string;
65
- width: number;
66
- height: number;
67
- durationMs: number;
68
- /**
69
- * Output file size in bytes.
70
- * Could be close to source size when platform falls back to source content.
71
- */
72
- size: number;
73
- type: string;
74
- }
75
-
76
- export interface GetVideoInfoOptions {
77
- /**
78
- * Video file path or `lx://` URI.
79
- */
80
- path: string;
81
- }
82
-
83
- export interface VideoInfo {
84
- /**
85
- * Encoded display width in pixels.
86
- */
87
- width: number;
88
- /**
89
- * Encoded display height in pixels.
90
- */
91
- height: number;
92
- /**
93
- * Video duration in milliseconds.
94
- */
95
- durationMs: number;
96
- /**
97
- * Clockwise rotation in degrees (usually `0 | 90 | 180 | 270`).
98
- */
99
- rotation?: number;
100
- /**
101
- * Average bitrate in bits per second (bps).
102
- */
103
- bitrate?: number;
104
- /**
105
- * Frame rate in frames per second (fps).
106
- */
107
- fps?: number;
108
- /**
109
- * MIME type, e.g. `video/mp4`.
110
- */
111
- type?: string;
112
- /**
113
- * Resolved path used by runtime (typically `lx://...`).
114
- */
115
- path: string;
116
- }
117
-
118
- export interface ExtractVideoThumbnailOptions {
119
- /**
120
- * Source video path or `lx://` URI.
121
- */
122
- path: string;
123
- /**
124
- * Optional output image path. If omitted, runtime chooses a temporary path.
125
- */
126
- outputPath?: string;
127
- /**
128
- * Max output width in pixels.
129
- * Optional; when set with/without `maxHeight`, output keeps aspect ratio (no cropping).
130
- */
131
- maxWidth?: number;
132
- /**
133
- * Max output height in pixels.
134
- * Optional; when set with/without `maxWidth`, output keeps aspect ratio (no cropping).
135
- */
136
- maxHeight?: number;
137
- /**
138
- * Target frame time in milliseconds from video start.
139
- * `0` means first frame.
140
- */
141
- timeMs?: number;
142
- /**
143
- * JPEG quality in range `0-100`.
144
- */
145
- quality?: number;
146
- }
147
-
148
- export interface ExtractVideoThumbnailResult {
149
- /**
150
- * Generated thumbnail file path.
151
- */
152
- tempFilePath: string;
153
- /**
154
- * Output image width in pixels.
155
- */
156
- width: number;
157
- /**
158
- * Output image height in pixels.
159
- */
160
- height: number;
161
- /**
162
- * Output MIME type, usually `image/jpeg`.
163
- */
164
- type: string;
165
- }
166
-
167
- export interface ChooseMediaOptions {
168
- count?: number;
169
- mediaType?: ('image' | 'video')[];
170
- sourceType?: ('album' | 'camera')[];
171
- camera?: 'back' | 'front';
172
- maxDuration?: number;
173
- }
174
-
175
- export interface ChosenMediaEntry {
176
- tempFilePath: string;
177
- fileType: 'image' | 'video';
178
- isOriginal: boolean;
179
- }
180
-
181
- export type MediaRotation = 0 | 90 | 180 | 270;
182
-
183
- export type MediaObjectFit = 'cover' | 'contain' | 'fill' | 'fit';
184
-
185
- export interface PreviewMediaSource {
186
- /**
187
- * Media source path.
188
- * Recommended: `lx://` path (for example `lx://usercache/...`) or a sandbox-local path
189
- * that can be resolved by runtime access rules.
190
- */
191
- path: string;
192
- type?: 'image' | 'video';
193
- /**
194
- * Optional clockwise rotation in degrees (`0 | 90 | 180 | 270`).
195
- * Default: when omitted, runtime resolves orientation from media metadata.
196
- */
197
- rotate?: MediaRotation;
198
- /**
199
- * Optional display fit mode for video preview.
200
- * Default: `contain`.
201
- */
202
- objectFit?: MediaObjectFit;
203
- /**
204
- * Display duration in milliseconds.
205
- * Effective when preview `advance` is not `manual`.
206
- */
207
- durationMs?: number;
208
- }
209
-
210
- export type PreviewMediaAdvance = 'manual' | 'next' | 'loop';
211
-
212
- export interface PreviewMediaSingleOptions extends PreviewMediaSource {
213
- /**
214
- * Auto behavior for the preview session.
215
- *
216
- * - `manual`: never auto-advance
217
- * - `next`: advance to the next item; if already on the last item, close the session
218
- * - `loop`: advance to the next item; if already on the last item, wrap to the first item
219
- *
220
- * Default: `manual`
221
- */
222
- advance?: PreviewMediaAdvance;
223
- /**
224
- * Optional cancellation signal for the preview request.
225
- *
226
- * Aborting rejects the returned promise with a cancellation error and requests the active
227
- * native preview session to close immediately.
228
- */
229
- signal?: AbortSignal;
230
- /**
231
- * Whether to show the top `current/total` indicator.
232
- *
233
- * Default: `true` when previewing multiple items, otherwise `false`.
234
- */
235
- showIndexIndicator?: boolean;
236
- }
237
-
238
- export interface PreviewMediaSequenceOptions {
239
- /**
240
- * Preview list. Supports images, videos, or a mixed queue.
241
- */
242
- sources: PreviewMediaSource[];
243
- /**
244
- * Initial item index in `sources`.
245
- * Must be an integer.
246
- * Out-of-range values are clamped by runtime.
247
- * Default: `0`.
248
- */
249
- startIndex?: number;
250
- /**
251
- * Auto behavior for the preview session.
252
- *
253
- * - `manual`: never auto-advance
254
- * - `next`: advance to the next item; if already on the last item, close the session
255
- * - `loop`: advance to the next item; if already on the last item, wrap to the first item
256
- *
257
- * Default: `manual`
258
- */
259
- advance?: PreviewMediaAdvance;
260
- /**
261
- * Optional cancellation signal for the preview request.
262
- *
263
- * Aborting rejects the returned promise with a cancellation error and requests the active
264
- * native preview session to close immediately.
265
- */
266
- signal?: AbortSignal;
267
- /**
268
- * Whether to show the top `current/total` indicator.
269
- *
270
- * Default: `true` when previewing multiple items, otherwise `false`.
271
- */
272
- showIndexIndicator?: boolean;
273
- }
274
-
275
- export type PreviewMediaOptions =
276
- | string
277
- | PreviewMediaSingleOptions
278
- | PreviewMediaSequenceOptions;
279
-
280
- export type PreviewMediaCloseReason = 'manual' | 'completed' | 'interrupted' | 'error';
281
-
282
- export interface PreviewMediaResult {
283
- /**
284
- * Why the preview session finished.
285
- */
286
- reason: PreviewMediaCloseReason;
287
- /**
288
- * Last active item index before close.
289
- */
290
- lastIndex: number;
291
- }
292
-
293
- /**
294
- * Handle returned synchronously from `lx.previewMedia(...)`. Exposes two
295
- * independent Promises so callers can coordinate transitions:
296
- *
297
- * - `presented` resolves once the first pixel of the underlying media has
298
- * been composited to screen. Use this to time the hide of an overlay
299
- * surface above the preview so the swap is seamless. Never rejects;
300
- * resolves with no value when the first frame is up. Safe to ignore.
301
- * - `completed` resolves when the preview session ends (manual / auto /
302
- * interrupted / error). Replaces the previous `Promise<PreviewMediaResult>`
303
- * that `previewMedia` used to return directly.
304
- *
305
- * If the call was aborted before any frame was presented, `presented` still
306
- * resolves (with no value) once the abort takes effect — it never rejects,
307
- * to keep fire-and-forget usage safe.
308
- */
309
- export interface PreviewMediaHandle {
310
- readonly presented: Promise<void>;
311
- readonly completed: Promise<PreviewMediaResult>;
312
- }
313
-
314
- export interface SaveMediaOptions {
315
- filePath: string;
316
- }
317
-
318
- export interface ScanCodeOptions {
319
- onlyFromCamera?: boolean;
320
- scanType?: ('barCode' | 'qrCode' | 'datamatrix' | 'pdf417')[];
321
- }
322
-
323
- export interface ScanCodeResult {
324
- scanResult: string;
325
- scanType: string;
326
- }
327
-
328
- export interface StreamSourceOptions {
329
- provider: string;
330
- isLive: boolean;
331
- duration?: number;
332
- params?: Record<string, unknown>;
333
- }
334
-
335
- export interface VideoContext {
336
- play(): void;
337
- pause(): void;
338
- stop(): void;
339
- seek(position: number): void;
340
- requestFullScreen(): void;
341
- exitFullScreen(): void;
342
- setStreamSource(options: StreamSourceOptions): void;
343
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * LxApp navigator APIs.
3
- */
4
-
5
- import type { PageQuery } from '../ui';
6
-
7
- export type LxAppEnvVersion = 'release' | 'preview' | 'develop';
8
-
9
- export interface NavigateToLxAppOptions {
10
- appId: string;
11
- page?: string;
12
- path?: string;
13
- query?: PageQuery;
14
- envVersion?: LxAppEnvVersion;
15
- targetVersion?: string;
16
- }
@@ -1,97 +0,0 @@
1
- /**
2
- * Share APIs.
3
- */
4
-
5
- export type ShareQuery = Record<string, string | number | boolean>;
6
-
7
- export type SharePage =
8
- /**
9
- * Share the current page.
10
- */
11
- | true
12
- /**
13
- * Share the current page with query.
14
- */
15
- | {
16
- /**
17
- * Query appended to the current page. Query belongs to the page target and is
18
- * encoded into the AppLink URL.
19
- */
20
- query?: ShareQuery;
21
- };
22
-
23
- interface ShareTitleOptions {
24
- /**
25
- * Share title.
26
- */
27
- title?: string;
28
- }
29
-
30
- interface ShareTextBaseOptions extends ShareTitleOptions {
31
- /**
32
- * Share text body.
33
- */
34
- text?: string;
35
- }
36
-
37
- /**
38
- * Share title/text only. Receiver support is platform/app dependent; some
39
- * share extensions may reject text-only shares.
40
- */
41
- export interface ShareTextOptions extends ShareTextBaseOptions {
42
- page?: never;
43
- files?: never;
44
- }
45
-
46
- /**
47
- * Share the current page as an AppLink.
48
- */
49
- export interface SharePageOptions extends ShareTextBaseOptions {
50
- /**
51
- * Share the current page. The runtime uses the current appId and page path
52
- * implicitly and shares it through the host AppLink configuration.
53
- *
54
- * Rejects when the host app has no `appLinks.hosts` configuration because
55
- * receivers would not be able to open the shared page.
56
- *
57
- * `title` and `text` are presentation hints. Platforms and receivers may
58
- * ignore them; on iOS the URL is shared by itself so receivers can render it
59
- * as a webpage card when they support that.
60
- *
61
- * `page` and `files` are mutually exclusive.
62
- */
63
- page: SharePage;
64
- files?: never;
65
- }
66
-
67
- /**
68
- * Share images, PDFs, or other files.
69
- */
70
- export interface ShareFilesOptions extends ShareTitleOptions {
71
- /**
72
- * File paths returned by LingXia APIs to share. Images, PDFs, and other
73
- * documents are all represented as file paths.
74
- *
75
- * Use `lx.chooseFile` for system files and `lx.chooseMedia` for picked media;
76
- * pass the returned path here without parsing it.
77
- * Some platforms or receivers may limit multi-file shares. Share files one
78
- * at a time when targeting those receivers.
79
- *
80
- * `files` and `page` are mutually exclusive.
81
- * `text` is intentionally not supported for file shares because system
82
- * receivers handle text+attachment inconsistently.
83
- */
84
- files: string[];
85
- page?: never;
86
- text?: never;
87
- }
88
-
89
- export type ShareOptions = ShareTextOptions | SharePageOptions | ShareFilesOptions;
90
-
91
- export interface ShareResult {
92
- /**
93
- * Best-effort completion flag. Some platforms can only confirm that the
94
- * system share UI was opened or closed.
95
- */
96
- completed?: boolean;
97
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Key-value storage APIs.
3
- */
4
-
5
- export interface Storage {
6
- get(key: string): unknown;
7
- set(key: string, value: unknown): void;
8
- remove(key: string): void;
9
- clear(): void;
10
- keys(): string[];
11
- has(key: string): boolean;
12
- size(): number;
13
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * System settings and URL APIs.
3
- */
4
-
5
- export interface SystemSettingInfo {
6
- bluetoothEnabled: boolean;
7
- locationEnabled: boolean;
8
- wifiEnabled: boolean;
9
- }
10
-
11
- export interface OpenURLOptions {
12
- url: string;
13
- target?: 'self' | 'external';
14
- }