---
title: "ComposeOptions: interface in Variants, TypeShade API"
description: "ComposeOptions, an interface in Variants. Options for composeModule. Feature axes as one family of modules, compiled and linked point by point."
url: https://typeshade.dev/api/composeoptions/
language: en
---

# `ComposeOptions`

Interface in Variants

Options for composeModule.

`import type { ComposeOptions } from 'typeshade'`

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

## Syntax

```ts
interface ComposeOptions {
  readonly allowUnswapped?: boolean;
}
```

## Description

The default is strict: a placeholder that receives no swap and a swap key that matches no placeholder are both errors at compose time.

Strictness matters because a placeholder left in place is easy to miss. The WGSL emitter writes it as a bare `// __placeholder: <tag>` comment and the shader still compiles and renders, while the GLSL emitter and [`compileModule`](https://typeshade.dev/api/compilemodule/) (the same module evaluated on the CPU in double precision) throw only when they reach it. Set `allowUnswapped` only when leaving a placeholder open is deliberate.

## Instance properties

**`allowUnswapped` optional read only `boolean`**

Let a placeholder with no matching swap stay in the module. The WGSL emitter writes it as the comment `// __placeholder: <tag>`; the GLSL emitter and [`compileModule`](https://typeshade.dev/api/compilemodule/) throw when they reach it. Off by default, where an un-swapped placeholder is a compose-time error.

## See also

- [`composeModule`](https://typeshade.dev/api/composemodule/)
- [`compileModule`](https://typeshade.dev/api/compilemodule/)

## Source

[`src/core/passes/compose.ts`, line 25](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/compose.ts#L25), at commit af54ddad5
