diff --git a/docs/src/docPages/api/extensions/history.md b/docs/src/docPages/api/extensions/history.md
index 4c1c6de8..30b04fd1 100644
--- a/docs/src/docPages/api/extensions/history.md
+++ b/docs/src/docPages/api/extensions/history.md
@@ -11,9 +11,10 @@ yarn add @tiptap/extension-history
```
## Settings
-| Option | Type | Default | Description |
-| -------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| historyPluginOptions | Object | {} | Supports the following configuration options:
**depth:** The amount of history events that are collected before the oldest events are discarded. Defaults to 100.
**newGroupDelay:** The delay between changes after which a new group should be started. Defaults to 500 (milliseconds). Note that when changes aren't adjacent, a new group is always started. |
+| Option | Type | Default | Description |
+| ------------- | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| depth | number | 100 | The amount of history events that are collected before the oldest events are discarded. Defaults to 100. |
+| newGroupDelay | number | 500 | The delay between changes after which a new group should be started (in milliseconds). When changes aren’t adjacent, a new group is always started. |
## Commands
| Command | Options | Description |
diff --git a/packages/extension-history/index.ts b/packages/extension-history/index.ts
index 764d6715..ef2ceed0 100644
--- a/packages/extension-history/index.ts
+++ b/packages/extension-history/index.ts
@@ -13,13 +13,15 @@ declare module '@tiptap/core/src/Editor' {
}
export interface HistoryOptions {
- historyPluginOptions: Record,
+ depth: any,
+ newGroupDelay: any,
}
export default new Extension()
.name('history')
.defaults({
- historyPluginOptions: {},
+ depth: 100,
+ newGroupDelay: 500,
})
.commands(() => ({
undo: () => ({ state, dispatch }) => {
@@ -35,6 +37,9 @@ export default new Extension()
'Shift-Mod-z': () => editor.redo(),
}))
.plugins(({ options }) => [
- history(options.historyPluginOptions),
+ history({
+ ...options.depth,
+ ...options.newGroupDelay,
+ }),
])
.create()