---
title: "CpuStruct: interface in CPU oracle, TypeShade API reference"
description: "CpuStruct, an interface in CPU oracle. A struct value on the CPU: a plain object keyed by field name, holding one CpuValue per field."
url: https://typeshade.dev/api/cpustruct/
language: en
---

# `CpuStruct`

Interface in CPU oracle

A struct value on the CPU: a plain object keyed by field name, holding one CpuValue per field.

`import type { CpuStruct } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface CpuStruct {
  [k: string]: CpuValue;
}
```

## Description

Calling a struct constructor in shader code (`MyStruct(a, b, …)`) produces one with its fields in declaration order; a struct-typed `var` starts as an empty object and gains fields as they are assigned. The type carries no struct identity of its own: the field set is whatever the declaring struct listed, and the caller checks it structurally.

## See also

- [`CpuValue`](https://typeshade.dev/api/cpuvalue/)

## Source

[`src/core/cpu-runtime/values.ts`, line 26](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/cpu-runtime/values.ts#L26), at commit af54ddad5
