import type { WithRequired } from 'utilium'; import { ArrayType } from './array.js'; import type { Field, FieldConfigInit, FieldOptions } from './fields.js'; import { type FieldOf, type StructInstance } from './structs.shared.js'; import { type Type } from './types.js'; export declare function init(_name: N | symbol, init: FieldConfigInit, extraOpts?: FieldOptions): Field & { name: N; }; type DynamicArrayField = WithRequired & Field>, 'countedBy'>; export declare function isDynamicArray(instance: StructInstance, field: FieldOf): field is DynamicArrayField; /** * Get the dynamic size in bytes of a dynamic array field * This *includes* the static size of the array items. */ export declare function dynamicArraySize(instance: StructInstance, field: DynamicArrayField): number; declare const kOffsets: unique symbol; /** * Get the offset of a field within a struct instance * @param cache If true, cache computed value and/or re-use existing cached value. If false, clear any cached offsets */ export declare function offsetOf(instance: StructInstance & { [kOffsets]?: { [P in keyof T]?: number; }; }, targetField: FieldOf & { name: N; }, cache: boolean): number; /** Sets the value of a field */ export declare function set(instance: StructInstance, field: FieldOf, value: any, index?: number): void; /** Gets the value of a field */ export declare function get(instance: StructInstance, field: FieldOf): any; export {};