WIP: create type definition file

This commit is contained in:
Armno 2018-11-27 19:57:08 +07:00
parent 7ab6baa0f4
commit 5c40dd3109
No known key found for this signature in database
GPG Key ID: AF781F1A2DDF1E59

55
src/lib/@types/index.d.ts vendored Normal file
View File

@ -0,0 +1,55 @@
declare module 'simple-keyboard' {
class SimpleKeyboard {
constructor(selector: string, options: SimpleKeyboardOptions);
}
interface SimpleKeyboardOptions {
/**
* Modify the keyboard layout.
*/
layout: any;
/**
* Specifies which layout should be used.
*/
layoutName: string;
/**
* Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: backspace).
*/
display: any;
/**
* By default, when you set the display property, you replace the default one. This setting merges them instead.
*/
mergeDisplay: boolean;
/**
* A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.
*/
theme: string;
/**
* A prop to add your own css classes to one or several buttons.
*/
buttonTheme: any[];
/**
* Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.
*/
debug: boolean;
/**
* Specifies whether clicking the ENTER button will input a newline (\n) or not.
*/
newLineOnEnter: boolean;
/**
* Specifies whether clicking the TAB button will input a tab character (\t) or not.
*/
tabCharOnTab: boolean;
}
export default SimpleKeyboard;
}