import type { EntityHandle, FieldDescriptor, FieldToken } from '@ecsia/schema'; export type ElementKind = 'u8' | 'u8c' | 'i8' | 'u16' | 'i16' | 'u32' | 'i32' | 'f32' | 'f64'; export type TypedArray = Uint8Array | Uint8ClampedArray | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array; type AnyTypedArrayCtor = { new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): TypedArray; readonly BYTES_PER_ELEMENT: number; }; export declare function elementCtor(element: ElementKind): AnyTypedArrayCtor; export declare function elementBytes(element: ElementKind): number; export interface ColumnLayout { readonly element: ElementKind; /** Elements per row: 1 scalar, N vec, 1 staticString index. */ readonly stride: number; readonly elementBytes: number; readonly rowBytes: number; /** * The non-zero fill applied to fresh AND grown rows. `-1` for eid columns (a fresh eid row * is the null sentinel, never 0 which is a valid entity index). 0 for every other kind (the * runtime zero-inits the buffer), unless a user default makes it non-zero-equivalent. */ readonly fillOnInit: number; } export declare function makeColumnLayout(element: ElementKind, stride: number, fillOnInit?: number): ColumnLayout; export declare const EID_NULL = -1; export declare function encodeEid(handle: EntityHandle | number): number; export declare function decodeEid(stored: number): EntityHandle | null; export declare function stringIndexElement(choicesLength: number): ElementKind; /** * Project a field token to its ColumnLayout, or `null` for object tokens (no * buffer). `fillOnInit` is taken from the descriptor when the field needs an explicit init (eid, * or a user-overridden non-zero default); otherwise 0. */ export declare function tokenToColumnLayout(token: FieldToken, fillOnInit?: number): ColumnLayout | null; /** Project a resolved FieldDescriptor to its ColumnLayout, or `null` for non-column-backed fields. */ export declare function fieldToColumnLayout(field: FieldDescriptor): ColumnLayout | null; export {}; //# sourceMappingURL=layout.d.ts.map