Class: FlatBufferRootProcessor<TJSONByRoot>

基于生成根表模型逐 slot 编解码并透明保留未知数据。 Encode and decode generated root table models slot by slot while preserving unknown data.

Type Parameters

TJSONByRoot

TJSONByRoot extends object = Record<string, unknown>

Constructors

Constructor

new FlatBufferRootProcessor<TJSONByRoot>(options): FlatBufferRootProcessor<TJSONByRoot>

创建并验证根表处理器配置。 Create and validate a root table processor configuration.

Parameters

options

FlatBufferRootProcessorOptions<TJSONByRoot>

Returns

FlatBufferRootProcessor<TJSONByRoot>

Methods

decode()

decode<K>(byteBuffer, rootNames?): Partial<Pick<TJSONByRoot, K>>

按物理 slot 顺序解码选中的根产品。 Decode selected root products in physical slot order.

Type Parameters

K

K extends string

Parameters

byteBuffer

ByteBuffer

rootNames?

K[]

Returns

Partial<Pick<TJSONByRoot, K>>


encode()

encode(byteBuffer?, patch?): Uint8Array

独立编译 patch slot,并与原始根表合并组装。 Compile patch slots independently and merge them into the source root table.

Parameters

byteBuffer?

ByteBuffer

patch?

Partial<TJSONByRoot>

Returns

Uint8Array


filterRootNames()

filterRootNames(requestedRootNames, enabledRootNames): string[]

过滤受业务开关控制的根名称,并保持请求顺序。 Filter root names controlled by business settings while preserving request order.

Parameters

requestedRootNames

string[]

enabledRootNames

string[]

Returns

string[]