forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery-knob.d.ts
116 lines (113 loc) · 2.28 KB
/
jquery-knob.d.ts
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Type definitions for jQuery Knob 1.2.11
// Project: http://anthonyterrien.com/knob/
// Definitions by: Iain Buchanan <https://github.com/iain8/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare module JQueryKnob {
export interface JQueryKnobOptions {
/**
* min value | default=0
*/
min?: number;
/**
* max value | default=100
*/
max?: number;
/**
* step size | default=1
*/
step?: number;
/**
* starting angle in degrees | default=0
*/
angleOffset?: number;
/**
* arc size in degrees | default=360
*/
angleArc?: number;
/**
* stop at min & max on keydown/mousewheel | default=true
*/
stopper?: boolean;
/**
* disable input and events | default=false
*/
readOnly?: boolean;
/**
* direction of progression | default=clockwise
*/
rotation?: string;
/**
* display mode "cursor", cursor size could be changed passing a
* numeric value to the option, default width is used when passing
* boolean value "true" | default=gauge
*/
cursor?: string | boolean;
/**
* gauge thickness
*/
thickness?: number;
/**
* gauge stroke endings | default=butt, round=rounded line endings
*/
lineCap?: string;
/**
* dial width
*/
width?: number;
/**
* default=true | false=hide input
*/
displayInput?: boolean;
/**
* default=false | true=displays the previous value with transparency
*/
displayPrevious?: boolean;
/**
* foreground color
*/
fgColor?: string;
/**
* input value (number) color
*/
inputColor?: string;
/**
* font family
*/
font?: string;
/**
* font weight
*/
fontWeight?: string;
/**
* background color
*/
bgColor?: string;
/**
* executed on release
*/
release?: (value: number) => void;
/**
* executed at each change of the value
*/
change?: (value: number) => void;
/**
* when drawing the canvas
*/
draw?: () => void;
/**
* triggered on [esc] keydown
*/
cancel?: () => void;
/**
* allows to format output (add unit %, ms...)
*/
format?: (value: number) => void;
}
}
interface JQuery {
/**
* Create a knob for the given input field, with optional options
*/
knob(options?: JQueryKnob.JQueryKnobOptions): JQuery;
}