From 8d32d90f99f3e842ea56e91b561d0cad0f260ec6 Mon Sep 17 00:00:00 2001 From: Anwar Javed Date: Wed, 9 Jan 2013 13:03:27 +0530 Subject: [PATCH] jQuery TimePicker & WaterMark Definations --- jquery.timepicker/jquery.timepicker.d.ts | 66 ++++++++++++++++++++++++ jquery.watermark/jquery.watermark.d.ts | 19 +++++++ 2 files changed, 85 insertions(+) create mode 100644 jquery.timepicker/jquery.timepicker.d.ts create mode 100644 jquery.watermark/jquery.watermark.d.ts diff --git a/jquery.timepicker/jquery.timepicker.d.ts b/jquery.timepicker/jquery.timepicker.d.ts new file mode 100644 index 0000000000..2c8e0bcde2 --- /dev/null +++ b/jquery.timepicker/jquery.timepicker.d.ts @@ -0,0 +1,66 @@ +// Type definitions for jQuery UI Timepicker 0.3.1 +// Project: http://fgelinas.com/code/timepicker/ +// Definitions by: https://github.com/anwarjaved +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +interface TimePickerHour { + starts?: number; // first displayed hour + ends?: number; // last displayed hour +} + +interface TimePickerMinutes { + starts?: number; // first displayed minute + ends?: number; // last displayed minute + interval?: number; // interval of displayed minutes +} + +interface TimePickerOptions { + showOn?: string; // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either (not yet implemented) + button?: string; // 'button' element that will trigger the timepicker + showAnim?: string; // Name of jQuery animation for popup + showOptions: any; // Options for enhanced animations + appendText?: string; // Display text following the input box, e.g. showing the format + + beforeShow: () => any; // Define a callback function executed before the timepicker is shown + onSelect: () => any; // Define a callback function when a hour / minutes is selected + onClose: () => any; // Define a callback function when the timepicker is closed + + timeSeparator?: string; // The character to use to separate hours and minutes. + periodSeparator?: string; // The character to use to separate the time from the time period. + showPeriod?: bool; // Define whether or not to show AM/PM with selected time + showPeriodLabels?: bool; // Show the AM/PM labels on the left of the time picker + showLeadingZero?: bool; // Define whether or not to show a leading zero for hours < 10. [true/false] + showMinutesLeadingZero?: bool; // Define whether or not to show a leading zero for minutes < 10. + altField?: string; // Selector for an alternate field to store selected time into + defaultTime?: 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) + myPosition?: string; // Position of the dialog relative to the input. + // see the position utility for more info : http://jqueryui.com/demos/position/ + atPosition?: 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 + //NEW: 2011-02-03 + onHourShow: () => any; // callback for enabling / disabling on selectable hours ex : function(hour) { return true; } + onMinuteShow: () => any; // callback for enabling / disabling on time selection ex : function(hour,minute) { return true; } + + hours?: TimePickerHour; + minutes?: TimePickerMinutes; + rows?: number; // number of rows for the input tables, minimum 2, makes more sense if you use multiple of 2 + // 2011-08-05 0.2.4 + showHours?: bool; // display the hours section of the dialog + showMinutes?: bool; // display the minute section of the dialog + optionalMinutes?: bool; // optionally parse inputs of whole hours with minutes omitted + + // buttons + showCloseButton?: bool; // shows an OK button to confirm the edit + showNowButton?: bool; // Shows the 'now' button + showDeselectButton?: bool; // Shows the deselect time button +} + + +interface JQuery { + timepicker(options?: TimePickerOptions): JQuery; +} diff --git a/jquery.watermark/jquery.watermark.d.ts b/jquery.watermark/jquery.watermark.d.ts new file mode 100644 index 0000000000..25b4e646aa --- /dev/null +++ b/jquery.watermark/jquery.watermark.d.ts @@ -0,0 +1,19 @@ +// Type definitions for Watermark plugin for jQuery 3.1.4 +// Project: http://jquery-watermark.googlecode.com +// Definitions by: https://github.com/anwarjaved +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + + +interface WatermarkOptions { + className?: string; // Default class name for all watermarks + useNative?: bool; // If true, plugin will detect and use native browser support for watermarks, if available. (e.g., WebKit's placeholder attribute.) + hideBeforeUnload?: bool; // If true, all watermarks will be hidden during the window beforeunload event. +} + + +interface JQuery { + watermark(text : string, options?: WatermarkOptions): JQuery; +}