---
title: "hostFace(): function in Editor, TypeShade API reference"
description: "hostFace, a function in Editor. Compute the host face of one shader module: which exports a host can call (Rule 8.20), their host types (Rule 8.21)…"
url: https://typeshade.dev/api/hostface/
language: en
---

# `hostFace()`

Function in Editor

Compute the host face of one shader module: which exports a host can call (Rule 8.20), their host types (Rule 8.21), the host view tsc reads, and the generated module a bundler reads, which runs the CPU tier's code at `f32` precision (Rule 11.7).

`import { hostFace } from 'typeshade/language-service'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
function hostFace(source: string, options: HostFaceOptions): HostFace
```

## Parameters

**`source` `string`**

**`options` `HostFaceOptions`**

## Return value

`HostFace`

## Description

A module with an error diagnostic has no face: the result carries the diagnostics alone.

The Vite plugin and `tshc sync` call it, and `typeshade/language-service` exports it for a tool that runs host code without Vite (change 0062): `readDocument` reads each file the module imports from where the tool keeps it.

## In the guide

- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)

## Source

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