@mqix/structured
Version:
This is a library for serialization of javascript objects from and to c like packed structs as an Uint8Array.
16 lines (15 loc) • 476 B
TypeScript
import { type Property, type StructuredType, type InferOutputType } from "./structured";
/**
* **union(*union*)**
*
* @param union all the diffrent properties the union has. This argument is the same format as for the struct in the `Structured` constructor.
*
* @example
* ```
* union([
* ["a", uint8],
* ["b", string(10)]
* ])
* ```
*/
export declare function union<const T extends readonly Property[]>(union: T): StructuredType<Partial<InferOutputType<T>>>;