mirror of
https://github.com/nodejs/node.git
synced 2024-11-24 03:07:54 +01:00
da7962fd4d
PR-URL: https://github.com/nodejs/node/pull/49742 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
declare namespace InternalSerdesBinding {
|
|
type Buffer = Uint8Array;
|
|
|
|
class Serializer {
|
|
_getDataCloneError: typeof Error;
|
|
constructor();
|
|
_setTreatArrayBufferViewsAsHostObjects(value: boolean): void;
|
|
releaseBuffer(): Buffer;
|
|
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
|
|
writeDouble(value: number): void;
|
|
writeHeader(): void;
|
|
writeRawBytes(value: ArrayBufferView): void;
|
|
writeUint32(value: number): void;
|
|
writeUint64(hi: number, lo: number): void;
|
|
writeValue(value: any): void;
|
|
}
|
|
|
|
class Deserializer {
|
|
buffer: ArrayBufferView;
|
|
constructor(buffer: ArrayBufferView);
|
|
_readRawBytes(length: number): number;
|
|
getWireFormatVersion(): number;
|
|
readDouble(): number;
|
|
readHeader(): boolean;
|
|
readRawBytes(length: number): Buffer;
|
|
readUint32(): number;
|
|
readUint64(): [hi: number, lo: number];
|
|
readValue(): unknown;
|
|
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer | SharedArrayBuffer): void;
|
|
}
|
|
}
|
|
|
|
export interface SerdesBinding {
|
|
Serializer: typeof InternalSerdesBinding.Serializer;
|
|
Deserializer: typeof InternalSerdesBinding.Deserializer;
|
|
}
|