mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +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'
|
||||
|
||||
declare global {
|
||||
interface HTMLElement {
|
||||
editor?: Editor;
|
||||
}
|
||||
export interface TiptapEditorHTMLElement extends HTMLElement {
|
||||
editor?: Editor
|
||||
}
|
||||
|
||||
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.
|
||||
// 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user