2021-04-11 18:11:27 +02:00
|
|
|
declare namespace InternalSerdesBinding {
|
2021-10-11 18:08:34 +02:00
|
|
|
type Buffer = Uint8Array;
|
|
|
|
|
2021-04-11 18:11:27 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-23 12:48:34 +02:00
|
|
|
export interface SerdesBinding {
|
2021-04-11 18:11:27 +02:00
|
|
|
Serializer: typeof InternalSerdesBinding.Serializer;
|
|
|
|
Deserializer: typeof InternalSerdesBinding.Deserializer;
|
2023-09-23 12:48:34 +02:00
|
|
|
}
|