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 26de7be8.
Syntax
interface Pack { 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 fields: readonly { name: string; type: string }[]; }[]; readonly overrides: readonly PackOverride[]; readonly features: readonly string[]; readonly console?: PackConsole; readonly ir?: PortableIr; readonly gl?: { readonly draws: Readonly<Record<string, PackGlDraw | { readonly none: string }>>; };}Instance properties
schemaread onlytypeof PACK_SCHEMAThe manifest’s schema, which a reader checks first (Rule 11.10).
compilerread onlystringThe package version that wrote it.
emitoptionalread 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 }), itspluginsapart, which it cannot): the optimizationlevel, theparensand thefp64Flavor. One the build did not give is absent and stands for its default ('O2','full'and'float'), and a manifest built with none has noemit. The load-time emitter emits the program again under them (Rule 11.10).wgslread onlystringglsloptionalread only{ readonly vertex: string; readonly fragment: string }bindingsread onlyreadonly PackBinding[]vertexLayoutoptionalread onlyGpuVertexLayoutThe first vertex entry’s vertex buffer, as
entries[].vertexgives each.entriesread onlyreadonly PackEntry[]structsread onlyreadonly { readonly name: string; readonly fields: readonly { name: string; type: string }[]; }[]overridesread onlyreadonly PackOverride[]featuresread onlyreadonly string[]The
GPUFeatureNames a device must have to create the program’s pipelines.consoleoptionalread onlyPackConsoleiroptionalread onlyPortableIrThe program as portable IR, when the build asked for it: what
repack()emits again. Only the package version that wrote it reads it.gloptionalread only{ readonly draws: Readonly<Record<string, PackGlDraw | { 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 161, at commit 26de7be8