-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.d.ts
More file actions
38 lines (32 loc) · 824 Bytes
/
index.d.ts
File metadata and controls
38 lines (32 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { ActionType, Key, Range } from "./src/constants";
import ValueHistory from "./src/valueHistory";
interface IState {
value: string;
caretStart: number;
caretEnd: number;
valid: boolean;
}
interface IKeyInfo {
name: string;
modifiers: string[];
}
interface IOptions {
thousands: string;
decimal: string;
fixed: boolean;
range: Range;
scale: number;
shortcuts: { [shortcut: string]: number };
onInvalidKey: (event: KeyboardEvent) => void;
onFocus: (event: FocusEvent) => ISelection | void;
}
interface IAction {
type: ActionType;
names: string[];
modifiers?: Key[];
}
interface ISelection {
start: number;
end: number;
}
type ActionHandler = (currentState: IState, keyInfo: IKeyInfo, options: IOptions, history: ValueHistory) => IState;