HostFaceOptions
Interface in Editor
How hostFace is called.
import type { HostFaceOptions } from 'typeshade/language-service'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
interface HostFaceOptions { readonly fileName: string; readonly origin?: string; readonly runtime?: string; readonly console?: 'gpu' | 'never'; readonly ir?: boolean; readonly fuse?: boolean; readonly readDocument?: (fileName: string) => string | undefined; readonly resolveImport?: (fromFile: string, specifier: string) => string | undefined;}Instance properties
fileNameread onlystringThe shader module’s path, carried into the diagnostics and named in the generated files.
originoptionalread onlystringThe exact identity of this module’s fusion records (change 0122). Defaults to
fileName; an empty string is an explicit identity. Distinct modules that can share a fusion scope need distinct identities. This does not change source paths, imports, diagnostics or views, and has no effect withfuse: false.runtimeoptionalread onlystringThe specifier the generated module imports its runtime from. Defaults to
typeshade/runtime/internal; a test points it at the source file. A tool that runs the generated module without a bundler (change 0062) mapstypeshade/runtime/internalto the package’s own copy, as a bundler does: it is what a generated module imports, not API for a host to import.consoleoptionalread only'gpu' | 'never''gpu'records eachconsole.*call a GPU entry reaches into the_consolebuffer (change 0014). The Vite plugin sets it invite dev. Production retains an optional manifest variant without recording;'never'omits that variant too.iroptionalread onlybooleanPut the program’s portable IR in the manifest, the default export, so the load-time emitter (
typeshade/emit) can emit it again (change 0025).fuseoptionalread onlybooleanWrite into the face of each kernel function that lowers the facts of its loops and the lowered module they name as portable IR, which the planner of
typeshade/fusefuses a chain of its calls from (change 0058). Enabled by default (change 0085);falseomits these facts to reduce generated size. Ordinary input projection remains independent.readDocumentoptionalread only(fileName: string) => string | undefinedReads a shader file the module imports (Rule 3.9), and a package’s
package.json: the module and what it imports are one program, and its face is the module’s own exports and re-exports. The Vite plugin reads from disk.resolveImportoptionalread only(fromFile: string, specifier: string) => string | undefinedThe file a specifier written in
fromFilenames; defaults to the rulecompile()uses.
See also
Source
src/compiler/ts/host-face/contracts.ts, line 5, at commit af54ddad5