next-flow-interface 0.27.11 → 0.27.14
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/index.d.ts +60 -139
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1786,7 +1786,7 @@ export declare class FirstLoadService {
|
|
|
1786
1786
|
* 开始加载所有文件
|
|
1787
1787
|
*
|
|
1788
1788
|
* @remarks
|
|
1789
|
-
* 启动首次加载流程,会遍历
|
|
1789
|
+
* 启动首次加载流程,会遍历 RvResourceService 缓存中的所有文件并开始下载。
|
|
1790
1790
|
* 该方法会:
|
|
1791
1791
|
* 1. 检查是否有需要加载的文件
|
|
1792
1792
|
* 2. 跳过正在上传中的文件(uploading = true)
|
|
@@ -5358,7 +5358,7 @@ export declare interface RvAwarenessWindow {
|
|
|
5358
5358
|
* 全局协同数据总变量
|
|
5359
5359
|
*
|
|
5360
5360
|
* 所有项目数据的根结构,通过 RhineVar 实现多人实时同步。
|
|
5361
|
-
*
|
|
5361
|
+
* resources 仅存储 ID 列表,元数据通过 RvResourceService 从后端获取并缓存在本地。
|
|
5362
5362
|
*
|
|
5363
5363
|
* @public
|
|
5364
5364
|
*/
|
|
@@ -5371,8 +5371,6 @@ export declare interface RvBase {
|
|
|
5371
5371
|
steps: RhineVarMap<RvStep>;
|
|
5372
5372
|
/** 插件信息 */
|
|
5373
5373
|
plugin: RvPlugin;
|
|
5374
|
-
/** 文件 ID 列表,元数据通过 RvFileService.getMetadata() 获取 */
|
|
5375
|
-
files: RhineVarArray<string>;
|
|
5376
5374
|
/** 资源 ID 列表,元数据通过 RvResourceService.getMetadata() 获取 */
|
|
5377
5375
|
resources: RhineVarArray<string>;
|
|
5378
5376
|
/** 场景节点树 */
|
|
@@ -5522,121 +5520,6 @@ export declare interface RvEnvironment {
|
|
|
5522
5520
|
};
|
|
5523
5521
|
}
|
|
5524
5522
|
|
|
5525
|
-
/**
|
|
5526
|
-
* 文件元数据接口
|
|
5527
|
-
*
|
|
5528
|
-
* 描述项目中一个文件的完整元信息。
|
|
5529
|
-
* 协同数据中仅存储 fid,完整元数据通过 RvFileService.getMetadata() 从后端获取并缓存。
|
|
5530
|
-
*
|
|
5531
|
-
* @public
|
|
5532
|
-
*/
|
|
5533
|
-
export declare interface RvFile {
|
|
5534
|
-
/** 文件唯一标识 */
|
|
5535
|
-
fid: string;
|
|
5536
|
-
/** 文件存储类型 */
|
|
5537
|
-
type: RvFileType;
|
|
5538
|
-
/** 文件名 */
|
|
5539
|
-
name: string;
|
|
5540
|
-
/** 文件大小(字节) */
|
|
5541
|
-
size: number;
|
|
5542
|
-
/** MIME 类型 */
|
|
5543
|
-
mime: string;
|
|
5544
|
-
/** 文件内容哈希值,用于去重 */
|
|
5545
|
-
hash?: string;
|
|
5546
|
-
/** 文件地址。格式: https://xxx | oss://{bucket}/{path} | attach://{fid} */
|
|
5547
|
-
url: string;
|
|
5548
|
-
/** 创建时间戳(毫秒) */
|
|
5549
|
-
createdAt: number;
|
|
5550
|
-
/** 更新时间戳(毫秒) */
|
|
5551
|
-
updatedAt: number;
|
|
5552
|
-
/** 是否正在上传中 */
|
|
5553
|
-
uploading?: boolean;
|
|
5554
|
-
/** 扩展数据 */
|
|
5555
|
-
extra?: Record<string, unknown>;
|
|
5556
|
-
}
|
|
5557
|
-
|
|
5558
|
-
/**
|
|
5559
|
-
* 文件协同数据服务
|
|
5560
|
-
*
|
|
5561
|
-
* 管理协同数据中的 fileId 列表,以及本地文件元数据缓存。
|
|
5562
|
-
* fileId 列表存储在协同数据中,元数据从后端获取并缓存在本地。
|
|
5563
|
-
*
|
|
5564
|
-
* @public
|
|
5565
|
-
*/
|
|
5566
|
-
export declare class RvFileService {
|
|
5567
|
-
static get instance(): RvFileService;
|
|
5568
|
-
private constructor();
|
|
5569
|
-
files: RhineVarArray<string>;
|
|
5570
|
-
private metadataCache;
|
|
5571
|
-
/**
|
|
5572
|
-
* 添加 fileId 到协同数据
|
|
5573
|
-
*/
|
|
5574
|
-
add(fileId: string): void;
|
|
5575
|
-
/**
|
|
5576
|
-
* 从协同数据移除 fileId
|
|
5577
|
-
*/
|
|
5578
|
-
remove(fileId: string): boolean;
|
|
5579
|
-
/**
|
|
5580
|
-
* 检查 fileId 是否在列表中
|
|
5581
|
-
*/
|
|
5582
|
-
has(fileId: string): boolean;
|
|
5583
|
-
/**
|
|
5584
|
-
* 获取缓存的文件元数据
|
|
5585
|
-
*/
|
|
5586
|
-
getMetadata(fileId: string): ResourceFileInfo | undefined;
|
|
5587
|
-
/**
|
|
5588
|
-
* 设置文件元数据缓存
|
|
5589
|
-
*/
|
|
5590
|
-
setMetadata(fileId: string, metadata: ResourceFileInfo): void;
|
|
5591
|
-
/**
|
|
5592
|
-
* 获取文件下载 URL(通过后端签名)
|
|
5593
|
-
*/
|
|
5594
|
-
getDownloadUrl(fileId: string): Promise<string>;
|
|
5595
|
-
/**
|
|
5596
|
-
* 订阅文件列表变化事件(ADD/REMOVE)
|
|
5597
|
-
*
|
|
5598
|
-
* @param subscriber - 事件回调函数
|
|
5599
|
-
* @returns 取消订阅的函数
|
|
5600
|
-
*/
|
|
5601
|
-
subscribe(subscriber: RvFileServiceSubscriber): () => void;
|
|
5602
|
-
/**
|
|
5603
|
-
* 取消订阅文件列表变化事件
|
|
5604
|
-
*
|
|
5605
|
-
* @param subscriber - 要取消的回调函数
|
|
5606
|
-
*/
|
|
5607
|
-
unsubscribe(subscriber: RvFileServiceSubscriber): void;
|
|
5608
|
-
/**
|
|
5609
|
-
* 订阅单个文件的变化事件
|
|
5610
|
-
*
|
|
5611
|
-
* @param fileId - 文件 ID
|
|
5612
|
-
* @param subscriber - 事件回调函数
|
|
5613
|
-
* @returns 取消订阅的函数
|
|
5614
|
-
*/
|
|
5615
|
-
subscribeSingle(fileId: string, subscriber: RvFileServiceSubscriber): () => void;
|
|
5616
|
-
unsubscribeSingle(fileId: string, subscriber: RvFileServiceSubscriber): void;
|
|
5617
|
-
}
|
|
5618
|
-
|
|
5619
|
-
/**
|
|
5620
|
-
* @public
|
|
5621
|
-
*/
|
|
5622
|
-
export declare enum RvFileServiceEventType {
|
|
5623
|
-
ADD = "ADD",
|
|
5624
|
-
REMOVE = "REMOVE"
|
|
5625
|
-
}
|
|
5626
|
-
|
|
5627
|
-
/**
|
|
5628
|
-
* @public
|
|
5629
|
-
*/
|
|
5630
|
-
export declare type RvFileServiceSubscriber = (type: RvFileServiceEventType, fileId: string) => void;
|
|
5631
|
-
|
|
5632
|
-
/**
|
|
5633
|
-
* @public
|
|
5634
|
-
*/
|
|
5635
|
-
export declare enum RvFileType {
|
|
5636
|
-
OSS = "OSS",
|
|
5637
|
-
URL = "URL"
|
|
5638
|
-
}
|
|
5639
|
-
|
|
5640
5523
|
/**
|
|
5641
5524
|
* @public
|
|
5642
5525
|
*/
|
|
@@ -6102,8 +5985,7 @@ export declare interface RvResource {
|
|
|
6102
5985
|
/**
|
|
6103
5986
|
* 资源协同数据服务
|
|
6104
5987
|
*
|
|
6105
|
-
* 管理协同数据中的 resourceId
|
|
6106
|
-
* resourceId 列表存储在协同数据中,元数据从后端获取并缓存在本地。
|
|
5988
|
+
* 管理协同数据中的 resourceId 列表,以及本地资源和文件元数据缓存。
|
|
6107
5989
|
*
|
|
6108
5990
|
* @public
|
|
6109
5991
|
*/
|
|
@@ -6112,8 +5994,11 @@ export declare class RvResourceService {
|
|
|
6112
5994
|
private constructor();
|
|
6113
5995
|
resources: StoredRhineVar<string[]>;
|
|
6114
5996
|
private metadataCache;
|
|
5997
|
+
private fileToResourceMap;
|
|
6115
5998
|
/**
|
|
6116
5999
|
* 添加 resourceId 到协同数据
|
|
6000
|
+
*
|
|
6001
|
+
* 如果资源元数据已在缓存中,会自动同步文件元数据并触发下载
|
|
6117
6002
|
*/
|
|
6118
6003
|
add(resourceId: string): void;
|
|
6119
6004
|
/**
|
|
@@ -6128,38 +6013,75 @@ export declare class RvResourceService {
|
|
|
6128
6013
|
* 获取缓存的资源元数据
|
|
6129
6014
|
*/
|
|
6130
6015
|
getMetadata(resourceId: string): Resource | undefined;
|
|
6016
|
+
/**
|
|
6017
|
+
* 通过 fileId 获取对应的资源元数据
|
|
6018
|
+
*/
|
|
6019
|
+
getMetadataByFileId(fileId: string): Resource | undefined;
|
|
6131
6020
|
/**
|
|
6132
6021
|
* 设置资源元数据缓存
|
|
6133
6022
|
*/
|
|
6134
6023
|
setMetadata(resourceId: string, metadata: Resource): void;
|
|
6024
|
+
private fileMetadataCache;
|
|
6135
6025
|
/**
|
|
6136
|
-
*
|
|
6137
|
-
*
|
|
6138
|
-
* 同时从 Resource.contentFile 提取文件元数据,写入 RvFileService.metadataCache
|
|
6026
|
+
* 添加文件元数据到本地缓存,并发布 ADD 事件
|
|
6139
6027
|
*/
|
|
6140
|
-
|
|
6028
|
+
addFile(fileId: string, metadata?: ResourceFileInfo): void;
|
|
6141
6029
|
/**
|
|
6142
|
-
*
|
|
6030
|
+
* 从本地缓存移除文件元数据,并发布 REMOVE 事件
|
|
6031
|
+
*/
|
|
6032
|
+
removeFile(fileId: string): boolean;
|
|
6033
|
+
/**
|
|
6034
|
+
* 检查文件是否在本地缓存中
|
|
6035
|
+
*/
|
|
6036
|
+
hasFile(fileId: string): boolean;
|
|
6037
|
+
/**
|
|
6038
|
+
* 获取缓存的文件元数据
|
|
6039
|
+
*/
|
|
6040
|
+
getFileMetadata(fileId: string): ResourceFileInfo | undefined;
|
|
6041
|
+
/**
|
|
6042
|
+
* 设置文件元数据缓存(不触发事件)
|
|
6043
|
+
*/
|
|
6044
|
+
setFileMetadata(fileId: string, metadata: ResourceFileInfo): void;
|
|
6045
|
+
/**
|
|
6046
|
+
* 获取所有文件 ID 列表
|
|
6047
|
+
*/
|
|
6048
|
+
getFileIds(): string[];
|
|
6049
|
+
/**
|
|
6050
|
+
* 获取文件下载 URL(通过后端签名)
|
|
6051
|
+
*/
|
|
6052
|
+
getDownloadUrl(fileId: string): Promise<string>;
|
|
6053
|
+
/**
|
|
6054
|
+
* 从后端同步资源列表到本地缓存
|
|
6143
6055
|
*
|
|
6144
|
-
*
|
|
6145
|
-
*
|
|
6056
|
+
* 通过 listResources 一次性拉取后端完整资源列表,
|
|
6057
|
+
* 仅填充本地元数据缓存,不自动添加到协同数据。
|
|
6058
|
+
* 需要手动调用 add() 方法将资源添加到协同数据。
|
|
6146
6059
|
*/
|
|
6147
|
-
|
|
6060
|
+
syncFromBackend(): Promise<void>;
|
|
6148
6061
|
/**
|
|
6149
|
-
*
|
|
6062
|
+
* 获取所有后端资源的元数据列表(从本地缓存)
|
|
6150
6063
|
*
|
|
6151
|
-
* @
|
|
6064
|
+
* @returns 资源元数据数组
|
|
6152
6065
|
*/
|
|
6153
|
-
|
|
6066
|
+
getAllMetadata(): Resource[];
|
|
6154
6067
|
/**
|
|
6155
|
-
*
|
|
6068
|
+
* 获取所有未添加到协同数据的资源列表
|
|
6156
6069
|
*
|
|
6157
|
-
* @
|
|
6158
|
-
* @param subscriber - 事件回调函数
|
|
6159
|
-
* @returns 取消订阅的函数
|
|
6070
|
+
* @returns 未添加的资源元数据数组
|
|
6160
6071
|
*/
|
|
6072
|
+
getUnaddedResources(): Resource[];
|
|
6073
|
+
/**
|
|
6074
|
+
* 订阅资源列表变化事件(ADD/REMOVE)
|
|
6075
|
+
*/
|
|
6076
|
+
subscribe(subscriber: RvResourceServiceSubscriber): () => void;
|
|
6077
|
+
unsubscribe(subscriber: RvResourceServiceSubscriber): void;
|
|
6161
6078
|
subscribeSingle(resourceId: string, subscriber: RvResourceServiceSubscriber): () => void;
|
|
6162
6079
|
unsubscribeSingle(resourceId: string, subscriber: RvResourceServiceSubscriber): void;
|
|
6080
|
+
/**
|
|
6081
|
+
* 订阅文件变化事件(ADD/REMOVE)
|
|
6082
|
+
*/
|
|
6083
|
+
subscribeFile(subscriber: RvResourceServiceSubscriber): () => void;
|
|
6084
|
+
unsubscribeFile(subscriber: RvResourceServiceSubscriber): void;
|
|
6163
6085
|
}
|
|
6164
6086
|
|
|
6165
6087
|
/**
|
|
@@ -6931,8 +6853,8 @@ export declare class SyncService {
|
|
|
6931
6853
|
* // 访问场景步骤
|
|
6932
6854
|
* const steps = SyncService.instance.state.steps
|
|
6933
6855
|
*
|
|
6934
|
-
* //
|
|
6935
|
-
* const
|
|
6856
|
+
* // 访问资源
|
|
6857
|
+
* const resources = SyncService.instance.state.resources
|
|
6936
6858
|
*
|
|
6937
6859
|
* // 等待同步完成
|
|
6938
6860
|
* await SyncService.instance.state.waitSynced()
|
|
@@ -7547,7 +7469,6 @@ export declare const attributeService: AttributeService
|
|
|
7547
7469
|
export declare const awarenessService: AwarenessService
|
|
7548
7470
|
export declare const historyService: HistoryService
|
|
7549
7471
|
export declare const rvStepService: RvStepService
|
|
7550
|
-
export declare const rvFileService: RvFileService
|
|
7551
7472
|
export declare const rvResourceService: RvResourceService
|
|
7552
7473
|
export declare const rvSceneService: RvSceneService
|
|
7553
7474
|
export declare const rvModelService: RvModelService
|