/** * State Synchronization Types */ import 'reflect-metadata'; /** * 支持的原始类型 */ export type PrimitiveType = 'string' | 'number' | 'boolean' | 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32'; /** * 字段类型(原始类型或构造函数) */ export type FieldType = PrimitiveType | Function; /** * 字段元数据 */ export interface FieldMetadata { key: string; type: FieldType; isArray: boolean; isMap: boolean; isSet: boolean; optional?: boolean; } /** * 类元数据 */ export interface ClassMetadata { fields: Map; className: string; } /** * 变化操作类型 */ export declare enum ChangeOp { ADD = "add", REPLACE = "replace", REMOVE = "remove" } /** * JSON Patch 格式的变化记录 */ export interface Patch { op: ChangeOp; path: string; value?: any; oldValue?: any; } /** * 编码选项 */ export interface EncodeOptions { /** * 压缩选项 */ compressionOptions?: { /** * 压缩阈值(字节),小于此值不压缩 */ threshold?: number; /** * 最小压缩率,低于此值不使用压缩结果 */ minCompressionRatio?: number; /** * 压缩级别 (1-9) */ level?: number; /** * 是否强制压缩 */ force?: boolean; /** * 是否启用自适应压缩 */ adaptive?: boolean; }; /** * 是否包含类型信息 */ includeTypes?: boolean; } /** * 解码选项 */ export interface DecodeOptions { /** * 是否自动解压 */ decompress?: boolean; } /** * 序列化后的状态数据 */ export interface EncodedState { /** * 二进制数据 */ data: Uint8Array; /** * 是否压缩 */ compressed: boolean; /** * 原始大小(压缩前) */ originalSize?: number; /** * 压缩后大小 */ compressedSize?: number; /** * 压缩率 */ compressionRatio?: number; } /** * Metadata keys */ export declare const METADATA_KEYS: { readonly FIELDS: symbol; readonly CLASS_NAME: symbol; }; /** * 变化追踪配置 */ export interface TrackingOptions { /** * 批量刷新间隔(毫秒) */ patchRate?: number; /** * 是否深度追踪嵌套对象 */ deep?: boolean; /** * 最大变化队列大小 */ maxQueueSize?: number; } //# sourceMappingURL=types.d.ts.map