diff --git a/jquery.watermark/jquery.watermark.d.ts b/jquery.watermark/jquery.watermark-3.1.d.ts
similarity index 62%
rename from jquery.watermark/jquery.watermark.d.ts
rename to jquery.watermark/jquery.watermark-3.1.d.ts
index 25b4e646a..f5b1dce6c 100644
--- a/jquery.watermark/jquery.watermark.d.ts
+++ b/jquery.watermark/jquery.watermark-3.1.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Watermark plugin for jQuery 3.1.4
+// Type definitions for Watermark plugin for jQuery 3.1
// Project: http://jquery-watermark.googlecode.com
// Definitions by: https://github.com/anwarjaved
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -6,14 +6,25 @@
///
-
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 Watermark {
+ options: WatermarkOptions;
+
+ show(element: string): void;
+ hide(element: string): void;
+ showAll(): void;
+ hideAll(): void;
+}
interface JQuery {
- watermark(text : string, options?: WatermarkOptions): JQuery;
+ watermark(text: string, options?: WatermarkOptions): JQuery;
}
+
+interface JQueryStatic {
+ watermark: Watermark;
+}
\ No newline at end of file
diff --git a/jquery.watermark/jquery.watermark-tests.ts b/jquery.watermark/jquery.watermark-tests.ts
new file mode 100644
index 000000000..5ce787598
--- /dev/null
+++ b/jquery.watermark/jquery.watermark-tests.ts
@@ -0,0 +1,28 @@
+///
+///
+
+
+$('#inputId').watermark('Required information');
+$('#inputId').watermark('Required information', { className: 'myClassName' });
+$('#inputId').watermark('Search', { useNative: false });
+
+$.watermark.options.className = 'myClass';
+
+$.watermark.options.useNative = false;
+
+var myFunction;
+$.watermark.options.useNative = myFunction;
+
+$.watermark.options.hideBeforeUnload = false;
+
+$.watermark.options = {
+ className: 'myClass',
+ useNative: false,
+ hideBeforeUnload: false
+};
+
+$.watermark.options.hideBeforeUnload = true;
+$.watermark.show('input.optional');
+$.watermark.hide('#myInput');
+$.watermark.showAll();
+$.watermark.hideAll();
\ No newline at end of file