---
title: "EmitOptions: interface in Emit, TypeShade API reference"
description: "EmitOptions, an interface in Emit. Options accepted by emitModule and emitGlslModule."
url: https://typeshade.dev/api/emitoptions/
language: en
---

# `EmitOptions`

Interface in Emit

Options accepted by emitModule and emitGlslModule.

`import type { EmitOptions } from 'typeshade'`

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

## Syntax

```ts
interface EmitOptions {
  readonly plugins?: readonly EmitPlugin[];
  readonly parens?: ParenMode;
  readonly fp64Flavor?: Fp64Flavor;
}
```

## Description

Every field is optional; an omitted or empty options object gives the plain emit.

## Examples

### Example

```ts
import { obfuscate } from 'typeshade/emit-prod'

const wgsl = emitModule(MODULE, { plugins: obfuscate(), parens: 'minimal' })
```

## Instance properties

**`plugins` optional read only `readonly EmitPlugin[]`**

Plugins to run around the assembly, in order. See [`EmitPlugin`](https://typeshade.dev/api/emitplugin/) for the hook sequence.

**`parens` optional read only `ParenMode`**

How many parentheses the emitted expressions carry. `'full'` is the default and wraps every operator. `'minimal'` omits a paren wherever operator precedence already implies the same parse. Pair it with `{ plugins: obfuscate() }` for the smallest shipped shader.

`'minimal'` omits a paren only where WGSL and GLSL ES 3.00 define the same precedence: `*`, `/` and `%` over `+` and `-` over unary `-`. The relational, logical, bitwise and shift operators stay wrapped on purpose, because WGSL gives them no chaining precedence at all, so mixing them unparenthesised is a compile error there and ranking them would invent a rule one target lacks. The operands of a bitwise or shift operator are unary in WGSL’s grammar, so an arithmetic one keeps its parens too: `a & (b - c)`.

It never reassociates. `a + (b + c)` keeps its parens, because in floating point that is a different number from `a + b + c`.

**`fp64Flavor` optional read only `Fp64Flavor`**

Which arithmetic primitives back the emulated-double helper functions that `f64` lowering injects. `'float'` is the default. `'integer'` writes the primitives in integer bit arithmetic, which a fast-math compiler pass cannot reassociate, and injects no `_fp64` guard binding. See [`Fp64Flavor`](https://typeshade.dev/api/fp64flavor/) for when to choose each.

## See also

- [`EmitPlugin`](https://typeshade.dev/api/emitplugin/)
- [`Fp64Flavor`](https://typeshade.dev/api/fp64flavor/)

## Source

[`src/core/emit.ts`, line 740](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/emit.ts#L740), at commit af54ddad5
