Build update

This commit is contained in:
Francisco Hodge 2021-04-04 17:29:44 +00:00
parent bddf3f6640
commit dd784b7fa7
6 changed files with 27 additions and 24 deletions

View File

@ -1,6 +1,6 @@
/*! /*!
* *
* simple-keyboard v3.0.26 * simple-keyboard v3.0.27
* https://github.com/hodgef/simple-keyboard * https://github.com/hodgef/simple-keyboard
* *
* Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors. * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.

File diff suppressed because one or more lines are too long

View File

@ -13,8 +13,8 @@ declare class SimpleKeyboard {
input: KeyboardInput; input: KeyboardInput;
options: KeyboardOptions; options: KeyboardOptions;
utilities: any; utilities: any;
caretPosition: number; caretPosition: number | null;
caretPositionEnd: number; caretPositionEnd: number | null;
keyboardDOM: KeyboardElement; keyboardDOM: KeyboardElement;
keyboardPluginClasses: string; keyboardPluginClasses: string;
keyboardDOMClass: string; keyboardDOMClass: string;
@ -34,8 +34,9 @@ declare class SimpleKeyboard {
holdTimeout: number; holdTimeout: number;
isMouseHold: boolean; isMouseHold: boolean;
initialized: boolean; initialized: boolean;
candidateBox: CandidateBox; candidateBox: CandidateBox | null;
keyboardRowsDOM: KeyboardElement; keyboardRowsDOM: KeyboardElement;
defaultName: string;
/** /**
* Creates an instance of SimpleKeyboard * Creates an instance of SimpleKeyboard
* @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. * @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.
@ -47,20 +48,20 @@ declare class SimpleKeyboard {
handleParams: (params: KeyboardParams) => { handleParams: (params: KeyboardParams) => {
keyboardDOMClass: string; keyboardDOMClass: string;
keyboardDOM: KeyboardElement; keyboardDOM: KeyboardElement;
options: Partial<KeyboardOptions>; options: Partial<KeyboardOptions | undefined>;
}; };
/** /**
* Getters * Getters
*/ */
getOptions: () => KeyboardOptions; getOptions: () => KeyboardOptions;
getCaretPosition: () => number; getCaretPosition: () => number | null;
getCaretPositionEnd: () => number; getCaretPositionEnd: () => number | null;
/** /**
* Changes the internal caret position * Changes the internal caret position
* @param {number} position The caret's start position * @param {number} position The caret's start position
* @param {number} positionEnd The caret's end position * @param {number} positionEnd The caret's end position
*/ */
setCaretPosition(position: number, endPosition?: number): void; setCaretPosition(position: number | null, endPosition?: number | null): void;
/** /**
* Retrieve the candidates for a given input * Retrieve the candidates for a given input
* @param input The input string to check * @param input The input string to check
@ -166,7 +167,7 @@ declare class SimpleKeyboard {
* Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned. * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.
* @param {string} button The button layout name to select * @param {string} button The button layout name to select
*/ */
getButtonElement(button: string): KeyboardElement | KeyboardElement[]; getButtonElement(button: string): KeyboardElement | KeyboardElement[] | undefined;
/** /**
* This handles the "inputPattern" option * This handles the "inputPattern" option
* by checking if the provided inputPattern passes * by checking if the provided inputPattern passes

View File

@ -3,10 +3,10 @@ import Utilities from "./services/Utilities";
export interface KeyboardLayoutObject { export interface KeyboardLayoutObject {
[key: string]: string[]; [key: string]: string[];
} }
export interface KeyboardButtonTheme { export declare type KeyboardButtonTheme = {
class: string; class: string;
buttons: string; buttons: string;
} } | null;
export interface KeyboardButtonAttributes { export interface KeyboardButtonAttributes {
attribute: string; attribute: string;
value: string; value: string;
@ -32,16 +32,18 @@ export declare type CandidateBoxRenderParams = {
onItemSelected: (selectedCandidate: string) => void; onItemSelected: (selectedCandidate: string) => void;
}; };
export declare type KeyboardElement = HTMLDivElement | HTMLButtonElement; export declare type KeyboardElement = HTMLDivElement | HTMLButtonElement;
export declare type KeyboardHandlerEvent = PointerEvent & TouchEvent & KeyboardEvent & { export declare type KeyboardHandlerEvent = any;
target: HTMLDivElement & HTMLInputElement;
};
export interface KeyboardButtonElements { export interface KeyboardButtonElements {
[key: string]: KeyboardElement[]; [key: string]: KeyboardElement[];
} }
export interface UtilitiesParams { export interface UtilitiesParams {
getOptions: () => KeyboardOptions; getOptions: () => KeyboardOptions;
getCaretPosition: () => number; getCaretPosition: () => number | null;
getCaretPositionEnd: () => number; getCaretPositionEnd: () => number | null;
dispatch: any;
}
export interface PhysicalKeyboardParams {
getOptions: () => KeyboardOptions;
dispatch: any; dispatch: any;
} }
export interface KeyboardOptions { export interface KeyboardOptions {

View File

@ -1,4 +1,4 @@
import { KeyboardOptions, UtilitiesParams } from "../interfaces"; import { KeyboardOptions, PhysicalKeyboardParams } from "../interfaces";
/** /**
* Physical Keyboard Service * Physical Keyboard Service
*/ */
@ -8,7 +8,7 @@ declare class PhysicalKeyboard {
/** /**
* Creates an instance of the PhysicalKeyboard service * Creates an instance of the PhysicalKeyboard service
*/ */
constructor({ dispatch, getOptions }: Partial<UtilitiesParams>); constructor({ dispatch, getOptions }: PhysicalKeyboardParams);
handleHighlightKeyDown(event: KeyboardEvent): void; handleHighlightKeyDown(event: KeyboardEvent): void;
handleHighlightKeyUp(event: KeyboardEvent): void; handleHighlightKeyUp(event: KeyboardEvent): void;
/** /**

View File

@ -5,8 +5,8 @@ import { KeyboardOptions, UtilitiesParams } from "../interfaces";
*/ */
declare class Utilities { declare class Utilities {
getOptions: () => KeyboardOptions; getOptions: () => KeyboardOptions;
getCaretPosition: () => number; getCaretPosition: () => number | null;
getCaretPositionEnd: () => number; getCaretPositionEnd: () => number | null;
dispatch: any; dispatch: any;
maxLengthReached: boolean; maxLengthReached: boolean;
/** /**
@ -122,7 +122,7 @@ declare class Utilities {
* @param {number} length Represents by how many characters the input should be moved * @param {number} length Represents by how many characters the input should be moved
* @param {boolean} minus Whether the cursor should be moved to the left or not. * @param {boolean} minus Whether the cursor should be moved to the left or not.
*/ */
updateCaretPosAction(length: number, minus?: boolean): number; updateCaretPosAction(length: number, minus?: boolean): number | null;
/** /**
* Adds a string to the input at a given position * Adds a string to the input at a given position
* *
@ -146,7 +146,7 @@ declare class Utilities {
* @param {object} inputObj * @param {object} inputObj
* @param {string} updatedInput * @param {string} updatedInput
*/ */
handleMaxLength(inputObj: KeyboardInput, updatedInput: string): boolean; handleMaxLength(inputObj: KeyboardInput, updatedInput: string): boolean | undefined;
/** /**
* Gets the current value of maxLengthReached * Gets the current value of maxLengthReached
*/ */