` element with a given `id`, to which the DocsAPI later binds the editor.
### Import
```ts
import { DocumentEditor } from "@onlyoffice/document-editor-react";
```
### Signature
```ts
const DocumentEditor = (props: DocumentEditorProps) => {
```
### Props
#### Required Props
- **id** (string) - The unique identifier for the editor container element.
- **documentServerUrl** (string) - The URL of the Document Server.
- **config** (Config) - The configuration object for the editor (type from `@onlyoffice/doceditor-types`).
#### Optional Props
- **shardkey** (string | boolean) - Optional shard key for the editor.
- **document_fileType** (string) - The file type of the document.
- **document_title** (string) - The title of the document.
- **documentType** (string) - The type of the document (e.g., 'word', 'cell', 'slide').
- **editorConfig_lang** (string) - The language of the editor interface.
- **height** (string) - The height of the editor container.
- **type** (string) - The type of the editor (e.g., 'embedded', 'desktop').
- **width** (string) - The width of the editor container.
- **onLoadComponentError** ((errorCode: number, errorDescription: string) => void) - Callback for component load errors.
#### Event Callback Props
All event callbacks accept an `event` object as their only argument.
- **events_onAppReady** ((event: object) => void) - Triggered when the application is ready.
- **events_onDocumentStateChange** ((event: object) => void) - Triggered when the document state changes.
- **events_onMetaChange** ((event: object) => void) - Triggered when document metadata changes.
- **events_onDocumentReady** ((event: object) => void) - Triggered when the document is ready.
- **events_onInfo** ((event: object) => void) - Triggered when information is available.
- **events_onWarning** ((event: object) => void) - Triggered when a warning occurs.
- **events_onError** ((event: object) => void) - Triggered when an error occurs.
- **events_onRequestSharingSettings** ((event: object) => void) - Triggered when sharing settings are requested.
- **events_onRequestRename** ((event: object) => void) - Triggered when a rename is requested.
- **events_onMakeActionLink** ((event: object) => void) - Triggered when an action link is made.
- **events_onRequestInsertImage** ((event: object) => void) - Triggered when inserting an image is requested.
- **events_onRequestSaveAs** ((event: object) => void) - Triggered when saving as is requested.
- **events_onRequestMailMergeRecipients** ((event: object) => void) - Deprecated since 7.5, use `events_onRequestSelectSpreadsheet`.
- **events_onRequestCompareFile** ((event: object) => void) - Deprecated since 7.5, use `events_onRequestSelectDocument`.
- **events_onRequestEditRights** ((event: object) => void) - Triggered when edit rights are requested.
- **events_onRequestHistory** ((event: object) => void) - Triggered when history is requested.
- **events_onRequestHistoryClose** ((event: object) => void) - Triggered when history close is requested.
- **events_onRequestHistoryData** ((event: object) => void) - Triggered when history data is requested.
- **events_onRequestRefreshFile** ((event: object) => void) - Triggered when refreshing the file is requested.
- **events_onRequestRestore** ((event: object) => void) - Triggered when restoring is requested.
- **events_onRequestSelectSpreadsheet** ((event: object) => void) - Triggered when selecting a spreadsheet is requested.
- **events_onRequestSelectDocument** ((event: object) => void) - Triggered when selecting a document is requested.
- **events_onRequestUsers** ((event: object) => void) - Triggered when users are requested.
### Render Output
Renders a `
` element. The DocsAPI later binds the editor to that element, located by `id`.
### Source
- **Source file**: `src/DocumentEditor.tsx` (component at line 82; re-exported from `src/index.ts:17`)
- **Kind**: Arrow-function React component (not a class). Stateless — all logic is in `useEffect` hooks.
```
--------------------------------
### createConnector method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Creates the connector for interacting with documents from the outside. Available only in the ONLYOFFICE Docs Developer edition. Returns an object.
```typescript
createConnector(): object;
```
--------------------------------
### DocumentEditor Component
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocumentEditor.md
Documentation for the DocumentEditor React component, including all props and event mappings.
```APIDOC
## DocumentEditor Component
### Description
React component that embeds the ONLYOFFICE Document Editor. It loads the DocsAPI script from the Document Server and initializes the editor with the provided configuration.
### Props
| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `id` | `string` | yes | — | Unique identifier; used as the DOM element `id` and as the registry key in `window.DocEditor.instances`. |
| `documentServerUrl` | `string` | yes | — | Base address of the ONLYOFFICE Document Server. Trailing `/` is appended if missing. DocsAPI is loaded from `{url}web-apps/apps/api/documents/api.js`. |
| `shardkey` | `string \| boolean` | no | `true` | Load-balancing shard key. `true` (boolean) → uses `config.document?.key`; string → used verbatim; `false` → no `?shardkey=` query parameter at all. |
| `config` | `Config` | yes | — | Generic editor configuration (document, editorConfig, events, documentType, height, type, width, token; see [types.md](../types.md)). Deep-cloned before use. |
| `document_fileType` | `string` | no | — | Overlay value mapped to `document.fileType` in the init config. Present in `config.document.fileType` always wins (see merge order). |
| `document_title` | `string` | no | — | Overlay value written to `document.document_title` in the init config. Note: the `Config` type field is `document.title`, so this is written under the `document_title` key verbatim. |
| `documentType` | `string` | no | — | Overlay value for top-level `documentType` in the init config. |
| `editorConfig_lang` | `string` | no | — | Overlay value mapped to `editorConfig.lang` in the init config. |
| `height` | `string` | no | — | Overlay value for top-level `height` (any CSS-compatible size). |
| `type` | `string` | no | — | Overlay value for top-level `type` (e.g. `desktop`, `mobile`, `embedded`). |
| `width` | `string` | no | — | Overlay value for top-level `width` (any CSS-compatible size). |
| `onLoadComponentError` | `(errorCode: number, errorDescription: string) => void` | no | — | Called when component loading fails. Codes: `-1` unknown, `-2` DocsAPI load failure, `-3` DocsAPI not defined. If omitted, errors are written via `console.error`. |
| `events_onAppReady` | `(event: object) => void` | no | — | Wired to `events.onAppReady`; invoked with `window.DocEditor.instances[id] || {}` — i.e. the `DocEditor` instance. Other `events_*` props are wired 1:1 to `events.
` (see table below). |
### Event prop → config `events` key mapping
| Prop | Config `events` key |
|------|---------------------|
| `events_onAppReady` | `onAppReady` |
| `events_onDocumentStateChange` | `onDocumentStateChange` |
| `events_onMetaChange` | `onMetaChange` |
| `events_onDocumentReady` | `onDocumentReady` |
| `events_onInfo` | `onInfo` |
| `events_onWarning` | `onWarning` |
| `events_onError` | `onError` |
| `events_onRequestSharingSettings` | `onRequestSharingSettings` |
| `events_onRequestRename` | `onRequestRename` |
| `events_onMakeActionLink` | `onMakeActionLink` |
| `events_onRequestInsertImage` | `onRequestInsertImage` |
| `events_onRequestSaveAs` | `onRequestSaveAs` |
| `events_onRequestMailMergeRecipients` | `onRequestMailMergeRecipients` |
| `events_onRequestCompareFile` | `onRequestCompareFile` |
| `events_onRequestEditRights` | `onRequestEditRights` |
| `events_onRequestHistory` | `onRequestHistory` |
| `events_onRequestHistoryClose` | `onRequestHistoryClose` |
| `events_onRequestHistoryData` | `onRequestHistoryData` |
| `events_onRequestRefreshFile` | `onRequestRefreshFile` |
| `events_onRequestRestore` | `onRequestRestore` |
| `events_onRequestSelectSpreadsheet` | `onRequestSelectSpreadsheet` |
| `events_onRequestSelectDocument` | `onRequestSelectDocument` |
| `events_onRequestUsers` | `onRequestUsers` |
```
--------------------------------
### setActionLink(link: string)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Sets the bookmark link. Must be called after the `onMakeActionLink` event.
```APIDOC
## setActionLink(link: string)
### Description
Sets the bookmark link. Must be called after the `onMakeActionLink` event.
### Method
setActionLink
### Parameters
- **link** (string) - Required - The bookmark link to set.
```
--------------------------------
### ConfigNormal and BaseConfig interfaces
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/types.md
Shows the base configuration fields and the normal (non-embedded) variant. BaseConfig includes platform type, dimensions, document type, and an optional JWT token.
```ts
export interface ConfigNormal extends BaseConfig {
document?: DocumentNormal;
editorConfig?: EditorConfigNormal;
events?: EventsNormal;
}
export interface BaseConfig {
type?: PlatformType; // default "desktop"
width?: string; // default "100%"
height?: string; // default "100%"
documentType?: DocumentType;
token?: string;
}
```
--------------------------------
### Import DocumentEditor from @onlyoffice/document-editor-react
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocumentEditor.md
Import the DocumentEditor component from the package top level.
```typescript
import { DocumentEditor } from "@onlyoffice/document-editor-react";
```
--------------------------------
### insertImage(options: InsertImageOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Inserts an image. Must be called after the `onRequestInsertImage` event.
```APIDOC
## insertImage(options: InsertImageOptions)
### Description
Inserts an image. Must be called after the `onRequestInsertImage` event.
### Method
insertImage
### Parameters
- **options** (InsertImageOptions) - Required - Options for inserting the image. See types.md for fields: `c`, `images[]`, `fileType?`, `token?`, `url?`.
```
--------------------------------
### DocEditor class
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/types.md
Main class for the document editor with constructor and 21 methods.
```APIDOC
## `DocEditor` class
### Description
Main class for the document editor. Constructor takes an id and config. Provides 21 methods for editor control.
### Constructor
- `constructor(id: string, config: Config)` - Creates a new editor instance.
### Methods
- `createConnector` - Creates a connector.
- `denyEditingRights` - Denies editing rights.
- `destroyEditor` - Destroys the editor.
- `downloadAs` - Downloads the document as a specific format.
- `insertImage` - Inserts an image.
- `refreshFile` - Refreshes the file.
- `refreshHistory` - Refreshes the history.
- `requestClose` - Requests to close the editor.
- `setActionLink` - Sets an action link.
- `setFavorite` - Sets favorite status.
- `setHistoryData` - Sets history data.
- `setMailMergeRecipients` - Sets mail merge recipients.
- `setReferenceData` - Sets reference data.
- `setReferenceSource` - Sets reference source.
- `setRequestedDocument` - Sets requested document.
- `setRequestedSpreadsheet` - Sets requested spreadsheet.
- `setRevisedFile` - Sets revised file.
- `setSharingSettings` - Sets sharing settings.
- `setUsers` - Sets users.
- `showMessage` - Shows a message.
- `startFilling` - Starts filling.
Full method signatures: [api-reference/DocEditor.md](api-reference/DocEditor.md).
```
--------------------------------
### DocumentBase, DocumentNormal, and DocumentEmbedded interfaces
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/types.md
Defines the document configuration. DocumentBase requires url and key; DocumentNormal adds optional metadata, permissions, and form flag. DocumentEmbedded is an empty extension of DocumentBase.
```ts
export interface DocumentBase {
title?: string; // default "Unnamed.{fileType}", max 128 chars
url: string; // absolute URL of the source document
fileType?: FileType; // inferred from documentType if omitted
key: string; // unique document id, max 128 chars
}
export interface DocumentNormal extends DocumentBase {
options?: Record; // not in public documentation
referenceData?: ReferenceData;
info?: { owner?: string; folder?: string; uploaded?: string;
sharingSettings?: SharingSetting[]; favorite?: boolean };
permissions?: DocumentPermissions;
isForm?: boolean;
}
export interface DocumentEmbedded extends DocumentBase {}
```
--------------------------------
### refreshFile(config: Config)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Updates the file version without reloading the editor. Must be called after the `onRequestRefreshFile` event.
```APIDOC
## refreshFile(config: Config)
### Description
Updates the file version without reloading the editor. Must be called after the `onRequestRefreshFile` event.
### Method
refreshFile
### Parameters
- **config** (Config) - Required - The configuration for the file refresh.
```
--------------------------------
### DocEditor constructor
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
The DocEditor constructor creates a new editor instance in the specified HTML element with the given configuration. It is called by the DocumentEditor component via window.DocsAPI.DocEditor(id, initConfig).
```APIDOC
## Constructor
```ts
constructor(id: string, config: Config);
```
### Description
Creates a new editor instance in the specified HTML element with the given configuration.
### Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | `string` | yes | ID of the HTML element to place the editor into |
| `config` | `Config` | yes | Editor initialization configuration |
### Usage
```ts
const editor = window.DocsAPI.DocEditor(id, initConfig);
```
```
--------------------------------
### setHistoryData method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Sends the link for viewing version history. Must be called after onRequestHistoryData; a token must be added to validate parameters.
```typescript
setHistoryData(options: SetHistoryDataOptions): void;
```
--------------------------------
### _createScriptTag internal helper signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/loadScript.md
Internal helper at line 56 of src/utils/loadScript.ts used to create and configure the script tag.
```typescript
const _createScriptTag = (id: string, url: string, resolve: (value: unknown) => void, reject: (reason?: any) => void) => {
```
--------------------------------
### Method option interfaces
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/types.md
Interfaces defining options for various editor methods.
```APIDOC
## Method option interfaces
### Description
Interfaces defining options for various editor methods.
### `InsertImageOptions`
- `c: "add" | "change" | "fill" | "watermark" | "slide"` - Required - Insert mode.
- `images: { fileType: "bmp"|"gif"|"jpe"|"jpeg"|"jpg"|"png"|"tif"|"tiff"; url: string }[]` - Required - Array of images.
- `fileType?` - Optional - File type.
- `token?` - Optional - Token.
- `url?` - Optional - URL.
### `RefreshHistoryOptions`
- `currentVersion?: number` - Optional - Current version.
- `error?: string` - Optional - Error message.
- `history?: { changes?: object; created: string; key: string; serverVersion?: number; user?: { id: string; name: string }; version?: number }[]` - Optional - History array.
### `SetHistoryDataOptions`
- `changesUrl: string` - Required - URL to changes.
- `fileType: string` - Required - File type.
- `key: string` - Required - Key.
- `previous: { fileType: string; key: string; url: string }` - Required - Previous file info.
- `token?: string` - Optional - Token.
- `url?: string` - Optional - URL.
- `version: number` - Required - Version.
### `SetReferenceDataOptions`
- `referenceData?: ReferenceData` - Optional - Reference data.
- `path?: string` - Optional - Path.
- `url?: string` - Optional - URL.
### `SetRequestedDocumentOptions`
- `fileType: string` - Required - File type.
- `token?: string` - Optional - Token.
- `url: string` - Required - URL.
### `SetRequestedSpreadsheetOptions`
- `fileType: string` - Required - File type.
- `token?: string` - Optional - Token.
- `url: string` - Required - URL.
### `SetSharingSettingsOptions`
- `sharingSettings: SharingSetting[]` - Required - Sharing settings array.
### `SetUsersOptions`
- `users: { email?: string; id?: string; image?: string; name?: string }[]` - Required - Array of users.
```
--------------------------------
### refreshHistory method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Shows document version history. Must be called after the onRequestHistory event. Options: currentVersion?, error?, history[] (changes?, created, key, serverVersion?, user?, version?).
```typescript
refreshHistory(options: RefreshHistoryOptions): void;
```
--------------------------------
### setActionLink method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Sets the bookmark link. Must be called after the onMakeActionLink event.
```typescript
setActionLink(link: string): void;
```
--------------------------------
### DocumentEditor component signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocumentEditor.md
The arrow-function component signature that accepts DocumentEditorProps.
```typescript
const DocumentEditor = (props: DocumentEditorProps) => {
```
--------------------------------
### refreshHistory(options: RefreshHistoryOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Shows document version history. Must be called after the `onRequestHistory` event.
```APIDOC
## refreshHistory(options: RefreshHistoryOptions)
### Description
Shows document version history. Must be called after the `onRequestHistory` event.
### Method
refreshHistory
### Parameters
- **options** (RefreshHistoryOptions) - Required - Options for refreshing history. Fields: `currentVersion?`, `error?`, `history[]` (`changes?`, `created`, `key`, `serverVersion?`, `user?`, `version?`).
```
--------------------------------
### setSharingSettings(options: SetSharingSettingsOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Updates sharing settings after the `onRequestSharingSettings` event.
```APIDOC
## setSharingSettings(options: SetSharingSettingsOptions)
### Description
Updates sharing settings after the `onRequestSharingSettings` event.
### Method
setSharingSettings
### Parameters
- **options** (SetSharingSettingsOptions) - Required - Options for sharing settings.
```
--------------------------------
### setRequestedDocument(options: SetRequestedDocumentOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Selects a document for comparing/combining/inserting text after `onRequestSelectDocument`.
```APIDOC
## setRequestedDocument(options: SetRequestedDocumentOptions)
### Description
Selects a document for comparing/combining/inserting text after `onRequestSelectDocument`.
### Method
setRequestedDocument
### Parameters
- **options** (SetRequestedDocumentOptions) - Required - Options for the requested document.
```
--------------------------------
### setRevisedFile(options: { fileType: string; token?: string; url: string })
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Deprecated since 7.5 — use `setRequestedDocument`. Selects a document for comparing after `onRequestCompareFile` (Enterprise/Developer editions only).
```APIDOC
## setRevisedFile(options: { fileType: string; token?: string; url: string })
### Description
Deprecated since 7.5 — use `setRequestedDocument`. Selects a document for comparing after `onRequestCompareFile` (Enterprise/Developer editions only).
### Method
setRevisedFile
### Parameters
- **options** (object) - Required - Options for the revised file.
- **fileType** (string) - Required - The file type.
- **token** (string) - Optional - The token.
- **url** (string) - Required - The URL.
```
--------------------------------
### insertImage method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Inserts an image. Must be called after the onRequestInsertImage event. InsertImageOptions fields: c, images[], fileType?, token?, url?.
```typescript
insertImage(options: InsertImageOptions): void;
```
--------------------------------
### refreshFile method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Updates the file version without reloading the editor. Must be called after the onRequestRefreshFile event.
```typescript
refreshFile(config: Config): void;
```
--------------------------------
### setUsers(options: SetUsersOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Sets users to mention in comments, grants range-edit access rights, or sets avatars after the `onRequestUsers` event.
```APIDOC
## setUsers(options: SetUsersOptions)
### Description
Sets users to mention in comments, grants range-edit access rights, or sets avatars after the `onRequestUsers` event.
### Method
setUsers
### Parameters
- **options** (SetUsersOptions) - Required - Options for setting users.
```
--------------------------------
### destroyEditor()
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Destroys the editor instance. Used when re-initializing with other configurations.
```APIDOC
## destroyEditor()
### Description
Destroys the editor instance. Used when re-initializing with other configurations. The component calls it during re-init and on unmount.
### Method
destroyEditor
```
--------------------------------
### Access editor instance via window.DocEditor.instances
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocumentEditor.md
Accesses the underlying DocEditor instance from the global registry by id. The instance is only valid while the component is mounted because the component calls destroyEditor() on unmount and clears the slot.
```jsx
// after the editor has initialized:
const editor = window.DocEditor.instances["docxEditor"];
editor.downloadAs("pdf"); // DocEditor method from @onlyoffice/doceditor-types
```
--------------------------------
### loadScript declaration as imported
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/loadScript.md
The type declaration of loadScript when imported, showing its parameters and return type.
```typescript
const loadScript: (url: string, id: string) => Promise
```
--------------------------------
### requestClose()
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Requests editor close. Recommended before `destroyEditor()` to check for unsaved data.
```APIDOC
## requestClose()
### Description
Requests editor close. Recommended before `destroyEditor()` to check for unsaved data.
### Method
requestClose
```
--------------------------------
### setFavorite(favorite: boolean)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Changes the *Favorite* icon state. Must be called after the `onMetaChange` event.
```APIDOC
## setFavorite(favorite: boolean)
### Description
Changes the *Favorite* icon state. Must be called after the `onMetaChange` event.
### Method
setFavorite
### Parameters
- **favorite** (boolean) - Required - The new favorite state.
```
--------------------------------
### setUsers method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Sets users to mention in comments, grants range-edit access rights, or sets avatars after the onRequestUsers event.
```typescript
setUsers(options: SetUsersOptions): void;
```
--------------------------------
### setReferenceSource(options: SetReferenceDataOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Changes a source of external data after the `onRequestReferenceSource` event.
```APIDOC
## setReferenceSource(options: SetReferenceDataOptions)
### Description
Changes a source of external data after the `onRequestReferenceSource` event.
### Method
setReferenceSource
### Parameters
- **options** (SetReferenceDataOptions) - Required - Options for the reference source.
```
--------------------------------
### setReferenceData(options: SetReferenceDataOptions)
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Refreshes data by a reference link. Must be called after `onRequestReferenceData` (Developer edition only).
```APIDOC
## setReferenceData(options: SetReferenceDataOptions)
### Description
Refreshes data by a reference link (`referenceData`, `path`, or `link`). Must be called after `onRequestReferenceData` (Developer edition only).
### Method
setReferenceData
### Parameters
- **options** (SetReferenceDataOptions) - Required - Options for reference data.
```
--------------------------------
### loadScript function signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/loadScript.md
The default export of src/utils/loadScript.ts at line 17. Asynchronous function that accepts a URL and an id, returning a Promise.
```typescript
const loadScript = async (url: string, id: string) => {
```
--------------------------------
### Config interface from @onlyoffice/doceditor-types
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/types.md
Defines the top-level configuration object passed to the ONLYOFFICE Document Editor React component. It extends ConfigNormal and adds embedded variants for document, editorConfig, and events.
```ts
export interface Config extends ConfigNormal {
document?: DocumentNormal & DocumentEmbedded;
editorConfig?: EditorConfigNormal & EditorConfigEmbedded;
events?: EventsNormal & EventsEmbedded;
}
```
--------------------------------
### setRequestedDocument method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Selects a document for comparing/combining/inserting text after onRequestSelectDocument.
```typescript
setRequestedDocument(options: SetRequestedDocumentOptions): void;
```
--------------------------------
### setSharingSettings method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Updates sharing settings after the onRequestSharingSettings event.
```typescript
setSharingSettings(options: SetSharingSettingsOptions): void;
```
--------------------------------
### requestClose method signature
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/DocEditor.md
Requests editor close. Recommended before destroyEditor() to check for unsaved data.
```typescript
requestClose(): void;
```
--------------------------------
### loadScript return new Promise body
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/api-reference/loadScript.md
The body of loadScript creates and returns a new Promise for script loading.
```typescript
return new Promise((resolve, reject) => { ... });
```
--------------------------------
### Handle editor runtime errors with events_onError
Source: https://github.com/onlyoffice/document-editor-react/blob/master/_autodocs/errors.md
Attach a handler to the editor's runtime errors via the events_onError prop. The event object may have title and description fields; the handler logs the description or falls back to the title.
```jsx
console.log("Editor error:", event.description ?? event.title)}
/>
```