> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# EditorEmittedEvent

> **EditorEmittedEvent** = \{ `event`: `FocusEvent`\<`HTMLDivElement`, `Element`\>; `type`: `"blurred"`; \} \| \{ `type`: `"done loading"`; \} \| \{ `type`: `"editable"`; \} \| `ErrorEvent` \| \{ `event`: `FocusEvent`\<`HTMLDivElement`, `Element`\>; `type`: `"focused"`; \} \| \{ `resolution`: [`InvalidValueResolution`](/api/editor/type-aliases/invalidvalueresolution/) \| `null`; `type`: `"invalid value"`; `value`: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`; \} \| \{ `type`: `"loading"`; \} \| [`MutationEvent`](/api/editor/type-aliases/mutationevent/) \| \{ `operation`: [`Operation`](/api/editor/type-aliases/operation/); `type`: `"operation"`; \} \| `PatchEvent` \| \{ `type`: `"read only"`; \} \| \{ `type`: `"ready"`; \} \| \{ `selection`: [`EditorSelection`](/api/editor/type-aliases/editorselection/); `type`: `"selection"`; \} \| \{ `type`: `"value changed"`; `value`: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`; \}

Defined in: packages/editor/src/editor/relay.ts:10

## Type Declaration

\{ `event`: `FocusEvent`\<`HTMLDivElement`, `Element`\>; `type`: `"blurred"`; \}

### event

> **event**: `FocusEvent`\<`HTMLDivElement`, `Element`\>

### type

> **type**: `"blurred"`

\{ `type`: `"done loading"`; \}

### ~~type~~

> **type**: `"done loading"`

:::caution[Deprecated]
Will be removed in the next major version
:::

\{ `type`: `"editable"`; \}

### type

> **type**: `"editable"`

`ErrorEvent`

\{ `event`: `FocusEvent`\<`HTMLDivElement`, `Element`\>; `type`: `"focused"`; \}

### event

> **event**: `FocusEvent`\<`HTMLDivElement`, `Element`\>

### type

> **type**: `"focused"`

\{ `resolution`: [`InvalidValueResolution`](/api/editor/type-aliases/invalidvalueresolution/) \| `null`; `type`: `"invalid value"`; `value`: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`; \}

### resolution

> **resolution**: [`InvalidValueResolution`](/api/editor/type-aliases/invalidvalueresolution/) \| `null`

### type

> **type**: `"invalid value"`

### value

> **value**: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`

\{ `type`: `"loading"`; \}

### ~~type~~

> **type**: `"loading"`

:::caution[Deprecated]
Will be removed in the next major version
:::

[`MutationEvent`](/api/editor/type-aliases/mutationevent/)

\{ `operation`: [`Operation`](/api/editor/type-aliases/operation/); `type`: `"operation"`; \}

### operation

> **operation**: [`Operation`](/api/editor/type-aliases/operation/)

### type

> **type**: `"operation"`

Emitted synchronously for every document-changing operation the
engine applies (`set.selection` is excluded; the `selection` event
serves selection observers), including operations from initial
value sync and normalization, unlike `patch` and `mutation`
events, which are held back until the editor is dirty. Do not
dispatch editor events from a listener; read current state via
`editor.getSnapshot()`.

The `operation` object is the engine's own, passed by reference:
treat it as read-only and copy anything you retain. Normalization
fix operations are delivered adjacent to the operation that
triggered them, but not in a guaranteed order; see the
[Operation](/api/editor/type-aliases/operation/) docs for the delivery-order contract. Subscribers
attached after setup receive only subsequent operations: seed
derived state from `editor.getSnapshot()` when subscribing, then
apply deltas.

:::caution[Beta]
This API should not be used in production and may be trimmed from a public release.
:::

`PatchEvent`

\{ `type`: `"read only"`; \}

### type

> **type**: `"read only"`

\{ `type`: `"ready"`; \}

### type

> **type**: `"ready"`

\{ `selection`: [`EditorSelection`](/api/editor/type-aliases/editorselection/); `type`: `"selection"`; \}

### selection

> **selection**: [`EditorSelection`](/api/editor/type-aliases/editorselection/)

### type

> **type**: `"selection"`

\{ `type`: `"value changed"`; `value`: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`; \}

### type

> **type**: `"value changed"`

### value

> **value**: [`PortableTextBlock`](/api/editor/type-aliases/portabletextblock/)[] \| `undefined`