mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-02 19:52:32 +02:00
Merge TypeScript types from master into main
This commit is contained in:
@@ -13,7 +13,7 @@ export const MERGING = new WeakMap<Editor, boolean | undefined>()
|
||||
* `HistoryEditor` contains helpers for history-enabled editors.
|
||||
*/
|
||||
|
||||
export interface HistoryEditor extends Editor {
|
||||
export type HistoryEditor = Editor & {
|
||||
history: History
|
||||
undo: () => void
|
||||
redo: () => void
|
||||
@@ -25,7 +25,7 @@ export const HistoryEditor = {
|
||||
*/
|
||||
|
||||
isHistoryEditor(value: any): value is HistoryEditor {
|
||||
return Editor.isEditor(value) && History.isHistory(value.history)
|
||||
return History.isHistory(value.history) && Editor.isEditor(value)
|
||||
},
|
||||
|
||||
/**
|
||||
|
6
packages/slate-history/test/jsx.d.ts
vendored
Normal file
6
packages/slate-history/test/jsx.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
// This allows tests to include Slate Nodes written in JSX without TypeScript complaining.
|
||||
declare namespace jsx.JSX {
|
||||
interface IntrinsicElements {
|
||||
[elemName: string]: any // eslint-disable-line
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user