---
title: "HostFaceOptions: interface in Editor, TypeShade API"
description: "HostFaceOptions, an interface in Editor. How hostFace is called. What an editor asks the compiler for: diagnostics, completion and hover, at a source position."
url: https://typeshade.dev/api/hostfaceoptions/
language: en
---

# `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

```ts
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

**`fileName` read only `string`**

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

**`origin` optional read 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`.

**`runtime` optional read 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.

**`console` optional read 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.

**`ir` optional read 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).

**`fuse` optional read 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.

**`readDocument` optional read only `(fileName: string) => string | undefined`**

Reads a shader file the module imports ([Rule 3.9](https://typeshade.dev/reference/rules/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.

**`resolveImport` optional read only `(fromFile: string, specifier: string) => string | undefined`**

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

## See also

- [`hostFace`](https://typeshade.dev/api/hostface/)

## Source

[`src/compiler/ts/host-face/contracts.ts`, line 5](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-face/contracts.ts#L5), at commit af54ddad5
