react-simple-keyboard 3.4.8 → 3.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,721 @@
1
- import Keyboard from "simple-keyboard";
2
- export interface KeyboardReactInterface extends Keyboard {
3
- options: Keyboard["options"] & {
4
- keyboardRef?: (r: any) => void;
1
+
2
+ export interface KeyboardReactInterface extends SimpleKeyboard {
3
+ options: SimpleKeyboard["options"] & {
4
+ // eslint-disable-next-line no-unused-vars
5
+ keyboardRef?: (r: any) => void;
5
6
  };
7
+ }
8
+ // Generated by dts-bundle v0.7.3
9
+ /**
10
+ * Root class for simple-keyboard.
11
+ * This class:
12
+ * - Parses the options
13
+ * - Renders the rows and buttons
14
+ * - Handles button functionality
15
+ */
16
+ export class SimpleKeyboard {
17
+ input: KeyboardInput;
18
+ options: KeyboardOptions;
19
+ utilities: any;
20
+ caretPosition: number | null;
21
+ caretPositionEnd: number | null;
22
+ keyboardDOM: KeyboardElement;
23
+ keyboardPluginClasses: string;
24
+ keyboardDOMClass: string;
25
+ buttonElements: KeyboardButtonElements;
26
+ currentInstanceName: string;
27
+ allKeyboardInstances: {
28
+ [key: string]: SimpleKeyboard;
29
+ };
30
+ keyboardInstanceNames: string[];
31
+ isFirstKeyboardInstance: boolean;
32
+ physicalKeyboard: PhysicalKeyboard;
33
+ modules: {
34
+ [key: string]: any;
35
+ };
36
+ activeButtonClass: string;
37
+ holdInteractionTimeout: number;
38
+ holdTimeout: number;
39
+ isMouseHold: boolean;
40
+ initialized: boolean;
41
+ candidateBox: CandidateBox | null;
42
+ keyboardRowsDOM: KeyboardElement;
43
+ defaultName: string;
44
+ activeInputElement: HTMLInputElement | HTMLTextAreaElement | null;
45
+ /**
46
+ * Creates an instance of SimpleKeyboard
47
+ * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.
48
+ */
49
+ constructor(selectorOrOptions?: string | HTMLDivElement | KeyboardOptions, keyboardOptions?: KeyboardOptions);
50
+ /**
51
+ * parseParams
52
+ */
53
+ handleParams: (selectorOrOptions?: string | HTMLDivElement | KeyboardOptions | undefined, keyboardOptions?: KeyboardOptions | undefined) => {
54
+ keyboardDOMClass: string;
55
+ keyboardDOM: KeyboardElement;
56
+ options: Partial<KeyboardOptions | undefined>;
57
+ };
58
+ /**
59
+ * Getters
60
+ */
61
+ getOptions: () => KeyboardOptions;
62
+ getCaretPosition: () => number | null;
63
+ getCaretPositionEnd: () => number | null;
64
+ /**
65
+ * Changes the internal caret position
66
+ * @param {number} position The caret's start position
67
+ * @param {number} positionEnd The caret's end position
68
+ */
69
+ setCaretPosition(position: number | null, endPosition?: number | null): void;
70
+ /**
71
+ * Retrieve the candidates for a given input
72
+ * @param input The input string to check
73
+ */
74
+ getInputCandidates(input: string): {
75
+ candidateKey: string;
76
+ candidateValue: string;
77
+ } | Record<string, never>;
78
+ /**
79
+ * Shows a suggestion box with a list of candidate words
80
+ * @param candidates The chosen candidates string as defined in the layoutCandidates option
81
+ * @param targetElement The element next to which the candidates box will be shown
82
+ */
83
+ showCandidatesBox(candidateKey: string, candidateValue: string, targetElement: KeyboardElement): void;
84
+ /**
85
+ * Handles clicks made to keyboard buttons
86
+ * @param {string} button The button's layout name.
87
+ */
88
+ handleButtonClicked(button: string, e?: KeyboardHandlerEvent): void;
89
+ /**
90
+ * Handles button mousedown
91
+ */
92
+ handleButtonMouseDown(button: string, e: KeyboardHandlerEvent): void;
93
+ /**
94
+ * Handles button mouseup
95
+ */
96
+ handleButtonMouseUp(button?: string, e?: KeyboardHandlerEvent): void;
97
+ /**
98
+ * Handles container mousedown
99
+ */
100
+ handleKeyboardContainerMouseDown(e: KeyboardHandlerEvent): void;
101
+ /**
102
+ * Handles button hold
103
+ */
104
+ handleButtonHold(button: string): void;
105
+ /**
106
+ * Send a command to all simple-keyboard instances (if you have several instances).
107
+ */
108
+ syncInstanceInputs(): void;
109
+ /**
110
+ * Clear the keyboard’s input.
111
+ * @param {string} [inputName] optional - the internal input to select
112
+ */
113
+ clearInput(inputName?: string): void;
114
+ /**
115
+ * Get the keyboard’s input (You can also get it from the onChange prop).
116
+ * @param {string} [inputName] optional - the internal input to select
117
+ */
118
+ getInput(inputName?: string, skipSync?: boolean): string;
119
+ /**
120
+ * Get all simple-keyboard inputs
121
+ */
122
+ getAllInputs(): KeyboardInput;
123
+ /**
124
+ * Set the keyboard’s input.
125
+ * @param {string} input the input value
126
+ * @param {string} inputName optional - the internal input to select
127
+ */
128
+ setInput(input: string, inputName?: string, skipSync?: boolean): void;
129
+ /**
130
+ * Replace the input object (`keyboard.input`)
131
+ * @param {object} inputObj The input object
132
+ */
133
+ replaceInput(inputObj: KeyboardInput): void;
134
+ /**
135
+ * Set new option or modify existing ones after initialization.
136
+ * @param {object} options The options to set
137
+ */
138
+ setOptions(options?: {}): void;
139
+ /**
140
+ * Detecting changes to non-function options
141
+ * This allows us to ascertain whether a button re-render is needed
142
+ */
143
+ changedOptions(newOptions: Partial<KeyboardOptions>): string[];
144
+ /**
145
+ * Executing actions depending on changed options
146
+ * @param {object} options The options to set
147
+ */
148
+ onSetOptions(changedOptions?: string[]): void;
149
+ /**
150
+ * Remove all keyboard rows and reset keyboard values.
151
+ * Used internally between re-renders.
152
+ */
153
+ resetRows(): void;
154
+ /**
155
+ * Send a command to all simple-keyboard instances at once (if you have multiple instances).
156
+ * @param {function(instance: object, key: string)} callback Function to run on every instance
157
+ */
158
+ dispatch(callback: (instance: SimpleKeyboard, key?: string) => void): void;
159
+ /**
160
+ * Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.
161
+ * @param {string} buttons List of buttons to select (separated by a space).
162
+ * @param {string} className Classes to give to the selected buttons (separated by space).
163
+ */
164
+ addButtonTheme(buttons: string, className: string): void;
165
+ /**
166
+ * Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.
167
+ * @param {string} buttons List of buttons to select (separated by a space).
168
+ * @param {string} className Classes to give to the selected buttons (separated by space).
169
+ */
170
+ removeButtonTheme(buttons: string, className: string): void;
171
+ /**
172
+ * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.
173
+ * @param {string} button The button layout name to select
174
+ */
175
+ getButtonElement(button: string): KeyboardElement | KeyboardElement[] | undefined;
176
+ /**
177
+ * This handles the "inputPattern" option
178
+ * by checking if the provided inputPattern passes
179
+ */
180
+ inputPatternIsValid(inputVal: string): boolean;
181
+ /**
182
+ * Handles simple-keyboard event listeners
183
+ */
184
+ setEventListeners(): void;
185
+ /**
186
+ * Event Handler: KeyUp
187
+ */
188
+ handleKeyUp(event: KeyboardHandlerEvent): void;
189
+ /**
190
+ * Event Handler: KeyDown
191
+ */
192
+ handleKeyDown(event: KeyboardHandlerEvent): void;
193
+ /**
194
+ * Event Handler: MouseUp
195
+ */
196
+ handleMouseUp(event: KeyboardHandlerEvent): void;
197
+ /**
198
+ * Event Handler: TouchEnd
199
+ */
200
+ handleTouchEnd(event: KeyboardHandlerEvent): void;
201
+ /**
202
+ * Event Handler: Select
203
+ */
204
+ handleSelect(event: KeyboardHandlerEvent): void;
205
+ /**
206
+ * Event Handler: SelectionChange
207
+ */
208
+ handleSelectionChange(event: KeyboardHandlerEvent): void;
209
+ /**
210
+ * Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered
211
+ */
212
+ caretEventHandler(event: KeyboardHandlerEvent): void;
213
+ /**
214
+ * Execute an operation on each button
215
+ */
216
+ recurseButtons(fn: any): void;
217
+ /**
218
+ * Destroy keyboard listeners and DOM elements
219
+ */
220
+ destroy(): void;
221
+ /**
222
+ * Process buttonTheme option
223
+ */
224
+ getButtonThemeClasses(button: string): string[];
225
+ /**
226
+ * Process buttonAttributes option
227
+ */
228
+ setDOMButtonAttributes(button: string, callback: any): void;
229
+ onTouchDeviceDetected(): void;
230
+ /**
231
+ * Disabling contextual window for hg-button
232
+ */
233
+ disableContextualWindow(): void;
234
+ /**
235
+ * Process autoTouchEvents option
236
+ */
237
+ processAutoTouchEvents(): void;
238
+ /**
239
+ * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).
240
+ */
241
+ onInit(): void;
242
+ /**
243
+ * Executes the callback function before a simple-keyboard render.
244
+ */
245
+ beforeFirstRender(): void;
246
+ /**
247
+ * Executes the callback function before a simple-keyboard render.
248
+ */
249
+ beforeRender(): void;
250
+ /**
251
+ * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).
252
+ */
253
+ onRender(): void;
254
+ /**
255
+ * Executes the callback function once all modules have been loaded
256
+ */
257
+ onModulesLoaded(): void;
258
+ /**
259
+ * Register module
260
+ */
261
+ registerModule: (name: string, initCallback: any) => void;
262
+ /**
263
+ * Load modules
264
+ */
265
+ loadModules(): void;
266
+ /**
267
+ * Get module prop
268
+ */
269
+ getModuleProp(name: string, prop: string): any;
270
+ /**
271
+ * getModulesList
272
+ */
273
+ getModulesList(): string[];
274
+ /**
275
+ * Parse Row DOM containers
276
+ */
277
+ parseRowDOMContainers(rowDOM: HTMLDivElement, rowIndex: number, containerStartIndexes: number[], containerEndIndexes: number[]): HTMLDivElement;
278
+ /**
279
+ * getKeyboardClassString
280
+ */
281
+ getKeyboardClassString: (...baseDOMClasses: any[]) => string;
282
+ /**
283
+ * Renders rows and buttons as per options
284
+ */
285
+ render(): void;
286
+ }
287
+ /**
288
+ * Physical Keyboard Service
289
+ */
290
+ export class PhysicalKeyboard {
291
+ getOptions: () => KeyboardOptions;
292
+ dispatch: any;
293
+ /**
294
+ * Creates an instance of the PhysicalKeyboard service
295
+ */
296
+ constructor({ dispatch, getOptions }: PhysicalKeyboardParams);
297
+ handleHighlightKeyDown(event: KeyboardEvent): void;
298
+ handleHighlightKeyUp(event: KeyboardEvent): void;
299
+ /**
300
+ * Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
301
+ * @param {object} event The KeyboardEvent
302
+ */
303
+ getSimpleKeyboardLayoutKey(event: KeyboardEvent): string;
304
+ /**
305
+ * Retrieve key from keyCode
306
+ */
307
+ keyCodeToKey(keyCode: number): string | undefined;
308
+ }
309
+ export interface KeyboardLayoutObject {
310
+ [key: string]: string[];
311
+ }
312
+ export type KeyboardButtonTheme = {
313
+ class: string;
314
+ buttons: string;
315
+ } | null;
316
+ export interface KeyboardButtonAttributes {
317
+ attribute: string;
318
+ value: string;
319
+ buttons: string;
320
+ }
321
+ export interface KeyboardInput {
322
+ [key: string]: string;
323
+ }
324
+ export type CandidateBoxParams = {
325
+ utilities: Utilities;
326
+ };
327
+ export type CandidateBoxShowParams = {
328
+ candidateValue: string;
329
+ targetElement: KeyboardElement;
330
+ onSelect: (selectedCandidate: string, e: MouseEvent) => void;
331
+ };
332
+ export type CandidateBoxRenderParams = {
333
+ candidateListPages: string[][];
334
+ targetElement: KeyboardElement;
335
+ pageIndex: number;
336
+ nbPages: number;
337
+ onItemSelected: (selectedCandidate: string, e: MouseEvent) => void;
338
+ };
339
+ export type KeyboardElement = HTMLDivElement | HTMLButtonElement;
340
+ export type KeyboardHandlerEvent = any;
341
+ export interface KeyboardButtonElements {
342
+ [key: string]: KeyboardElement[];
343
+ }
344
+ export interface UtilitiesParams {
345
+ getOptions: () => KeyboardOptions;
346
+ getCaretPosition: () => number | null;
347
+ getCaretPositionEnd: () => number | null;
348
+ dispatch: any;
349
+ }
350
+ export interface PhysicalKeyboardParams {
351
+ getOptions: () => KeyboardOptions;
352
+ dispatch: any;
353
+ }
354
+ export interface KeyboardOptions {
355
+ /**
356
+ * Modify the keyboard layout.
357
+ */
358
+ layout?: KeyboardLayoutObject;
359
+ /**
360
+ * Specifies which layout should be used.
361
+ */
362
+ layoutName?: string;
363
+ /**
364
+ * Replaces variable buttons (such as `{bksp}`) with a human-friendly name (e.g.: `backspace`).
365
+ */
366
+ display?: {
367
+ [button: string]: string;
368
+ };
369
+ /**
370
+ * By default, when you set the display property, you replace the default one. This setting merges them instead.
371
+ */
372
+ mergeDisplay?: boolean;
373
+ /**
374
+ * A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.
375
+ */
376
+ theme?: string;
377
+ /**
378
+ * A prop to add your own css classes to one or several buttons.
379
+ */
380
+ buttonTheme?: KeyboardButtonTheme[];
381
+ /**
382
+ * A prop to add your own attributes to one or several buttons.
383
+ */
384
+ buttonAttributes?: KeyboardButtonAttributes[];
385
+ /**
386
+ * Runs a `console.log` every time a key is pressed. Displays the buttons pressed and the current input.
387
+ */
388
+ debug?: boolean;
389
+ /**
390
+ * Specifies whether clicking the "ENTER" button will input a newline (`\n`) or not.
391
+ */
392
+ newLineOnEnter?: boolean;
393
+ /**
394
+ * Specifies whether clicking the "TAB" button will input a tab character (`\t`) or not.
395
+ */
396
+ tabCharOnTab?: boolean;
397
+ /**
398
+ * Allows you to use a single simple-keyboard instance for several inputs.
399
+ */
400
+ inputName?: string;
401
+ /**
402
+ * `number`: Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.
403
+ *
404
+ * `{ [inputName: string]: number }`: Restrains simple-keyboard’s individual inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.
405
+ */
406
+ maxLength?: any;
407
+ /**
408
+ * When set to true, this option synchronizes the internal input of every simple-keyboard instance.
409
+ */
410
+ syncInstanceInputs?: boolean;
411
+ /**
412
+ * Enable highlighting of keys pressed on physical keyboard.
413
+ */
414
+ physicalKeyboardHighlight?: boolean;
415
+ /**
416
+ * Calls handler for a button highlighted by physicalKeyboardHighlight
417
+ * In other words, this calls keyboard.handleButtonClicked(buttonName) on the highlighted button
418
+ */
419
+ physicalKeyboardHighlightPress?: boolean;
420
+ /**
421
+ * Trigger click on a button's element when using physicalKeyboardHighlightPress
422
+ * In other words, this calls button.click() on the highlighted button
423
+ */
424
+ physicalKeyboardHighlightPressUseClick?: boolean;
425
+ /**
426
+ * Define the text color that the physical keyboard highlighted key should have.
427
+ */
428
+ physicalKeyboardHighlightTextColor?: string;
429
+ /**
430
+ * Define the background color that the physical keyboard highlighted key should have.
431
+ */
432
+ physicalKeyboardHighlightBgColor?: string;
433
+ /**
434
+ * Calling preventDefault for the mousedown events keeps the focus on the input.
435
+ */
436
+ preventMouseDownDefault?: boolean;
437
+ /**
438
+ * Calling preventDefault for the mouseup events.
439
+ */
440
+ preventMouseUpDefault?: boolean;
441
+ /**
442
+ * Stops pointer down events on simple-keyboard buttons from bubbling to parent elements.
443
+ */
444
+ stopMouseDownPropagation?: boolean;
445
+ /**
446
+ * Stops pointer up events on simple-keyboard buttons from bubbling to parent elements.
447
+ */
448
+ stopMouseUpPropagation?: boolean;
449
+ /**
450
+ * Render buttons as a button element instead of a div element.
451
+ */
452
+ useButtonTag?: boolean;
453
+ /**
454
+ * A prop to ensure characters are always be added/removed at the end of the string.
455
+ */
456
+ disableCaretPositioning?: boolean;
457
+ /**
458
+ * Restrains input(s) change to the defined regular expression pattern.
459
+ */
460
+ inputPattern?: any;
461
+ /**
462
+ * Instructs simple-keyboard to use touch events instead of click events.
463
+ */
464
+ useTouchEvents?: boolean;
465
+ /**
466
+ * Enable useTouchEvents automatically when touch device is detected.
467
+ */
468
+ autoUseTouchEvents?: boolean;
469
+ /**
470
+ * Opt out of PointerEvents handling, falling back to the prior mouse event logic.
471
+ */
472
+ useMouseEvents?: boolean;
473
+ /**
474
+ * Disable button hold action.
475
+ */
476
+ disableButtonHold?: boolean;
477
+ /**
478
+ * Adds unicode right-to-left control characters to input return values.
479
+ */
480
+ rtl?: boolean;
481
+ /**
482
+ * Enable input method editor candidate list support.
483
+ */
484
+ enableLayoutCandidates?: boolean;
485
+ /**
486
+ * Character suggestions to be shown on certain key presses
487
+ */
488
+ layoutCandidates?: {
489
+ [key: string]: string;
490
+ };
491
+ /**
492
+ * Exclude buttons from layout
493
+ */
494
+ excludeFromLayout?: {
495
+ [key: string]: string[];
496
+ };
497
+ /**
498
+ * Determine size of layout candidate list
499
+ */
500
+ layoutCandidatesPageSize?: number;
501
+ /**
502
+ * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).
503
+ */
504
+ onRender?: (instance?: SimpleKeyboard) => void;
505
+ /**
506
+ * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).
507
+ */
508
+ onInit?: (instance?: SimpleKeyboard) => void;
509
+ /**
510
+ * Retrieves the current input
511
+ */
512
+ onChange?: (input: string, e?: MouseEvent) => any;
513
+ /**
514
+ * Retrieves all inputs
515
+ */
516
+ onChangeAll?: (inputObj: KeyboardInput, e?: MouseEvent) => any;
517
+ /**
518
+ * Module options can have any format
519
+ */
520
+ [name: string]: any;
521
+ }
522
+ export class CandidateBox {
523
+ utilities: Utilities;
524
+ candidateBoxElement: HTMLDivElement;
525
+ pageIndex: number;
526
+ pageSize: number;
527
+ constructor({ utilities }: CandidateBoxParams);
528
+ destroy(): void;
529
+ show({ candidateValue, targetElement, onSelect, }: CandidateBoxShowParams): void;
530
+ renderPage({ candidateListPages, targetElement, pageIndex, nbPages, onItemSelected, }: CandidateBoxRenderParams): void;
531
+ }
532
+ /**
533
+ * Utility Service
534
+ */
535
+ export class Utilities {
536
+ getOptions: () => KeyboardOptions;
537
+ getCaretPosition: () => number | null;
538
+ getCaretPositionEnd: () => number | null;
539
+ dispatch: any;
540
+ maxLengthReached: boolean;
541
+ /**
542
+ * Creates an instance of the Utility service
543
+ */
544
+ constructor({ getOptions, getCaretPosition, getCaretPositionEnd, dispatch, }: UtilitiesParams);
545
+ /**
546
+ * Retrieve button type
547
+ *
548
+ * @param {string} button The button's layout name
549
+ * @return {string} The button type
550
+ */
551
+ getButtonType(button: string): string;
552
+ /**
553
+ * Adds default classes to a given button
554
+ *
555
+ * @param {string} button The button's layout name
556
+ * @return {string} The classes to be added to the button
557
+ */
558
+ getButtonClass(button: string): string;
559
+ /**
560
+ * Default button display labels
561
+ */
562
+ getDefaultDiplay(): {
563
+ "{bksp}": string;
564
+ "{backspace}": string;
565
+ "{enter}": string;
566
+ "{shift}": string;
567
+ "{shiftleft}": string;
568
+ "{shiftright}": string;
569
+ "{alt}": string;
570
+ "{s}": string;
571
+ "{tab}": string;
572
+ "{lock}": string;
573
+ "{capslock}": string;
574
+ "{accept}": string;
575
+ "{space}": string;
576
+ "{//}": string;
577
+ "{esc}": string;
578
+ "{escape}": string;
579
+ "{f1}": string;
580
+ "{f2}": string;
581
+ "{f3}": string;
582
+ "{f4}": string;
583
+ "{f5}": string;
584
+ "{f6}": string;
585
+ "{f7}": string;
586
+ "{f8}": string;
587
+ "{f9}": string;
588
+ "{f10}": string;
589
+ "{f11}": string;
590
+ "{f12}": string;
591
+ "{numpaddivide}": string;
592
+ "{numlock}": string;
593
+ "{arrowup}": string;
594
+ "{arrowleft}": string;
595
+ "{arrowdown}": string;
596
+ "{arrowright}": string;
597
+ "{prtscr}": string;
598
+ "{scrolllock}": string;
599
+ "{pause}": string;
600
+ "{insert}": string;
601
+ "{home}": string;
602
+ "{pageup}": string;
603
+ "{delete}": string;
604
+ "{forwarddelete}": string;
605
+ "{end}": string;
606
+ "{pagedown}": string;
607
+ "{numpadmultiply}": string;
608
+ "{numpadsubtract}": string;
609
+ "{numpadadd}": string;
610
+ "{numpadenter}": string;
611
+ "{period}": string;
612
+ "{numpaddecimal}": string;
613
+ "{numpad0}": string;
614
+ "{numpad1}": string;
615
+ "{numpad2}": string;
616
+ "{numpad3}": string;
617
+ "{numpad4}": string;
618
+ "{numpad5}": string;
619
+ "{numpad6}": string;
620
+ "{numpad7}": string;
621
+ "{numpad8}": string;
622
+ "{numpad9}": string;
623
+ };
624
+ /**
625
+ * Returns the display (label) name for a given button
626
+ *
627
+ * @param {string} button The button's layout name
628
+ * @param {object} display The provided display option
629
+ * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.
630
+ */
631
+ getButtonDisplayName(button: string, display: KeyboardOptions["display"], mergeDisplay: boolean): string;
632
+ /**
633
+ * Returns the updated input resulting from clicking a given button
634
+ *
635
+ * @param {string} button The button's layout name
636
+ * @param {string} input The input string
637
+ * @param {number} caretPos The cursor's current position
638
+ * @param {number} caretPosEnd The cursor's current end position
639
+ * @param {boolean} moveCaret Whether to update simple-keyboard's cursor
640
+ */
641
+ getUpdatedInput(button: string, input: string, caretPos: number, caretPosEnd?: number, moveCaret?: boolean): string;
642
+ /**
643
+ * Moves the cursor position by a given amount
644
+ *
645
+ * @param {number} length Represents by how many characters the input should be moved
646
+ * @param {boolean} minus Whether the cursor should be moved to the left or not.
647
+ */
648
+ updateCaretPos(length: number, minus?: boolean): void;
649
+ /**
650
+ * Action method of updateCaretPos
651
+ *
652
+ * @param {number} length Represents by how many characters the input should be moved
653
+ * @param {boolean} minus Whether the cursor should be moved to the left or not.
654
+ */
655
+ updateCaretPosAction(length: number, minus?: boolean): number | null;
656
+ /**
657
+ * Adds a string to the input at a given position
658
+ *
659
+ * @param {string} source The source input
660
+ * @param {string} str The string to add
661
+ * @param {number} position The (cursor) position where the string should be added
662
+ * @param {boolean} moveCaret Whether to update simple-keyboard's cursor
663
+ */
664
+ addStringAt(source: string, str: string, position?: number, positionEnd?: number, moveCaret?: boolean): string;
665
+ /**
666
+ * Check whether the button is a standard button
667
+ */
668
+ isStandardButton: (button: string) => boolean | "";
669
+ /**
670
+ * Removes an amount of characters before a given position
671
+ *
672
+ * @param {string} source The source input
673
+ * @param {number} position The (cursor) position from where the characters should be removed
674
+ * @param {boolean} moveCaret Whether to update simple-keyboard's cursor
675
+ */
676
+ removeAt(source: string, position?: number, positionEnd?: number, moveCaret?: boolean): string;
677
+ /**
678
+ * Removes an amount of characters after a given position
679
+ *
680
+ * @param {string} source The source input
681
+ * @param {number} position The (cursor) position from where the characters should be removed
682
+ */
683
+ removeForwardsAt(source: string, position?: number, positionEnd?: number, moveCaret?: boolean): string;
684
+ /**
685
+ * Determines whether the maxLength has been reached. This function is called when the maxLength option it set.
686
+ *
687
+ * @param {object} inputObj
688
+ * @param {string} updatedInput
689
+ */
690
+ handleMaxLength(inputObj: KeyboardInput, updatedInput: string): boolean | undefined;
691
+ /**
692
+ * Gets the current value of maxLengthReached
693
+ */
694
+ isMaxLengthReached(): boolean;
695
+ /**
696
+ * Determines whether a touch device is being used
697
+ */
698
+ isTouchDevice(): number | true;
699
+ /**
700
+ * Determines whether pointer events are supported
701
+ */
702
+ pointerEventsSupported(): boolean;
703
+ /**
704
+ * Bind all methods in a given class
705
+ */
706
+ static bindMethods(myClass: any, instance: any): void;
707
+ /**
708
+ * Transforms an arbitrary string to camelCase
709
+ *
710
+ * @param {string} str The string to transform.
711
+ */
712
+ camelCase(str: string): string;
713
+ /**
714
+ * Split array into chunks
715
+ */
716
+ chunkArray<T>(arr: T[], size: number): T[][];
717
+ /**
718
+ * Reusable empty function
719
+ */
720
+ static noop: () => void;
6
721
  }