整合组件类型至统一的componentregistry中

This commit is contained in:
YHH
2025-08-07 09:43:34 +08:00
parent 9a08ae74b6
commit 7a000318a6
13 changed files with 136 additions and 1652 deletions

View File

@@ -13,18 +13,8 @@ import {
isProtoSerializable,
getProtoName
} from './ProtobufDecorators';
import { SerializedData } from './SerializationTypes';
/**
* 序列化数据接口
*/
export interface SerializedData {
/** 组件类型名称 */
componentType: string;
/** 序列化后的数据 */
data: Uint8Array;
/** 数据大小(字节) */
size: number;
}
/**
* Protobuf序列化器
@@ -143,6 +133,7 @@ export class ProtobufSerializer {
const buffer = MessageType.encode(message).finish();
return {
type: 'protobuf',
componentType: componentType,
data: buffer,
size: buffer.length
@@ -245,6 +236,7 @@ export class ProtobufSerializer {
const buffer = MessageType.encode(message).finish();
results.push({
type: 'protobuf',
componentType: component.constructor.name,
data: buffer,
size: buffer.length