mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 02:03:59 +02:00
Allow Operation type to be extended (#4708)
* Allow Operation type to be extended * fix lint * add changeset
This commit is contained in:
22
.changeset/tough-rockets-walk.md
Normal file
22
.changeset/tough-rockets-walk.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
'slate': patch
|
||||
---
|
||||
|
||||
Allow `Operation` type to be extended
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
import type { BaseOperation } from 'slate'
|
||||
|
||||
type CustomOperation =
|
||||
| BaseOperation
|
||||
| YourCustomOperation
|
||||
| AnotherCustomOperation
|
||||
|
||||
declare module 'slate' {
|
||||
interface CustomTypes {
|
||||
Operation: CustomOperation;
|
||||
}
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user