From f595687773d7204e3b3f55da364ddf16fe76a9ac Mon Sep 17 00:00:00 2001 From: Mateus Demboski Date: Tue, 1 Mar 2016 15:25:03 -0300 Subject: [PATCH 1/2] Added notie.js (https://github.com/jaredreich/notie.js) definitions --- notie/notie.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 notie/notie.d.ts diff --git a/notie/notie.d.ts b/notie/notie.d.ts new file mode 100644 index 000000000..f8b6786b8 --- /dev/null +++ b/notie/notie.d.ts @@ -0,0 +1,10 @@ +// Type definitions for notie.js +// Project: https://github.com/jaredreich/notie.js +// Definitions by: Mateus Demboski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var notie: { + alert: (type: number, message: string, seconds: number) => void; + confirm: (title: string, yes_text: string, no_text: string, yes_callback: () => void) => void; + input: (title: string, submit_text: string, cancel_text: string, type: string, placeholder: string, submit_callback: (value_entered: string) => void, prefilled_value_optional?: string) => void; +}; From 4d45dd8d40cd229a43d5a55b1b24e99691b06539 Mon Sep 17 00:00:00 2001 From: Mateus Demboski Date: Tue, 1 Mar 2016 15:27:06 -0300 Subject: [PATCH 2/2] Added tests file for notie definitions --- notie/notie-tests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 notie/notie-tests.ts diff --git a/notie/notie-tests.ts b/notie/notie-tests.ts new file mode 100644 index 000000000..f1e78c2a5 --- /dev/null +++ b/notie/notie-tests.ts @@ -0,0 +1,24 @@ +/// + +notie.alert(1, 'Success!', 1.5); +notie.alert(2, 'Warning
with
HTML
included.', 2); +notie.alert(3, 'Error.', 2.5); +notie.alert(4, 'Information.', 2); + +notie.confirm('Are you sure you want to do that?', 'Yes', 'Cancel', function() { + notie.alert(1, 'Good choice!', 2); +}); +notie.confirm('Are you sure?', 'Yes', 'Cancel', function() { + notie.confirm('Are you really sure?', 'Yes', 'Cancel', function() { + notie.confirm('Are you really really sure?', 'Yes', 'Cancel', function() { + notie.alert(1, 'Okay, jeez...', 2); + }); + }); +}); + +notie.input('Please enter your email address:', 'Submit', 'Cancel', 'email', 'name@example.com', function(value_entered) { + notie.alert(1, 'You entered: ' + value_entered, 2); +}); +notie.input('What city do you live in?', 'Submit', 'Cancel', 'text', 'Enter your city:', function(value_entered) { + notie.alert(1, 'You entered: ' + value_entered, 2); +}, 'New York');