mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #3001 from adidahiya/pickadate
Improve pickadate.js typings
This commit is contained in:
@@ -150,10 +150,13 @@ datePickerInput.pickadate({
|
||||
}
|
||||
});
|
||||
|
||||
var datePickerApi = <Pickadate.Api> datePickerInput.pickadate('picker');
|
||||
var datePickerApi = datePickerInput.pickadate('picker');
|
||||
|
||||
datePickerInput.pickadate('open');
|
||||
datePickerInput.pickadate('get', 'value');
|
||||
datePickerInput.pickadate('$node').show();
|
||||
datePickerInput.pickadate('$root').show();
|
||||
datePickerInput.pickadate('_hidden').show();
|
||||
|
||||
testApiMethods(datePickerApi);
|
||||
|
||||
@@ -234,10 +237,13 @@ timePickerInput.pickatime({
|
||||
}
|
||||
});
|
||||
|
||||
var timePickerApi = <Pickadate.Api> timePickerInput.pickatime('picker');
|
||||
var timePickerApi = timePickerInput.pickatime('picker');
|
||||
|
||||
timePickerInput.pickatime('open');
|
||||
timePickerInput.pickatime('get', 'value');
|
||||
timePickerInput.pickatime('$node').show();
|
||||
timePickerInput.pickatime('$root').show();
|
||||
timePickerInput.pickatime('_hidden').show();
|
||||
|
||||
testApiMethods(timePickerApi);
|
||||
|
||||
|
||||
Vendored
+32
-18
@@ -289,29 +289,43 @@ declare module Pickadate {
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Initialize a date picker.
|
||||
*/
|
||||
pickadate(options?: Pickadate.DateOptions): any;
|
||||
* Access the API object after initialization.
|
||||
*/
|
||||
pickadate(keyword: "picker"): Pickadate.Api;
|
||||
pickadate(objectName: "$node"): JQuery;
|
||||
pickadate(objectName: "$root"): JQuery;
|
||||
pickadate(objectName: "_hidden"): JQuery;
|
||||
|
||||
/**
|
||||
* Access objects attached to the picker or invoke API methods after initialization.
|
||||
* If keyword is "picker", this returns a PickadateApi.
|
||||
* @param keyword "picker", an object name, or method name
|
||||
* @param arguments any arguments to pass to the method
|
||||
*/
|
||||
pickadate(keyword: string, ...arguments: any[]): any;
|
||||
* Invoke API methods after picker initialization.
|
||||
* @param methodName
|
||||
* @param arguments any arguments to pass to the method
|
||||
*/
|
||||
pickadate(methodName: string, ...arguments: any[]): any;
|
||||
|
||||
/**
|
||||
* Initialize a time picker.
|
||||
*/
|
||||
pickatime(options?: Pickadate.TimeOptions): any;
|
||||
* Initialize a date picker.
|
||||
* @returns the original JQuery selection
|
||||
*/
|
||||
pickadate(options?: Pickadate.DateOptions): JQuery;
|
||||
|
||||
|
||||
pickatime(keyword: "picker"): Pickadate.Api;
|
||||
pickatime(objectName: "$node"): JQuery;
|
||||
pickatime(objectName: "$root"): JQuery;
|
||||
pickatime(objectName: "_hidden"): JQuery;
|
||||
|
||||
/**
|
||||
* Access objects attached to the picker or invoke API methods after initialization.
|
||||
* If keyword is "picker", this returns a PickadateApi.
|
||||
* @param keyword "picker", an object name, or method name
|
||||
* @param arguments any arguments to pass to the method
|
||||
*/
|
||||
pickatime(keyword: string, ...arguments: any[]): any;
|
||||
* Invoke API methods after picker initialization.
|
||||
* @param methodName
|
||||
* @param arguments any arguments to pass to the method
|
||||
*/
|
||||
pickatime(methodName: string, ...arguments: any[]): any;
|
||||
|
||||
/**
|
||||
* Initialize a time picker.
|
||||
* @returns the original JQuery selection
|
||||
*/
|
||||
pickatime(options?: Pickadate.TimeOptions): JQuery;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user