mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -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))
|
||||
|
||||
+1
-1
@@ -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
|
||||
@@ -0,0 +1,45 @@
|
||||
/// <reference path="../jquery/jquery-1.8.d.ts"/>
|
||||
/// <reference path="jquery.timepicker-0.3.d.ts"/>
|
||||
|
||||
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'
|
||||
});
|
||||
+14
-3
@@ -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 @@
|
||||
|
||||
/// <reference path="../jquery/jquery-1.8.d.ts"/>
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/// <reference path="../jquery/jquery-1.8.d.ts"/>
|
||||
/// <reference path="jquery.watermark-3.1.d.ts"/>
|
||||
|
||||
|
||||
$('#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();
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/// <reference path="knockout-2.2.d.ts" />
|
||||
|
||||
// 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;
|
||||
}
|
||||
+2
@@ -3,6 +3,8 @@
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../knockout/knockout-2.2.d.ts" />
|
||||
|
||||
interface KnockoutMappingCreateOptions {
|
||||
data: any;
|
||||
parent: any;
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/// <reference path="knockout-2.2.d.ts" />
|
||||
|
||||
// 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;
|
||||
}
|
||||
Vendored
+14
-7
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../../scripts/framework/pouch.d.ts" />
|
||||
/// <reference path="pouch-0.1.d.ts" />
|
||||
|
||||
declare var $: any;
|
||||
|
||||
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
// Type definitions for Finite State Machine 2.2
|
||||
// Project: https://github.com/jakesgordon/javascript-state-machine
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// 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;
|
||||
@@ -0,0 +1,18 @@
|
||||
/// <reference path="state-machine-2.2.d.ts" />
|
||||
|
||||
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'; },
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user