From 384a53f595cdba08d1398902e53c6901700ec459 Mon Sep 17 00:00:00 2001 From: Moes Date: Tue, 10 May 2016 11:04:35 +1000 Subject: [PATCH 1/7] update toastr.d.ts add clearOptions to force clearing a toast, ignoring focus --- toastr/toastr.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toastr/toastr.d.ts b/toastr/toastr.d.ts index edf65d4073..e921bfbd7b 100644 --- a/toastr/toastr.d.ts +++ b/toastr/toastr.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Toastr 2.0.1 +// Type definitions for Toastr 2.1.1 // Project: https://github.com/CodeSeven/toastr // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -174,6 +174,13 @@ interface Toastr { * @param toast Toast to clear */ (toast: JQuery): void; + /** + * Clear specific toast + * + * @param toast Toast to clear + * @param clearOptions force clearing a toast, ignoring focus + */ + (toast: JQuery, clearOptions: { force: boolean }): void; }; /** * Create an error toast From e39766617019f476737a294150e880a36224a5b4 Mon Sep 17 00:00:00 2001 From: Moes Date: Wed, 11 May 2016 13:29:25 +1000 Subject: [PATCH 2/7] Update jquery.pnotify.d.ts to v3.0.0 Update jquery.pnotify.d.ts to v3.0.0 --- jquery.pnotify/jquery.pnotify.d.ts | 128 +++++++++++++++++++++++++++-- 1 file changed, 119 insertions(+), 9 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index edb7e2468c..cdccb6fbd5 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.pnotify 2.x +// Type definitions for jquery.pnotify 3.x // Project: https://github.com/sciactive/pnotify // Definitions by: David Sichau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,11 +24,98 @@ interface PNotifyLabel { stick?: string; } + +interface IPNotifyconfirmButton { + text: string; + addClass: string; + /** + * Whether to trigger this button when the user hits enter in a single line prompt. + */ + promptTrigger: boolean; + click: (notice: PNotify, value: any) => void +} + +interface PNotifyconfirm { + /** + * Make a confirmation box. + */ + confirm: boolean; + + /** + * Make a prompt. + */ + prompt: boolean; + /** + * Classes to add to the input element of the prompt. + */ + prompt_class: string + + /** + * The default value of the prompt. + */ + prompt_default: string + + /** + * Whether the prompt should accept multiple lines of text. + */ + prompt_multi_line: boolean; + + /** + * Where to align the buttons. (right, center, left, justify) + */ + align: string; + + /** + * The buttons to display, and their callbacks. + */ + buttons: IPNotifyconfirmButton[]; + +} + +interface IPNotifyButtons { + /** + * Provide a button for the user to manually close the notice. + */ + closer: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover: boolean; + /** + * Provide a button for the user to manually stick the notice. + */ + sticker: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover: boolean; + /** + * Show the buttons even when the nonblock module is in use. + */ + show_on_nonblock: boolean; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels: { + close: string; + stick: string; + unstick: string; + }; + /** + * The classes to use for button icons. Leave them null to use the classes from the styling you're using. + */ + classes: { + closer: string; + pin_up: string; + pin_down: string; + }; +} + interface PNotifyOptions { /** * The notice's title. Either boolean false or string */ - title?: any; + title?: string | boolean; /** * Whether to escape the content of the title. (Not allow HTML.) */ @@ -36,15 +123,15 @@ interface PNotifyOptions { /** * The notice's text. Either boolean false or string */ - text?: any; + text?: string | boolean; /** * Whether to escape the content of the text. (Not allow HTML.) */ text_escape?: boolean; /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) + * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ - styling?: string; + styling?: "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; /** * Additional classes to be added to the notice. (For custom styling.) */ @@ -89,7 +176,7 @@ interface PNotifyOptions { /** * Type of the notice. "notice", "info", "success", or "error". */ - type?: string; + type?: "notice" | "info" | "success" | "error"; /** * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. */ @@ -166,15 +253,38 @@ interface PNotifyOptions { } interface PNotify { - elem: JQuery; - + + /** + * The state can be "initializing", "opening", "open", "closing", and "closed" + */ + + state: "initializing" | "opening" | "open" | "closing" | "closed"; + + /** + * This function is for updating the notice. + */ update(options?: PNotifyOptions): void; + + /** + * Remove the notice. + */ remove(): void; + + /** + * Display the notice. + */ + open(): void; + + /** + * Get the DOM element. + */ + get(): JQuery; + } interface PNotifyConstructor { new (options?: PNotifyOptions): PNotify; - + removeAll(): void; } From c5bcfd3d0832909ff89f69e2c4f6669d0513cf87 Mon Sep 17 00:00:00 2001 From: Moes Date: Wed, 11 May 2016 14:01:51 +1000 Subject: [PATCH 3/7] Update jquery.pnotify.d.ts Add type --- jquery.pnotify/jquery.pnotify.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index cdccb6fbd5..3fd1d30d99 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -4,6 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +type NoticeTypeOptions = "notice" | "info" | "success" | "error"; +type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; +type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; interface PNotifyStack { dir1?: string; @@ -131,7 +134,7 @@ interface PNotifyOptions { /** * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ - styling?: "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; + styling?: StylingOptions; /** * Additional classes to be added to the notice. (For custom styling.) */ @@ -176,7 +179,7 @@ interface PNotifyOptions { /** * Type of the notice. "notice", "info", "success", or "error". */ - type?: "notice" | "info" | "success" | "error"; + type?: NoticeTypeOptions; /** * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. */ @@ -257,8 +260,7 @@ interface PNotify { /** * The state can be "initializing", "opening", "open", "closing", and "closed" */ - - state: "initializing" | "opening" | "open" | "closing" | "closed"; + state?: StateOptions; /** * This function is for updating the notice. From 04757e55977be45e0269500435ae4d4c21c8fe67 Mon Sep 17 00:00:00 2001 From: Moes Date: Wed, 11 May 2016 14:06:26 +1000 Subject: [PATCH 4/7] remove type is not supported by travis remove type is not supported by travis --- jquery.pnotify/jquery.pnotify.d.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 3fd1d30d99..6568adf351 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -4,9 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -type NoticeTypeOptions = "notice" | "info" | "success" | "error"; -type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; -type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; + +// could not pass the Travis Test if enabled +//type NoticeTypeOptions = "notice" | "info" | "success" | "error"; +//type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; +//type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; interface PNotifyStack { dir1?: string; @@ -134,7 +136,7 @@ interface PNotifyOptions { /** * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ - styling?: StylingOptions; + styling?: string; /** * Additional classes to be added to the notice. (For custom styling.) */ @@ -179,7 +181,7 @@ interface PNotifyOptions { /** * Type of the notice. "notice", "info", "success", or "error". */ - type?: NoticeTypeOptions; + type?: string; /** * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. */ @@ -260,7 +262,7 @@ interface PNotify { /** * The state can be "initializing", "opening", "open", "closing", and "closed" */ - state?: StateOptions; + state?: string; /** * This function is for updating the notice. @@ -291,4 +293,3 @@ interface PNotifyConstructor { } declare var PNotify: PNotifyConstructor; - From c3775121b076d76269e8cc26429d3dd2c4ead1c6 Mon Sep 17 00:00:00 2001 From: Moes Date: Wed, 11 May 2016 14:21:25 +1000 Subject: [PATCH 5/7] Update jquery.pnotify.d.ts to v3.0.0 make options optional --- jquery.pnotify/jquery.pnotify.d.ts | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 6568adf351..26c927cec9 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -31,12 +31,12 @@ interface PNotifyLabel { interface IPNotifyconfirmButton { - text: string; - addClass: string; + text?: string; + addClass?: string; /** * Whether to trigger this button when the user hits enter in a single line prompt. */ - promptTrigger: boolean; + promptTrigger?: boolean; click: (notice: PNotify, value: any) => void } @@ -44,36 +44,36 @@ interface PNotifyconfirm { /** * Make a confirmation box. */ - confirm: boolean; + confirm?: boolean; /** * Make a prompt. */ - prompt: boolean; + prompt?: boolean; /** * Classes to add to the input element of the prompt. */ - prompt_class: string + prompt_class?: string /** * The default value of the prompt. */ - prompt_default: string + prompt_default?: string /** * Whether the prompt should accept multiple lines of text. */ - prompt_multi_line: boolean; + prompt_multi_line?: boolean; /** * Where to align the buttons. (right, center, left, justify) */ - align: string; + align?: string; /** * The buttons to display, and their callbacks. */ - buttons: IPNotifyconfirmButton[]; + buttons?: IPNotifyconfirmButton[]; } @@ -81,38 +81,38 @@ interface IPNotifyButtons { /** * Provide a button for the user to manually close the notice. */ - closer: boolean; + closer?: boolean; /** * Only show the closer button on hover. */ - closer_hover: boolean; + closer_hover?: boolean; /** * Provide a button for the user to manually stick the notice. */ - sticker: boolean; + sticker?: boolean; /** * Only show the sticker button on hover. */ - sticker_hover: boolean; + sticker_hover?: boolean; /** * Show the buttons even when the nonblock module is in use. */ - show_on_nonblock: boolean; + show_on_nonblock?: boolean; /** * The various displayed text, helps facilitating internationalization. */ - labels: { - close: string; - stick: string; - unstick: string; + labels?: { + close?: string; + stick?: string; + unstick?: string; }; /** * The classes to use for button icons. Leave them null to use the classes from the styling you're using. */ - classes: { - closer: string; - pin_up: string; - pin_down: string; + classes?: { + closer?: string; + pin_up?: string; + pin_down?: string; }; } @@ -150,7 +150,7 @@ interface PNotifyOptions { /** * Create a non-blocking notice. It lets the user click elements underneath it. */ - nonblock: boolean; + nonblock?: boolean; /** * The opacity of the notice (if it's non-blocking) when the mouse is over it. From 1d065982928e04a50c939900f618c03c919e5d5e Mon Sep 17 00:00:00 2001 From: Moes Date: Thu, 12 May 2016 15:20:36 +1000 Subject: [PATCH 6/7] Update jquery.pnotify.d.ts change the return type of update() to return PNotify to enable chaining --- jquery.pnotify/jquery.pnotify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 26c927cec9..c07347c1e8 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -267,7 +267,7 @@ interface PNotify { /** * This function is for updating the notice. */ - update(options?: PNotifyOptions): void; + update(options?: PNotifyOptions): PNotify; /** * Remove the notice. From 73d6e70b5eb7fcd9383d4055d08a5b6edb82db77 Mon Sep 17 00:00:00 2001 From: Moes Date: Mon, 16 May 2016 10:12:32 +1000 Subject: [PATCH 7/7] Update jquery.pnotify.d.ts remove the I from the interface --- jquery.pnotify/jquery.pnotify.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index c07347c1e8..7f727aa1b0 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -30,7 +30,7 @@ interface PNotifyLabel { } -interface IPNotifyconfirmButton { +interface PNotifyconfirmButton { text?: string; addClass?: string; /** @@ -73,11 +73,11 @@ interface PNotifyconfirm { /** * The buttons to display, and their callbacks. */ - buttons?: IPNotifyconfirmButton[]; + buttons?: PNotifyconfirmButton[]; } -interface IPNotifyButtons { +interface PNotifyButtons { /** * Provide a button for the user to manually close the notice. */