# Interfaces V–W

Import these from `@grafloria/renderer`.

## Interfaces

### `ValidationIssue`

One validation issue, resolved to the entity it is about.

```ts
interface ValidationIssue
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `entity` | `'node' \| 'link'` |  |  |
| `entityId` | `string` |  |  |
| `severity` | `'error' \| 'warning'` |  |  |
| `message` | `string` |  |  |
| `code` | `string` |  |  |

### `Waypoint`

Represents a waypoint on a link path

```ts
interface Waypoint
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `index` | `number` |  |  |
| `point` | `Point` |  |  |

### `WaypointHandle`

Also has every member of `Waypoint`, listed on its own entry.

Waypoint handle for rendering

```ts
interface WaypointHandle extends Waypoint
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `linkId` | `string` |  |  |

### `WaypointHitResult`

Result of hit testing a waypoint

```ts
interface WaypointHitResult
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `waypointIndex` | `number` |  |  |
| `waypoint` | `Waypoint` |  |  |
| `distance` | `number` |  |  |

### `WhiteboardHost`

The slice of a mounted diagram the whiteboard tools need. `DiagramInstance` satisfies it
structurally, but a test can hand over a fake with four members instead of forty.

```ts
interface WhiteboardHost
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `viewport` | `ViewportController` |  |  |
| `container` | `HTMLElement` |  |  |
| `batch?` | `(fn: () => void) => void` |  | Run a multi-op commit as ONE undo step. A collab/undo-aware host passes `replica.transact`; the default runs it inline (a plain instance has no undo stack, and one add / N removes are still atomic to the model either way). |

**Members**

- `getModel(): DiagramModel`
- `render(): void` — Queue a repaint after a commit.
- `getEngine?(): DiagramEngine | null` — The command manager, when the host has one. `DiagramInstance`
already exposes exactly this signature, so an embed keeps handing the instance over
unchanged. The EDIT tool commits its translate through `engine.commandManager` so the
gesture is Ctrl-Z-able; without an engine it falls back to a plain `setPoints` commit
(still correct, still ONE op for collab — just not on an undo stack that doesn't exist).
