# AutosaveConfig

interface

The configuration of the [autosave feature](module_autosave_autosave-Autosave.md).

```typescript
ClassicEditor
	.create( {
		attachTo: editorElement,
		autosave: {
			save( editor: Editor ) {
				// The saveData() function must return a promise
				// which should be resolved when the data is successfully saved.
				return saveData( editor.getData() );
			}
		}
	} );
	.then( ... )
	.catch( ... );
```

See [all editor configuration options](module_core_editor_editorconfig-EditorConfig.md).

See also the demo of the [autosave feature](../features/autosave.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-autosave/src/autosave.ts#L390)

<a id="properties">

## Properties

<a id="member-save">

### `save?: ( editor: Editor ) => Promise<unknown>`

The callback to be executed when the data needs to be saved.

This function must return a promise which should be resolved when the data is successfully saved.

```typescript
ClassicEditor
	.create( {
		attachTo: editorElement,
		autosave: {
			save( editor: Editor ) {
				return saveData( editor.getData() );
			}
		}
	} );
	.then( ... )
	.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-autosave/src/autosave.ts#L411)

<a id="member-waitingTime">

### `waitingTime?: number`

The minimum amount of time that needs to pass after the last action to call the provided callback. By default it is 1000 ms.

```typescript
ClassicEditor
	.create( {
		attachTo: editorElement,
		autosave: {
			save( editor: Editor ) {
				return saveData( editor.getData() );
			},
			waitingTime: 2000
		}
	} );
	.then( ... )
	.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-autosave/src/autosave.ts#L432)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
