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

# defineDecoration

> **defineDecoration**(`decoration`): [`Decoration`](/api/editor/interfaces/decoration/)

Defined in: packages/editor/src/define-decoration.ts:12

An identity helper in the `defineSchema`/`defineDecorator` tradition:
contextual typing and autocomplete for a `Decoration` literal without
annotating it yourself. Accepts every member of the `Decoration`
union. Unrelated to `defineDecorator`, which defines a schema mark
like `strong`; a `Decoration` is an ephemeral visual layer entry for
`editor.registerDecorations`.

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

## Parameters

### decoration

[`Decoration`](/api/editor/interfaces/decoration/)

## Returns

[`Decoration`](/api/editor/interfaces/decoration/)