# Browser rendering API

Generated public signatures, parameters, return values and data fields.

Signatures and descriptions are extracted from public exports and JSDoc. Chinese explanations are checked against current source. See [Embed in Vue](/en/guide/vue) for the component integration.

## Render and rasterize

### renderTextDiagram

`@quirekit/text-diagram/browser` · MIT

@param language - Explicit grammar.
@param source - Exact draft.
@param options - Cancellable render owner.
@returns A static SVG snapshot tied to exactly this source.

```ts
function renderTextDiagram(language: TextDiagramLanguage, source: string, options: TextDiagramRenderOptions): Promise<TextDiagramSnapshot>
```

### rasterizeTextDiagram

`@quirekit/text-diagram/browser` · MIT

@param snapshot - Already sanitized, source-bound SVG.
@param owner - Canvas owner.
@param signal - Save lifetime.
@returns A bounded PNG from this snapshot, without rereading the draft.

```ts
function rasterizeTextDiagram(snapshot: TextDiagramSnapshot, owner: Document, signal: AbortSignal): Promise<TextDiagramRaster>
```


## Options

### TextDiagramRenderOptions

`@quirekit/text-diagram/browser` · MIT

Explicit render lifetime; no host editor state is captured.

```ts
export interface TextDiagramRenderOptions {
    readonly signal: AbortSignal;
    readonly ownerDocument?: Document;
    readonly typography?: TextDiagramTypography;
}
```

**signal** — Cancellation of this exact source request.

**ownerDocument** — DOM owner used for measurement and isolated engines.

**typography** — Mermaid text role; PlantUML and DOT retain their source-defined engine typography.

### TextDiagramTypography

`@quirekit/text-diagram/browser` · MIT

Mermaid measurement typography, shared by editor, reading and export.

```ts
export interface TextDiagramTypography {
    readonly fontFamily: string;
    readonly fontSize: number;
}
```

**fontFamily** — Actual host font stack.

**fontSize** — CSS pixel font size.
