forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.timepicker.d.ts
144 lines (121 loc) · 4.75 KB
/
jquery.timepicker.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
// Type definitions for jQuery UI Timepicker 0.3
// Project: http://fgelinas.com/code/timepicker/
// Definitions by: Anwar Javed <https://github.com/anwarjaved>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="../jqueryui/jqueryui.d.ts"/>
interface TimePickerHour {
/** first displayed hour */ starts?: number;
/** last displayed hour */ ends?: number;
}
interface TimePickerMinutes {
/** first displayed minute */ starts?: number;
/** last displayed minute */ ends?: number;
/** interval of displayed minutes */ interval?: number;
}
interface TimePickerOptions {
/** 'focus' for popup on focus, */ showOn?: string;
/** * 'button' element that will trigger the timepicker. * * "button" for trigger button, or "both" for either (not yet implemented). */ button?: string;
// Localization
/** Define the locale text for "Hours" */
hourText?: string;
/** Define the locale text for "Minute" */
minuteText?: string;
/** Define the locale text for periods. */
amPmText?: [string, string];
/** Name of jQuery animation for popup */ showAnim?: string;
/** Options for enhanced animations */ showOptions?: any;
/** Display text following the input box, e.g. showing the format */ appendText?: string;
/** Define a callback function executed before the timepicker is shown */ beforeShow?: () => any;
/** Define a callback function when a hour / minutes is selected */ onSelect?: (timeText: string, inst: any) => any;
/** Define a callback function when the timepicker is closed */ onClose?: (timeText: string, inst: any) => any;
/** The character to use to separate hours and minutes. */ timeSeparator?: string;
/** The character to use to separate the time from the time period. */ periodSeparator?: string;
/** Define whether or not to show AM/PM with selected time */ showPeriod?: boolean;
/** Show the AM/PM labels on the left of the time picker */ showPeriodLabels?: boolean;
/** Define whether or not to show a leading zero for hours < 10. [true/false] */ showLeadingZero?: boolean;
/** Define whether or not to show a leading zero for minutes < 10. */ showMinutesLeadingZero?: boolean;
/** Selector for an alternate field to store selected time into */ altField?: string;
/** * Used as default time when input field is empty or for inline timePicker * (set to 'now' for the current time, '' for no highlighted time) **/ defaultTime?: string;
/** * Position of the dialog relative to the input. * * See the position utility for more info : http://jqueryui.com/demos/position/ */ myPosition?: string;
/** * Position of the input element to match * * Note : if the position utility is not loaded, the timepicker will attach left top to left bottom * See the position utility for more info : http://jqueryui.com/demos/position/ */ atPosition?: string;
//NEW: 2011-02-03
/** callback for enabling / disabling on selectable hours ex : function(hour) { return true; } */ onHourShow?: () => any;
/** callback for enabling / disabling on time selection ex : function(hour,minute) { return true; } */ onMinuteShow?: () => any;
hours?: TimePickerHour;
minutes?: TimePickerMinutes;
/** number of rows for the input tables, minimum 2, makes more sense if you use multiple of 2 */ rows?: number;
// 2011-08-05 0.2.4
/** display the hours section of the dialog */ showHours?: boolean;
/** display the minute section of the dialog */ showMinutes?: boolean;
/** optionally parse inputs of whole hours with minutes omitted */ optionalMinutes?: boolean;
// buttons
/** shows an OK button to confirm the edit */ showCloseButton?: boolean;
/** Text for the confirmation button (ok button).*/
closeButtonText?: string;
/** Shows the 'now' button */ showNowButton?: boolean;
/** Text for the 'now' button.*/
nowButtonText?: string;
/** Shows the deselect time button */ showDeselectButton?: boolean;
/** Text for the deselect button */
deselectButtonText?: string;
}
interface JQuery {
timepicker(): JQuery;
timepicker(methodName: 'getTime'): string;
timepicker(methodName: 'getTimeAsDate'): Date;
timepicker(methodName: 'getHour'): number;
timepicker(methodName: 'getMinute'): number;
timepicker(methodName: string): any;
timepicker(methodName: string, methodParameter: any): any;
timepicker(optionLiteral: string, optionName: string): any;
timepicker(options: TimePickerOptions): JQuery;
}