# CurrentRenderDocument

A service that provides the `Document` interface for rendering.

Defaults to the global `document` object. This can be overridden for testing
or environments where the global document is not available or desired.

## Signatures

```ts
export declare const CurrentRenderDocument: Context.Reference<Document>;
```

## Why

DOM creation is an explicit Effect service so tests, iframes, and alternate
documents can use the same renderer without patching `globalThis.document`.

## Ownership and lifetime

The reference borrows the provided `Document`; it does not own or close the
browsing context. The surrounding Layer controls how long the override lives.

## Examples

```ts
import { CurrentRenderDocument } from "@typed/template/Render"
import { Layer } from "effect"

// Override document for testing
const testDocument = new Document()
const testLayer = Layer.succeed(CurrentRenderDocument, testDocument)
```
