zyjj-web-sdk 1.1.33 → 2.0.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/lib/api/api.d.ts +2 -1
- package/lib/api/entity.d.ts +2 -2
- package/lib/contract-v2/client.d.ts +8 -0
- package/lib/contract-v2/fixtures.d.ts +17 -0
- package/lib/contract-v2/index.d.ts +8 -0
- package/lib/contract-v2/index.js +314 -0
- package/lib/contract-v2/manifest.d.ts +15 -0
- package/lib/contract-v2/matrix.d.ts +8 -0
- package/lib/contract-v2/remote-product.d.ts +2 -0
- package/lib/contract-v2/schema.d.ts +13 -0
- package/lib/contract-v2/task-ledger.d.ts +16 -0
- package/lib/contract-v2/types.d.ts +375 -0
- package/lib/index.d.ts +9 -123
- package/lib/index.js +67167 -3669
- package/lib/index.umd.cjs +363 -20
- package/lib/tool/utils.d.ts +2 -1
- package/lib/types/cloud.d.ts +8 -2
- package/lib/types/resource.d.ts +24 -0
- package/lib/types/tool-task.d.ts +3 -3
- package/package.json +14 -4
- package/lib/tool/db.d.ts +0 -7
- package/lib/types/local-task.d.ts +0 -168
- package/lib/types/new-local-task.d.ts +0 -68
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
export declare const CONTRACT_VERSION_V2: "2.0.0";
|
|
2
|
+
export type HostCapability = 'system.getRuntimeInfo' | 'navigation.openExternal' | 'navigation.close' | 'navigation.reveal' | 'files.pick' | 'files.read' | 'files.write' | 'files.stat' | 'files.removeTemp' | 'ffmpeg.execute' | 'ffmpeg.probe' | 'ffmpeg.cancel' | 'downloads.start' | 'downloads.cancel' | 'tasks.create' | 'tasks.appendEvent' | 'tasks.snapshot' | 'tasks.list' | 'tasks.cancel' | 'tasks.clear' | 'cloud.upload' | 'cloud.download' | 'transport.subscribeTask' | 'transport.unsubscribeTask' | 'cloud.executeTask' | 'settings.get' | 'settings.set';
|
|
3
|
+
export type HostErrorCode = 'INVALID_REQUEST' | 'CONTRACT_VERSION_MISMATCH' | 'CAPABILITY_DENIED' | 'RESOURCE_DENIED' | 'NOT_FOUND' | 'CANCELLED' | 'CONFLICT' | 'INTERNAL';
|
|
4
|
+
export interface HostError {
|
|
5
|
+
code: HostErrorCode;
|
|
6
|
+
message: string;
|
|
7
|
+
retryable: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface RuntimeInfo {
|
|
10
|
+
platform: 'web' | 'electron';
|
|
11
|
+
contractVersion: typeof CONTRACT_VERSION_V2;
|
|
12
|
+
capabilities: HostCapability[];
|
|
13
|
+
}
|
|
14
|
+
/** Remote-visible metadata only. A path, URI, Blob URL, or filesystem handle never crosses Contract v2. */
|
|
15
|
+
export interface ResourceRef {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
mime: string;
|
|
19
|
+
size: number;
|
|
20
|
+
}
|
|
21
|
+
export interface FileReadResult {
|
|
22
|
+
bytesBase64: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FileStatResult {
|
|
25
|
+
name: string;
|
|
26
|
+
mime: string;
|
|
27
|
+
size: number;
|
|
28
|
+
}
|
|
29
|
+
export type FfmpegVideoCodec = 'copy' | 'libx264' | 'libvpx-vp9';
|
|
30
|
+
export type FfmpegAudioCodec = 'copy' | 'aac' | 'libopus' | 'libmp3lame';
|
|
31
|
+
export type FfmpegPreset = 'ultrafast' | 'veryfast' | 'fast' | 'medium' | 'slow';
|
|
32
|
+
export interface FfmpegTrim {
|
|
33
|
+
startSeconds: number;
|
|
34
|
+
durationSeconds: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FfmpegSource {
|
|
37
|
+
sourceId: string;
|
|
38
|
+
resource: ResourceRef;
|
|
39
|
+
mediaKind: 'video' | 'audio' | 'image';
|
|
40
|
+
}
|
|
41
|
+
export interface FfmpegOutputProfile {
|
|
42
|
+
name: string;
|
|
43
|
+
mime: 'video/mp4' | 'video/webm' | 'audio/mpeg' | 'audio/mp4' | 'image/png';
|
|
44
|
+
width?: number;
|
|
45
|
+
height?: number;
|
|
46
|
+
fps?: number;
|
|
47
|
+
videoCodec?: FfmpegVideoCodec;
|
|
48
|
+
audioCodec?: FfmpegAudioCodec;
|
|
49
|
+
preset?: FfmpegPreset;
|
|
50
|
+
crf?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface FfmpegTranscodePlan {
|
|
53
|
+
kind: 'transcode';
|
|
54
|
+
source: FfmpegSource;
|
|
55
|
+
trim?: FfmpegTrim;
|
|
56
|
+
loop?: boolean;
|
|
57
|
+
includeVideo: boolean;
|
|
58
|
+
includeAudio: boolean;
|
|
59
|
+
output: FfmpegOutputProfile;
|
|
60
|
+
}
|
|
61
|
+
export interface FfmpegTransform {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
66
|
+
rotation: number;
|
|
67
|
+
opacity: number;
|
|
68
|
+
}
|
|
69
|
+
export interface FfmpegVideoClip {
|
|
70
|
+
clipId: string;
|
|
71
|
+
sourceId: string;
|
|
72
|
+
timelineStartSeconds: number;
|
|
73
|
+
sourceStartSeconds: number;
|
|
74
|
+
durationSeconds: number;
|
|
75
|
+
transform: FfmpegTransform;
|
|
76
|
+
}
|
|
77
|
+
export interface FfmpegVideoTrack {
|
|
78
|
+
trackId: string;
|
|
79
|
+
mode: 'concat' | 'overlay';
|
|
80
|
+
layer: number;
|
|
81
|
+
clips: FfmpegVideoClip[];
|
|
82
|
+
}
|
|
83
|
+
export interface FfmpegAudioClip {
|
|
84
|
+
clipId: string;
|
|
85
|
+
sourceId: string;
|
|
86
|
+
timelineStartSeconds: number;
|
|
87
|
+
sourceStartSeconds: number;
|
|
88
|
+
durationSeconds: number;
|
|
89
|
+
volume: number;
|
|
90
|
+
}
|
|
91
|
+
export interface FfmpegAudioTrack {
|
|
92
|
+
trackId: string;
|
|
93
|
+
clips: FfmpegAudioClip[];
|
|
94
|
+
}
|
|
95
|
+
export interface FfmpegTextLayer {
|
|
96
|
+
layerId: string;
|
|
97
|
+
text: string;
|
|
98
|
+
timelineStartSeconds: number;
|
|
99
|
+
durationSeconds: number;
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
fontSize: number;
|
|
103
|
+
color: string;
|
|
104
|
+
background: string;
|
|
105
|
+
opacity: number;
|
|
106
|
+
layer: number;
|
|
107
|
+
}
|
|
108
|
+
export interface FfmpegCompositionPlan {
|
|
109
|
+
kind: 'composition';
|
|
110
|
+
canvas: {
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
fps: number;
|
|
114
|
+
durationSeconds: number;
|
|
115
|
+
background: string;
|
|
116
|
+
};
|
|
117
|
+
sources: FfmpegSource[];
|
|
118
|
+
videoTracks: FfmpegVideoTrack[];
|
|
119
|
+
audioTracks: FfmpegAudioTrack[];
|
|
120
|
+
textLayers: FfmpegTextLayer[];
|
|
121
|
+
output: FfmpegOutputProfile;
|
|
122
|
+
}
|
|
123
|
+
export interface FfmpegFrameSequencePlan {
|
|
124
|
+
kind: 'frame-sequence';
|
|
125
|
+
width: number;
|
|
126
|
+
height: number;
|
|
127
|
+
fps: number;
|
|
128
|
+
frames: Array<{
|
|
129
|
+
frameId: string;
|
|
130
|
+
resource: ResourceRef;
|
|
131
|
+
}>;
|
|
132
|
+
output: FfmpegOutputProfile;
|
|
133
|
+
}
|
|
134
|
+
export type FfmpegPlan = FfmpegTranscodePlan | FfmpegCompositionPlan | FfmpegFrameSequencePlan;
|
|
135
|
+
export type TaskStateV2 = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
136
|
+
export type TaskEventTypeV2 = 'queued' | 'running' | 'stage.started' | 'stage.progress' | 'stage.retry' | 'log' | 'completed' | 'failed' | 'cancelled';
|
|
137
|
+
export interface TaskEventRecordV2 {
|
|
138
|
+
eventId: string;
|
|
139
|
+
taskId: string;
|
|
140
|
+
seq: number;
|
|
141
|
+
at: string;
|
|
142
|
+
type: TaskEventTypeV2;
|
|
143
|
+
data: Record<string, string | number | boolean | null>;
|
|
144
|
+
}
|
|
145
|
+
export interface TaskSnapshotV2 {
|
|
146
|
+
taskId: string;
|
|
147
|
+
releaseId: string;
|
|
148
|
+
schedulerVersion: string;
|
|
149
|
+
planSnapshot: Record<string, unknown>;
|
|
150
|
+
state: TaskStateV2;
|
|
151
|
+
lastEventSeq: number;
|
|
152
|
+
}
|
|
153
|
+
export interface TaskSnapshotResult {
|
|
154
|
+
snapshot: TaskSnapshotV2 | null;
|
|
155
|
+
events: TaskEventRecordV2[];
|
|
156
|
+
}
|
|
157
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
158
|
+
[key: string]: JsonValue;
|
|
159
|
+
};
|
|
160
|
+
export type CloudUploadBackend = 'tencent-cos' | 'aliyun-oss';
|
|
161
|
+
interface RequestBase<C extends HostCapability, P> {
|
|
162
|
+
requestId: string;
|
|
163
|
+
contractVersion: typeof CONTRACT_VERSION_V2;
|
|
164
|
+
capability: C;
|
|
165
|
+
payload: P;
|
|
166
|
+
}
|
|
167
|
+
export interface HostPayloadMap {
|
|
168
|
+
'system.getRuntimeInfo': Record<string, never>;
|
|
169
|
+
'navigation.openExternal': {
|
|
170
|
+
url: string;
|
|
171
|
+
};
|
|
172
|
+
'navigation.close': Record<string, never>;
|
|
173
|
+
'navigation.reveal': {
|
|
174
|
+
resource: ResourceRef;
|
|
175
|
+
};
|
|
176
|
+
'files.pick': {
|
|
177
|
+
accept: string[];
|
|
178
|
+
multiple: boolean;
|
|
179
|
+
};
|
|
180
|
+
'files.read': {
|
|
181
|
+
resource: ResourceRef;
|
|
182
|
+
};
|
|
183
|
+
'files.write': {
|
|
184
|
+
name: string;
|
|
185
|
+
mime: string;
|
|
186
|
+
bytesBase64: string;
|
|
187
|
+
};
|
|
188
|
+
'files.stat': {
|
|
189
|
+
resource: ResourceRef;
|
|
190
|
+
};
|
|
191
|
+
'files.removeTemp': {
|
|
192
|
+
resource: ResourceRef;
|
|
193
|
+
};
|
|
194
|
+
'ffmpeg.execute': {
|
|
195
|
+
taskId: string;
|
|
196
|
+
plan: FfmpegPlan;
|
|
197
|
+
};
|
|
198
|
+
'ffmpeg.probe': {
|
|
199
|
+
resource: ResourceRef;
|
|
200
|
+
};
|
|
201
|
+
'ffmpeg.cancel': {
|
|
202
|
+
taskId: string;
|
|
203
|
+
};
|
|
204
|
+
'downloads.start': {
|
|
205
|
+
resource: ResourceRef;
|
|
206
|
+
name: string;
|
|
207
|
+
};
|
|
208
|
+
'downloads.cancel': {
|
|
209
|
+
downloadId: string;
|
|
210
|
+
};
|
|
211
|
+
'tasks.create': TaskSnapshotV2;
|
|
212
|
+
'tasks.appendEvent': {
|
|
213
|
+
taskId: string;
|
|
214
|
+
event: TaskEventRecordV2;
|
|
215
|
+
};
|
|
216
|
+
'tasks.snapshot': {
|
|
217
|
+
taskId: string;
|
|
218
|
+
};
|
|
219
|
+
'tasks.list': Record<string, never>;
|
|
220
|
+
'tasks.cancel': {
|
|
221
|
+
taskId: string;
|
|
222
|
+
};
|
|
223
|
+
'tasks.clear': Record<string, never>;
|
|
224
|
+
'cloud.upload': {
|
|
225
|
+
resource: ResourceRef;
|
|
226
|
+
taskId?: string;
|
|
227
|
+
};
|
|
228
|
+
'cloud.download': {
|
|
229
|
+
url: string;
|
|
230
|
+
name: string;
|
|
231
|
+
};
|
|
232
|
+
'transport.subscribeTask': {
|
|
233
|
+
taskId: string;
|
|
234
|
+
afterSeq: number;
|
|
235
|
+
};
|
|
236
|
+
'transport.unsubscribeTask': {
|
|
237
|
+
subscriptionId: string;
|
|
238
|
+
};
|
|
239
|
+
'cloud.executeTask': {
|
|
240
|
+
taskId: string;
|
|
241
|
+
entityId: string;
|
|
242
|
+
input: {
|
|
243
|
+
[key: string]: JsonValue;
|
|
244
|
+
};
|
|
245
|
+
execution: 'sync' | 'async';
|
|
246
|
+
};
|
|
247
|
+
'settings.get': {
|
|
248
|
+
key: string;
|
|
249
|
+
};
|
|
250
|
+
'settings.set': {
|
|
251
|
+
key: string;
|
|
252
|
+
value: string | number | boolean;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export type HostRequest<C extends HostCapability = HostCapability> = C extends HostCapability ? RequestBase<C, HostPayloadMap[C]> : never;
|
|
256
|
+
export interface HostResponseMap {
|
|
257
|
+
'system.getRuntimeInfo': RuntimeInfo;
|
|
258
|
+
'navigation.openExternal': Record<string, never>;
|
|
259
|
+
'navigation.close': Record<string, never>;
|
|
260
|
+
'navigation.reveal': Record<string, never>;
|
|
261
|
+
'files.pick': {
|
|
262
|
+
resources: ResourceRef[];
|
|
263
|
+
};
|
|
264
|
+
'files.read': FileReadResult;
|
|
265
|
+
'files.write': {
|
|
266
|
+
resource: ResourceRef;
|
|
267
|
+
};
|
|
268
|
+
'files.stat': FileStatResult;
|
|
269
|
+
'files.removeTemp': {
|
|
270
|
+
removed: string;
|
|
271
|
+
};
|
|
272
|
+
'ffmpeg.execute': {
|
|
273
|
+
outputs: ResourceRef[];
|
|
274
|
+
exitCode: number;
|
|
275
|
+
};
|
|
276
|
+
'ffmpeg.probe': {
|
|
277
|
+
durationSeconds: number | null;
|
|
278
|
+
streams: Array<{
|
|
279
|
+
codec: string;
|
|
280
|
+
kind: 'video' | 'audio' | 'other';
|
|
281
|
+
}>;
|
|
282
|
+
};
|
|
283
|
+
'ffmpeg.cancel': {
|
|
284
|
+
cancelled: string;
|
|
285
|
+
};
|
|
286
|
+
'downloads.start': {
|
|
287
|
+
downloadId: string;
|
|
288
|
+
};
|
|
289
|
+
'downloads.cancel': {
|
|
290
|
+
cancelled: string;
|
|
291
|
+
};
|
|
292
|
+
'tasks.create': TaskSnapshotV2;
|
|
293
|
+
'tasks.appendEvent': {
|
|
294
|
+
acceptedSeq: number;
|
|
295
|
+
};
|
|
296
|
+
'tasks.snapshot': TaskSnapshotResult;
|
|
297
|
+
'tasks.list': TaskSnapshotV2[];
|
|
298
|
+
'tasks.cancel': {
|
|
299
|
+
cancelled: string;
|
|
300
|
+
};
|
|
301
|
+
'tasks.clear': {
|
|
302
|
+
cleared: number;
|
|
303
|
+
};
|
|
304
|
+
'cloud.upload': {
|
|
305
|
+
key: string;
|
|
306
|
+
backend: CloudUploadBackend;
|
|
307
|
+
};
|
|
308
|
+
'cloud.download': {
|
|
309
|
+
resource: ResourceRef;
|
|
310
|
+
};
|
|
311
|
+
'transport.subscribeTask': {
|
|
312
|
+
subscriptionId: string;
|
|
313
|
+
};
|
|
314
|
+
'transport.unsubscribeTask': Record<string, never>;
|
|
315
|
+
'cloud.executeTask': {
|
|
316
|
+
backendTaskId: string | null;
|
|
317
|
+
output: {
|
|
318
|
+
[key: string]: JsonValue;
|
|
319
|
+
} | null;
|
|
320
|
+
};
|
|
321
|
+
'settings.get': {
|
|
322
|
+
value: string | number | boolean | null;
|
|
323
|
+
};
|
|
324
|
+
'settings.set': Record<string, never>;
|
|
325
|
+
}
|
|
326
|
+
export type HostSuccess<C extends HostCapability> = {
|
|
327
|
+
requestId: string;
|
|
328
|
+
contractVersion: typeof CONTRACT_VERSION_V2;
|
|
329
|
+
ok: true;
|
|
330
|
+
data: HostResponseMap[C];
|
|
331
|
+
};
|
|
332
|
+
export type HostFailure = {
|
|
333
|
+
requestId: string;
|
|
334
|
+
contractVersion: typeof CONTRACT_VERSION_V2;
|
|
335
|
+
ok: false;
|
|
336
|
+
error: HostError;
|
|
337
|
+
};
|
|
338
|
+
export type HostResponse<C extends HostCapability = HostCapability> = HostSuccess<C> | HostFailure;
|
|
339
|
+
export interface TaskEventNotification {
|
|
340
|
+
subscriptionId: string;
|
|
341
|
+
taskId: string;
|
|
342
|
+
type: 'task.event';
|
|
343
|
+
event: TaskEventRecordV2;
|
|
344
|
+
}
|
|
345
|
+
export interface HostEvent {
|
|
346
|
+
subscriptionId: string;
|
|
347
|
+
taskId: string;
|
|
348
|
+
type: 'task.event';
|
|
349
|
+
event: TaskEventRecordV2;
|
|
350
|
+
}
|
|
351
|
+
export interface HostClientV2 {
|
|
352
|
+
invoke<C extends HostCapability>(request: HostRequest<C>): Promise<HostResponse<C>>;
|
|
353
|
+
subscribe(listener: (event: HostEvent) => void): () => void;
|
|
354
|
+
cancel(requestId: string): Promise<void>;
|
|
355
|
+
dispose?(): Promise<void>;
|
|
356
|
+
}
|
|
357
|
+
export interface RemoteAssetV2 {
|
|
358
|
+
url: string;
|
|
359
|
+
size: number;
|
|
360
|
+
sha256: string;
|
|
361
|
+
kind: 'js' | 'css' | 'wasm' | 'asset';
|
|
362
|
+
contentType: string;
|
|
363
|
+
}
|
|
364
|
+
export interface RemoteManifestV2 {
|
|
365
|
+
releaseId: string;
|
|
366
|
+
contractVersion: typeof CONTRACT_VERSION_V2;
|
|
367
|
+
uiEntry: string;
|
|
368
|
+
schedulerEntry: string;
|
|
369
|
+
assets: RemoteAssetV2[];
|
|
370
|
+
requiredCapabilities: HostCapability[];
|
|
371
|
+
issuedAt: string;
|
|
372
|
+
keyId: string;
|
|
373
|
+
signature: string;
|
|
374
|
+
}
|
|
375
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,126 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export * from './contract-v2/index.ts';
|
|
2
|
+
export * from './api/api.ts';
|
|
3
|
+
export * from './api/entity.ts';
|
|
4
|
+
export * from './types/cloud.ts';
|
|
5
|
+
export * from './types/config.ts';
|
|
6
|
+
export * from './types/mqtt.ts';
|
|
7
|
+
export * from './types/resource.ts';
|
|
8
|
+
export * from './types/tool-task.ts';
|
|
7
9
|
export { default as UserLoginModal } from './components/UserLogin.tsx';
|
|
8
|
-
export type { UserLoginModalProps } from './components/UserLogin.tsx';
|
|
9
10
|
export { default as PageTable } from './components/PageTable.tsx';
|
|
10
|
-
export type { PageTableProps } from './components/PageTable.tsx';
|
|
11
11
|
export { SendCommonRequest, SendKnowledgeRequest } from './api/api.ts';
|
|
12
|
-
export
|
|
13
|
-
GetAllTool: () => Promise<import("./api/entity.ts").GetPageInfo<import("./types/cloud.ts").ToolInfo>>;
|
|
14
|
-
ToolInc: (id: string) => Promise<unknown>;
|
|
15
|
-
UpdateUserInfo: (data: {
|
|
16
|
-
tool_id_list?: string[] | undefined;
|
|
17
|
-
}) => Promise<unknown>;
|
|
18
|
-
GetAppInfo: (os: string, version: string, uid?: string | undefined) => Promise<import("./types/cloud.ts").AppInfo>;
|
|
19
|
-
CostPoint: (data: {
|
|
20
|
-
name: string;
|
|
21
|
-
point: number;
|
|
22
|
-
desc: string;
|
|
23
|
-
uid: string;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
GetUserInfo: () => Promise<import("./types/cloud.ts").UserInfo>;
|
|
26
|
-
UserDownloadMaterial: (id: string) => Promise<string>;
|
|
27
|
-
GetMqttTaskClientInfo: () => Promise<import("./api/entity.ts").MqttClientInfo>;
|
|
28
|
-
AddTask: (data: import("./api/entity.ts").AddTaskReq) => Promise<string>;
|
|
29
|
-
GetTaskInfo: (id: string) => Promise<import("./types/cloud.ts").TaskInfo>;
|
|
30
|
-
GetTencentCosInfo: () => Promise<import("./api/entity.ts").GetCosResp>;
|
|
31
|
-
GetMaterialUrl: (key_list: string[]) => Promise<{
|
|
32
|
-
[key: string]: string;
|
|
33
|
-
}>;
|
|
34
|
-
GetMaterialTagList: () => Promise<string[]>;
|
|
35
|
-
GetToolList: (req: import("./api/entity.ts").GetPageReq) => Promise<import("./api/entity.ts").GetPageInfo<import("./types/cloud.ts").ToolInfo>>;
|
|
36
|
-
GetToolTagList: () => Promise<string[]>;
|
|
37
|
-
GetToolDetail: (id: string) => Promise<import("./api/entity.ts").GetToolDetailResp>;
|
|
38
|
-
};
|
|
39
|
-
export declare const Enum: {
|
|
40
|
-
ToolType: typeof ToolType;
|
|
41
|
-
LocalActionReqType: typeof LocalActionReqType;
|
|
42
|
-
LocalActionResType: typeof LocalActionResType;
|
|
43
|
-
MQTTEventType: typeof MQTTEventType;
|
|
44
|
-
FileSource: typeof FileSource;
|
|
45
|
-
LocalTaskStatus: typeof LocalTaskStatus;
|
|
46
|
-
LocalTaskEventType: typeof LocalTaskEventType;
|
|
47
|
-
ToolTaskType: typeof ToolTaskType;
|
|
48
|
-
FfmpegActionType: typeof FfmpegActionType;
|
|
49
|
-
CloudTaskStatus: typeof CloudTaskStatus;
|
|
50
|
-
TaskType: typeof TaskType;
|
|
51
|
-
LabElementType: typeof LabElementType;
|
|
52
|
-
ToolConfigType: typeof ToolConfigType;
|
|
53
|
-
ToolEventType: typeof ToolEventType;
|
|
54
|
-
WorkActionType: typeof WorkActionType;
|
|
55
|
-
TaskActionType: typeof TaskActionType;
|
|
56
|
-
};
|
|
57
|
-
export declare const Tool: {
|
|
58
|
-
render: {
|
|
59
|
-
renderTime: (time: number) => string;
|
|
60
|
-
renderEllipsis: (value: string) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
renderCopy: (value: string) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
};
|
|
63
|
-
utils: {
|
|
64
|
-
file2ToolParamFile: (file: File, no_path?: boolean | undefined, cloud_source?: FileSource | undefined) => import("./types/local-task.ts").ToolParamFile;
|
|
65
|
-
seconds2TimeStr: (seconds: number) => string;
|
|
66
|
-
object2query: (data: {
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
}) => string;
|
|
69
|
-
paramReplace: (value: string, data: {
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
}) => string;
|
|
72
|
-
object2urlParam: (data: {
|
|
73
|
-
[key: string]: any;
|
|
74
|
-
}) => string;
|
|
75
|
-
convertFileSize: (bytes: number) => string;
|
|
76
|
-
downloadFile: (url: string) => Promise<void>;
|
|
77
|
-
downloadFileDirect: (url: string, name?: string | undefined) => void;
|
|
78
|
-
};
|
|
79
|
-
cloud: {
|
|
80
|
-
getTencentCosInfo: () => Promise<{
|
|
81
|
-
cos: import("cos-js-sdk-v5");
|
|
82
|
-
path: string;
|
|
83
|
-
bucket: string;
|
|
84
|
-
region: string;
|
|
85
|
-
}>;
|
|
86
|
-
getAliYunOssInfo: () => Promise<{
|
|
87
|
-
oss: import("ali-oss");
|
|
88
|
-
path: string;
|
|
89
|
-
bucket: string;
|
|
90
|
-
region: string;
|
|
91
|
-
}>;
|
|
92
|
-
};
|
|
93
|
-
db: {
|
|
94
|
-
addTask: (data: import("./types/local-task.ts").LocalTaskInfo, table?: string) => Promise<IDBValidKey>;
|
|
95
|
-
getAllData: <T>(table?: string) => Promise<T[]>;
|
|
96
|
-
getData: <T_1>(id: string, table?: string) => Promise<T_1>;
|
|
97
|
-
updateData: <T_2>(id: string, data: T_2, table?: string) => Promise<IDBValidKey>;
|
|
98
|
-
deleteData: (id: string, table?: string) => Promise<void>;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
export declare const Store: {
|
|
102
|
-
UserReducer: import("redux").Reducer<import("./store/entity.ts").UserState>;
|
|
103
|
-
UserAction: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
104
|
-
loginOut(state: import("immer").WritableDraft<import("./store/entity.ts").UserState>): void;
|
|
105
|
-
showLogin(state: import("immer").WritableDraft<import("./store/entity.ts").UserState>): void;
|
|
106
|
-
hideLogin(state: import("immer").WritableDraft<import("./store/entity.ts").UserState>): void;
|
|
107
|
-
}, "user">;
|
|
108
|
-
GetUserInfo: import("@reduxjs/toolkit").AsyncThunk<import("./types/cloud.ts").UserInfo | undefined, undefined, any>;
|
|
109
|
-
MqttReducer: import("redux").Reducer<import("./store/entity.ts").MqttState>;
|
|
110
|
-
MqttAction: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
111
|
-
closeClient(state: import("immer").WritableDraft<import("./store/entity.ts").MqttState>): void;
|
|
112
|
-
addMqttCallback(state: import("immer").WritableDraft<import("./store/entity.ts").MqttState>, info: {
|
|
113
|
-
payload: import("./types/mqtt.ts").MqttAddCallbackReq;
|
|
114
|
-
type: string;
|
|
115
|
-
}): void;
|
|
116
|
-
addMqttEventCallback(state: import("immer").WritableDraft<import("./store/entity.ts").MqttState>, info: {
|
|
117
|
-
payload: import("./types/mqtt.ts").MqttAddTaskEventReq;
|
|
118
|
-
type: string;
|
|
119
|
-
}): void;
|
|
120
|
-
addMqttListener(state: import("immer").WritableDraft<import("./store/entity.ts").MqttState>, info: {
|
|
121
|
-
payload: import("./store/entity.ts").MqttCallback;
|
|
122
|
-
type: string;
|
|
123
|
-
}): void;
|
|
124
|
-
}, "mqtt">;
|
|
125
|
-
InitMqtt: import("@reduxjs/toolkit").AsyncThunk<import("mqtt").MqttClient, undefined, any>;
|
|
126
|
-
};
|
|
12
|
+
export { getTencentCosInfo, getAliYunOssInfo } from './tool/utils.ts';
|