---
title: "Pack: interface in Reflection, TypeShade API reference"
description: "Pack, an interface in Reflection. The serialisable result of buildManifest: see there."
url: https://typeshade.dev/api/pack/
language: en
---

# `Pack`

Interface in Reflection

The serialisable result of buildManifest: see there.

`import type { Pack } from 'typeshade'`
`import type { Pack } from 'typeshade/runtime'`

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

## Syntax

```ts
interface Pack<E extends PackBindings = PackBindings> {
  readonly schema: typeof PACK_SCHEMA;
  readonly compiler: string;
  readonly emit?: { readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; };
  readonly wgsl: string;
  readonly glsl?: { readonly vertex: string; readonly fragment: string };
  readonly bindings: readonly PackBinding[];
  readonly vertexLayout?: GpuVertexLayout;
  readonly entries: readonly PackEntry[];
  readonly structs: readonly { readonly name: string; readonly emitted: string; readonly fields: readonly { name: string; emitted: string; type: string }[]; }[];
  readonly overrides: readonly PackOverride[];
  readonly features: readonly string[];
  readonly console?: PackConsole;
  readonly variants?: { readonly console?: PackConsole };
  readonly ir?: PortableIr;
  readonly gl?: { /** Each vertex entry's vertex program on WebGL2 (change 0054), or why it has none. */ readonly vertices?: Readonly<Record<string, PackGlVertex | { readonly none: string }>>; /** Each fragment entry's fragment program on WebGL2, or why it has none: a render * pipeline links it with a vertex entry's, and a full-screen draw with the tier's own. */ readonly draws?: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; /** Each compute entry's pass program on WebGL2 (change 0054), or why it has none. */ readonly computes?: Readonly<Record<string, PackGlCompute | { readonly none: string }>>; };
  readonly [entryBindings]?: E;
}
```

## Description

`E` is the bindings each entry reaches (change 0030). The host view of a module types its default export with them, and the program runtime carries them to each draw and dispatch. A manifest read from JSON, or built at run time, is `Pack` with no argument, which takes any bindings. Nothing at run time holds `E`.

## Instance properties

**`schema` read only `typeof PACK_SCHEMA`**

The manifest’s schema, which a reader checks first ([Rule 11.10](https://typeshade.dev/reference/rules/11-10/)).

**`compiler` read only `string`**

The package version that wrote it.

**`emit` optional read only `{ readonly level?: 'O0' | 'O1' | 'O2'; readonly parens?: 'full' | 'minimal'; readonly fp64Flavor?: 'float' | 'integer'; }`**

The options the program was emitted under, when the build gave any of the three a manifest can record (`packModule(m, { emit })`, its `plugins` apart, which it cannot): the optimization `level`, the `parens` and the `fp64Flavor`. Each option the build did not provide is absent and uses its default (`'O2'`, `'full'` and `'float'`), and a manifest built with none has no `emit`. The load-time emitter emits the program again under them ([Rule 11.10](https://typeshade.dev/reference/rules/11-10/)).

**`wgsl` read only `string`**

**`glsl` optional read only `{ readonly vertex: string; readonly fragment: string }`**

**`bindings` read only `readonly PackBinding[]`**

**`vertexLayout` optional read only `GpuVertexLayout`**

The first vertex entry’s vertex buffer, as `entries[].vertex` gives each.

**`entries` read only `readonly PackEntry[]`**

**`structs` read only `readonly { readonly name: string; readonly emitted: string; readonly fields: readonly { name: string; emitted: string; type: string }[]; }[]`**

**`overrides` read only `readonly PackOverride[]`**

**`features` read only `readonly string[]`**

The `GPUFeatureName`s a device must have to create the program’s pipelines.

**`console` optional read only `PackConsole`**

Recorded variant enabled by default. Retained for legacy recorded builds.

**`variants` optional read only `{ readonly console?: PackConsole }`**

Available variants, selected explicitly at load time. Their presence enables nothing.

**`ir` optional read only `PortableIr`**

The program as portable IR, when the build asked for it: what `repack()` emits again. Only the package version that wrote it reads it.

**`gl` optional read only `{ /** Each vertex entry's vertex program on WebGL2 (change 0054), or why it has none. */ readonly vertices?: Readonly<Record<string, PackGlVertex | { readonly none: string }>>; /** Each fragment entry's fragment program on WebGL2, or why it has none: a render * pipeline links it with a vertex entry's, and a full-screen draw with the tier's own. */ readonly draws?: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; /** Each compute entry's pass program on WebGL2 (change 0054), or why it has none. */ readonly computes?: Readonly<Record<string, PackGlCompute | { readonly none: string }>>; }`**

What the WebGL2 tier uses: each full-screen fragment entry’s draw, or why it has none.

## Source

[`src/core/manifest-types.ts`, line 292](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/manifest-types.ts#L292), at commit af54ddad5
