mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-08 01:53:04 +08:00
chore: update typings to not conflict with globals
This commit is contained in:
parent
4cca382695
commit
3b67e8adc6
5
.changeset/rotten-geckos-notice.md
Normal file
5
.changeset/rotten-geckos-notice.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tiptap/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
This changes the typing to not declare types on all HTMLElements, just a local one with the editor instance attached
|
468
package-lock.json
generated
468
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -39,10 +39,8 @@ import { isFunction } from './utilities/isFunction.js'
|
|||||||
|
|
||||||
export * as extensions from './extensions/index.js'
|
export * as extensions from './extensions/index.js'
|
||||||
|
|
||||||
declare global {
|
export interface TiptapEditorHTMLElement extends HTMLElement {
|
||||||
interface HTMLElement {
|
editor?: Editor
|
||||||
editor?: Editor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Editor extends EventEmitter<EditorEvents> {
|
export class Editor extends EventEmitter<EditorEvents> {
|
||||||
@ -342,7 +340,7 @@ export class Editor extends EventEmitter<EditorEvents> {
|
|||||||
|
|
||||||
// Let’s store the editor instance in the DOM element.
|
// Let’s store the editor instance in the DOM element.
|
||||||
// So we’ll have access to it for tests.
|
// So we’ll have access to it for tests.
|
||||||
const dom = this.view.dom as HTMLElement
|
const dom = this.view.dom as TiptapEditorHTMLElement
|
||||||
|
|
||||||
dom.editor = this
|
dom.editor = this
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user