跳到主要内容

DevToolsPanelUploadSource

Defined in: v2/panel-endpoint.ts:74

上传的字节来源。

Properties​

totalBytes​

readonly totalBytes: number;

Defined in: v2/panel-endpoint.ts:76

总字节数;用于 TRANSFER_START 的 totalBytes 与限额预检。

Methods​

read()​

read(offset, length): Promise<Uint8Array<ArrayBufferLike>>;

Defined in: v2/panel-endpoint.ts:85

读取 [offset, offset + length)。

Parameters​

ParameterTypeDescription
offsetnumber起始偏移,等于此前已发出的字节数。
lengthnumber需要的字节数,恒 ≤ 256 KiB。

Returns​

Promise<Uint8Array<ArrayBufferLike>>

恰好 length 个字节;长度不符视为来源实现错误,本次上传以 operation_failed 结束并发出 TRANSFER_CANCEL。