UNPKG

augnitosdk

Version:

AugnitoSDK lets you make use of the Speech Recognition AI. You can edit, format and complete reports at the speed of human speech, with the best-in-class accuracy

64 lines (63 loc) 4.29 kB
import { ActionRecipe } from '../../recipe'; import { EditorType } from '../core/EditorType'; import { BaseInteropProcessor } from './BaseInteropProcessor'; import { InteropProcessor } from './InteropProcessor'; import { AugnitoRange, WrappedRange, WrappedRangeFindOptions, WrappedSelection } from 'augnito-dom-ranges'; import { FindLastCharType, TraverseTextNodeResult } from '../types/CommonTypes'; import { DynamicSelect } from '../types/DynamicSelect'; declare abstract class CommonContentEditableProcessor extends BaseInteropProcessor implements InteropProcessor { protected _augnitoRange: AugnitoRange; protected _editorDocument: Document | null; protected _dynamicSelect: DynamicSelect | null; protected customLineBreakFunction?(): void; protected customTextWriteFunction?(insertText: string): void; protected customActionProcessor?(selectFor: string): boolean; protected customSelectProcessor?(recipe: Partial<ActionRecipe>): boolean; protected customCommandProcessor?(action: string): boolean; constructor(loggingEnabled: boolean); abstract get editorType(): EditorType; abstract validateDependencies(): void; processFinalResult(recipe: Partial<ActionRecipe>, editor?: Element): void; processCommand(command: Pick<ActionRecipe, 'name'> & Partial<ActionRecipe>, editor?: Element): void; /** * Inserts text at the current position * @param editorInstance The current editor * @param newProcessText The text to be inserted */ protected insertTextAtCursor(editorInstance: Document, newProcessText: string): void; protected findLastChar(editorDocument: Document): FindLastCharType; protected processSelect(recipe: Partial<ActionRecipe>, editorDocument: Document): boolean; protected processSelectForAction(selectFor: string, editorDocument: Document, DeSelectRequired?: boolean): boolean; /** * Checks if there is a selection Pending to be handled. It could be the case the user said * "Select 'criteria' and there were more than one results. If there is nothing pending, it does nothing" * @param actionRecipe The current recipe * @returns True if a badge was selected; false otherwise */ protected onBeforeProcess(actionRecipe: Partial<ActionRecipe>): boolean; private removeDynamicSelect; protected getLastLines(ItemCount: number, editorDocument: Document): WrappedRange | null; protected getLastLinesRecursive(count: number, ItemCount: number, element: ChildNode | Node | Element): ChildNode | Node | Element; protected isListElement(element: ChildNode): boolean; protected getNextInterval(item: 'word' | string, itemCount: number, editorDocument: Document): WrappedRange | null; protected getPrevInterval(item: 'word' | 'line' | string, itemCount: number, editorDocument: Document): WrappedRange | null; protected getNextWordInterval(itemCount: number, editorDocument: Document): WrappedRange; protected getPrevWordInterval(ItemCount: number, editorDocument: Document): WrappedRange; protected deSelectSelection(editorDocument: Document, atStart?: boolean, forceDeselect?: boolean): void; protected searchDynamicFiled(searchOption: WrappedRangeFindOptions): void; protected deleteSelection(editorDocument: Document | null): void; protected setSelectionRange(editorDocument: Document, range: WrappedRange): void; /** * Callback for inserting a line of text * @param editorDocument The current Editor * @param insertText The text to be inserted */ protected insertTextCallback(editorDocument: Document, insertText: string, IsAddSpace: boolean): void; protected scrollElementToView(selection: WrappedSelection): void; protected findLineBreakAtCursor: (currentNode: Node) => boolean; protected findLineBreakAtNextCursor: (currentNode: Node) => boolean; protected traverseTextNodes(moveby: 'character' | 'word', jumpRange: number, breakCondition: string[] | number, isInvert: boolean, editorDocument: Document, keepToLastStep?: boolean): TraverseTextNodeResult; static findActiveEditor(activeControl: Element): Element; private validateEditorDocument; } export { CommonContentEditableProcessor };