mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-04-02 21:03:00 +08:00
Fix types
This commit is contained in:
parent
9c24c1cb01
commit
5464fbc77e
@ -10,8 +10,7 @@
|
|||||||
"build-modern-esm": "webpack --config webpack.config.modern_esm.js",
|
"build-modern-esm": "webpack --config webpack.config.modern_esm.js",
|
||||||
"test": "jest --silent",
|
"test": "jest --silent",
|
||||||
"coverage": "npm run test -- --coverage",
|
"coverage": "npm run test -- --coverage",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build"
|
||||||
"trypublish": "npm publish || true"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -19,8 +19,9 @@ class Demo {
|
|||||||
onChange: input => this.onChange(input),
|
onChange: input => this.onChange(input),
|
||||||
onKeyPress: button => this.onKeyPress(button),
|
onKeyPress: button => this.onKeyPress(button),
|
||||||
preventMouseDownDefault: true,
|
preventMouseDownDefault: true,
|
||||||
|
layoutCandidatesPageSize: 15,
|
||||||
layoutCandidates: {
|
layoutCandidates: {
|
||||||
ni: "你 尼",
|
ni: "你 尼 你 尼 你 尼 你 尼 你 尼 你 尼 你 尼 你 尼 你 尼 你 尼",
|
||||||
hao: "好 号"
|
hao: "好 号"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -3,18 +3,18 @@ import "./css/index.css";
|
|||||||
/**
|
/**
|
||||||
* Demos
|
* Demos
|
||||||
*/
|
*/
|
||||||
import BasicDemo from "./BasicDemo";
|
//import BasicDemo from "./BasicDemo";
|
||||||
//import RTLDemo from "./RTLDemo";
|
//import RTLDemo from "./RTLDemo";
|
||||||
//import ButtonThemeDemo from "./ButtonThemeDemo";
|
//import ButtonThemeDemo from "./ButtonThemeDemo";
|
||||||
//import DOMElementDemo from "./DOMElementDemo";
|
//import DOMElementDemo from "./DOMElementDemo";
|
||||||
//import FullKeyboardDemo from "./FullKeyboardDemo";
|
//import FullKeyboardDemo from "./FullKeyboardDemo";
|
||||||
//import MultipleKeyboardsDemo from "./MultipleKeyboardsDestroyDemo";
|
//import MultipleKeyboardsDemo from "./MultipleKeyboardsDestroyDemo";
|
||||||
//import CandidateBoxDemo from "./CandidateBoxDemo";
|
import CandidateBoxDemo from "./CandidateBoxDemo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selected demo
|
* Selected demo
|
||||||
*/
|
*/
|
||||||
const SELECTED_DEMO = BasicDemo;
|
const SELECTED_DEMO = CandidateBoxDemo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap
|
* Bootstrap
|
||||||
|
@ -13,6 +13,10 @@ import {
|
|||||||
} from "../interfaces";
|
} from "../interfaces";
|
||||||
import CandidateBox from "./CandidateBox";
|
import CandidateBox from "./CandidateBox";
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window { SimpleKeyboardInstances: any; }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Root class for simple-keyboard.
|
* Root class for simple-keyboard.
|
||||||
* This class:
|
* This class:
|
||||||
@ -821,7 +825,7 @@ class SimpleKeyboard {
|
|||||||
* Get all simple-keyboard inputs
|
* Get all simple-keyboard inputs
|
||||||
*/
|
*/
|
||||||
getAllInputs(): KeyboardInput {
|
getAllInputs(): KeyboardInput {
|
||||||
const output = {};
|
const output = {} as KeyboardInput;
|
||||||
const inputNames = Object.keys(this.input);
|
const inputNames = Object.keys(this.input);
|
||||||
|
|
||||||
inputNames.forEach((inputName) => {
|
inputNames.forEach((inputName) => {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
export const getDefaultLayout = () => {
|
import { KeyboardLayoutObject } from "../interfaces";
|
||||||
|
|
||||||
|
export const getDefaultLayout = (): KeyboardLayoutObject => {
|
||||||
return {
|
return {
|
||||||
default: [
|
default: [
|
||||||
"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}",
|
"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}",
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
|
||||||
"lib": ["es2020", "dom"],
|
"lib": ["es2020", "dom"],
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user