1
0
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:
Sunny Hirai
2020-11-27 16:31:16 -08:00
74 changed files with 3410 additions and 3414 deletions

View File

@@ -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
View 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
}
}