FieldLayout
Interface in Reflection
One struct field's byte layout: its name, its DSL type key (the string typeKey returns), and its offset, align and size in bytes under the LayoutKind the enclosing StructLayout was computed with.
import type { FieldLayout } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
interface FieldLayout { readonly name: string; readonly emitted: string; readonly type: string; readonly offset: number; readonly align: number; readonly size: number;}Description
A packer that writes Float32Array
slots divides offset by 4; every type this engine lays out is at least 4-byte aligned,
so the division is exact.
Instance properties
nameread onlystringThe field’s authored name, the one the host reads by.
emittedread onlystringThe field’s name in the emitted text (Rule 11.10). Equal to
namewhen the target spells it as written.typeread onlystringoffsetread onlynumberalignread onlynumbersizeread onlynumber
See also
Source
src/core/reflect/layout.ts, line 153, at commit af54ddad5