UNPKG

quick-struct

Version:

C like style to write struct layout, and it can convert variable length array or string automatically. It can be used in Node.js and Browser

9 lines (8 loc) 416 B
import { QStruct } from "."; import type { FieldRecord } from "./compile"; export interface ConvertToBufferResult { buffer: ArrayBuffer; placeholderIndex?: number; } export declare function encode(this: QStruct, obj: any, structName?: string): ArrayBufferLike; export declare const convertToBuffer: (name: string, value: any, fieldDetail: FieldRecord, isLittleEndianness?: boolean) => ConvertToBufferResult;