import type { PrimitiveType, PointyObject, ObjectPointerDef, AllocStructOptions, AllocStructResult, EnumDef, StructDef, StructDefOptions, DefineStructReturnType } from "./types.js"; export declare const pointerSize: number; /** * Type helper for creating object pointers for structs. */ export declare function objectPtr(): ObjectPointerDef; export declare function allocStruct(structDef: StructDef, options?: AllocStructOptions): AllocStructResult; export declare function defineEnum>(mapping: T, base?: Exclude): EnumDef; type ValidationFunction = (value: any, fieldName: string, options: { hints?: any; input?: any; }) => void | never; interface StructFieldOptions { optional?: boolean; mapOptionalInline?: boolean; unpackTransform?: (value: any) => any; packTransform?: (value: any) => any; lengthOf?: string; asPointer?: boolean; default?: any; condition?: () => boolean; validate?: ValidationFunction | ValidationFunction[]; } type StructField = readonly [string, PrimitiveType, StructFieldOptions?] | readonly [string, EnumDef, StructFieldOptions?] | readonly [string, StructDef, StructFieldOptions?] | readonly [string, "cstring" | "char*", StructFieldOptions?] | readonly [string, ObjectPointerDef, StructFieldOptions?] | readonly [ string, readonly [EnumDef | StructDef | PrimitiveType | ObjectPointerDef], StructFieldOptions? ]; export declare function packObjectArray(val: (PointyObject | null)[]): DataView; export declare function defineStruct(fields: Fields & StructField[], structDefOptions?: Opts): DefineStructReturnType; export {};