---
title: "FieldLayout: interface in Reflection, TypeShade API"
description: "FieldLayout, an interface in Reflection. One struct field's byte layout: its name, its DSL type key (the string typeKey returns), and its offset…"
url: https://typeshade.dev/api/fieldlayout/
language: en
---

# `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

```ts
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

**`name` read only `string`**

The field’s authored name, the one the host reads by.

**`emitted` read only `string`**

The field’s name in the emitted text ([Rule 11.10](https://typeshade.dev/reference/rules/11-10/)). Equal to `name` when the target spells it as written.

**`type` read only `string`**

**`offset` read only `number`**

**`align` read only `number`**

**`size` read only `number`**

## See also

- [`typeKey`](https://typeshade.dev/api/typekey/)
- [`LayoutKind`](https://typeshade.dev/api/layoutkind/)
- [`StructLayout`](https://typeshade.dev/api/structlayout/)

## Source

[`src/core/reflect/layout.ts`, line 153](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/reflect/layout.ts#L153), at commit af54ddad5
