# emitImports() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.emitimports/
Published: 2026-08-28
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 2.0.0 — generated reference, not hand-written

Emit the import statements for the runtimes a file uses.

**Signature:**

```typescript
export declare function emitImports(names: readonly RuntimeName[], map?: ImportMap): string;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| names | readonly [RuntimeName](https://imqueue.org/api/pg-prisma/latest/pg-prisma.runtimename/)\[\] | The runtimes this file takes symbols from. |
| map | [ImportMap](https://imqueue.org/api/pg-prisma/latest/pg-prisma.importmap/) | _(Optional)_ Redirections, from [parseImportMap()](https://imqueue.org/api/pg-prisma/latest/pg-prisma.parseimportmap/). |


**Returns:**

string

The import statements, newline-terminated, or '' for none.

## Remarks

Statements are \*\*merged by resolved specifier\*\*. Redirecting several runtimes at one package is the whole point of the option, and emitting one import per original specifier would then produce three imports of the same module in a file — which is a lint error, and reads as an oversight rather than as the redirection it is. Specifiers and symbols are both sorted, so the output is stable and a regenerated file diffs cleanly.

## Example


```typescript
emitImports(['rpc', 'zod'], { zod: '@my-org/runtime',
                              '@imqueue/rpc': '@my-org/runtime' });
// "import { classType, property, z } from '@my-org/runtime';\n"
```

