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
*
* 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;
options: KeyboardOptions;
utilities: any;
caretPosition: number;
caretPositionEnd: number;
caretPosition: number | null;
caretPositionEnd: number | null;
keyboardDOM: KeyboardElement;
keyboardPluginClasses: string;
keyboardDOMClass: string;
@ -34,8 +34,9 @@ declare class SimpleKeyboard {
holdTimeout: number;
isMouseHold: boolean;
initialized: boolean;
candidateBox: CandidateBox;
candidateBox: CandidateBox | null;
keyboardRowsDOM: KeyboardElement;
defaultName: string;
/**
* 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.
@ -47,20 +48,20 @@ declare class SimpleKeyboard {
handleParams: (params: KeyboardParams) => {
keyboardDOMClass: string;
keyboardDOM: KeyboardElement;
options: Partial<KeyboardOptions>;
options: Partial<KeyboardOptions | undefined>;
};
/**
* Getters
*/
getOptions: () => KeyboardOptions;
getCaretPosition: () => number;
getCaretPositionEnd: () => number;
getCaretPosition: () => number | null;
getCaretPositionEnd: () => number | null;
/**
* Changes the internal caret position
* @param {number} position The caret's start 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
* @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.
* @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
* by checking if the provided inputPattern passes

View File

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

View File

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

View File

@ -5,8 +5,8 @@ import { KeyboardOptions, UtilitiesParams } from "../interfaces";
*/
declare class Utilities {
getOptions: () => KeyboardOptions;
getCaretPosition: () => number;
getCaretPositionEnd: () => number;
getCaretPosition: () => number | null;
getCaretPositionEnd: () => number | null;
dispatch: any;
maxLengthReached: boolean;
/**
@ -122,7 +122,7 @@ declare class Utilities {
* @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.
*/
updateCaretPosAction(length: number, minus?: boolean): number;
updateCaretPosAction(length: number, minus?: boolean): number | null;
/**
* Adds a string to the input at a given position
*
@ -146,7 +146,7 @@ declare class Utilities {
* @param {object} inputObj
* @param {string} updatedInput
*/
handleMaxLength(inputObj: KeyboardInput, updatedInput: string): boolean;
handleMaxLength(inputObj: KeyboardInput, updatedInput: string): boolean | undefined;
/**
* Gets the current value of maxLengthReached
*/