diff --git a/README.md b/README.md
index b48c5939d..d7beb91ea 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,7 @@ Complete
* [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov))
+* [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) (by [Boris Yankov](https://github.com/borisyankov))
* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
@@ -39,8 +40,10 @@ Complete
* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos))
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov))
+* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.Transit](http://ricostacruz.com/jquery.transit/) (by [MrBigDog2U](https://github.com/MrBigDog2U))
* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov))
+* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved))
* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit))
* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
diff --git a/jquery.timepicker/jquery.timepicker.d.ts b/jquery.timepicker/jquery.timepicker-0.3.d.ts
similarity index 97%
rename from jquery.timepicker/jquery.timepicker.d.ts
rename to jquery.timepicker/jquery.timepicker-0.3.d.ts
index 5025290ef..a939c9425 100644
--- a/jquery.timepicker/jquery.timepicker.d.ts
+++ b/jquery.timepicker/jquery.timepicker-0.3.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for jQuery UI Timepicker 0.3.1
+// Type definitions for jQuery UI Timepicker 0.3
// Project: http://fgelinas.com/code/timepicker/
// Definitions by: https://github.com/anwarjaved
// Definitions: https://github.com/borisyankov/DefinitelyTyped
diff --git a/jquery.timepicker/jquery.timepicker-tests.ts b/jquery.timepicker/jquery.timepicker-tests.ts
new file mode 100644
index 000000000..5a979fc26
--- /dev/null
+++ b/jquery.timepicker/jquery.timepicker-tests.ts
@@ -0,0 +1,45 @@
+///
+///
+
+var beforeShowCallback, onSelectCallback, onCloseCallback, onHourShow, onMinuteShow;
+$('#timepicker').timepicker({
+ timeSeparator: ':',
+ showLeadingZero: true,
+ showMinutesLeadingZero: true,
+ showPeriod: false,
+ showPeriodLabels: true,
+ periodSeparator: ' ',
+ altField: '#alternate_input',
+ defaultTime: '12:34',
+ showOn: 'focus',
+ button: null,
+ hourText: 'Hour',
+ minuteText: 'Minute',
+ amPmText: ['AM', 'PM'],
+
+ myPosition: 'left top',
+ atPosition: 'left bottom',
+ beforeShow: beforeShowCallback,
+ onSelect: onSelectCallback,
+ onClose: onCloseCallback,
+ onHourShow: onHourShow,
+ onMinuteShow: onMinuteShow,
+ hours: {
+ starts: 0,
+ ends: 23
+ },
+ minutes: {
+ starts: 0,
+ ends: 55,
+ interval: 5
+ },
+ rows: 4,
+ showHours: true,
+ showMinutes: true,
+ showCloseButton: false,
+ closeButtonText: 'Done',
+ showNowButton: false,
+ nowButtonText: 'Now',
+ showDeselectButton: false,
+ deselectButtonText: 'Deselect'
+});
\ No newline at end of file
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
diff --git a/knockout.editables/ko.editables-0.9.d.ts b/knockout.editables/ko.editables-0.9.d.ts
new file mode 100644
index 000000000..0579ee146
--- /dev/null
+++ b/knockout.editables/ko.editables-0.9.d.ts
@@ -0,0 +1,30 @@
+///
+
+// build: ko.editables 0.9
+// http://romanych.github.com/ko.editables/
+
+// bestowed by ko.editable(target)
+interface KnockoutEditable {
+ addEditable(target: any): any;
+ beginEdit(): void;
+ commit(): void;
+ rollback(): void;
+ hasChanges(): bool;
+}
+
+interface KnockoutEditableStatic {
+ (viewModel: any, autoInit?: bool): void;
+ beginEdit(scope: string): void;
+ commit(scope: string): void;
+ rollback(scope: string): void;
+ hasChanges(scope: string): bool;
+
+ // INTERNAL
+ //getHasChangesFlag(scope: string): any;
+ //enable(object: any, scope: string); void;
+}
+
+// extend ko global
+interface KnockoutStatic {
+ editable: KnockoutEditableStatic;
+}
\ No newline at end of file
diff --git a/knockout.mapping/knockout.mapping-2.0.d.ts b/knockout.mapping/knockout.mapping-2.0.d.ts
index 0667b9cf0..6ff398e37 100644
--- a/knockout.mapping/knockout.mapping-2.0.d.ts
+++ b/knockout.mapping/knockout.mapping-2.0.d.ts
@@ -3,6 +3,8 @@
// Definitions by: Boris Yankov
// Definitions https://github.com/borisyankov/DefinitelyTyped
+///
+
interface KnockoutMappingCreateOptions {
data: any;
parent: any;
diff --git a/knockout.viewmodel/knockout.viewmodel-1.1.d.ts b/knockout.viewmodel/knockout.viewmodel-1.1.d.ts
new file mode 100644
index 000000000..eece83f90
--- /dev/null
+++ b/knockout.viewmodel/knockout.viewmodel-1.1.d.ts
@@ -0,0 +1,19 @@
+///
+
+// build: knockout.viewmodel 1.1.3
+// http://coderenaissance.github.com/knockout.viewmodel/
+
+interface KnockoutViewModelStatic {
+ toModel(viewmodel: any): any;
+ fromModel(model: any, options?: any): any;
+ updateFromModel(viewmodel: any, model: any);
+
+ // INTERNAL flag: enable logging of conversions
+ // logs will be written to console
+ logging: bool;
+}
+
+// Extend ko global
+interface KnockoutStatic {
+ viewmodel: KnockoutViewModelStatic;
+}
\ No newline at end of file
diff --git a/pouchDB/pouch-0.1.d.ts b/pouchDB/pouch-0.1.d.ts
index da380db7a..0fa6a1eb2 100644
--- a/pouchDB/pouch-0.1.d.ts
+++ b/pouchDB/pouch-0.1.d.ts
@@ -10,7 +10,9 @@ interface PouchError {
}
interface PouchApi {
+ type(): string;
id(): string;
+ close(callback: () => void): void;
}
interface PouchInfoResponse {
@@ -49,6 +51,7 @@ interface PouchAllDocsItem {
id: string;
key: string;
value: any;
+ doc: any;
}
interface PouchAllDocsResponse {
@@ -66,8 +69,12 @@ interface PouchApi {
allDocs(callback: (err: PouchError, res: PouchAllDocsResponse) => void): void;
}
+interface PouchBulkDocsRequest {
+ docs: any[];
+}
+
interface PouchUpdateOptions {
- new_edits: bool;
+ new_edits?: bool;
}
interface PouchUpdateResponse {
@@ -77,8 +84,8 @@ interface PouchUpdateResponse {
}
interface PouchApi {
- bulkDocs(req, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse[]) => void): void;
- bulkDocs(req, callback: (err: PouchError, res: PouchUpdateResponse[]) => void): void;
+ bulkDocs(req: PouchBulkDocsRequest, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse[]) => void): void;
+ bulkDocs(req: PouchBulkDocsRequest, callback: (err: PouchError, res: PouchUpdateResponse[]) => void): void;
//
// post == insert (doc does not contain an _id)
//
@@ -87,13 +94,13 @@ interface PouchApi {
//
// put == update (doc DOES contain an _id)
//
- put(doc, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
- put(doc, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
+ put(doc: any, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
+ put(doc: any, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
//
// remove == delete
//
- remove(doc, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
- remove(doc, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
+ remove(doc: any, opts: PouchUpdateOptions, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
+ remove(doc: any, callback: (err: PouchError, res: PouchUpdateResponse) => void): void;
}
interface PouchFilter {
diff --git a/pouchDB/pouch-tests.ts b/pouchDB/pouch-tests.ts
index e5dc7bbe6..4d67520de 100644
--- a/pouchDB/pouch-tests.ts
+++ b/pouchDB/pouch-tests.ts
@@ -1,4 +1,4 @@
-///
+///
declare var $: any;
diff --git a/state-machine/state-machine-2.2.d.ts b/state-machine/state-machine-2.2.d.ts
new file mode 100644
index 000000000..a8682cdd5
--- /dev/null
+++ b/state-machine/state-machine-2.2.d.ts
@@ -0,0 +1,49 @@
+// Type definitions for Finite State Machine 2.2
+// Project: https://github.com/jakesgordon/javascript-state-machine
+// Definitions by: Boris Yankov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+interface ErrorCallback {
+ (name: string, from: string, to: string, args: any[]): void;
+}
+
+interface EventCallback {
+ event: string;
+ from: string;
+ to: string;
+ msg?: string;
+}
+
+interface StateMachineEvent {
+ name: string;
+ from: string;
+ to: string;
+}
+
+interface StateMachineConfig {
+ initial?: any; // string or { state: 'foo', event: 'setup', defer: true|false }
+ events?: StateMachineEvent[];
+ callbacks?: any;
+ target?: any;
+ error?: ErrorCallback;
+}
+
+interface StateMachineStatic {
+ create(config: StateMachineConfig, target?: any): StateMachine;
+}
+
+interface StateMachine {
+ current: string;
+ is(sstate: string): bool;
+ can(event: StateMachineEvent): bool;
+ cannot(event: StateMachineEvent): bool;
+ error: ErrorCallback;
+
+ onbeforeevent: EventCallback;
+ onleaveevent: EventCallback;
+ onenterevent: EventCallback;
+ onafterevent: EventCallback;
+}
+
+declare var StateMachine: StateMachineStatic;
\ No newline at end of file
diff --git a/state-machine/state-machine-tests.ts b/state-machine/state-machine-tests.ts
new file mode 100644
index 000000000..4ff9bdf93
--- /dev/null
+++ b/state-machine/state-machine-tests.ts
@@ -0,0 +1,18 @@
+///
+
+var fsm = StateMachine.create({
+ initial: 'green',
+ events: [
+ { name: 'warn', from: 'green', to: 'yellow' },
+ { name: 'panic', from: 'yellow', to: 'red' },
+ { name: 'calm', from: 'red', to: 'yellow' },
+ { name: 'clear', from: 'yellow', to: 'green' }
+ ],
+ callbacks: {
+ onpanic: function (event, from, to, msg) { alert('panic! ' + msg); },
+ onclear: function (event, from, to, msg) { alert('thanks to ' + msg); },
+ ongreen: function (event, from, to) { document.body.className = 'green'; },
+ onyellow: function (event, from, to) { document.body.className = 'yellow'; },
+ onred: function (event, from, to) { document.body.className = 'red'; },
+ }
+});
\ No newline at end of file