---
title: "emitFuncs(): function in Emit, TypeShade API reference"
description: "emitFuncs, a function in Emit. Emit a list of functions as WGSL, joined by blank lines, through the same lowering and optimization passes emitModule runs."
url: https://typeshade.dev/api/emitfuncs/
language: en
---

# `emitFuncs()`

Function in Emit

Emit a list of functions as WGSL, joined by blank lines, through the same lowering and optimization passes emitModule runs.

`import { emitFuncs } from 'typeshade'`

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

## Syntax

```ts
function emitFuncs(funcs: readonly FuncDecl[]): string
```

## Parameters

**`funcs` `readonly FuncDecl[]`**

## Return value

`string`

## Description

Constant folding, dead-code removal and reuse binding apply exactly as they would inside a full module, so the text matches the function section [`emitModule`](https://typeshade.dev/api/emitmodule/) would write for the same declarations.

A bare list of functions is not a complete module, so validation and the capability check are skipped; only the passes the spelling needs run. [`emitFragment`](https://typeshade.dev/api/emitfragment/) runs the full set when the declarations form a module.

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | Writes WGSL for WebGPU. |
| GLSL ES 3.00 (WebGL2) | Does not apply | |
| CPU oracle | Does not apply | |

## See also

- [`emitModule`](https://typeshade.dev/api/emitmodule/)
- [`emitFragment`](https://typeshade.dev/api/emitfragment/)

## Source

[`src/core/backends/wgsl.ts`, line 206](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/wgsl.ts#L206), at commit af54ddad5
