> ## Documentation Index
> Fetch the complete documentation index at: https://chart-spec.enchor.us/llms.txt
> Use this file to discover all available pages before exploring further.

# ChartDocument

```ts theme={null}
type ChartDocument = 
  | {
  fileName: string;
  format: "chart";
  tokens: ChartFileTokens;
}
  | {
  bytes: Uint8Array;
  fileName: string;
  format: "mid";
  readError: string | null;
  tokens: MidiTokens | null;
};
```

The chart file of a song, tokenized in its format.

## Union Members

### Type Literal

```ts theme={null}
{
  fileName: string;
  format: "chart";
  tokens: ChartFileTokens;
}
```

***

### Type Literal

```ts theme={null}
{
  bytes: Uint8Array;
  fileName: string;
  format: "mid";
  readError: string | null;
  tokens: MidiTokens | null;
}
```

| Name | Type | Description |
| - | - | - |
| `bytes` | `Uint8Array` | - |
| `fileName` | `string` | - |
| `format` | `"mid"` | - |
| `readError` | `string` \| `null` | - |
| `tokens` | [`MidiTokens`](https://chart-spec.enchor.us/scan-chart/api/index/interfaces/MidiTokens) \| `null` | Every chunk of the file, unknown types included, or `null` when the file can't be read as MIDI. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.