chore(ckeditor5-footnotes): fix references: Writer -> ModelWriter

This commit is contained in:
Elian Doran 2025-07-12 19:21:20 +03:00
parent 275d07659d
commit 23fe76989b
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import { defineSchema } from './schema.js';
import { ATTRIBUTES, COMMANDS, ELEMENTS } from '../constants.js';
import InsertFootnoteCommand from '../insert-footnote-command.js';
import { modelQueryElement, modelQueryElementsAll } from '../utils.js';
import { Autoformat, Batch, ModelElement, Plugin, ModelRootElement, viewToModelPositionOutsideModelElement, Widget, Writer } from 'ckeditor5';
import { Autoformat, Batch, ModelElement, Plugin, ModelRootElement, viewToModelPositionOutsideModelElement, Widget, ModelWriter } from 'ckeditor5';
export default class FootnoteEditing extends Plugin {
@ -143,7 +143,7 @@ export default class FootnoteEditing extends Plugin {
* batch these changes with the ones that instantiated them,
* such that the set can be undone with a single action.
*/
private _clearContents( modelWriter: Writer, footnoteContent: ModelElement ) {
private _clearContents( modelWriter: ModelWriter, footnoteContent: ModelElement ) {
const contents = modelWriter.createRangeIn( footnoteContent );
modelWriter.appendElement( 'paragraph', footnoteContent );
modelWriter.remove( contents );
@ -155,7 +155,7 @@ export default class FootnoteEditing extends Plugin {
* which triggers the `updateReferenceIds` method. modelWriter is passed in to batch these changes with
* the ones that instantiated them, such that the set can be undone with a single action.
*/
private _removeFootnote( modelWriter: Writer, footnote: ModelElement ) {
private _removeFootnote( modelWriter: ModelWriter, footnote: ModelElement ) {
// delete the current footnote and its references,
// and renumber subsequent footnotes.
if ( !this.editor ) {
@ -212,7 +212,7 @@ export default class FootnoteEditing extends Plugin {
* all references are deleted. modelWriter is passed in to batch these changes with
* the ones that instantiated them, such that the set can be undone with a single action.
*/
private _removeReferences( modelWriter: Writer, footnoteId: string | undefined = undefined ) {
private _removeReferences( modelWriter: ModelWriter, footnoteId: string | undefined = undefined ) {
const removeList: Array<any> = [];
if ( !this.rootElement ) {
throw new Error( 'Document has no root element.' );

View File

@ -1,4 +1,4 @@
import { Command, type ModelElement, type ModelRootElement, type Writer } from "ckeditor5";
import { Command, type ModelElement, type ModelRootElement, type ModelWriter } from "ckeditor5";
import { ATTRIBUTES, ELEMENTS } from './constants.js';
import { modelQueryElement } from './utils.js';
@ -82,7 +82,7 @@ export default class InsertFootnoteCommand extends Command {
/**
* Returns the footnote section if it exists, or creates on if it doesn't.
*/
private _getFootnoteSection( writer: Writer, rootElement: ModelRootElement ): ModelElement {
private _getFootnoteSection( writer: ModelWriter, rootElement: ModelRootElement ): ModelElement {
const footnoteSection = modelQueryElement( this.editor, rootElement, element =>
element.is( 'element', ELEMENTS.footnoteSection )
);