[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Lookup](https://evolu.dev/docs/api-reference/common/Lookup) › Structural

```ts
type Structural<T> = T extends StructuralScalar
  ? T
  : T extends ReadonlyArray<infer Item>
    ? ReadonlyArray<Structural<Item>>
    : T extends StructuralFunction
      ? never
      : T extends object
        ? {
            readonly [K in keyof T as Extract<
              T[K],
              StructuralFunction
            > extends never
              ? K
              : never]: Structural<Exclude<T[K], StructuralFunction>>;
          } & {
            readonly [K in keyof T as Extract<
              T[K],
              StructuralFunction
            > extends never
              ? never
              : K]?: never;
          }
        : never;
```

Defined in: [packages/common/src/Lookup.ts:274](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Lookup.ts#L274)

Compile-time structural form of `T` for structural lookup APIs.

This exists because [StructuralKey](https://evolu.dev/docs/api-reference/common/Lookup/type-aliases/StructuralKey) is the runtime serialization model,
not a good public generic constraint for interface-shaped objects.
`StructuralKey` models object values with a string index signature, which is
stricter than ordinary interfaces like `{ readonly id: string }` even though
the runtime serializer accepts such plain objects.

`Structural<T>` checks a concrete type recursively at compile time instead:
scalars pass through, arrays recurse, object properties recurse, and
function-valued properties are rejected. This keeps public structural APIs
ergonomic for interface-based inputs while preserving the same runtime
constraints as structural lookup serialization.

## See

- [StructuralKey](https://evolu.dev/docs/api-reference/common/Lookup/type-aliases/StructuralKey)
- [structuralLookup](https://evolu.dev/docs/api-reference/common/Lookup/functions/structuralLookup)