UNPKG

@syncfusion/ej2-documenteditor

Version:

Feature-rich document editor control with built-in support for context menu, options pane and dialogs.

478 lines (477 loc) 12.7 kB
import { WParagraphFormat } from '../format/paragraph-format'; import { WSectionFormat } from '../format/section-format'; import { WCharacterFormat } from '../format/character-format'; import { WListFormat } from '../format/list-format'; import { WListLevel } from '../list/list-level'; import { EditorHistory } from '../index'; import { IWidget, FieldElementBox, TableWidget, TableRowWidget, BookmarkElementBox, EditRangeStartElementBox, CommentElementBox, FormField } from '../viewer/page'; import { DocumentEditor } from '../../document-editor'; import { Action } from '../../index'; import { TextPosition } from '../index'; import { ElementBox } from '../viewer/page'; import { WTableFormat, WRowFormat, WCellFormat } from '../format/index'; import { DocumentHelper } from '../viewer'; import { ProtectionType } from '../../base/types'; /** * @private */ export declare class BaseHistoryInfo { private ownerIn; documentHelper: DocumentHelper; private actionIn; private removedNodesIn; private modifiedPropertiesIn; private modifiedNodeLength; private selectionStartIn; private selectionEndIn; private insertPositionIn; private endPositionIn; private currentPropertyIndex; private ignoredWord; insertedText: string; insertedData: ImageInfo; type: string; headerFooterStart: number; headerFooterEnd: number; private tableRelatedLength; cellOperation: Operation[]; format: string; fieldBegin: FieldElementBox; private startIndex; private insertIndex; private endIndex; ignoreStartOffset: boolean; insertedElement: ElementBox; splittedRevisions: MarkerInfo[]; isAcceptOrReject: string; insertedNodes: IWidget[]; pasteContent: string; insertedFormat: Object; private collabStart; private collabEnd; private isremovedNodes; /** * @private */ lastElementRevision: ElementBox; /** * @private */ endRevisionLogicalIndex: string; /** * @private */ markerData: MarkerInfo[]; /** * @private */ formFieldType: string; /** * @private */ isEditHyperlink: boolean; /** * @private */ dropDownIndex: number; readonly owner: DocumentEditor; readonly editorHistory: EditorHistory; action: Action; readonly modifiedProperties: Object[]; readonly removedNodes: IWidget[]; selectionStart: string; selectionEnd: string; insertPosition: string; endPosition: string; constructor(node: DocumentEditor); private readonly viewer; updateSelection(): void; private updateTableSelection; private splitOperationForDelete; setBookmarkInfo(bookmark: BookmarkElementBox): void; setFormFieldInfo(field: FieldElementBox, value: string | number | boolean): void; setEditRangeInfo(editStart: EditRangeStartElementBox): void; private revertFormTextFormat; private revertFormField; private revertBookmark; private revertComment; private revertEditRangeRegion; revert(): void; private highlightListText; private removeContent; updateEndRevisionInfo(): void; private retrieveEndPosition; /** * Method to retrieve exact spitted node which is marked as last available element. * * @param {ElementBox} elementBox - Specifies the element box * @returns {ElementBox} - Returns element box */ private checkAdjacentNodeForMarkedRevision; private revertModifiedProperties; private redoAction; private revertModifiedNodes; private insertRemovedNodes; undoRevisionForElements(start: TextPosition, end: TextPosition, id: string): void; private revertResizing; private revertTableDialogProperties; addModifiedPropertiesForSection(format: WSectionFormat, property: string, value: Object): Object; addModifiedProperties(format: WCharacterFormat, property: string, value: Object): Object; addModifiedPropertiesForParagraphFormat(format: WParagraphFormat, property: string, value: Object): Object; addModifiedPropertiesForContinueNumbering(paragraphFormat: WParagraphFormat, value: Object): Object; addModifiedPropertiesForRestartNumbering(listFormat: WListFormat, value: Object): Object; addModifiedPropertiesForList(listLevel: WListLevel): Object; private revertProperties; addModifiedCellOptions(applyFormat: WCellFormat, format: WCellFormat, table: TableWidget): WCellFormat; private copyCellOptions; addModifiedTableOptions(format: WTableFormat): void; private copyTableOptions; private getProperty; private getCharacterPropertyValue; addModifiedTableProperties(format: WTableFormat, property: string, value: Object): Object; addModifiedRowProperties(rowFormat: WRowFormat, property: string, value: Object): Object; addModifiedCellProperties(cellFormat: WCellFormat, property: string, value: Object): Object; /** * @private * @returns {void} */ destroy(): void; /** * @private */ getDeleteOperationsForTrackChanges(): Operation[]; /** * @private */ getDeleteOperationForTrackChanges(element: ElementBox): Operation; /** * @private */ getActionInfo(isInvertOperation?: boolean): Operation[]; /** * @private */ private getElementAbsolutePosition; /** * @private */ getFieldOperation(): Operation[]; private getDeleteContent; private getEditHyperlinkOperation; private getPasteContentLength; /** * @private * @returns {Operation} */ getUpdateOperation(): Operation; private getResizingOperation; /** * @private * @returns {Operation} */ getDeleteOperation(action: Action, setEndIndex?: boolean, text?: string): Operation; /** * @private * @returns {Operation} */ getInsertOperation(action: Action, setEndIndex?: boolean): Operation; private getUndoRedoOperation; private getPasteOpertion; private buildTableRowCellOperation; private assignRevisionData; private createAcceptRejectOperation; private beforeInsertTableRevision; private afterInsertTableRrevision; private buildRowOperation; /** * @private */ buildRowOperationForTrackChanges(row: TableRowWidget, action?: Action): void; private buildCellOperation; private deleteColumnOperation; private getPasteMergeOperation; private deleteCell; /** * @private * @returns {Operation} */ getFormatOperation(element?: ElementBox, action?: string): Operation; private getRemovedText; private getRemovedFieldCode; private getParagraphText; private getTableText; private getRowText; /** * @private * @returns {Operation} */ getCommentOperation(operation: Operation, action: Action, comment?: CommentElementBox): Operation; /** * @private */ getDeleteCommentOperation(modifiedActions: BaseHistoryInfo[], operations: Operation[]): void; /** * @private * @returns {Operation} */ buildFormatOperation(action: Action, ischarFormat: boolean): Operation[]; /** * @private * @returns {Operation} */ getSelectedCellOperation(action: Action, ischarFormat?: boolean, isBorder?: boolean, isShading?: boolean): Operation[]; private createListFormat; private createCharacterFormat; private createParagraphFormat; /** * @private * @returns {void} */ createTableFormat(action: Action): void; /** * @private * @returns {void} */ createRowFormat(action: Action): void; /** * @private * @returns {void} */ createCellFormat(action: Action): void; private getTableFormatString; private createSectionFormat; private getRowString; private getCellString; } /** * Specifies the operation that is performed in Document Editor. * > Reserved for internal use only. */ export interface Operation { /** * Reserved for internal use only. */ action?: 'Insert' | 'Delete' | 'Format' | 'Update'; /** * Reserved for internal use only. */ offset?: number; /** * Reserved for internal use only. */ text?: string; /** * Reserved for internal use only. */ length?: number; /** * Reserved for internal use only. */ skipOperation?: boolean; /** * Reserved for internal use only. */ imageData?: ImageInfo; /** * Reserved for internal use only. */ type?: string; /** * Reserved for internal use only. */ markerData?: MarkerInfo; /** * Reserved for internal use only. */ protectionData?: ProtectionInfo; /** * Reserved for internal use only. */ enableTrackChanges?: boolean; /** * Reserved for internal use only. */ pasteContent?: string; /** * Reserved for internal use only. */ styleData?: string; /** * Reserved for internal use only. */ listData?: string; /** * Reserved for internal use only. */ format?: string; } /** * Specifies the information about the image data. * > Reserved for internal use only. */ export interface ImageInfo { /** * Reserved for internal use only. */ imageString?: string; /** * Reserved for internal use only. */ height?: number; /** * Reserved for internal use only. */ width?: number; /** * Reserved for internal use only. */ metaString?: string; } /** * Specifies the information about marker elements. * > Reserved for internal use only. */ export interface MarkerInfo { /** * Reserved for internal use only. */ bookmarkName?: string; /** * Reserved for internal use only. */ type?: string; /** * Reserved for internal use only. */ user?: string; /** * Reserved for internal use only. */ editRangeId?: number; /** * Reserved for internal use only. */ skipOperation?: boolean; /** * Reserved for internal use only. */ columnFirst?: string; /** * Reserved for internal use only. */ columnLast?: string; /** * Reserved for internal use only. */ isAfterParagraphMark?: boolean; /** * Reserved for internal use only. */ isAfterTableMark?: boolean; /** * Reserved for internal use only. */ isAfterRowMark?: boolean; /** * Reserved for internal use only. */ isAfterCellMark?: boolean; /** * Reserved for internal use only. */ formFieldData?: FormField; /** * Reserved for internal use only. */ checkBoxValue?: boolean; /** * Reserved for internal use only. */ commentId?: string; /** * Reserved for internal use only. */ author?: string; /** * Reserved for internal use only. */ date?: string; /** * Reserved for internal use only. */ initial?: string; /** * Reserved for internal use only. */ done?: boolean; /** * Reserved for internal use only. */ commentIndex?: number; /** * Reserved for internal use only. */ commentAction?: string; /** * Reserved for internal use only. */ text?: string; /** * Reserved for internal use only. */ ownerCommentId?: string; /** * Reserved for internal use only. */ isReply?: boolean; /** * Reserved for internal use only. */ revisionId?: string; /** * Reserved for internal use only. */ revisionType?: string; /** * Reserved for internal use only. */ isAcceptOrReject?: string; /** * Reserved for internal use only. */ splittedRevisions?: MarkerInfo[]; /** * Reserved for internal use only. */ removedIds?: string[]; /** * Reserved for internal use only. */ dropDownIndex?: number; /** * Reserved for internal use only. */ isSkipTracking?: boolean; /** * Reserved for internal use only. */ revisionForFootnoteEndnoteContent?: MarkerInfo; } /** * Specifies the information about the protection type. * > Reserved for internal use. */ export interface ProtectionInfo { /** * Reserved for internal use only. */ saltValue?: string; /** * Reserved for internal use only. */ hashValue?: string; /** * Reserved for internal use only. */ protectionType?: ProtectionType; }