HostFaceOptions
On this page

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 only string

The shader module’s path, carried into the diagnostics and named in the generated files.

originoptionalread only string

The 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 with fuse: false.

runtimeoptionalread only string

The 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) maps typeshade/runtime/internal to 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 each console.* call a GPU entry reaches into the _console buffer (change 0014). The Vite plugin sets it in vite dev. Production retains an optional manifest variant without recording; 'never' omits that variant too.

iroptionalread only boolean

Put 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 only boolean

Write 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/fuse fuses a chain of its calls from (change 0058). Enabled by default (change 0085); false omits these facts to reduce generated size. Ordinary input projection remains independent.

readDocumentoptionalread only (fileName: string) => string | undefined

Reads 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 | undefined

The file a specifier written in fromFile names; defaults to the rule compile() uses.

See also

Source

src/compiler/ts/host-face/contracts.ts, line 5, at commit af54ddad5

Edit this page Report a problem