@lingxia/types 0.10.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.
- package/dist/automation/index.d.ts +942 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +13 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/generated/i18n.d.ts +1 -1
- package/dist/generated/i18n.d.ts.map +1 -1
- package/dist/generated/i18n.js +29 -0
- package/dist/generated/i18n.js.map +1 -1
- package/dist/generated/logic-web.d.ts +305 -0
- package/dist/generated/logic.d.ts +1909 -0
- package/dist/generated/logic.d.ts.map +1 -0
- package/dist/generated/logic.js +5 -0
- package/dist/generated/logic.js.map +1 -0
- package/dist/index.d.ts +16 -313
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/dist/logic-globals.d.ts +1 -0
- package/dist/process.d.ts +117 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +10 -0
- package/dist/process.js.map +1 -0
- package/package.json +73 -47
- package/src/automation/index.ts +1074 -0
- package/src/generated/i18n.ts +29 -0
- package/src/generated/logic-web.d.ts +305 -0
- package/src/generated/logic.ts +2123 -0
- package/src/index.ts +18 -459
- package/src/logic-globals.d.ts +1 -0
- package/src/process.ts +135 -0
- package/dist/app/index.d.ts +0 -328
- package/dist/app/index.d.ts.map +0 -1
- package/dist/app/index.js +0 -6
- package/dist/app/index.js.map +0 -1
- package/dist/device/actions.d.ts +0 -7
- package/dist/device/actions.d.ts.map +0 -1
- package/dist/device/actions.js +0 -6
- package/dist/device/actions.js.map +0 -1
- package/dist/device/index.d.ts +0 -5
- package/dist/device/index.d.ts.map +0 -1
- package/dist/device/index.js +0 -21
- package/dist/device/index.js.map +0 -1
- package/dist/device/info.d.ts +0 -16
- package/dist/device/info.d.ts.map +0 -1
- package/dist/device/info.js +0 -6
- package/dist/device/info.js.map +0 -1
- package/dist/device/network.d.ts +0 -12
- package/dist/device/network.d.ts.map +0 -1
- package/dist/device/network.js +0 -6
- package/dist/device/network.js.map +0 -1
- package/dist/device/wifi.d.ts +0 -20
- package/dist/device/wifi.d.ts.map +0 -1
- package/dist/device/wifi.js +0 -6
- package/dist/device/wifi.js.map +0 -1
- package/dist/display/index.d.ts +0 -8
- package/dist/display/index.d.ts.map +0 -1
- package/dist/display/index.js +0 -6
- package/dist/display/index.js.map +0 -1
- package/dist/env/index.d.ts +0 -8
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/index.js +0 -6
- package/dist/env/index.js.map +0 -1
- package/dist/file/index.d.ts +0 -146
- package/dist/file/index.d.ts.map +0 -1
- package/dist/file/index.js +0 -6
- package/dist/file/index.js.map +0 -1
- package/dist/input/index.d.ts +0 -18
- package/dist/input/index.d.ts.map +0 -1
- package/dist/input/index.js +0 -8
- package/dist/input/index.js.map +0 -1
- package/dist/location/index.d.ts +0 -19
- package/dist/location/index.d.ts.map +0 -1
- package/dist/location/index.js +0 -6
- package/dist/location/index.js.map +0 -1
- package/dist/lxapp/index.d.ts +0 -11
- package/dist/lxapp/index.d.ts.map +0 -1
- package/dist/lxapp/index.js +0 -6
- package/dist/lxapp/index.js.map +0 -1
- package/dist/media/index.d.ts +0 -372
- package/dist/media/index.d.ts.map +0 -1
- package/dist/media/index.js +0 -6
- package/dist/media/index.js.map +0 -1
- package/dist/navigator/index.d.ts +0 -14
- package/dist/navigator/index.d.ts.map +0 -1
- package/dist/navigator/index.js +0 -6
- package/dist/navigator/index.js.map +0 -1
- package/dist/share/index.d.ts +0 -90
- package/dist/share/index.d.ts.map +0 -1
- package/dist/share/index.js +0 -6
- package/dist/share/index.js.map +0 -1
- package/dist/storage/index.d.ts +0 -13
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -6
- package/dist/storage/index.js.map +0 -1
- package/dist/system/index.d.ts +0 -9
- package/dist/system/index.d.ts.map +0 -1
- package/dist/system/index.js +0 -6
- package/dist/system/index.js.map +0 -1
- package/dist/transfer/index.d.ts +0 -166
- package/dist/transfer/index.d.ts.map +0 -1
- package/dist/transfer/index.js +0 -6
- package/dist/transfer/index.js.map +0 -1
- package/dist/ui/index.d.ts +0 -134
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -6
- package/dist/ui/index.js.map +0 -1
- package/dist/update/index.d.ts +0 -17
- package/dist/update/index.d.ts.map +0 -1
- package/dist/update/index.js +0 -6
- package/dist/update/index.js.map +0 -1
- package/src/app/index.ts +0 -378
- package/src/device/actions.ts +0 -7
- package/src/device/index.ts +0 -4
- package/src/device/info.ts +0 -17
- package/src/device/network.ts +0 -23
- package/src/device/wifi.ts +0 -23
- package/src/display/index.ts +0 -9
- package/src/env/index.ts +0 -8
- package/src/file/index.ts +0 -171
- package/src/input/index.ts +0 -19
- package/src/location/index.ts +0 -20
- package/src/lxapp/index.ts +0 -12
- package/src/media/index.ts +0 -411
- package/src/navigator/index.ts +0 -16
- package/src/share/index.ts +0 -97
- package/src/storage/index.ts +0 -13
- package/src/system/index.ts +0 -9
- package/src/transfer/index.ts +0 -194
- package/src/ui/index.ts +0 -165
- package/src/update/index.ts +0 -19
package/src/media/index.ts
DELETED
|
@@ -1,411 +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 CompressVideoProgressEvent {
|
|
77
|
-
/** Transcode progress in percent, `0`-`100`. */
|
|
78
|
-
progress: number;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface CompressVideoIteratorResult {
|
|
82
|
-
done: boolean;
|
|
83
|
-
value?: CompressVideoProgressEvent;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Handle returned by `lx.compressVideo`.
|
|
88
|
-
*
|
|
89
|
-
* Awaiting the task resolves with the final {@link CompressVideoResult}.
|
|
90
|
-
* Iterating it with `for await` yields {@link CompressVideoProgressEvent}s
|
|
91
|
-
* while the transcode runs.
|
|
92
|
-
*/
|
|
93
|
-
export interface CompressVideoTask
|
|
94
|
-
extends PromiseLike<CompressVideoResult>,
|
|
95
|
-
AsyncIterable<CompressVideoProgressEvent> {
|
|
96
|
-
next(): Promise<CompressVideoIteratorResult>;
|
|
97
|
-
/** Stops iteration only. Does not cancel the compression. */
|
|
98
|
-
return(): Promise<CompressVideoIteratorResult>;
|
|
99
|
-
catch<TResult = never>(
|
|
100
|
-
onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,
|
|
101
|
-
): Promise<CompressVideoResult | TResult>;
|
|
102
|
-
finally(onfinally?: (() => void) | null): Promise<CompressVideoResult>;
|
|
103
|
-
/**
|
|
104
|
-
* Cancels the transcode and deletes any partial output.
|
|
105
|
-
* The task promise rejects with an `AbortError` (`code: 'E_ABORT'`).
|
|
106
|
-
*/
|
|
107
|
-
cancel(): void;
|
|
108
|
-
wait(): Promise<CompressVideoResult>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface GetVideoInfoOptions {
|
|
112
|
-
/**
|
|
113
|
-
* Video file path or `lx://` URI.
|
|
114
|
-
*/
|
|
115
|
-
path: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface VideoInfo {
|
|
119
|
-
/**
|
|
120
|
-
* Encoded display width in pixels.
|
|
121
|
-
*/
|
|
122
|
-
width: number;
|
|
123
|
-
/**
|
|
124
|
-
* Encoded display height in pixels.
|
|
125
|
-
*/
|
|
126
|
-
height: number;
|
|
127
|
-
/**
|
|
128
|
-
* Video duration in milliseconds.
|
|
129
|
-
*/
|
|
130
|
-
durationMs: number;
|
|
131
|
-
/**
|
|
132
|
-
* Clockwise rotation in degrees (usually `0 | 90 | 180 | 270`).
|
|
133
|
-
*/
|
|
134
|
-
rotation?: number;
|
|
135
|
-
/**
|
|
136
|
-
* Average bitrate in bits per second (bps).
|
|
137
|
-
*/
|
|
138
|
-
bitrate?: number;
|
|
139
|
-
/**
|
|
140
|
-
* Frame rate in frames per second (fps).
|
|
141
|
-
*/
|
|
142
|
-
fps?: number;
|
|
143
|
-
/**
|
|
144
|
-
* MIME type, e.g. `video/mp4`.
|
|
145
|
-
*/
|
|
146
|
-
type?: string;
|
|
147
|
-
/**
|
|
148
|
-
* Resolved path used by runtime (typically `lx://...`).
|
|
149
|
-
*/
|
|
150
|
-
path: string;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export interface ExtractVideoThumbnailOptions {
|
|
154
|
-
/**
|
|
155
|
-
* Source video path or `lx://` URI.
|
|
156
|
-
*/
|
|
157
|
-
path: string;
|
|
158
|
-
/**
|
|
159
|
-
* Optional output image path. If omitted, runtime chooses a temporary path.
|
|
160
|
-
*/
|
|
161
|
-
outputPath?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Max output width in pixels.
|
|
164
|
-
* Optional; when set with/without `maxHeight`, output keeps aspect ratio (no cropping).
|
|
165
|
-
*/
|
|
166
|
-
maxWidth?: number;
|
|
167
|
-
/**
|
|
168
|
-
* Max output height in pixels.
|
|
169
|
-
* Optional; when set with/without `maxWidth`, output keeps aspect ratio (no cropping).
|
|
170
|
-
*/
|
|
171
|
-
maxHeight?: number;
|
|
172
|
-
/**
|
|
173
|
-
* Target frame time in milliseconds from video start.
|
|
174
|
-
* `0` means first frame.
|
|
175
|
-
*/
|
|
176
|
-
timeMs?: number;
|
|
177
|
-
/**
|
|
178
|
-
* JPEG quality in range `0-100`.
|
|
179
|
-
*/
|
|
180
|
-
quality?: number;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface ExtractVideoThumbnailResult {
|
|
184
|
-
/**
|
|
185
|
-
* Generated thumbnail file path.
|
|
186
|
-
*/
|
|
187
|
-
tempFilePath: string;
|
|
188
|
-
/**
|
|
189
|
-
* Output image width in pixels.
|
|
190
|
-
*/
|
|
191
|
-
width: number;
|
|
192
|
-
/**
|
|
193
|
-
* Output image height in pixels.
|
|
194
|
-
*/
|
|
195
|
-
height: number;
|
|
196
|
-
/**
|
|
197
|
-
* Output MIME type, usually `image/jpeg`.
|
|
198
|
-
*/
|
|
199
|
-
type: string;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface ChooseMediaOptions {
|
|
203
|
-
count?: number;
|
|
204
|
-
mediaType?: ('image' | 'video')[];
|
|
205
|
-
sourceType?: ('album' | 'camera')[];
|
|
206
|
-
camera?: 'back' | 'front';
|
|
207
|
-
maxDuration?: number;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface ChosenMediaEntry {
|
|
211
|
-
tempFilePath: string;
|
|
212
|
-
fileType: 'image' | 'video';
|
|
213
|
-
isOriginal: boolean;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export type MediaRotation = 0 | 90 | 180 | 270;
|
|
217
|
-
|
|
218
|
-
export type MediaObjectFit = 'cover' | 'contain' | 'fill' | 'fit';
|
|
219
|
-
|
|
220
|
-
export interface PreviewMediaSource {
|
|
221
|
-
/**
|
|
222
|
-
* Media source path.
|
|
223
|
-
* Recommended: `lx://` path (for example `lx://usercache/...`) or a sandbox-local path
|
|
224
|
-
* that can be resolved by runtime access rules.
|
|
225
|
-
*/
|
|
226
|
-
path: string;
|
|
227
|
-
type?: 'image' | 'video';
|
|
228
|
-
/**
|
|
229
|
-
* Optional clockwise rotation in degrees (`0 | 90 | 180 | 270`).
|
|
230
|
-
* Default: when omitted, runtime resolves orientation from media metadata.
|
|
231
|
-
*/
|
|
232
|
-
rotate?: MediaRotation;
|
|
233
|
-
/**
|
|
234
|
-
* Optional display fit mode for video preview.
|
|
235
|
-
* Default: `contain`.
|
|
236
|
-
*/
|
|
237
|
-
objectFit?: MediaObjectFit;
|
|
238
|
-
/**
|
|
239
|
-
* Display duration in milliseconds.
|
|
240
|
-
* Effective when preview `advance` is not `manual`.
|
|
241
|
-
*/
|
|
242
|
-
durationMs?: number;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export type PreviewMediaAdvance = 'manual' | 'next' | 'loop';
|
|
246
|
-
|
|
247
|
-
export interface PreviewMediaSingleOptions extends PreviewMediaSource {
|
|
248
|
-
/**
|
|
249
|
-
* Auto behavior for the preview session.
|
|
250
|
-
*
|
|
251
|
-
* - `manual`: never auto-advance
|
|
252
|
-
* - `next`: advance to the next item; if already on the last item, close the session
|
|
253
|
-
* - `loop`: advance to the next item; if already on the last item, wrap to the first item
|
|
254
|
-
*
|
|
255
|
-
* Default: `manual`
|
|
256
|
-
*/
|
|
257
|
-
advance?: PreviewMediaAdvance;
|
|
258
|
-
/**
|
|
259
|
-
* Optional cancellation signal for the preview request.
|
|
260
|
-
*
|
|
261
|
-
* Aborting rejects the returned promise with a cancellation error and requests the active
|
|
262
|
-
* native preview session to close immediately.
|
|
263
|
-
*/
|
|
264
|
-
signal?: AbortSignal;
|
|
265
|
-
/**
|
|
266
|
-
* Whether to show the top `current/total` indicator.
|
|
267
|
-
*
|
|
268
|
-
* Default: `true` when previewing multiple items, otherwise `false`.
|
|
269
|
-
*/
|
|
270
|
-
showIndexIndicator?: boolean;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export interface PreviewMediaSequenceOptions {
|
|
274
|
-
/**
|
|
275
|
-
* Preview list. Supports images, videos, or a mixed queue.
|
|
276
|
-
*/
|
|
277
|
-
sources: PreviewMediaSource[];
|
|
278
|
-
/**
|
|
279
|
-
* Initial item index in `sources`.
|
|
280
|
-
* Must be an integer.
|
|
281
|
-
* Out-of-range values are clamped by runtime.
|
|
282
|
-
* Default: `0`.
|
|
283
|
-
*/
|
|
284
|
-
startIndex?: number;
|
|
285
|
-
/**
|
|
286
|
-
* Auto behavior for the preview session.
|
|
287
|
-
*
|
|
288
|
-
* - `manual`: never auto-advance
|
|
289
|
-
* - `next`: advance to the next item; if already on the last item, close the session
|
|
290
|
-
* - `loop`: advance to the next item; if already on the last item, wrap to the first item
|
|
291
|
-
*
|
|
292
|
-
* Default: `manual`
|
|
293
|
-
*/
|
|
294
|
-
advance?: PreviewMediaAdvance;
|
|
295
|
-
/**
|
|
296
|
-
* Optional cancellation signal for the preview request.
|
|
297
|
-
*
|
|
298
|
-
* Aborting rejects the returned promise with a cancellation error and requests the active
|
|
299
|
-
* native preview session to close immediately.
|
|
300
|
-
*/
|
|
301
|
-
signal?: AbortSignal;
|
|
302
|
-
/**
|
|
303
|
-
* Whether to show the top `current/total` indicator.
|
|
304
|
-
*
|
|
305
|
-
* Default: `true` when previewing multiple items, otherwise `false`.
|
|
306
|
-
*/
|
|
307
|
-
showIndexIndicator?: boolean;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export type PreviewMediaOptions =
|
|
311
|
-
| string
|
|
312
|
-
| PreviewMediaSingleOptions
|
|
313
|
-
| PreviewMediaSequenceOptions;
|
|
314
|
-
|
|
315
|
-
export type PreviewMediaCloseReason = 'manual' | 'completed' | 'interrupted' | 'error';
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* The item the user is (or was) looking at, handed back as the caller
|
|
319
|
-
* described it — `path` is returned verbatim, so it can be matched against
|
|
320
|
-
* the caller's own data without re-indexing an array.
|
|
321
|
-
*/
|
|
322
|
-
export interface PreviewMediaShownSource {
|
|
323
|
-
/** The path exactly as passed in the request. */
|
|
324
|
-
path: string;
|
|
325
|
-
/** Resolved media kind (after extension inference when `type` was omitted). */
|
|
326
|
-
type: 'image' | 'video';
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/** One change-stream event / the `current` snapshot. */
|
|
330
|
-
export interface PreviewMediaChange {
|
|
331
|
-
index: number;
|
|
332
|
-
source: PreviewMediaShownSource;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export interface PreviewMediaResult {
|
|
336
|
-
/**
|
|
337
|
-
* Why the preview session finished.
|
|
338
|
-
*/
|
|
339
|
-
reason: PreviewMediaCloseReason;
|
|
340
|
-
/**
|
|
341
|
-
* Index of the item on screen when the session closed.
|
|
342
|
-
*/
|
|
343
|
-
index: number;
|
|
344
|
-
/**
|
|
345
|
-
* The item on screen when the session closed — "what the user just
|
|
346
|
-
* viewed/played", without mapping `index` back yourself.
|
|
347
|
-
*/
|
|
348
|
-
source: PreviewMediaShownSource;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Handle returned synchronously from `lx.previewMedia(...)` — synchronous so
|
|
353
|
-
* listeners can be attached before the first event fires:
|
|
354
|
-
*
|
|
355
|
-
* - `presented` resolves once the first pixel of the underlying media has
|
|
356
|
-
* been composited to screen. Use this to time the hide of an overlay
|
|
357
|
-
* surface above the preview so the swap is seamless. Never rejects;
|
|
358
|
-
* resolves with no value when the first frame is up. Safe to ignore.
|
|
359
|
-
* - `current` is a live `{ index, source }` snapshot of the item on screen,
|
|
360
|
-
* updated as the user swipes and as the session auto-advances.
|
|
361
|
-
* - `onChange(listener)` fires for every item change. Returns an
|
|
362
|
-
* unsubscribe function.
|
|
363
|
-
* - `completed` resolves `{ reason, index, source }` when the preview
|
|
364
|
-
* session ends (manual / auto / interrupted / error), or rejects on abort.
|
|
365
|
-
*
|
|
366
|
-
* If the call was aborted before any frame was presented, `presented` still
|
|
367
|
-
* resolves (with no value) once the abort takes effect — it never rejects,
|
|
368
|
-
* to keep fire-and-forget usage safe.
|
|
369
|
-
*
|
|
370
|
-
* @example
|
|
371
|
-
* const preview = lx.previewMedia({ sources, startIndex: 2 });
|
|
372
|
-
* preview.onChange(({ source }) => markAsViewed(source.path));
|
|
373
|
-
* const { reason, source } = await preview.completed;
|
|
374
|
-
*/
|
|
375
|
-
export interface PreviewMediaHandle {
|
|
376
|
-
readonly presented: Promise<void>;
|
|
377
|
-
readonly current: PreviewMediaChange;
|
|
378
|
-
onChange(listener: (change: PreviewMediaChange) => void): () => void;
|
|
379
|
-
readonly completed: Promise<PreviewMediaResult>;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export interface SaveMediaOptions {
|
|
383
|
-
filePath: string;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export interface ScanCodeOptions {
|
|
387
|
-
onlyFromCamera?: boolean;
|
|
388
|
-
scanType?: ('barCode' | 'qrCode' | 'datamatrix' | 'pdf417')[];
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
export interface ScanCodeResult {
|
|
392
|
-
scanResult: string;
|
|
393
|
-
scanType: string;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export interface StreamSourceOptions {
|
|
397
|
-
provider: string;
|
|
398
|
-
isLive: boolean;
|
|
399
|
-
duration?: number;
|
|
400
|
-
params?: Record<string, unknown>;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
export interface VideoContext {
|
|
404
|
-
play(): void;
|
|
405
|
-
pause(): void;
|
|
406
|
-
stop(): void;
|
|
407
|
-
seek(position: number): void;
|
|
408
|
-
requestFullScreen(): void;
|
|
409
|
-
exitFullScreen(): void;
|
|
410
|
-
setStreamSource(options: StreamSourceOptions): void;
|
|
411
|
-
}
|
package/src/navigator/index.ts
DELETED
|
@@ -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
|
-
}
|
package/src/share/index.ts
DELETED
|
@@ -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
|
-
}
|
package/src/storage/index.ts
DELETED
|
@@ -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
|
-
}
|