import { EventEmitter } from '@angular/core'; import { ElementRef, NgZone } from '@angular/core'; import { EmojiText, emSegment } from '@wizdm/emoji/text'; import { EmojiUtils } from '@wizdm/emoji/utils'; import { OnDestroy } from '@angular/core'; /** @dynamic - tells ngc to ignore the error on type Document generated by strictEmitMetadata: true */ export declare class EmojiInput extends EmojiText implements OnDestroy { private document; private elref; private zone; private start; private end; constructor(document: Document, elref: ElementRef, zone: NgZone, utils: EmojiUtils); /** True whenever the curernt selection is collapsed in a cursor */ get collapsed(): boolean; /** Input's HTMLElement */ get element(): HTMLElement; /** The Document's Selection object */ private get selection(); /** The Window object */ private get window(); /** True whenever the platform is Mac, iPhone or iPad */ private get mac(); /** True whenever this input has focus */ get focused(): boolean; /** Sets the focus on the input's element */ focus(): void; /** Removes focus from the input's element; keystrokes will subsequently go nowhere. */ blur(): void; get editable(): string; get showPlaceholder(): boolean; /** The placeholder text */ placeholder: string; /** The input value */ set value(value: string); ngOnDestroy(): void; /** Emits the new text on changes */ valueChange: EventEmitter; /** Disables the input */ set disableInput(value: boolean); disabled: boolean; /** Marks the input as required */ set requireInput(value: boolean); required: boolean; /** Selects the newline mode. * - None: enter does nothig. * - Always: enter always inserts a new line. * - Shift: enter inserts newline in conjunction with the shift key only */ newline: 'none' | 'always' | 'shift'; /** Undo history bouncing time */ historyTime: number; /** Undo history limits */ historyLimit: number; beforeInput(ev: InputEvent): boolean; keyDown(ev: KeyboardEvent): boolean; /** Handles keayboard accellerators */ private keyAccellerators; editCut(ev: ClipboardEvent): boolean; editCopy(ev: ClipboardEvent): boolean; editPaste(ev: ClipboardEvent): boolean; /** Compiles the input text into segment accounting for multiple lines */ protected compile(source: string): number; /** Wait for the current queue of microtaks to be emptied. The async funtion will than be called after the rendering completed */ private whenDone; /** Selects the text between start and end when specified. * Sets the cursor position otherwise */ select(start: number, end?: number): this; /** Insert a new text at the current cursor position */ insert(key: string): this; /** Deletes the current selection (Del-like) */ private del; /** Deletes the previous character (Backspace-like) */ backspace(): this; /** Internal insertion/deletion helper */ private ins; /** Updates the value of the text and selection */ private update; /** Moves the given selection index ahead by one character */ private next; /** Moves the given selection index back by one character */ private prev; /** Sorts the selection edges */ private sort; /** Queries the current selection */ private query; /** Applies the current selection back to the dom */ private apply; /** Forces the cursor position to fall right before or after the emoji image the user clicked onto */ cursorAt(segment: emSegment, at: 'left' | 'right'): void; /** Selection helper function: Computes the absolute offset from the given segment and relative offset */ private abs; /** Computes the absolute text offset from the Node/offset dom selection pair */ private offset; /** Computes a Node/offset dom selection pair from an absolute offset */ private range; /** Returns the text associated with the given node */ private nodeText; /********** HISTORY UNDO/REDO ***********/ private store$; private history; private timeIndex; private sub$; /** Clears the history buffer */ private clearHistory; /** Initilizes the history buffer */ private enableHistory; /** Stores a snapshot in the undo/redo history buffer * @param force (option) when true forces the storage unconditionally. * Storage will be performed conditionally to the time elapsed since * the last modification otherwise. */ private store; /** Returns true whenever the last modifications can be undone */ private get undoable(); /** Undoes the latest changes. It requires enableHistory() to be called */ private undo; /** Returns true whenever the last undone modifications can be redone */ private get redoable(); /** Redoes the last undone modifications. It requires enableHistory() to be called */ private redo; }