EmitFragment
Interface in Emit
A module emitted without its stage wrapper, plus everything the host must supply or ensure for the result to compile.
import type { EmitFragment } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface EmitFragment { readonly source: string; readonly preamble: readonly string[]; readonly declares: FragmentDeclares; readonly requires: readonly string[];}Description
Produced by emitFragment (WGSL) and
emitGlslFragment (GLSL).
Instance properties
sourceread onlystringThe header-less source: declarations, helpers, and (unless excluded) entry points.
preambleread onlyreadonly string[]Directive and precision lines the host must place ahead of
source, in order. They are returned as data so a composer can merge and de-duplicate them across fragments.declaresread onlyFragmentDeclaresThe manifest of what
sourcedeclares.requiresread onlyreadonly string[]Symbols the fragment references but does not define: functions declared with
externFn, and variables declared withexternVar, spelled for the target. A composer can check this list against what the host actually provides. Function names come from call sites that resolve to neither a module function nor a known intrinsic. Sorted and de-duplicated.
See also
Source
src/core/fragment.ts, line 49, at commit 26de7be8