Skip to content

Commit

Permalink
fix: content type in change handler
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey committed May 29, 2024
1 parent d09a160 commit dba1fb5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions projects/ngx-quill/src/lib/quill-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { DOCUMENT, isPlatformServer } from '@angular/common'
import { DomSanitizer } from '@angular/platform-browser'

import QuillType from 'quill'
import Delta from 'quill-delta'
import type QuillType from 'quill'
import type DeltaType from 'quill-delta'

import {
AfterViewInit,
Expand Down Expand Up @@ -47,11 +47,11 @@ export interface Range {
}

export interface ContentChange {
content: any
delta: Delta
content: DeltaType
delta: DeltaType
editor: QuillType
html: string | null
oldDelta: Delta
oldDelta: DeltaType
source: string
text: string
}
Expand Down Expand Up @@ -174,7 +174,7 @@ export abstract class QuillEditorBase implements AfterViewInit, ControlValueAcce
if (this.isEmptyValue(html)) {
html = this.defaultEmptyValue()
}
let modelValue: string | Delta | null = html
let modelValue: string | DeltaType | null = html
const format = getFormat(this.format(), this.service.config.format)

if (format === 'text') {
Expand Down Expand Up @@ -415,7 +415,7 @@ export abstract class QuillEditorBase implements AfterViewInit, ControlValueAcce
})
}

textChangeHandler = (delta: Delta, oldDelta: Delta, source: string): void => {
textChangeHandler = (delta: DeltaType, oldDelta: DeltaType, source: string): void => {
// only emit changes emitted by user interactions
const text = this.quillEditor.getText()
const content = this.quillEditor.getContents()
Expand Down

0 comments on commit dba1fb5

Please sign in to comment.