Merge pull request #4 from borisyankov/master

Update my fork
This commit is contained in:
Saftpresse99
2014-09-19 15:42:23 +02:00
303 changed files with 8903 additions and 2837 deletions
+13 -2
View File
@@ -1,4 +1,4 @@
# Contributors
# Contributors
This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.
@@ -118,6 +118,7 @@ All definitions files include a header with the author and editors, so at some p
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
* [gulp](http://gulpjs.com/) (by [Drew Noakes](https://drewnoakes.com))
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
@@ -161,6 +162,7 @@ All definitions files include a header with the author and editors, so at some p
* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge))
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
* [jQuery.customSelect](https://github.com/adamcoulombe/jquery.customSelect) (by [tomato360](https://github.com/tomato360))
* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny))
* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix))
@@ -175,6 +177,7 @@ All definitions files include a header with the author and editors, so at some p
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360))
* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli))
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
@@ -214,6 +217,7 @@ All definitions files include a header with the author and editors, so at some p
* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/))
* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/))
* [keymaster.js](https://github.com/madrobby/keymaster) (by [Marting W. Kirst](https://github.com/nitram509/))
* [Keypress](https://github.com/dmauro/Keypress/) (by [Roger Chen](https://github.com/rcchen/))
* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
* [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))
@@ -244,14 +248,16 @@ All definitions files include a header with the author and editors, so at some p
* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr))
* [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga))
* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613))
* [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee))
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame))
* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon))
* [Mixpanel](https://github.com/mixpanel/mixpanel-js) (by [Knut Eirik Leira Hjelle](https://github.com/hjellek))
* [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame))
* [mocha-phantomjs](https://github.com/metaskills/mocha-phantomjs) (by [ErikSchierboom](https://github.com/ErikSchierboom))
* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/))
* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield))
* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee))
@@ -275,11 +281,13 @@ All definitions files include a header with the author and editors, so at some p
* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov))
* [node-uuid](https://github.com/broofa/node-uuid) (by [Jeff May](https://github.com/jeffmay))
* [notify.js](https://github.com/alexgibson/notify.js) (by [soundTricker](https://github.com/soundTricker))
* [npm](https://github.com/npm/npm) (by [Maxime LUCE](https://github.com/SomaticIT))
* [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel))
* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/))
* [object-path](https://github.com/mariocasciaro/object-path) (by [Paulo Cesar](https://github.com/pocesar/))
* [ocLazyLoad](https://github.com/ocombe/ocLazyLoad) (by [Roland Zwaga](https://github.com/rolandzwaga/))
* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/))
* [opn](https://github.com/sindresorhus/opn) (by [Shinnosuke Watanabe](https://github.com/shinnn))
* [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [passport-facebook](https://github.com/jaredhanson/passport-facebook) (by [James Roland Cabresos](https://github.com/staticfunction/))
@@ -288,6 +296,7 @@ All definitions files include a header with the author and editors, so at some p
* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds))
* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin))
* [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura))
* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame))
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
@@ -323,6 +332,7 @@ All definitions files include a header with the author and editors, so at some p
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
* [ShellJS](http://shelljs.org) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [Showdown](https://github.com/coreyti/showdown) (by [Chris Bowdon](https://github.com/cbowdon))
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
@@ -389,3 +399,4 @@ All definitions files include a header with the author and editors, so at some p
* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov))
* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith))
* [Parse SDK](https://parse.com/docs/js_guide) (by [Ullisen Media Group, LLC](http://ullisenmedia.com))
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1
View File
@@ -23,6 +23,7 @@ declare module ng.ui {
onEnter?: any;
onExit?: any;
data?: any;
reloadOnSearch?: boolean;
}
interface IStateProvider extends IServiceProvider {
+4
View File
@@ -618,6 +618,10 @@ module locationTests {
$location.search('foo', 'yipee');
// => $location
// set foo to 5
$location.search('foo', 5);
// => $location
/*
* From: https://docs.angularjs.org/guide/$location
*/
+34 -23
View File
@@ -150,12 +150,12 @@ declare module ng {
/**
* Creates a deep copy of source, which should be an object or an array.
*
*
* - If no destination is supplied, a copy of the object or array is created.
* - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it.
* - If source is not an object or array (inc. null and undefined), source is returned.
* - If source is identical to 'destination' an exception will be thrown.
*
*
* @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined.
* @param destination Destination into which the source is copied. If provided, must be of the same type as source.
*/
@@ -163,7 +163,7 @@ declare module ng {
/**
* Wraps a raw DOM element or HTML string as a jQuery element.
*
*
* If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
*/
element: IAugmentedJQueryStatic;
@@ -290,14 +290,14 @@ declare module ng {
controller(object: Object): IModule;
/**
* Register a new directive with the compiler.
*
*
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
* @param directiveFactory An injectable directive factory function.
*/
directive(name: string, directiveFactory: IDirectiveFactory): IModule;
/**
* Register a new directive with the compiler.
*
*
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
* @param directiveFactory An injectable directive factory function.
*/
@@ -445,6 +445,7 @@ declare module ng {
$untouched: boolean;
$validators: IModelValidators;
$asyncValidators: IAsyncModelValidators;
$pristine: boolean;
$dirty: boolean;
@@ -456,6 +457,10 @@ declare module ng {
[index: string]: (...args: any[]) => boolean;
}
interface IAsyncModelValidators {
[index: string]: (...args: any[]) => ng.IPromise<boolean>;
}
interface IModelParser {
(value: any): any;
}
@@ -482,22 +487,20 @@ declare module ng {
$digest(): void;
$emit(name: string, ...args: any[]): IAngularEvent;
// Documentation says exp is optional, but actual implementaton counts on it
$eval(expression: string, args?: Object): any;
$eval(expression: (scope: IScope) => any, args?: Object): any;
$eval(expression?: string, args?: Object): any;
$eval(expression?: (scope: IScope) => any, args?: Object): any;
// Documentation says exp is optional, but actual implementaton counts on it
$evalAsync(expression: string): void;
$evalAsync(expression: (scope: IScope) => any): void;
$evalAsync(expression?: string): void;
$evalAsync(expression?: (scope: IScope) => any): void;
// Defaults to false by the implementation checking strategy
$new(isolate?: boolean): IScope;
/**
* Listens on events of a given type. See $emit for discussion of event life cycle.
*
* The event listener function format is: function(event, args...).
*
*
* The event listener function format is: function(event, args...).
*
* @param name Event name to listen on.
* @param listener Function to call when the event is emitted.
*/
@@ -721,7 +724,7 @@ declare module ng {
/**
* Change path when called with parameter and return $location.
* Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
*
*
* @param path New path
*/
path(path: string): ILocationService;
@@ -731,30 +734,38 @@ declare module ng {
replace(): ILocationService;
/**
* Return search part (as object) of current url
* Return search part (as object) of current url
*/
search(): any;
/**
* Change search part when called with parameter and return $location.
*
*
* @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
*
*
* If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
*/
search(search: any): ILocationService;
/**
* Change search part when called with parameter and return $location.
*
*
* @param search New search params
* @param paramValue If search is a string, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
*/
search(search: string, paramValue: string): ILocationService;
/**
* Change search part when called with parameter and return $location.
*
*
* @param search New search params
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
*/
search(search: string, paramValue: number): ILocationService;
/**
* Change search part when called with parameter and return $location.
*
* @param search New search params
* @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument.
*/
@@ -762,7 +773,7 @@ declare module ng {
/**
* Change search part when called with parameter and return $location.
*
*
* @param search New search params
* @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
*/
@@ -892,7 +903,7 @@ declare module ng {
/**
* Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
*
*
* Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
*/
finally<TResult>(finallyCallback: () => any): IPromise<TResult>;
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
"--noImplicitAny --module commonjs"
--noImplicitAny --module commonjs
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
--noImplicitAny --module commonjs --target es5
--noImplicitAny --module commonjs --target es5
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
--target ES5
--target ES5
+1 -1
View File
@@ -1 +1 @@
""
+4 -4
View File
@@ -477,10 +477,10 @@ barProm = fooProm.race<Bar>();
//TODO fix collection inference
barProm = fooProm.map<Foo, Bar>((item: Foo, index: number, arrayLength: number) => {
barArrProm = fooProm.map<Foo, Bar>((item: Foo, index: number, arrayLength: number) => {
return bar;
});
barProm = fooProm.map<Foo, Bar>((item: Foo) => {
barArrProm = fooProm.map<Foo, Bar>((item: Foo) => {
return bar;
});
@@ -495,10 +495,10 @@ barProm = fooProm.reduce<Foo, Bar>((memo: Bar, item: Foo) => {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fooProm = fooProm.filter<Foo>((item: Foo, index: number, arrayLength: number) => {
fooArrProm = fooArrProm.filter<Foo>((item: Foo, index: number, arrayLength: number) => {
return bool;
});
fooProm = fooProm.filter<Foo>((item: Foo) => {
fooArrProm = fooArrProm.filter<Foo>((item: Foo) => {
return bool;
});
+4 -4
View File
@@ -296,8 +296,8 @@ declare class Promise<R> implements Promise.Thenable<R> {
* Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
// TODO type inference from array-resolving promise?
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U): Promise<U>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U): Promise<U[]>;
/**
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
@@ -310,8 +310,8 @@ declare class Promise<R> implements Promise.Thenable<R> {
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
// TODO type inference from array-resolving promise?
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<U>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise<U>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<U[]>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise<U[]>;
/**
* Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise.
+52 -49
View File
@@ -2,73 +2,76 @@
/// <reference path="bootbox.d.ts" />
bootbox.alert("Are we ok?");
bootbox.alert("Are we ok with Test button?", "Test");
bootbox.alert("Are we ok with callback?", function() {
bootbox.alert("Are we ok with callback?", function () {
console.log("Callback called!");
});
bootbox.alert("Are we ok with callback and custom button?", "Test", function() {
console.log("Callback called!");
bootbox.alert({
message: "Are we ok with callback and custom button?",
callback: function () {
console.log("Callback called!");
}
});
bootbox.confirm("Click ok to pass test", function(result) {
console.log(result);
});
bootbox.confirm("Click ok to pass test");
bootbox.confirm("Click cancel to pass test", function(result) {
bootbox.confirm("Click cancel to pass test", function (result) {
console.log(!result);
});
bootbox.confirm("Click confirm to pass test", "Cancel?", "Confirm?", function(result) {
console.log(result);
});
bootbox.confirm("Click cancel to pass test", "Cancel?", "Confirm?", function(result) {
console.log(!result);
bootbox.confirm({
message: "Click confirm to pass test",
callback: function (result) {
console.log(result);
}
});
bootbox.prompt("Are we ok?");
bootbox.prompt("Enter 'ok' to pass test", function(result) {
bootbox.prompt("Enter 'ok' to pass test", function (result) {
console.log(result);
});
bootbox.prompt("Enter 'ok' to pass test", "Cancel?", "Confirm?", function(result) {
console.log(result);
bootbox.prompt({
message: "Enter 'ok' to pass test", callback: function (result) {
console.log(result);
}
});
bootbox.prompt("Keep default value and click ok", "Cancel?", "Confirm?", function(result) {
console.log(result);
}, "Test Value");
bootbox.dialog("Test Dialog");
var handler = {
label: "OK",
class: "MyClass",
bootbox.dialog("Test Dialog", function (result) {
return result;
});
bootbox.dialog({
message: "Test Dialog",
callback: function (result) { }
});
var bdo: BootboxDialogOptions;
var sampleButton: BootboxButton = {
label: 'ButtonLabelToUse',
callback: function () {
console.log("Test Dialog");
return 'callback of button click'
},
className: 'additionalButtonClassName'
};
bdo = {
message: '',
className: 'callName',
buttons: {
'ButtonTextLabel': sampleButton
}
};
var option = {
header: "header",
headerCloseButton: true
};
bootbox.dialog(bdo);
bootbox.dialog("Test Dialog", handler);
bootbox.dialog("Test Dialog", [handler], option);
bootbox.setDefaults({
locale: 'en_US',
animate: false,
backdrop: false,
className: 'newClassName',
closeButton: true,
show: true
})
bootbox.hideAll();
bootbox.animate(false);
bootbox.backdrop("backdrop");
bootbox.classes("myClass");
var icons: BootboxIcons = {
OK: "OK Icon",
CANCEL: "Cancel Icon",
CONFIRM: "Confirm Icon"
};
bootbox.setIcons(icons);
bootbox.setLocale("en");
bootbox.addLocale("klingon", { OK: "luq", CANCEL: "qIl", CONFIRM: "Confirm" });
bootbox.hideAll();
+48 -33
View File
@@ -1,48 +1,63 @@
// Type definitions for Bootbox 3.0.0
// Type definitions for Bootbox 4.0.0
// Project: https://github.com/makeusabrew/bootbox
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BootboxLocale {
OK: string;
CANCEL: string;
CONFIRM: string;
interface BootboxAlertOptions {
message: string;
callback?: () => any;
}
interface BootboxIcons {
OK: any;
CANCEL: any;
CONFIRM: any;
interface BootboxConfirmOptions {
message: string;
callback?: (result: boolean) => any;
}
interface BootboxHandler {
label: string;
class: string;
callback: (result?: any) => void;
interface BootboxPromptOptions {
message: string;
callback?: (result: string) => any;
}
interface BootboxOption {
header: string;
headerCloseButton: boolean;
interface BootboxButton {
label?: string;
className?: string;
callback?: () => any;
}
interface BootboxDialogOptions {
message: any; // String | Element
title?: any; // String | Element
callback?: (result: boolean) => any;
show?: boolean;
onEscape?: () => any;
backdrop?: boolean;
closeButton?: boolean;
animate?: boolean;
className?: string;
buttons?: Object; // complex object where each key is of type BootboxButton
}
interface BootboxDefaultOptions {
locale?: string;
show?: boolean;
backdrop?: boolean;
closeButton?: boolean;
animate?: boolean;
className?: string;
}
interface BootboxStatic {
alert(message: string, callback: () => void): void;
alert(message: string, customButtonText?: string, callback?: () => void): void;
confirm(message: string, callback: (result: boolean) => void): void;
confirm(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: boolean) => void): void;
prompt(message: string, callback: (result: string) => void, defaultValue?: string): void;
prompt(message: string, cancelButtonText?: string, confirmButtonText?: string, callback?: (result: string) => void, defaultValue?: string): void;
dialog(message: string, handlers: BootboxHandler[], options?: any): void;
dialog(message: string, handler: BootboxHandler): void;
dialog(message: string): void;
alert(message: string, callback?: () => void): void;
alert(options: BootboxAlertOptions): void;
confirm(message: string, callback?: (result: boolean) => void): void;
confirm(options: BootboxConfirmOptions): void;
prompt(message: string, callback?: (result: string) => void): void;
prompt(options: BootboxPromptOptions): void;
dialog(message: string, callback?: (result: string) => void): void;
dialog(options: BootboxDialogOptions): void;
setDefaults(options: BootboxDefaultOptions): void;
hideAll(): void;
animate(shouldAnimate: boolean): void;
backdrop(backdropValue: string): void;
classes(customCssClasses: string): void;
setIcons(icons: BootboxIcons): void;
setLocale(localeName: string): void;
addLocale(localeName: string, translations: BootboxLocale) : void;
}
declare var bootbox : BootboxStatic;
declare var bootbox: BootboxStatic;
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1
View File
@@ -0,0 +1 @@
cordova-tests.js
+70 -10
View File
@@ -10,19 +10,33 @@ console.log('cordova.version: ' + cordova.version + ', cordova.platformId: ' + c
cordova.exec(null, null, "NativeClassName", "MethodName");
cordova.define('mymodule', (require, exports, module) => { });
cordova.define('mymodule', (req, exp, mod)=> {
mod.exports = { dummy: () => { console.log("i'm a dummy"); }};
});
var myModule = cordova.require('mymodule');
myModule.dummy();
var argsCheck: ArgsCheck = <ArgsCheck>cordova.require('cordova/argcheck');
argsCheck.checkArgs('ssA', 'cordova.exec', [() => { }, () => { }, 'window', 'openDatabase']);
class Application {
start() { console.log("Starting app"); }
pause() { console.log('app paused'); }
}
declare var app: Application;
document.addEventListener('deviceready', () => { app.start(); });
document.addEventListener('pause', ()=> { app.pause(); });
// Battery status plugin
//----------------------------------------------------------------------
window.addEventListener('batterystatus',
(ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); });
window.addEventListener('batterycritical',
()=> { alert('Battery is critical low!'); });
() => { alert('Battery is critical low!'); });
// Camera plugin
//----------------------------------------------------------------------
@@ -51,10 +65,12 @@ var contact: Contact = navigator.contacts.create({
navigator.contacts.find(["phoneNumbers"],
(contacts: Contact[])=> { alert('Find ' + contacts.length + ' contacts'); },
(error: ContactError) => { alert('Error: ' + error.message); },
{
filter: "+1",
multiple: true
}
new ContactFindOptions("+1", true)
);
navigator.contacts.pickContact(
(contact: Contact)=> { console.log(contact); },
(err: ContactError)=> { console.log(err.message); }
);
// Device API
@@ -105,26 +121,64 @@ function fsaccessor(fs: FileSystem) {
var fsreader: DirectoryReader = fs.root.createReader();
fsreader.readEntries(
(entries: Entry[]) => { console.log(fs.root.name + ' has ' + entries.length + ' child elements'); },
(err: Error)=> { alert('Error: ' + err.message); });
(err: FileError)=> { alert('Error: ' + err.code); });
}
window.requestFileSystem(
window.TEMPORARY,
1024 * 1024 * 5,
fsaccessor,
(err: Error) => { alert('Error: ' + err.message); });
(err: FileError) => { alert('Error: ' + err.code); }
);
window.resolveLocalFileSystemURI(cordova.file.applicationDirectory,
(entry: Entry)=> {
if (entry.isDirectory) {
console.log('successfully resolved ' + entry.fullPath + 'directory');
console.log(entry.toURL());
console.log(entry.toInternalURL());
} else {
var fentry = <FileEntry>entry;
fentry.file((f: File) => { console.log(f.slice(f.size - 10, f.size)); });
fentry.createWriter((writer: FileWriter)=> {
if (writer.readyState == FileWriter.INIT) {
console.log('Init FileWriter');
writer.write(new Blob(['sdfdsfsdf']));
writer.onprogress = function(ev: ProgressEvent) {
console.log('Writing ' + ev.target);
};
}
});
}
},
(error: FileError) => { console.log(error.code); }
);
// FileTransfer plugin
//----------------------------------------------------------------------
var file = new FileTransfer();
file.onprogress = (ev: ProgressEvent) => {
if (ev.lengthComputable) {
console.log(ev.loaded + '/' + ev.total);
}
};
file.download('http://some.server.com/download.php',
'cdvfile://localhost/persistent/path/to/downloads/',
(file: FileEntry)=> { console.log('File Downloaded to ' + file.fullPath); },
(err: FileTransferError)=> { alert('Error ' + err.code); },
(err: FileTransferError) => {
console.error('Error ' + err.code);
if (err.exception) {
console.error('Failed with exception ' + err.exception);
}
},
{ headers: null },
true);
file.abort();
// InAppBrowser plugin
//----------------------------------------------------------------------
@@ -135,6 +189,10 @@ file.download('http://some.server.com/download.php',
var iab = <InAppBrowser>window.open('google.com', '_self');
iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); });
iab.show();
iab.executeScript(
{ code: "console.log('Injected script in action')" },
()=> { console.log('Script is executed'); }
);
// Globalization plugin
//----------------------------------------------------------------------
@@ -226,4 +284,6 @@ db.transaction(
// Vibration plugin
//----------------------------------------------------------------------
navigator.notification.vibrate(100);
navigator.notification.vibrate(100);
navigator.notification.vibrateWithPattern([100, 200, 200, 150, 50], 3);
setTimeout(navigator.notification.cancelVibration, 1000);
+27
View File
@@ -44,6 +44,33 @@ interface Cordova {
require(moduleName: string): any;
}
interface Document {
addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
}
// cordova/argscheck module
interface ArgsCheck {
checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void;
+12 -5
View File
@@ -44,11 +44,11 @@ interface Camera {
}
interface CameraOptions {
/** Picture quality in range o-100 */
/** Picture quality in range 0-100. Default is 50 */
quality?: number;
/**
* Choose the format of the return value.
* Defined in navigator.camera.DestinationType
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
* DATA_URL : 0, Return image as base64-encoded string
* FILE_URI : 1, Return image file URI
* NATIVE_URI : 2 Return image native URI
@@ -56,7 +56,8 @@ interface CameraOptions {
*/
destinationType?: number;
/**
* Set the source of the picture. Defined in navigator.camera.PictureSourceType
* Set the source of the picture.
* Defined in navigator.camera.PictureSourceType. Default is CAMERA.
* PHOTOLIBRARY : 0,
* CAMERA : 1,
* SAVEDPHOTOALBUM : 2
@@ -65,7 +66,8 @@ interface CameraOptions {
/** Allow simple editing of image before selection. */
allowEdit?: boolean;
/**
* Choose the returned image file's encoding. Defined in navigator.camera.EncodingType
* Choose the returned image file's encoding.
* Defined in navigator.camera.EncodingType. Default is JPEG
* JPEG : 0 Return JPEG encoded image
* PNG : 1 Return PNG encoded image
*/
@@ -93,7 +95,12 @@ interface CameraOptions {
correctOrientation?: boolean;
/** Save the image to the photo album on the device after capture. */
saveToPhotoAlbum?: boolean;
/** Choose the camera to use (front- or back-facing). Defined in navigator.camera.Direction */
/**
* Choose the camera to use (front- or back-facing).
* Defined in navigator.camera.Direction. Default is BACK.
* FRONT: 0
* BACK: 1
*/
cameraDirection?: number;
/** iOS-only options that specify popover location in iPad. Defined in CameraPopoverOptions. */
popoverOptions?: CameraPopoverOptions;
+12 -1
View File
@@ -34,6 +34,14 @@ interface Contacts {
onSuccess: (contacts: Contact[]) => void,
onError: (error: ContactError) => void,
options?: ContactFindOptions): void;
/**
* The navigator.contacts.pickContact method launches the Contact Picker to select a single contact.
* The resulting object is passed to the contactSuccess callback function specified by the contactSuccess parameter.
* @param onSuccess Success callback function invoked with the array of Contact objects returned from the database
* @param onError Error callback function, invoked when an error occurs.
*/
pickContact(onSuccess: (contact: Contact) => void,
onError: (error: ContactError) => void): void
}
interface ContactProperties {
@@ -253,10 +261,13 @@ interface ContactFindOptions {
filter?: string;
/** Determines if the find operation returns multiple navigator.contacts. */
multiple?: boolean;
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
desiredFields?: string[];
}
declare var ContactFindOptions: {
/** Constructor for ContactFindOptions object */
new(filter?: string,
multiple?: boolean): ContactFindOptions
multiple?: boolean,
desiredFields?: string[]): ContactFindOptions
};
+4 -1
View File
@@ -59,7 +59,10 @@ interface Notification {
/** Object, passed to promptCallback */
interface NotificationPromptResult {
/** The index of the pressed button. Note that the index uses one-based indexing, so the value is 1, 2, 3, etc. */
/**
* The index of the pressed button. Note that the index uses one-based indexing, so the value is 1, 2, 3, etc.
* 0 is the result when the dialog is dismissed without a button press.
*/
buttonIndex: number;
/** The text entered in the prompt dialog box. */
input1: string;
+101 -19
View File
@@ -18,7 +18,16 @@ interface Window {
type: number,
size: number,
successCallback: (fileSystem: FileSystem) => void,
errorCallback?: (fileError: Error) => void): void;
errorCallback?: (fileError: FileError) => void): void;
/**
* Look up file system Entry referred to by local URI.
* @param string uri URI referring to a local file or directory
* @param successCallback invoked with Entry object corresponding to URI
* @param errorCallback invoked if error occurs retrieving file system entry
*/
resolveLocalFileSystemURI(uri: string,
successCallback: (entry: Entry) => void,
errorCallback?: (error: FileError) => void): void;
TEMPORARY: number;
PERSISTENT: number;
}
@@ -54,7 +63,7 @@ interface Entry {
*/
getMetadata(
successCallback: (metadata: Metadata) => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
/**
* Move an entry to a different location on the file system. It is an error to try to:
* move a directory inside itself or to any child at any depth;move an entry into its parent if a name different from its current one isn't provided;
@@ -69,9 +78,9 @@ interface Entry {
* @param errorCallback A callback that is called when errors happen.
*/
moveTo(parent: DirectoryEntry,
newName?: string,
successCallback?: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
newName?: string,
successCallback?: (entry: Entry) => void,
errorCallback?: (error: FileError) => void): void;
/**
* Copy an entry to a different location on the file system. It is an error to try to:
* copy a directory inside itself or to any child at any depth;
@@ -88,24 +97,34 @@ interface Entry {
* @param errorCallback A callback that is called when errors happen.
*/
copyTo(parent: DirectoryEntry,
newName?: string,
successCallback?: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
newName?: string,
successCallback?: (entry: Entry) => void,
errorCallback?: (error: FileError) => void): void;
/**
* Returns a URL that can be used as the src attribute of a <video> or <audio> tag.
* If that is not possible, construct a cdvfile:// URL.
* @return string URL
*/
toURL(): string;
/**
* Return a URL that can be passed across the bridge to identify this entry.
* @return string URL that can be passed across the bridge to identify this entry
*/
toInternalURL(): string;
/**
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
* @param successCallback A callback that is called on success.
* @param errorCallback A callback that is called when errors happen.
*/
remove(successCallback: () => void ,
errorCallback?: (error: Error) => void ): void;
remove(successCallback: () => void,
errorCallback?: (error: FileError) => void): void;
/**
* Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
* @param successCallback A callback that is called with the time of the last modification.
* @param errorCallback A callback that is called when errors happen.
*/
getParent(successCallback: (entry: Entry) => void ,
errorCallback?: (error: Error) => void ): void;
getParent(successCallback: (entry: Entry) => void,
errorCallback?: (error: FileError) => void): void;
}
/** This interface supplies information about the state of a file or directory. */
@@ -137,7 +156,7 @@ interface DirectoryEntry extends Entry {
*/
getFile(path: string, options?: Flags,
successCallback?: (entry: FileEntry) => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
/**
* Creates or looks up a directory.
* @param path Either an absolute path or a relative path from this DirectoryEntry
@@ -153,7 +172,7 @@ interface DirectoryEntry extends Entry {
*/
getDirectory(path: string, options?: Flags,
successCallback?: (entry: DirectoryEntry) => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
/**
* Deletes a directory and all of its contents, if any. In the event of an error (e.g. trying
* to delete a directory that contains a file that cannot be removed), some of the contents
@@ -162,7 +181,7 @@ interface DirectoryEntry extends Entry {
* @param errorCallback A callback that is called when errors happen.
*/
removeRecursively(successCallback: () => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
}
/**
@@ -194,7 +213,9 @@ interface DirectoryReader {
* of readEntries, successCallback must be called with a zero-length array as an argument.
* @param errorCallback A callback indicating that there was an error reading from the Directory.
*/
readEntries(successCallback: (entries: Entry[]) => void, errorCallback?: (error: Error) => void): void;
readEntries(
successCallback: (entries: Entry[]) => void,
errorCallback?: (error: FileError) => void): void;
}
/** This interface represents a file on a file system. */
@@ -206,14 +227,14 @@ interface FileEntry extends Entry {
*/
createWriter(successCallback: (
writer: FileWriter) => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
/**
* Returns a File that represents the current state of the file that this FileEntry represents.
* @param successCallback A callback that is called with the File.
* @param errorCallback A callback that is called when errors happen.
*/
file(successCallback: (file: File) => void,
errorCallback?: (error: Error) => void): void;
errorCallback?: (error: FileError) => void): void;
}
/**
@@ -279,4 +300,65 @@ interface FileWriter extends FileSaver {
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
*/
truncate(size: number): void;
}
}
/* FileWriter states */
declare var FileWriter: {
INIT: number;
WRITING: number;
DONE: number
};
interface FileError {
/** Error code */
code: number;
}
declare var FileError: {
new (code: number): FileError;
NOT_FOUND_ERR: number;
SECURITY_ERR: number;
ABORT_ERR: number;
NOT_READABLE_ERR: number;
ENCODING_ERR: number;
NO_MODIFICATION_ALLOWED_ERR: number;
INVALID_STATE_ERR: number;
SYNTAX_ERR: number;
INVALID_MODIFICATION_ERR: number;
QUOTA_EXCEEDED_ERR: number;
TYPE_MISMATCH_ERR: number;
PATH_EXISTS_ERR: number;
};
/*
* Constants defined in fileSystemPaths
*/
interface Cordova {
file: {
/* Read-only directory where the application is installed. */
applicationDirectory: string;
/* Root of app's private writable storage */
applicationStorageDirectory: string;
/* Where to put app-specific data files. */
dataDirectory: string;
/* Cached files that should survive app restarts. Apps should not rely on the OS to delete files in here. */
cacheDirectory: string;
/* Android: the application space on external storage. */
externalApplicationStorageDirectory: string;
/* Android: Where to put app-specific data files on external storage. */
externalDataDirectory: string;
/* Android: the application cache on external storage. */
externalCacheDirectory: string;
/* Android: the external storage (SD card) root. */
externalRootDirectory: string;
/* iOS: Temp directory that the OS can clear at will. */
tempDirectory: string;
/* iOS: Holds app-specific files that should be synced (e.g. to iCloud). */
syncedDataDirectory: string;
/* iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files) */
documentsDirectory: string;
/* BlackBerry10: Files globally available to all apps */
sharedDirectory: string
}
}
+5 -2
View File
@@ -14,7 +14,7 @@
*/
interface FileTransfer {
/** Called with a ProgressEvent whenever a new chunk of data is transferred. */
onprogress: Function;
onprogress: (event: ProgressEvent) => void;
/**
* Sends a file to a server.
* @param fileURL Filesystem URL representing the file on the device. For backwards compatibility,
@@ -116,12 +116,15 @@ interface FileTransferError {
target: string;
/** HTTP status code. This attribute is only available when a response code is received from the HTTP connection. */
http_status: number;
/* Request body */
body: any;
/* Exception that is thrown by native code */
exception: any;
}
declare var FileTransferError: {
/** Constructor for FileTransferError object */
new (code?: number, source?: string, target?: string, status?: number, body?: any): FileTransferError;
new (code?: number, source?: string, target?: string, status?: number, body?: any, exception?: any): FileTransferError;
FILE_NOT_FOUND_ERR: number;
INVALID_URL_ERR: number;
CONNECTION_ERR: number;
+13
View File
@@ -12,4 +12,17 @@ interface Notification {
* @param time Milliseconds to vibrate the device. Ignored on iOS.
*/
vibrate(time: number): void
/**
* Vibrates the device with a given pattern.
* @param number[] pattern Pattern with which to vibrate the device.
* The first value - number of milliseconds to wait before turning the vibrator on.
* The next value - the number of milliseconds for which to keep the vibrator on before turning it off.
* @param number repeat Optional index into the pattern array at which to start repeating (will repeat until canceled),
* or -1 for no repetition (default).
*/
vibrateWithPattern(pattern: number[], repeat: number): void;
/**
* Immediately cancels any currently running vibration.
*/
cancelVibration(): void;
}
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
Vendored
+2 -1
View File
@@ -808,7 +808,7 @@ declare module D3 {
* Returns the first non-null element in the current selection. If the selection is empty,
* returns null.
*/
node: () => Element;
node: <T extends Element>() => T;
}
export interface EnterSelection {
@@ -1104,6 +1104,7 @@ declare module D3 {
offset(offset: string): StackLayout;
x(accessor: (d: any, i: number) => any): StackLayout;
y(accessor: (d: any, i: number) => any): StackLayout;
out(setter: (d: any, y0: number, y: number) => void): StackLayout;
}
export interface TreeLayout {
@@ -1 +1 @@
""
+61
View File
@@ -0,0 +1,61 @@
/// <reference path="./deep-diff.d.ts" />
import _deepDiff = require('deep-diff');
var diff = _deepDiff.diff;
var lhs = {
name: 'my object',
description: 'it\'s an object!',
details: {
it: 'has',
an: 'array',
with: ['a', 'few', 'elements']
}
};
var rhs = {
name: 'updated object',
description: 'it\'s an object!',
details: {
it: 'has',
an: 'array',
with: ['a', 'few', 'more', 'elements', { than: 'before' }]
}
};
var differences: deepDiff.IDiff[] = diff(lhs, rhs);
console.log(differences);
// --------------------------
var observableDiff = _deepDiff.observableDiff;
var applyChange = _deepDiff.applyChange;
var lhs = {
name: 'my object',
description: 'it\'s an object!',
details: {
it: 'has',
an: 'array',
with: ['a', 'few', 'elements']
}
};
var rhs = {
name: 'updated object',
description: 'it\'s an object!',
details: {
it: 'has',
an: 'array',
with: ['a', 'few', 'more', 'elements', { than: 'before' }]
}
};
observableDiff(lhs, rhs, function (d: deepDiff.IDiff) {
// Apply all changes except those to the 'name' property...
if (d.path.length !== 1 || d.path.join('.') !== 'name') {
applyChange(lhs, rhs, d);
}
});
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for deep-diff
// Project: https://github.com/flitbit/diff/
// Definitions by: ZauberNerd <https://github.com/ZauberNerd/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module deepDiff {
interface IDiff {
kind: string;
path: string[];
lhs: any;
rhs: any;
index?: number;
item?: IDiff;
}
interface IAccumulator {
push(diff: IDiff): void;
length: number;
}
interface IPrefilter {
(path: string[], key: string): boolean;
}
interface IDeepDiff {
diff(): IDiff;
diff(lhs: Object, rhs: Object, prefilter?: IPrefilter, acc?: IAccumulator): IDiff[];
observableDiff(lhs: Object, rhs: Object, changes: Function, prefilter?: IPrefilter, path?: string[], key?: string, stack?: Object[]): void;
applyDiff(target: Object, source: Object, filter: Function): void;
applyChange(target: Object, source: Object, change: IDiff): void;
revertChange(target: Object, source: Object, change: IDiff): void;
isConflict(): boolean;
noConflict(): IDeepDiff;
}
}
declare var diff: deepDiff.IDeepDiff;
declare module "deep-diff" {
var diff: deepDiff.IDeepDiff;
export = diff;
}
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,7 @@ module Test {
}
});
var application = new DevExpress.framework.html.HtmlApplication({
var application:DevExpress.framework.html.HtmlApplication = new DevExpress.framework.html.HtmlApplication({
namespace: "global",
defaultLayout: "slideout",
navigation: [
@@ -42,7 +42,7 @@ module Test {
]
});
$("div").appendTo(document.body).dxTabs({
itemClickAction: function (e) {
itemClickAction: function (e: any) {
console.log(e.itemData.text);
},
items: [
@@ -75,7 +75,7 @@ module Test {
{ title: "unread", text: "unread" },
{ title: "favorites", text: "favorites" }
],
itemSelectAction: function (e) { console.log("itemSelectAction"); }
itemSelectAction: function (e: Object) { console.log("itemSelectAction"); }
});
$("div").appendTo(document.body).dxLookup({
items: [
@@ -89,7 +89,7 @@ module Test {
],
valueExpr: 'id',
displayExpr: 'caption',
itemRender: function (item) {
itemRender: function (item: any) {
return "Text is: " + item.caption;
}
});
@@ -108,7 +108,7 @@ module Test {
{ text: "home", icon: "home" },
{ text: "URI", icon: "tips" }
],
itemClickAction: function (e) { console.log(e.itemData.text); }
itemClickAction: function (e: any) { console.log(e.itemData.text); }
});
$("div").appendTo(document.body).dxSwitch({
value: false,
@@ -142,28 +142,21 @@ module Test {
visible: true,
target: '.dx-button'
});
$("div").appendTo(document.body).dxEditBox({
value: "Value",
readOnly: false,
enterKeyAction: function (e) { console.log("key entered"); },
focusOutAction: function (e) { console.log("focus out"); },
focusInAction: function (e) { console.log("focus in"); }
});
$("div").appendTo(document.body).dxTextBox({
value: "Text",
placeholder: "Placeholder",
mode: "email",
maxLength: 20,
readOnly: false,
changeAction: function (e) { console.log("value changed"); },
valueUpdateAction: function (e) { console.log("value updated"); }
changeAction: function (e:Object) { console.log("value changed"); },
valueUpdateAction: function (e:Object) { console.log("value updated"); }
});
$("div").appendTo(document.body).dxToolbar({
items: [
{ align: 'left', widget: 'button', options: { type: 'back', text: 'Back', clickAction: function (e) { console.log("back clicked"); } } },
{ align: 'center', widget: 'button', options: { text: 'button', clickAction: function (e) { console.log("button clicked"); } } },
{ align: 'center', widget: 'button', options: { icon: 'plus', text: 'add', clickAction: function (e) { console.log("plus clicked"); } } },
{ align: 'right', widget: 'button', options: { icon: 'find', clickAction: function (e) { console.log("find clicked"); } }, useMenu: false },
{ align: 'left', widget: 'button', options: { type: 'back', text: 'Back', clickAction: function (e:Object) { console.log("back clicked"); } } },
{ align: 'center', widget: 'button', options: { text: 'button', clickAction: function (e:Object) { console.log("button clicked"); } } },
{ align: 'center', widget: 'button', options: { icon: 'plus', text: 'add', clickAction: function (e:Object) { console.log("plus clicked"); } } },
{ align: 'right', widget: 'button', options: { icon: 'find', clickAction: function (e:Object) { console.log("find clicked"); } }, useMenu: false },
{ text: 'Products', isMenu: true }
]
});
@@ -174,7 +167,7 @@ module Test {
{ text: "item3", widthRatio: 2, heightRatio: 2 }
],
listHeight: 500,
itemRender: function (item) { return "Text is: " + item.text; },
itemRender: function (item: any) { return "Text is: " + item.text; },
itemClickAction: function () { console.log("itemClick"); },
baseItemWidth: 100,
baseItemHeight: 100,
@@ -195,7 +188,7 @@ module Test {
$("div").appendTo(document.body).dxCheckBox({
checked: false,
disabled: false,
clickAction: function (e) { console.log("clicked"); }
clickAction: function (e:Object) { console.log("clicked"); }
});
$("div").appendTo(document.body).dxTextArea({
value: 'Disabled',
@@ -218,8 +211,8 @@ module Test {
});
$("div").appendTo(document.body).dxScrollable({
useNative: false,
startAction: function (e) { console.log("start"); },
endAction: function (e) { console.log("end"); }
startAction: function (e:Object) { console.log("start"); },
endAction: function (e:Object) { console.log("end"); }
});
$("div").appendTo(document.body).dxRadioGroup({
items: [{ text: "0" }, { text: "1" }, { text: "2" }],
@@ -227,8 +220,8 @@ module Test {
selectedIndex: -1
});
$("div").appendTo(document.body).dxScrollView({
pullDownAction: function (e) { console.log("pulling down"); },
reachBottomAction: function (e) { console.log("bottom reached"); },
pullDownAction: function (e:Object) { console.log("pulling down"); },
reachBottomAction: function (e:Object) { console.log("bottom reached"); },
disabled: false
});
$("div").appendTo(document.body).dxActionSheet({
+1502
View File
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
/// <reference path="dx.webappjs.d.ts" />
module Test {
$('<div/>').appendTo(document.body)
.dxDataGrid({
allowColumnResizing: true,
allowColumnReordering: true,
cellClick: (clickedCell: Object) => { },
rowClick: (clickedRow: Object) => { },
columnChooser: {
enabled: true,
height: 180,
width: 400,
emptyPanelText: 'A place to hide the columns'
},
columnAutoWidth: true,
columns: [
'author', 'title', 'year', 'genre', 'format',
{ dataField: 'price', visible: false },
{ dataField: 'length', visible: false }
],
dataSource: new DevExpress.data.DataSource({
store: {
type: 'array',
data: [
{ id: 1, title: "The Catcher in the Rye", author: "J. D. Salinger", year: 1951, genre: "Bildungsroman", format: "paperback" },
{ id: 2, title: "The Hitchhiker's Guide to the Galaxy", author: "D. Adams", year: 1979, genre: "Comedy, sci-fi", format: "hardcover" },
{ id: 3, title: "Fahrenheit 451", author: "R. Bradbury", year: 1953, genre: "Dystopian novel", format: "paperback" },
{ id: 4, title: "Nineteen Eighty-Four", author: "G. Orwell", year: 1949, genre: "Dystopian novel, political fiction", format: "hardcover" },
{ id: 5, title: "Crime and Punishment", author: "F. Dostoyevsky", year: 1866, genre: "Philosophical novel", format: "paperback" }
],
key: "id"
}
}),
customizeColumns: (columns: Array<Object>) => { },
dataErrorOccurred: (error: Error) => { },
disabled: false,
editing: {
editMode: 'batch',
editEnabled: true,
insertEnabled: true,
removeEnabled: true
},
filterRow: {
visible: true,
showOperationChooser: false
},
groupPanel: {
visible: true
},
grouping: {
autoExpandAll: false
},
height: () => {
return 200;
},
hoverStateEnabled: true,
loadPanel: {
height: 150,
width: 400,
text: 'Data is loading...'
},
noDataText: "It isn't the data you're looking for",
pager: {
showPageSizeSelector: true,
allowedPageSizes: [3, 5, 8]
},
paging: {
pageSize: 8,
pageIndex: 19
},
rowAlternationEnabled: true,
rowPrepared: (rowElement: JQuery, rowInfo: Object) => { },
rtlEnabled: false,
scrolling: { mode: 'infinite' },
searchPanel: {
visible: true,
width: 250
},
selectedRowKeys: [1, 2, 4],
selection: {
mode: 'multiple',
allowSelectAll: false
},
showColumnHeaders: true,
showColumnLines: true,
showRowLines: true,
sorting: { mode: 'multiple' },
visible: true,
width: () => { return 400; },
wordWrapEnabled: true
});
}
+1597
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
@@ -1 +1 @@
""
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+23 -3
View File
@@ -78,6 +78,8 @@ declare module "express" {
param(name: string, handler: RequestParamHandler): T;
param(name: string, matcher: RegExp): T;
param(name: string, mapper: (param: any) => any): T;
// Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API
param(callback: (name: string, matcher: RegExp) => RequestParamHandler): T;
/**
* Special-cased "all" method, applying the given route `path`,
@@ -422,7 +424,22 @@ declare module "express" {
* @param code
*/
status(code: number): Response;
/**
* Set the response HTTP status code to `statusCode` and send its string representation as the response body.
* @link http://expressjs.com/4x/api.html#res.sendStatus
*
* Examples:
*
* res.sendStatus(200); // equivalent to res.status(200).send('OK')
* res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
* res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
* res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')
*
* @param code
*/
sendStatus(code: number): Send;
/**
* Set Link header field with the given `links`.
*
@@ -833,15 +850,18 @@ declare module "express" {
* app.set('foo', 'bar');
* app.get('foo');
* // => "bar"
* app.set('foo', ['bar', 'baz']);
* app.get('foo');
* // => ["bar", "baz"]
*
* Mounted servers inherit their parent server's settings.
*
* @param setting
* @param val
*/
set(setting: string, val: string): Application;
set(setting: string, val: any): Application;
get: {
(name: string): string; // Getter
(name: string): any; // Getter
(name: string, ...handlers: RequestHandler[]): Application;
(name: RegExp, ...handlers: RequestHandler[]): Application;
};
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""
+1 -1
View File
@@ -1 +1 @@
""

Some files were not shown because too many files have changed in this diff Show More