Skip to content

Commit

Permalink
fix: beforeRender accpet return type Promise<any> (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
BBboy01 authored Aug 22, 2024
1 parent 49aa2e6 commit 7171fec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions projects/ngx-quill/config/src/quill-editor.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface QuillConfig {
modules?: QuillModules
placeholder?: string
readOnly?: boolean
registry?: QuillOptions['registry'] // added in quill2 result of const registry = new Parchment.Registry();
registry?: QuillOptions['registry'] // added in quill2 result of const registry = new Parchment.Registry();
theme?: string
// Custom Config to track all changes or only changes by 'user'
trackChanges?: 'user' | 'all'
Expand All @@ -86,7 +86,7 @@ export interface QuillConfig {
sanitize?: boolean
// A function, which is executed before the Quill editor is rendered, this might be useful
// for lazy-loading CSS.
beforeRender?: () => Promise<void>
beforeRender?: () => Promise<any>
}

export const QUILL_CONFIG_TOKEN = new InjectionToken<QuillConfig>('config', {
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-editor.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ describe('QuillEditor - beforeRender', () => {
class BeforeRenderTestComponent {
@ViewChild(QuillEditorComponent, { static: true }) editor!: QuillEditorComponent

beforeRender?: () => Promise<void>
beforeRender?: () => Promise<any>
}

let fixture: ComponentFixture<BeforeRenderTestComponent>
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export abstract class QuillEditorBase implements AfterViewInit, ControlValueAcce
readonly formats = input<string[] | null | undefined>(undefined)
readonly customToolbarPosition = input<'top' | 'bottom'>('top')
readonly sanitize = input<boolean | undefined>(undefined)
readonly beforeRender = input<() => Promise<void> | undefined>(undefined)
readonly beforeRender = input<() => Promise<any> | undefined>(undefined)
readonly styles = input<any>(null)
readonly registry = input<QuillOptions['registry']>(
undefined
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-quill/src/lib/quill-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class QuillViewComponent implements AfterViewInit, OnChanges, OnDestroy {
readonly debug = input<'warn' | 'log' | 'error' | false>(false)
readonly formats = input<string[] | null | undefined>(undefined)
readonly sanitize = input<boolean | undefined>(undefined)
readonly beforeRender = input<() => Promise<void> | undefined>(undefined)
readonly beforeRender = input<() => Promise<any> | undefined>(undefined)
readonly strict = input(true)
readonly content = input<any>()
readonly customModules = input<CustomModule[]>([])
Expand Down

0 comments on commit 7171fec

Please sign in to comment.