# RichTextEditorActions (@salmonui/rich-text)

> The RichTextEditorActions interface of @salmonui/rich-text: actionsRef.current once the engine is mounted.

Canonical: https://salmonui.dev/docs/reference/rich-text/RichTextEditorActions

```ts
import type { RichTextEditorActions } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: interface

```ts
interface RichTextEditorActions {
    readonly commands: RichTextCommands;
    run(id: string, ...args: unknown[]): unknown;
    getHtml(options?: {
        readonly xhtml?: boolean;
    }): string;
    getText(): string;
    getSelection(): RichTextSelection;
    setSelection(anchor: number, head?: number): void;
    focus(): void;
    clearHistory(): void;
    openDialog(id: RichTextDialogId): void;
    closeDialog(): void;
    insertFiles(files: readonly File[]): Promise<void>;
    readonly engine: RichTextEngine;
}
```

`actionsRef.current` once the engine is mounted.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `commands` | `readonly commands: RichTextCommands;` |  |  |
| `run` | `run(id: string, ...args: unknown[]): unknown;` |  | Runs a command, alias, extension command or UI action by id. |
| `getHtml` | `getHtml(options?: {     readonly xhtml?: boolean; }): string;` |  |  |
| `getText` | `getText(): string;` |  |  |
| `getSelection` | `getSelection(): RichTextSelection;` |  |  |
| `setSelection` | `setSelection(anchor: number, head?: number): void;` |  |  |
| `focus` | `focus(): void;` |  |  |
| `clearHistory` | `clearHistory(): void;` |  |  |
| `openDialog` | `openDialog(id: RichTextDialogId): void;` |  |  |
| `closeDialog` | `closeDialog(): void;` |  |  |
| `insertFiles` | `insertFiles(files: readonly File[]): Promise<void>;` |  | Inserts files through `onUpload` (or `imageInsert`) as on paste and drop. |
| `engine` | `readonly engine: RichTextEngine;` |  | The headless engine. |
