# Types

Import these from `@grafloria/element`.

## Types

### `DashboardSnapshot`

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

A whole board as plain data: every `DashboardOptions` field except the
function seams. `dashboard({ ...snapshot, renderWidget })` rebuilds it.

Typed as an Omit rather than a hand-written twin on purpose — a field added
to `DashboardOptions` then joins the snapshot automatically instead of being
silently dropped, which is the exact failure this type exists to end.

```ts
type DashboardSnapshot = Omit<
  DashboardOptions,
  'renderWidget' | 'onLayoutChange' | 'views'
> & { views: DashboardViewSpec[] };
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `views` | `DashboardViewSpec[]` |  |  |

### `DragHandleOption`

```ts
type DragHandleOption = boolean | string | DragGripOptions;
```

**Members**

- `toString(): string` — Returns a string representation of a string.
- `valueOf(): string` — Returns the primitive value of the specified object.

### `SectionCaption`

`false`/absent: no band. `true`: the title. A string: that text.

```ts
type SectionCaption = false | true | string | SectionCaptionOptions;
```

**Members**

- `toString(): string` — Returns a string representation of a string.
- `valueOf(): string` — Returns the primitive value of the specified object.

### `WidgetRenderer`

The signature every renderer here (and `renderWidget`) satisfies.

```ts
type WidgetRenderer = (widget: DashboardWidgetSpec, host: HTMLElement) => void;
```
