Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Rogier Schouten
2014-06-25 13:40:28 +02:00
253 changed files with 27828 additions and 11781 deletions
+13 -1
View File
@@ -83,10 +83,12 @@ All definitions files include a header with the author and editors, so at some p
* [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame))
* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei))
* [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren))
* [flipsnap.js](http://pxgrid.github.io/js-flipsnap/) (by [kubosho_](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki))
* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros))
* [fs-extra](https://github.com/jprichardson/node-fs-extra) (by [midknight41](https://github.com/midknight41))
* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk))
* [Fuse.js](https://github.com/krisk/Fuse) (by [Greg Smith](https://github.com/smrq))
* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/))
* [GeoJSON](http://geojson.org/) (by [Jake Bruun](https://github.com/cobster))
* [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo))
@@ -155,9 +157,12 @@ All definitions files include a header with the author and editors, so at some p
* [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.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb))
* [jQuery.pjax](https://github.com/defunkt/jquery-pjax) (by [Junle Li](https://github.com/lijunle))
* [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/))
* [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle))
* [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske))
* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/))
* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/))
* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski))
@@ -210,6 +215,7 @@ All definitions files include a header with the author and editors, so at some p
* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle))
* [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug))
* [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r))
* [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen))
* [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))
@@ -218,6 +224,7 @@ All definitions files include a header with the author and editors, so at some p
* [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))
* [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))
* [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))
@@ -270,6 +277,7 @@ All definitions files include a header with the author and editors, so at some p
* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall))
* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov))
* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [rtree.js] (https://github.com/leaflet-extras/RTree) (by [Omede Firouz](https://github.com/oefirouz))
* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov))
* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov))
* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong))
@@ -284,6 +292,7 @@ All definitions files include a header with the author and editors, so at some p
* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr))
* [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n))
* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev))
* [sockjs-node](https://github.com/sockjs/sockjs-node) (by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing))
* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti))
@@ -299,6 +308,7 @@ All definitions files include a header with the author and editors, so at some p
* [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com))
* [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame))
* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/))
* [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga))
* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov))
* [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski))
* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
@@ -315,6 +325,7 @@ All definitions files include a header with the author and editors, so at some p
* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade))
* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient))
* [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq))
* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov))
* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [vinyl](https://github.com/wearefractal/vinyl) (by [vvakame](https://github.com/vvakame/))
@@ -325,6 +336,7 @@ All definitions files include a header with the author and editors, so at some p
* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples)
* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd))
* [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib))
* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Finch 0.5.13
// Project: https://github.com/stoodder/finchjs
// Definitions by: https://github.com/DavidSichau
// Project: https://github.com/stoodder/finchjs
// Definitions by: David Sichau <https://github.com/DavidSichau>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="JSONStream.d.ts" />
import json = require('JSONStream');
var read: NodeJS.ReadableStream;
var write: NodeJS.WritableStream;
read = read.pipe(json.parse('*'));
read = read.pipe(json.parse(['foo/*', 'bar/*']));
read = json.stringify();
read = json.stringify('{', ',', '}');
read = json.stringifyObject();
read = json.stringifyObject('{', ',', '}');
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for JSONStream v0.8.0
// Project: http://github.com/dominictarr/JSONStream
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'JSONStream' {
export interface Options {
recurse: boolean;
}
export function parse(pattern: any): NodeJS.ReadWriteStream;
export function parse(patterns: any[]): NodeJS.ReadWriteStream;
export function stringify(): NodeJS.ReadWriteStream;
export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
export function stringifyObject(): NodeJS.ReadWriteStream;
export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
}
+32
View File
@@ -0,0 +1,32 @@
/// <reference path="alertify.d.ts" />
alertify.init();
alertify.alert("This is an alert");
alertify.alert("This is an alert with a callback", () => {
alertify.success("Alert finished");
}, "myCustomClass");
alertify.confirm("This is a confirm request");
alertify.confirm("This is a confirm request with a callback", () => {
alertify.success("Confirm finished");
}, "myCustomClass");
var custom = alertify.extend("custom");
alertify.log("log message 1");
alertify.log("log message 2", "success", 3000);
alertify.prompt("prompt message 1");
alertify.prompt("prompt message 2", () => { console.log("callback"); }, "ok", "myClass");
alertify.set({ delay: 1000 });
alertify.set({ labels: { ok: "OK", cancel: "Cancel" }});
alertify.set({ buttonFocus: "ok" });
alertify.set({ buttonReverse: true });
alertify.success("This is a success message");
alertify.error("This is an error message");
alertify.debug();
+124
View File
@@ -0,0 +1,124 @@
// Type definitions for alertify 0.3.11
// Project: http://fabien-d.github.io/alertify.js/
// Definitions by: John Jeffery <http://github.com/jjeffery>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var alertify: alertify.IAlertifyStatic;
declare module alertify {
interface IAlertifyStatic {
/**
* Create an alert dialog box
* @param message The message passed from the callee
* @param fn Callback function
* @param cssClass Class(es) to append to dialog box
* @return alertify (ie this)
* @since 0.0.1
*/
alert(message: string, fn?: Function, cssClass?: string): IAlertifyStatic;
/**
* Create a confirm dialog box
* @param message The message passed from the callee
* @param fn Callback function
* @param cssClass Class(es) to append to dialog box
* @return alertify (ie this)
* @since 0.0.1
*/
confirm(message: string, fn?: Function, cssClass?: string): IAlertifyStatic;
/**
* Extend the log method to create custom methods
* @param type Custom method name
* @return function for logging
* @since 0.0.1
*/
extend(type: string): (message: string, wait?: number) => IAlertifyStatic;
/**
* Initialize Alertify and create the 2 main elements.
* Initialization will happen automatically on the first
* use of alert, confirm, prompt or log.
* @since 0.0.1
*/
init(): void;
/**
* Show a new log message box
* @param message The message passed from the callee
* @param type Optional type of log message
* @param wait Optional time (in ms) to wait before auto-hiding
* @return alertify (ie this)
* @since 0.0.1
*/
log(message: string, type?: string, wait?: number): IAlertifyStatic;
/**
* Create a prompt dialog box
* @param message The message passed from the callee
* @param fn Callback function
* @param placeholder Default value for prompt input
* @param cssClass Class(es) to append to dialog
* @return alertify (ie this)
* @since 0.0.1
*/
prompt(message: string, fn?: Function, placeholder?: string, cssClass?: string): IAlertifyStatic;
/**
* Shorthand for log messages
* @param message The message passed from the callee
* @return alertify (ie this)
* @since 0.0.1
*/
success(message: string): IAlertifyStatic;
/**
* Shorthand for log messages
* @param message The message passed from the callee
* @return alertify (ie this)
* @since 0.0.1
*/
error(message: string): IAlertifyStatic;
/**
* Used to set alertify properties
* @param Properties
* @since 0.2.11
*/
set(args: IProperties): void;
/**
* The labels used for dialog buttons
*/
labels: ILabels;
/**
* Attaches alertify.error to window.onerror method
* @since 0.3.8
*/
debug(): void;
}
/**
* Properties for alertify.set function
*/
interface IProperties {
/** Default value for milliseconds display of log messages */
delay?: number;
/** Default values for display of labels */
labels?: ILabels;
/** Default button for focus */
buttonFocus?: string;
/** Should buttons be displayed in reverse order */
buttonReverse?: boolean;
}
/** Labels for altertify.set function */
interface ILabels {
ok?: string;
cancel?: string;
}
}
+12 -2
View File
@@ -176,8 +176,7 @@ amplify.request("twitter-mentions", { user: "amplifyjs" });
//Example:
amplify.request.decoders.appEnvelope =
function (data, status, xhr, success, error) {
var appEnvelopeDecoder: amplifyDecoder = function (data, status, xhr, success, error) {
if (data.status === "success") {
success(data.data);
} else if (data.status === "fail" || data.status === "error") {
@@ -187,6 +186,17 @@ function (data, status, xhr, success, error) {
}
};
//a new decoder can be added to the amplifyDecoders interface
interface amplifyDecoders {
appEnvelope: amplifyDecoder;
}
amplify.request.decoders.appEnvelope = appEnvelopeDecoder;
//but you can also just add it via an index
amplify.request.decoders['appEnvelopeStr'] = appEnvelopeDecoder;
amplify.request.define("decoderExample", "ajax", {
url: "/myAjaxUrl",
type: "POST",
+28 -6
View File
@@ -3,11 +3,33 @@
// Definitions by: Jonas Eriksson <https://github.com/joeriks/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface amplifyRequestSettings {
resourceId: string;
data?: any;
success?: Function;
error?: Function;
success?: (...args: any[]) => void;
error?: (...args: any[]) => void;
}
interface amplifyDecoder {
(
data?: any,
status?: string,
xhr?: JQueryXHR,
success?: (...args: any[]) => void,
error?: (...args: any[]) => void
): void
}
interface amplifyDecoders {
[decoderName: string]: amplifyDecoder;
jsSend: amplifyDecoder;
}
interface amplifyAjaxSettings extends JQueryAjaxSettings {
cache?: any;
decoder?: any /* string or amplifyDecoder */;
}
interface amplifyRequest {
@@ -39,7 +61,7 @@ interface amplifyRequest {
* cache: See the cache section for more details.
* decoder: See the decoder section for more details.
*/
define(resourceId: string, requestType: string, settings?: any): void;
define(resourceId: string, requestType: string, settings?: amplifyAjaxSettings): void;
/***
* Define a custom request.
@@ -50,9 +72,9 @@ interface amplifyRequest {
* success: Callback to invoke on success.
* error: Callback to invoke on error.
*/
define(resourceId: string, resource: Function): void;
decoders: any;
define(resourceId: string, resource: (settings: amplifyRequestSettings) => void): void;
decoders: amplifyDecoders;
cache: any;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular Translate (pascalprecht.translate module)
// Project: https://github.com/PascalPrecht/angular-translate
// Definitions by: Michel Salib <michelsalib@hotmail.com>
// Definitions by: Michel Salib <https://github.com/michelsalib>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
+24 -3
View File
@@ -13,6 +13,10 @@ myApp.config((
$urlMatcherFactory: ng.ui.IUrlMatcherFactory) => {
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
var obj: Object = matcher.exec('/user/bob', { x:'1', q:'hello' });
var concat: ng.ui.IUrlMatcher = matcher.concat('/test');
var str: string = matcher.format({ id:'bob', q:'yes' });
var arr: string[] = matcher.parameters();
$urlRouterProvider
.when('/test', '/list')
@@ -78,12 +82,13 @@ interface IUrlLocatorTestService {
// Service for determining who the currently logged on user is.
class UrlLocatorTestService implements IUrlLocatorTestService {
static $inject = ["$http", "$rootScope", "$urlRouter"];
static $inject = ["$http", "$rootScope", "$urlRouter", "$state"];
constructor(
private $http: ng.IHttpService,
private $rootScope: ng.IRootScopeService,
private $urlRouter: ng.ui.IUrlRouterService
private $urlRouter: ng.ui.IUrlRouterService,
private $state: ng.ui.IStateService
) {
$rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event));
}
@@ -107,6 +112,23 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
});
}
}
private stateServiceTest() {
this.$state.go("myState");
this.$state.transitionTo("myState");
if (this.$state.includes("myState") === true) {
//
}
if (this.$state.is("myState") === true) {
//
}
if (this.$state.href("myState") === "/myState") {
//
}
this.$state.get("myState");
this.$state.get();
this.$state.reload();
}
}
myApp.service("urlLocatorTest", UrlLocatorTestService);
@@ -124,4 +146,3 @@ module UiViewScrollProviderTests {
$uiViewScrollProvider.useAnchorScroll();
}]);
}
+4 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.1.5+ (ui.router module)
// Project: https://github.com/angular-ui/ui-router
// Definitions by: Michel Salib <michelsalib@hotmail.com>
// Definitions by: Michel Salib <https://github.com/michelsalib>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
@@ -33,13 +33,13 @@ declare module ng.ui {
interface IUrlMatcher {
concat(pattern: string): IUrlMatcher;
exec(path: string, searchParams: {}): {};
parameters(): string[];
format(values: {}): string;
}
interface IUrlMatcherFactory {
compile(pattern: string): IUrlMatcher;
isMatcher(o: any): boolean;
parameters(): string[];
format(values: {}): string;
}
interface IUrlRouterProvider extends IServiceProvider {
@@ -86,6 +86,7 @@ declare module ng.ui {
get(): IState[];
current: IState;
params: IStateParamsService;
reload(): void;
}
interface IStateParamsService {
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.2+ (ngAnimate module)
// Project: http://angularjs.org
// Definitions by: Michel Salib <michelsalib@hotmail.com>
// Definitions by: Michel Salib <https://github.com/michelsalib>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
/// Type definitions for Angular JS 1.2 (ngCookies module)
// Type definitions for Angular JS 1.2 (ngCookies module)
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.2 (ngResource module)
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Michael Jess <http://github.com/miffels> (minor enhancements)
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Michael Jess <http://github.com/miffels>
// Definitions: https://github.com/daptiv/DefinitelyTyped
/// <reference path="angular.d.ts" />
+4 -1
View File
@@ -9,6 +9,9 @@
declare var $routeProvider: ng.route.IRouteProvider;
$routeProvider
.when('/projects/:projectId/dashboard',{
controller: ''
controller: '',
templateUrl: '',
caseInsensitiveMatch: true,
reloadOnSearch: false
})
.otherwise({redirectTo: '/'});
+78 -6
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.2 (ngRoute module)
// Project: http://angularjs.org
// Definitions by: Jonathan Park
// Definitions by: Jonathan Park <https://github.com/park9140>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -15,7 +15,9 @@ declare module ng.route {
// RouteParamsService
// see http://docs.angularjs.org/api/ngRoute.$routeParams
///////////////////////////////////////////////////////////////////////////
interface IRouteParamsService {}
interface IRouteParamsService {
[key: string]: any;
}
///////////////////////////////////////////////////////////////////////////
// RouteService
@@ -30,17 +32,73 @@ declare module ng.route {
// to a controller that was not initialized as a result of a route maching.
current?: ICurrentRoute;
}
// see http://docs.angularjs.org/api/ngRoute.$routeProvider#when for options explanations
/**
* see http://docs.angularjs.org/api/ngRoute/provider/$routeProvider#when for API documentation
*/
interface IRoute {
/**
* {(string|function()=}
* Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string.
*/
controller?: any;
controllerAs?: any;
/**
* A controller alias name. If present the controller will be published to scope under the controllerAs name.
*/
controllerAs?: string;
/**
* Undocumented?
*/
name?: string;
/**
* {string=|function()=}
* Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl.
*
* If template is a function, it will be called with the following parameters:
*
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
*/
template?: string;
/**
* {string=|function()=}
* Path or function that returns a path to an html template that should be used by ngView.
*
* If templateUrl is a function, it will be called with the following parameters:
*
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
*/
templateUrl?: any;
/**
* {Object.<string, function>=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is:
*
* - key - {string}: a name of a dependency to be injected into the controller.
* - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead.
*/
resolve?: any;
/**
* {(string|function())=}
* Value to update $location path with and trigger route redirection.
*
* If redirectTo is a function, it will be called with the following parameters:
*
* - {Object.<string>} - route parameters extracted from the current $location.path() by applying the current route templateUrl.
* - {string} - current $location.path()
* - {Object} - current $location.search()
* - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search().
*/
redirectTo?: any;
/**
* Reload route when only $location.search() or $location.hash() changes.
*
* This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope.
*/
reloadOnSearch?: boolean;
/**
* Match routes without being case sensitive
*
* This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive
*/
caseInsensitiveMatch?: boolean;
}
@@ -55,10 +113,24 @@ declare module ng.route {
}
interface IRouteProvider extends IServiceProvider {
/**
* Sets route definition that will be used on route change when no other route definition is matched.
*
* @params Mapping information to be assigned to $route.current.
*/
otherwise(params: IRoute): IRouteProvider;
/**
* This is a description
* Adds a new route definition to the $route service.
*
* @param path Route path (matched against $location.path). If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be updated to add or drop the trailing slash to exactly match the route definition.
*
* - path can contain named groups starting with a colon: e.g. :name. All characters up to the next slash are matched and stored in $routeParams under the given name when the route matches.
* - path can contain named groups starting with a colon and ending with a star: e.g.:name*. All characters are eagerly stored in $routeParams under the given name when the route matches.
* - path can contain optional named groups with a question mark: e.g.:name?.
*
* For example, routes like /color/:color/largecode/:largecode*\/edit will match /color/brown/largecode/code/with/slashes/edit and extract: color: brown and largecode: code/with/slashes.
*
* @param route Mapping information to be assigned to $route.current on route match.
*/
when(path: string, route: IRoute): IRouteProvider;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular Scenario Testing
// Project: http://angularjs.org
// Definitions by: RomanoLindano
// Definitions by: RomanoLindano <https://github.com/RomanoLindano>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
+1
View File
@@ -223,6 +223,7 @@ foo.then((x) => {
// angular.element() tests
var element = angular.element("div.myApp");
var scope: ng.IScope = element.scope();
var isolateScope: ng.IScope = element.isolateScope();
+58 -13
View File
@@ -51,16 +51,21 @@ declare module ng {
isString(value: any): boolean;
isUndefined(value: any): boolean;
lowercase(str: string): string;
/** construct your angular application
official docs: Interface for configuring angular modules.
see: http://docs.angularjs.org/api/angular.Module
*/
/**
* The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
*
* When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved.
*
* @param name The name of the module to create or retrieve.
* @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration.
* @param configFn Optional configuration function for the module.
*/
module(
/** name of your module you want to create */
name: string,
/** name of modules yours depends on */
requires?: string[],
configFunction?: any): IModule;
configFn?: Function): IModule;
noop(...args: any[]): void;
toJson(obj: any, pretty?: boolean): string;
uppercase(str: string): string;
@@ -81,23 +86,55 @@ declare module ng {
animation(name: string, animationFactory: Function): IModule;
animation(name: string, inlineAnnotatedFunction: any[]): IModule;
animation(object: Object): IModule;
/** configure existing services.
Use this method to register work which needs to be performed on module loading
/**
* Use this method to register work which needs to be performed on module loading.
*
* @param configFn Execute this function on module load. Useful for service configuration.
*/
config(configFn: Function): IModule;
/** configure existing services.
Use this method to register work which needs to be performed on module loading
/**
* Use this method to register work which needs to be performed on module loading.
*
* @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
*/
config(inlineAnnotatedFunction: any[]): IModule;
constant(name: string, value: any): IModule;
constant(object: Object): IModule;
/**
* The $controller service is used by Angular to create new controllers.
*
* This provider allows controller registration via the register method.
*
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
*/
controller(name: string, controllerConstructor: Function): IModule;
/**
* The $controller service is used by Angular to create new controllers.
*
* This provider allows controller registration via the register method.
*
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
*/
controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
controller(object : Object): IModule;
directive(name: string, directiveFactory: Function): IModule;
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
directive(object: Object): IModule;
/**
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
*
* @param name The name of the instance.
* @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
*/
factory(name: string, serviceFactoryFunction: Function): IModule;
/**
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
*
* @param name The name of the instance.
* @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
*/
factory(name: string, inlineAnnotatedFunction: any[]): IModule;
factory(object: Object): IModule;
filter(name: string, filterFactoryFunction: Function): IModule;
@@ -166,6 +203,7 @@ declare module ng {
$error: any;
$addControl(control: ng.INgModelController): void;
$removeControl(control: ng.INgModelController): void;
$setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void;
$setDirty(): void;
$setPristine(): void;
}
@@ -241,6 +279,8 @@ declare module ng {
$parent: IScope;
$root: IRootScopeService;
$id: string;
// Hidden members
@@ -263,13 +303,17 @@ declare module ng {
// WindowService
// see http://docs.angularjs.org/api/ng.$window
///////////////////////////////////////////////////////////////////////////
interface IWindowService extends Window {}
interface IWindowService extends Window {
[key: string]: any;
}
///////////////////////////////////////////////////////////////////////////
// BrowserService
// TODO undocumented, so we need to get it from the source code
///////////////////////////////////////////////////////////////////////////
interface IBrowserService {}
interface IBrowserService {
[key: string]: any;
}
///////////////////////////////////////////////////////////////////////////
// TimeoutService
@@ -925,6 +969,7 @@ declare module ng {
controller(name: string): any;
injector(): any;
scope(): IScope;
isolateScope(): IScope;
inheritedData(key: string, value: any): JQuery;
inheritedData(obj: { [key: string]: any; }): JQuery;
+6 -1
View File
@@ -1,4 +1,9 @@
// Type definitions for ansicolors
// Project: https://github.com/thlorenz/ansicolors
// Definitions by: rogierschouten <https://github.com/rogierschouten>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "ansicolors" {
var colors: {[index: string]: (s: string) => string;};
export = colors;
export = colors;
}
-1
View File
@@ -1 +0,0 @@
""
+2 -2
View File
@@ -121,12 +121,12 @@ declare module ArbiterDef {
/**
* Unsubscribing simply sets a flag which prevents the subscriber from executing, in case you want to re-subscribe later.
*/
unsubscribe(subscription_id: number);
unsubscribe(subscription_id: number): boolean;
/**
* After unsubscribing, you can later re-subscribe to begin receiving messages again.
*/
resubscribe(subscription_id: number);
resubscribe(subscription_id: number): boolean;
}
}
-1
View File
@@ -1 +0,0 @@
""
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for asciify 1.3.5
// Project: https://www.npmjs.org/package/asciify
// Definitions by: Alan Norbauer http://alan.norbauer.com
// Definitions by: Alan Norbauer <http://alan.norbauer.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -26,4 +26,4 @@ declare module "asciify" {
}
export = asciify
}
}
+16
View File
@@ -156,6 +156,22 @@ q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) {
console.log('finished processing bar');
});
// tests for strongly typed tasks
var q2 = async.queue(function (task: string, callback) {
console.log('Task: ' + task);
callback();
}, 1);
q2.push('task1');
q2.push('task2', function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
});
q2.push(['task3', 'task4', 'task5'], function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
});
var filename = '';
async.auto({
get_data: function (callback) { },
+1
View File
@@ -16,6 +16,7 @@ interface AsyncQueue<T> {
length(): number;
concurrency: number;
push(task: T, callback?: AsyncMultipleResultsCallback<T>): void;
push(task: T[], callback?: AsyncMultipleResultsCallback<T>): void;
saturated: AsyncMultipleResultsCallback<T>;
empty: AsyncMultipleResultsCallback<T>;
drain: AsyncMultipleResultsCallback<T>;
-1
View File
@@ -1 +0,0 @@
""
-1
View File
@@ -1 +0,0 @@
""
+10 -1
View File
@@ -15,7 +15,7 @@
// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary").
// you should create a separate file.
// NOTE Document? You should use DevTools hehe...
// API documentation : https://atom.io/docs/api/v0.106.0/api/docs/README.md.html
interface Window {
atom: AtomCore.IAtom;
@@ -1010,7 +1010,14 @@ declare module AtomCore {
interface IAtomStatic extends ISerializationStatic<IAtom> {
version: number;
loadSettings: IAtomSettings;
/* Load or create the Atom environment in the given mode */
loadOrCreate(mode:'editor'):IAtom;
/* Load or create the Atom environment in the given mode */
loadOrCreate(mode:'spec'):IAtom;
/* Load or create the Atom environment in the given mode */
loadOrCreate(mode:string):IAtom;
loadState(mode:any):void;
getStatePath(mode:any):string;
getConfigDirPath():string;
@@ -1023,6 +1030,8 @@ declare module AtomCore {
new(state:IAtomState):IAtom;
}
// https://atom.io/docs/api/v0.106.0/api/classes/Atom.html
/* Global Atom class : instance members */
interface IAtom {
constructor:IAtomStatic;
+2 -2
View File
@@ -1,5 +1,5 @@
// Type definitions for Auth0Widget.js
// Project: Auth0.com
// Project: http://auth0.com
// Definitions by: Robert McLaws <https://github.com/advancedrei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -45,4 +45,4 @@ declare var Auth0Widget: Auth0WidgetStatic;
declare module "Auth0Widget" {
export = Auth0Widget
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
// Type definitions for Auth0.js
// Project: Auth0.com
// Project: http://auth0.com
// Definitions by: Robert McLaws <https://github.com/advancedrei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -130,4 +130,4 @@ declare var Auth0: Auth0Static;
declare module "Auth0" {
export = Auth0
}
}
@@ -42,21 +42,21 @@ declare module Microsoft.WindowsAzure {
getTableName(): string;
getMobileServiceClient(): MobileServiceClient;
insert(istance: any, paramsQS: Object, callback: (error: any, retInserted: any) => any): void;
insert(istance: any, paramsQS: Object): asyncPromise;
insert(istance: any): asyncPromise;
insert(instance: any, paramsQS: Object, callback: (error: any, retInserted: any) => any): void;
insert(instance: any, paramsQS: Object): asyncPromise;
insert(instance: any): asyncPromise;
update(istance: any, paramsQS: Object, callback: (error: any, retUpdated: any) => any): void;
update(istance: any, paramsQS: Object): asyncPromise;
update(istance: any): asyncPromise;
update(instance: any, paramsQS: Object, callback: (error: any, retUpdated: any) => any): void;
update(instance: any, paramsQS: Object): asyncPromise;
update(instance: any): asyncPromise;
lookup(id: number, paramsQS: Object, callback: (error: any, retValue: any) => any): void;
lookup(id: number, paramsQS: Object): asyncPromise;
lookup(id: number): asyncPromise;
del(istance: any, paramsQS: Object, callback: (error?: any) => void ): void;
del(istance: any, paramsQS: Object): asyncPromise;
del(istance: any): asyncPromise;
del(instance: any, paramsQS: Object, callback: (error?: any) => void ): void;
del(instance: any, paramsQS: Object): asyncPromise;
del(instance: any): asyncPromise;
read(query: IQuery, paramsQS: Object, callback: (error: any, retValues: any) => any): void;
+1 -3
View File
@@ -1,10 +1,8 @@
// Type definitions for Backbone 1.0.0
// Project: http://backbonejs.org/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions by: Natan Vivo <https://github.com/nvivo/>
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Natan Vivo <https://github.com/nvivo/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../underscore/underscore.d.ts" />
@@ -0,0 +1,31 @@
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="bootstrap.v3.datetimepicker.d.ts" />
function test_cases() {
$('#datetimepicker').datetimepicker();
$('#datetimepicker').datetimepicker({
pickDate: false
});
$('#datetimepicker').datetimepicker({
pickTime: false
});
$('#datetimepicker').datetimepicker({
minDate: '2012-12-31'
});
$('#datetimepicker').data("DateTimePicker").setMaxDate('2012-12-31');
var startDate = new Date(2012, 1, 20);
var endDate = new Date(2012, 1, 25);
$('#datetimepicker2')
.datetimepicker()
.on("dp.change", function (ev) {
if (ev.date.valueOf() > endDate.valueOf()) {
$('#alert').show().find('strong').text('The start date must be before the end date.');
} else {
$('#alert').hide();
startDate = ev.date;
$('#date-start-display').text($('#date-start').data('date'));
}
});
}
@@ -0,0 +1,100 @@
// Type definitions for Bootstrap datetimepicker v3
// Project: http://eonasdan.github.io/bootstrap-datetimepicker
// Definitions by: Jesica N. Fera <https://github.com/bayitajesi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* bootstrap-datetimepicker.js 3.0.0 Copyright (c) 2014 Jonathan Peterson
* Available via the MIT license.
* see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details.
*/
/// <reference path="../jquery/jquery.d.ts"/>
declare module BootstrapV3DatetimePicker {
interface DatetimepickerChangeEventObject extends JQueryEventObject {
date: any;
oldDate: any;
}
interface DatetimepickerEventObject extends JQueryEventObject {
date: any;
}
interface DatetimepickerIcons {
time?: string;
date?: string;
up?: string;
down?: string;
}
interface DatetimepickerOptions {
pickDate?: boolean;
pickTime?: boolean;
useMinutes?: boolean;
useSeconds?: boolean;
useCurrent?: boolean;
minuteStepping?: number;
minDate?: any;
maxDate?: any;
showToday?: boolean;
collapse?: boolean;
language?: string;
defaultDate?: string;
disabledDates?: Array<any>;
enabledDates?: Array<any>;
icons?: DatetimepickerIcons;
useStrict?: boolean;
direction?: string;
sideBySide?: boolean;
daysOfWeekDisabled?: Array<any>;
}
interface Datetimepicker {
setDate(date: any): void;
setMinDate(date: any): void;
setMaxDate(date: any): void;
show(): void;
disable(): void;
enable(): void;
getDate(): void;
}
}
interface JQuery {
datetimepicker(): JQuery;
datetimepicker(options: BootstrapV3DatetimePicker.DatetimepickerOptions): JQuery;
off(events: "dp.change", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery;
off(events: "dp.change", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery;
on(events: "dp.change", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery;
on(events: "dp.change", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery;
on(events: 'dp.change', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerChangeEventObject) => any): JQuery;
off(events: "dp.show", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
off(events: "dp.show", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.show", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.show", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: 'dp.show', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
off(events: "dp.hide", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
off(events: "dp.hide", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.hide", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.hide", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: 'dp.hide', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
off(events: "dp.error", selector?: string, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
off(events: "dp.error", handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.error", selector: string, data: any, handler?: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: "dp.error", selector: string, handler: (eventobject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
on(events: 'dp.error', handler: (eventObject: BootstrapV3DatetimePicker.DatetimepickerEventObject) => any): JQuery;
data(key: 'DateTimePicker'): BootstrapV3DatetimePicker.Datetimepicker;
}
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for buffer-equal 1.0 0
// Project: https://github.com/chaijs/assertion-error
// Project: https://github.com/substack/node-buffer-equal
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="bufferstream.d.ts" />
import BufferStream = require('bufferstream')
var stream = new BufferStream({encoding:'utf8', size:'flexible'});
stream.enable();
stream.disable();
stream.split('//', ':');
stream.on('split', (chunk: any, token: any) => {
console.log("got '%s' by '%s'", chunk.toString(), token.toString())
});
stream.write("buffer:stream//23");
console.log(stream.toString());
+119
View File
@@ -0,0 +1,119 @@
// Type definitions for bufferstream v0.6.2
// Project: https://github.com/dodo/node-bufferstream
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'bufferstream' {
import stream = require('stream');
export = BufferStream;
class BufferStream extends stream.Duplex {
constructor(options?: BufferStream.Opts);
/*
different buffer behaviors can be triggered by size:
none when output drains, bufferstream drains too
flexible buffers everthing that it gets and not piping out
<number> TODO buffer has given size. buffers everthing until buffer is full. when buffer is full then the stream will drain
*/
setSize(size: string): void; // can be one of ['none', 'flexible', <number>]
setSize(size: number): void; // can be one of ['none', 'flexible', <number>]
/*
enables stream buffering default
*/
enable(): void;
/*
flushes buffer and disables stream buffering. BufferStream now pipes all data as long as the output accepting data. when the output is draining BufferStream will buffer all input temporary.
token[s] buffer splitters (should be String or Buffer)
disables given tokens. wont flush until no splitter tokens are left.
*/
disable(): void;
disable(token: string, ...tokens: string[]): void;
disable(tokens: string[]): void; // Array
disable(token: Buffer, ...tokens: Buffer[]): void;
disable(tokens: Buffer[]): void; // Array
/*
each time BufferStream finds a splitter token in the input data it will emit a split event. this also works for binary data.
token[s] buffer splitters (should be String or Buffer)
*/
split(token: string, ...tokens: string[]): void;
split(tokens: string[]): void; // Array
split(token: Buffer, ...tokens: Buffer[]): void;
split(tokens: Buffer[]): void; // Array
/*
returns Buffer.
*/
getBuffer(): Buffer;
/*
returns Buffer.
*/
buffer: Buffer;
/*
shortcut for buffer.toString()
*/
toString(): string;
/*
shortcut for buffer.length
*/
length: number;
}
module BufferStream {
export interface Opts {
/*
default encoding for writing strings
*/
encoding?: string;
/*
if true and the source is a child_process the stream will block the entire process (timeouts wont work anymore, but splitting and listening on data still works, because they work sync)
*/
blocking?: boolean;
/*
defines buffer level or sets buffer to given size (see ↓setSize for more)
*/
size?: any;
/*
immediately call disable
*/
disabled?: boolean;
/*
short form for:
split(token, function (chunk) {emit('data', chunk)})
*/
// String or Buffer
split?: any;
}
export var fn: {warn: boolean};
}
}
declare module 'bufferstream/postbuffer' {
import http = require('http');
import BufferStream = require('bufferstream');
class PostBuffer extends BufferStream {
/*
for if you want to get all the post data from a http server request and do some db reqeust before.
http client buffer
*/
constructor(req: http.ServerRequest);
/*
set a callback to get all post data from a http server request
*/
onEnd(callback: (data: any) => void): void;
/*
pumps data into another stream to allow incoming streams given options will be passed to Stream.pipe
*/
pipe(stream: NodeJS.WritableStream, options?: BufferStream.Opts): NodeJS.ReadableStream;
}
export = PostBuffer;
}
+4
View File
@@ -102,6 +102,10 @@ declare module CamlBuilder {
All(...conditions: IExpression[]): IExpression;
/** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */
Any(...conditions: IExpression[]): IExpression;
/** Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */
All(conditions: IExpression[]): IExpression;
/** Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression(). */
Any(conditions: IExpression[]): IExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */
TextField(internalName: string): ITextFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for chai-datetime
// Project: https://github.com/gaslight/chai-datetime.git
// Definitions by: Cliff Burger <https://github.com/cliffburger/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for chai-jquery 1.1.1
// Project: https://github.com/chaijs/chai-jquery
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
-1
View File
@@ -1 +0,0 @@
""
+1 -2
View File
@@ -1,8 +1,7 @@
// Type definitions for chai 1.7.2
// Project: http://chaijs.com/
// Definitions by: Jed Hunsaker <https://github.com/jedhunsaker/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module chai {
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Chrome packaged application development.
// Type definitions for Chrome packaged application development
// Project: http://developer.chrome.com/apps/
// Definitions by: Adam Lay <https://github.com/AdamLay>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -92,4 +92,4 @@ declare module chrome.app.window {
var onMaximized: WindowEvent;
var onMinimized: WindowEvent;
var onRestored: WindowEvent;
}
}
+64 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Chrome extension development.
// Type definitions for Chrome extension development
// Project: http://developer.chrome.com/extensions/
// Definitions by: Matthew Kimber <https://github.com/matthewkimber> and otiai10 <https://github.com/otiai10>
// Definitions by: Matthew Kimber <https://github.com/matthewkimber>, otiai10 <https://github.com/otiai10>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
////////////////////
@@ -1232,6 +1232,68 @@ declare module chrome.management {
var onEnabled: ManagementEnabledEvent;
}
////////////////////
// Notifications
// https://developer.chrome.com/extensions/notifications
////////////////////
declare module chrome.notifications {
interface ButtonOptions {
title: string;
iconUrl?: string;
}
interface ItemOptions {
title: string;
message: string;
}
interface NotificationOptions {
type?: string;
iconUrl?: string;
title?: string;
message?: string;
contextMessage?: string;
priority?: number;
eventTime?: number;
buttons?: Array<ButtonOptions>;
items?: Array<ItemOptions>;
progress?: number;
isClickable?: boolean;
}
interface OnClosed {
addListener(callback: (notificationId: string, byUser: boolean) => void): void;
}
interface OnClicked {
addListener(callback: (notificationId: string) => void): void;
}
interface OnButtonClicked {
addListener(callback: (notificationId: string, buttonIndex: number) => void): void;
}
interface OnPermissionLevelChanged {
addListener(callback: (level: string) => void): void;
}
interface OnShowSettings {
addListener(callback: Function): void;
}
export var onClosed: OnClosed;
export var onClicked: OnClicked;
export var onButtonClicked: OnButtonClicked;
export var onPermissionLevelChanged: OnPermissionLevelChanged;
export var onShowSettings: OnShowSettings;
export function create(notificationId: string, options: NotificationOptions, callback: (notificationId: string) => void): void;
export function update(notificationId: string, options: NotificationOptions, callback: (wasUpdated: boolean) => void): void;
export function clear(notificationId: string, callback: (wasCleared: boolean) => void): void;
export function getAll(callback: (notifications: any) => void): void;
export function getPermissionLevel(callback: (level: string) => void): void;
}
////////////////////
// Omnibox
////////////////////
+3 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for Apache Cordova.
// Type definitions for Apache Cordova
// Project: http://cordova.apache.org
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions by: Microsoft Open Technologies Inc. <http://msopentech.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
@@ -57,4 +57,4 @@ interface UrlUtil {
}
/** Apache Cordova instance */
declare var cordova: Cordova;
declare var cordova: Cordova;
+2 -2
View File
@@ -1,5 +1,5 @@
// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1
// Project: http://www.createjs.com/#!/EaselJS
// Type definitions for CreateJS
// Project: http://www.createjs.com/
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>, Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+2 -2
View File
@@ -1,5 +1,5 @@
// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1
// Project: http://www.createjs.com/#!/EaselJS
// Type definitions for CreateJS
// Project: http://www.createjs.com/
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>, Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Crossroads.js
// Project: http://millermedeiros.github.io/crossroads.js/
// Definitions by: Diullei Gomes <https://github.com/diullei>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../js-signals/js-signals.d.ts" />
Vendored
+3 -3
View File
@@ -751,8 +751,8 @@ declare module D3 {
empty: () => boolean;
data: {
(values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => string): UpdateSelection;
(values: any[], key?: (data: any, index?: number) => string): UpdateSelection;
(values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection;
(values: any[], key?: (data: any, index?: number) => any): UpdateSelection;
(): any[];
};
@@ -2743,7 +2743,7 @@ declare module D3 {
clamp(clamp: boolean): TimeScale;
ticks: {
(count: number): any[];
(range: Range, count: number): any[];
(range: D3.Time.Range, count: number): any[];
};
tickFormat(count: number): (n: number) => string;
copy(): TimeScale;
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="date.format.d.ts" />
// test dateFormat
var now : string = dateFormat();
var nowFullDate : string = dateFormat( dateFormat.masks.fullDate );
// test format() (on the prototype of Date)
var then : Date = new Date( 2014, 1, 1 );
var thenDefaultFormat : string = then.format();
var thenCustomFormat : string = then.format('yyyy/m/d HH:MM');
+244
View File
@@ -0,0 +1,244 @@
// Type definitions for Date Format 1.2.3
// Project: http://blog.stevenlevithan.com/archives/date-time-format
// Definitions by: Rob Stutton <https://github.com/balrob>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/*****************************************************************************
Portions Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/** Enables basic storage and retrieval of dates and times. */
interface Date {
/** Returns a string representation of a date. The format of the string depends on the locale. */
toString(): string;
/** Returns a date as a string value. */
toDateString(): string;
/** Returns a time as a string value. */
toTimeString(): string;
/** Returns a value as a string value appropriate to the host environment's current locale. */
toLocaleString(): string;
/** Returns a date as a string value appropriate to the host environment's current locale. */
toLocaleDateString(): string;
/** Returns a time as a string value appropriate to the host environment's current locale. */
toLocaleTimeString(): string;
/** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
valueOf(): number;
/** Gets the time value in milliseconds. */
getTime(): number;
/** Gets the year, using local time. */
getFullYear(): number;
/** Gets the year using Universal Coordinated Time (UTC). */
getUTCFullYear(): number;
/** Gets the month, using local time. */
getMonth(): number;
/** Gets the month of a Date object using Universal Coordinated Time (UTC). */
getUTCMonth(): number;
/** Gets the day-of-the-month, using local time. */
getDate(): number;
/** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
getUTCDate(): number;
/** Gets the day of the week, using local time. */
getDay(): number;
/** Gets the day of the week using Universal Coordinated Time (UTC). */
getUTCDay(): number;
/** Gets the hours in a date, using local time. */
getHours(): number;
/** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
getUTCHours(): number;
/** Gets the minutes of a Date object, using local time. */
getMinutes(): number;
/** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
getUTCMinutes(): number;
/** Gets the seconds of a Date object, using local time. */
getSeconds(): number;
/** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
getUTCSeconds(): number;
/** Gets the milliseconds of a Date, using local time. */
getMilliseconds(): number;
/** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
getUTCMilliseconds(): number;
/** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
getTimezoneOffset(): number;
/**
* Sets the date and time value in the Date object.
* @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
*/
setTime(time: number): void;
/**
* Sets the milliseconds value in the Date object using local time.
* @param ms A numeric value equal to the millisecond value.
*/
setMilliseconds(ms: number): void;
/**
* Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
* @param ms A numeric value equal to the millisecond value.
*/
setUTCMilliseconds(ms: number): void;
/**
* Sets the seconds value in the Date object using local time.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setSeconds(sec: number, ms?: number): void;
/**
* Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCSeconds(sec: number, ms?: number): void;
/**
* Sets the minutes value in the Date object using local time.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setMinutes(min: number, sec?: number, ms?: number): void;
/**
* Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCMinutes(min: number, sec?: number, ms?: number): void;
/**
* Sets the hour value in the Date object using local time.
* @param hours A numeric value equal to the hours value.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setHours(hours: number, min?: number, sec?: number, ms?: number): void;
/**
* Sets the hours value in the Date object using Universal Coordinated Time (UTC).
* @param hours A numeric value equal to the hours value.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCHours(hours: number, min?: number, sec?: number, ms?: number): void;
/**
* Sets the numeric day-of-the-month value of the Date object using local time.
* @param date A numeric value equal to the day of the month.
*/
setDate(date: number): void;
/**
* Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
* @param date A numeric value equal to the day of the month.
*/
setUTCDate(date: number): void;
/**
* Sets the month value in the Date object using local time.
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
* @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
*/
setMonth(month: number, date?: number): void;
/**
* Sets the month value in the Date object using Universal Coordinated Time (UTC).
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
* @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
*/
setUTCMonth(month: number, date?: number): void;
/**
* Sets the year of the Date object using local time.
* @param year A numeric value for the year.
* @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
* @param date A numeric value equal for the day of the month.
*/
setFullYear(year: number, month?: number, date?: number): void;
/**
* Sets the year value in the Date object using Universal Coordinated Time (UTC).
* @param year A numeric value equal to the year.
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
* @param date A numeric value equal to the day of the month.
*/
setUTCFullYear(year: number, month?: number, date?: number): void;
/** Returns a date converted to a string using Universal Coordinated Time (UTC). */
toUTCString(): string;
/** Returns a date as a string value in ISO format. */
toISOString(): string;
/** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
toJSON(key?: any): string;
/**
* This is a convenience addition to the Date prototype
* Returns a formatted version of the date.
* The mask defaults to dateFormat.masks.default.
* @param {string=} mask
* @param {boolean=} utc
*/
format(mask?: string, utc?: boolean) : string;
}
declare var Date: {
new (): Date;
new (value: number): Date;
new (value: string): Date;
new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
(): string;
prototype: Date;
/**
* Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
* @param s A date string
*/
parse(s: string): number;
/**
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
* @param month The month as an number between 0 and 11 (January to December).
* @param date The date as an number between 1 and 31.
* @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
* @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
* @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
* @param ms An number from 0 to 999 that specifies the milliseconds.
*/
UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
now(): number;
};
// Some common format strings
interface DateFormatMasks {
"default": string;
shortDate: string;
mediumDate: string;
longDate: string;
fullDate: string;
shortTime: string;
mediumTime: string;
longTime: string;
isoDate: string;
isoTime: string;
isoDateTime: string;
isoUtcDateTime: string;
}
// Internationalization strings
interface DateFormatI18n {
dayNames: string[];
monthNames: string[];
}
/**
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
* The date defaults to the current date/time.
* The mask defaults to dateFormat.masks.default.
* @param {Date=} date
* @param {string=} mask
* @param {boolean=} utc
*/
declare var dateFormat: {
(date?: any, mask?: string, utc?: boolean ): string;
masks : DateFormatMasks;
i18n : DateFormatI18n;
};
+3 -2
View File
@@ -1,7 +1,8 @@
// Type definitions for DCJS
// Project: https://github.com/dc-js
// Definitions by: hans windhoff
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// this makes only sense together with d3 and crossfilter so you need the d3.d.ts and crossfilter.d.ts files
///<reference path="../d3/d3.d.ts" />
@@ -195,4 +196,4 @@ export interface ILegendwidget {
export function rowChart(cssSel: string): IRowchart;
}
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="deep-freeze.d.ts" />
import df = require('deep-freeze');
class Foo {
foo: string;
}
var foo:Foo = df(new Foo());
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for deep-freeze
// Project: https://github.com/substack/deep-freeze
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'deep-freeze' {
function df<T>(obj: T): T;
export = df;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for domready
// Project: https://github.com/ded/domready
// Definitions by: Christian Holm Nielsen
// Definitions by: Christian Holm Nielsen <https://github.com/dotnetnerd>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function domready(callback: () => any) : void;
+1795 -1681
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="easy-table.d.ts" />
import EasyTable = require('easy-table');
var table = new EasyTable();
table.cell('aa', 1);
table.cell('bb',1);
table.newRow();
table.cell('aa', 1);
table.cell('bb',1);
table.print();
+41
View File
@@ -0,0 +1,41 @@
// Type definitions for easy-table 0.2.0
// Project: https://github.com/eldargab/easy-table
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "easy-table" {
class EasyTable {
constructor();
cell(label: string, value: any, printer?: EasyTable.CellPrinter, width?: number):void;
newRow(): void;
toString(): string;
printTransposed(): string;
print(): string;
sort(fields: string): void;
sort(comparer: (a: any, b: any) => number): void;
total(label: string, accumulator: EasyTable.Accumulator, totalPrinter: EasyTable.CellPrinter): void;
}
module EasyTable {
function printArray(array: any[], cellPrinter?: CellPrinter, tablePrinter?: Printer): string;
function printObject(object: any, cellPrinter?: CellPrinter, tablePrinter?: Printer): string;
//printer helpers
function Number(length: number): CellPrinter;
function RightPadder(char: string): CellPrinter;
function LeftPadder(char: string): CellPrinter;
interface CellPrinter extends Function {
(obj: any, cell: (label: string, value: any, width?: number) => void):string;
}
interface Printer extends Function {
(table: EasyTable):string;
}
interface Accumulator extends Function {
(sum: number, val: number, index: number, length: number):number;
}
}
export = EasyTable;
}
+2 -2
View File
@@ -1,7 +1,7 @@
// Type definitions for expect.js 0.2.0
// Project: https://github.com/LearnBoost/expect.js
// Definitions by: Teppei Sato <https://github.com/teppeis>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function expect(target?: any): Expect.Root;
@@ -17,7 +17,7 @@ declare module Expect {
*
* @param fn callback to match error string against
*/
throwError(fn?: (exception: any) => void): void;
throwError(fn?: (exception: any) => void): void;
/**
* Assert that the function throws.
+2 -2
View File
@@ -1,7 +1,7 @@
// Type definitions for expectations.js 0.2.5
// Project: https://github.com/spmason/expectations
// Definitions by: vvakame <https://github.com/vvakame>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var expect:Expectations.IExpectations;
@@ -57,4 +57,4 @@ declare module Expectations {
fail(why?:string, what?:any):any;
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for express-validator
// Project: https://github.com/ctavan/express-validator
// Definitions by: Nathan Ridley <https://github.com/axefrog/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ExpressValidator {
export interface ValidationError {
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Express 3.1
// Project: http://expressjs.com
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* =================== USAGE ===================
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for FabricJS
// Project: http://fabricjs.com/
// Definitions by: Oliver Klemencic <https://github.com/oklemencic/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module fabric {
+1 -1
View File
@@ -1,4 +1,4 @@
// Type Definitions for File System API
// Type definitions for File System API
// Project: http://www.w3.org/TR/file-system-api/
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type Definitions for File API: Writer
// Type definitions for File API: Writer
// Project: http://www.w3.org/TR/file-writer-api/
// Definitions by: Kon <http://phyzkit.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+7 -3
View File
@@ -4,8 +4,12 @@ declare var els: Element[];
declare var mixinFn: Function;
function TestComponent() {
var self: Flight.Component = this;
var self: Flight.Component = this;
self.attributes({
fooSelector: '.bar'
});
self.defaultAttrs({
fooSelector: '.bar'
});
@@ -14,7 +18,7 @@ function TestComponent() {
var el: HTMLElement = data.el;
self.select('fooSelector').addClass('bar');
};
self.around('initialize', function () { });
self.before('initialize', function () { });
self.after("initialize", function () {
+16 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Flight 1.1.1
// Type definitions for Flight 1.1.4
// Project: http://flightjs.github.com/flight/
// Definitions by: Jonathan Hedrén <https://github.com/jonathanhedren/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -9,10 +9,25 @@ declare module Flight {
export interface Base {
/**
* Most Components and Mixins need to define attributes. In Flight,
* default values are assigned by passing an object to the attributes
* function.
*
* NOTE: this.attributes replaces the now deprecated this.defaultAttrs.
* However, for backwards compatibility, if you are using this.defaultAttrs
* then all the old attribute behavior remains in place.
*/
attributes(obj: Object): void;
/**
* Most Components and Mixins need to define attributes. In Flight,
* default values are assigned by passing an object to the defaultAttrs
* function.
*
* NOTE: this.attributes replaces the now deprecated this.defaultAttrs.
* However, for backwards compatibility, if you are using this.defaultAttrs
* then all the old attribute behavior remains in place.
*/
defaultAttrs(obj: Object): void;
@@ -181,7 +196,6 @@ declare module Flight {
$node: JQuery;
}
export interface AdviceStatic {
withAdvice(): Function;
}
+13
View File
@@ -0,0 +1,13 @@
/**
* Created by kubosho_ on 6/16/2014.
*/
///<reference path='flipsnap.d.ts'/>
Flipsnap('', {
maxPoint: 3,
distance: 230,
transitionDuration: 500,
disableTouch: true,
disable3d: false
});
+93
View File
@@ -0,0 +1,93 @@
// Type definitions for flipsnap.js
// Project: http://pxgrid.github.io/js-flipsnap/
// Definitions by: kubosho_ <https://github.com/kubosho>, gsino <https://github.com/gsino>, Mayuki Sawatari <https://github.com/mayuki>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface IFlipsnap {
/**
* Return true or false. true is returned when there is previous element.
*/
hasPrev(): boolean;
/**
* Return true or false. true is returned when there is next element.
*/
hasNext(): boolean;
/**
* Move to previous item.
*/
toPrev(transitionDuration?: number): void;
/**
* Move to next item.
*/
toNext(transitionDuration?: number): void;
/**
* Move to item of number.
*/
moveToPoint(point: number, transitionDuration?: number): void;
/**
* Recalculate values
*/
refresh(): void;
element: HTMLElement;
}
interface FlipsnapStatic {
/**
* @param element The element
*/
(element: HTMLElement, opts?: FlipsnapOptions): IFlipsnap;
/**
* @param selector The parameter must be CSS Selector. When set string, to get first element of result. Not all element.
*/
(selector: string, opts?: FlipsnapOptions): IFlipsnap;
}
interface FlipsnapOptions {
/**
* Stop point count. default is auto calculate from element item count.
*/
maxPoint?: number;
/**
* Move distance. default is auto calculate from element width and maxPont.
*/
distance?: number;
/**
* Transition duration (millisecond). default is 350.
*/
transitionDuration?: number;
/**
* When set true, touch event is disabled. Only handling button or etc interface. default is false.
*/
disableTouch?: boolean;
/**
* When support 3D transform browser and this option set true, it is not used 3D transform and use 2D transform. You should set true, when it is a device which has a bug in 3D transform(old Android or BlackBerry etc). default is false.
*/
disable3d?: boolean;
}
interface HTMLElement {
addEventListener(type: "fstouchstart", listener: (ev: Event) => any, useCapture?: boolean): void;
addEventListener(type: "fstouchmove", listener: (ev: FlipsnapTouchMoveEvent) => any, useCapture?: boolean): void;
addEventListener(type: "fstouchend", listener: (ev: FlipsnapTouchEndEvent) => any, useCapture?: boolean): void;
}
interface FlipsnapTouchMoveEvent extends Event {
delta: number;
direction: number;
}
interface FlipsnapTouchEndEvent extends Event {
moved: boolean;
cancelled: boolean;
newPoint: number;
originalPoint: number;
}
declare var Flipsnap: FlipsnapStatic;
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for aws-sdk
// Type definitions for fs-extra
// Project: https://github.com/jprichardson/node-fs-extra
// Definitions by: midknight41 <https://github.com/midknight41>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for ftdomdelegate
// Project: https://github.com/ftlabs/ftdomdelegate
// Definitions by: Christian Holm Nielsen
// Definitions by: Christian Holm Nielsen <https://github.com/dotnetnerd>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Delegate
@@ -19,4 +19,4 @@ declare class Delegate
root(element? : Element) : void;
destroy() : void;
}
}
+73
View File
@@ -0,0 +1,73 @@
/// <reference path="fuse.d.ts" />
function test_fuse_find_identifiers() {
var books = [{
id: 1,
title: 'The Great Gatsby',
author: 'F. Scott Fitzgerald'
}, {
id: 2,
title: 'The DaVinci Code',
author: 'Dan Brown'
}, {
id: 3,
title: 'Angels & Demons',
author: 'Dan Brown'
}];
var options = {
keys: ['author', 'title'], // keys to search in
id: 'id' // return a list of identifiers only
};
var f = new Fuse(books, options);
var result = f.search('brwn'); // Fuzzy-search for pattern 'brwn'
}
function test_fuse_find_records() {
var books = [{
id: 1,
title: 'The Great Gatsby',
author: 'F. Scott Fitzgerald'
}, {
id: 2,
title: 'The DaVinci Code',
author: 'Dan Brown'
}, {
id: 3,
title: 'Angels & Demons',
author: 'Dan Brown'
}];
var options = {
keys: ['author', 'title']
};
var f = new Fuse(books, options);
var result = f.search('brwn');
}
function test_fuse_flat_array() {
var books = ["Old Man's War", "The Lock Artist", "HTML5", "Right Ho Jeeves", "The Code of the Wooster", "Thank You Jeeves", "The DaVinci Code", "Angels & Demons", "The Silmarillion", "Syrup", "The Lost Symbol", "The Book of Lies", "Lamb", "Fool", "Incompetence", "Fat", "Colony", "Backwards, Red Dwarf", "The Grand Design", "The Book of Samson", "The Preservationist", "Fallen", "Monster 1959"];
var f = new Fuse(books);
var result = f.search('Falen');
}
function test_fuse_deep_key_search() {
var books = [{
id: 1,
title: 'The Great Gatsby',
author: {
firstName: 'F. Scott',
lastName: 'Fitzgerald'
}
}, {
title: 'The DaVinci Code',
author: {
firstName: 'Dan',
lastName: 'Brown'
}
}];
var options = {
keys: ['author.firstName']
}
var f = new Fuse(books, options);
var result = f.search('brwn');
}
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for Fuse.js 1.1.5
// Project: https://github.com/krisk/Fuse
// Definitions by: Greg Smith <https://github.com/smrq/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Fuse {
constructor(list: any[], options?: fuse.IFuseOptions);
search(pattern: string): any[];
}
declare module fuse {
interface IFuseOptions extends ISearchOptions {
caseSensitive?: boolean;
includeScore?: boolean;
shouldSort?: boolean;
searchFn?: any;
sortFn?: (a: {score: number}, b: {score: number}) => number;
getFn?: (obj: any, path: string) => any;
keys?: string[];
}
interface ISearchOptions {
location?: number;
distance?: number;
threshold?: number;
maxPatternLength?: number;
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for glDatePicker 2.0
// Project: http://glad.github.com/glDatePicker/
// Definitions by: Dániel Tar https://github.com/qcz
// Definitions by: Dániel Tar <https://github.com/qcz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
@@ -66,4 +66,4 @@ interface GlDatePicker {
interface JQuery {
glDatePicker(ret: boolean): GlDatePicker;
glDatePicker(options?: GlDatePickerOptions): JQuery;
}
}
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="glob-stream" />
import gs = require('glob-stream');
var read: NodeJS.ReadableStream;
read = gs.create('xx');
read = gs.create('xx', {});
read = gs.create(['xx'], {});
read = gs.create(['xx'], {cwd: 'xx'});
read = gs.create(['xx'], {base: 'xx'});
read = gs.create(['xx'], {cwdbase: true});
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for glob-stream v3.1.12
// Project: http://github.com/wearefractal/glob-stream
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../glob/glob.d.ts" />
declare module 'glob-stream' {
import glob = require('glob');
export interface Options extends glob.IOptions {
cwd?: string;
base?: string;
cwdbase?: boolean;
}
export interface Element {
cwd: string;
base: string;
path: string;
}
export function create(glob:string, opts?: Options): NodeJS.ReadableStream;
export function create(globs:string[], opts?: Options): NodeJS.ReadableStream;
}
@@ -37,5 +37,309 @@ function test_dataTableAddRow() {
dataTable.addRow(['row3', 0]);
}
function test_geoChart() {
var data = google.visualization.arrayToDataTable([
['Country', 'Population', 'Area Percentage'],
['France', 65700000, 50],
['Germany', 81890000, 27],
['Poland', 38540000, 23],
]);
var options = {
sizeAxis: { minValue: 0, maxValue: 100 },
region: '155', // Western Europe
displayMode: 'markers',
colorAxis: {colors: ['#e7711c', '#4374e0']} // orange to blue
};
var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_scatterChart() {
var data = google.visualization.arrayToDataTable([
['Age', 'Weight'],
[ 8, 12],
[ 4, 5.5],
[ 11, 14],
[ 4, 5],
[ 3, 3.5],
[ 6.5, 7]
]);
var options = {
title: 'Age vs. Weight comparison',
hAxis: {title: 'Age', minValue: 0, maxValue: 15},
vAxis: {title: 'Weight', minValue: 0, maxValue: 15},
legend: 'none'
};
var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_barChart() {
var data = google.visualization.arrayToDataTable([
["Element", "Density", { role: "style" } ],
["Copper", 8.94, "#b87333"],
["Silver", 10.49, "silver"],
["Gold", 19.30, "gold"],
["Platinum", 21.45, "color: #e5e4e2"],
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);
var options = {
title: "Density of Precious Metals, in g/cm^3",
width: 600,
height: 400,
bar: {groupWidth: "95%"},
legend: { position: "none" }
};
var chart = new google.visualization.BarChart(document.getElementById("barchart_values"));
chart.draw(view, options);
}
function test_histogram() {
var data = google.visualization.arrayToDataTable([
['Dinosaur', 'Length'],
['Acrocanthosaurus (top-spined lizard)', 12.2],
['Albertosaurus (Alberta lizard)', 9.1],
['Allosaurus (other lizard)', 12.2],
['Apatosaurus (deceptive lizard)', 22.9],
['Archaeopteryx (ancient wing)', 0.9],
['Argentinosaurus (Argentina lizard)', 36.6],
['Baryonyx (heavy claws)', 9.1],
['Brachiosaurus (arm lizard)', 30.5],
['Ceratosaurus (horned lizard)', 6.1],
['Coelophysis (hollow form)', 2.7],
['Compsognathus (elegant jaw)', 0.9],
['Deinonychus (terrible claw)', 2.7],
['Diplodocus (double beam)', 27.1],
['Dromicelomimus (emu mimic)', 3.4],
['Gallimimus (fowl mimic)', 5.5],
['Mamenchisaurus (Mamenchi lizard)', 21.0],
['Megalosaurus (big lizard)', 7.9],
['Microvenator (small hunter)', 1.2],
['Ornithomimus (bird mimic)', 4.6],
['Oviraptor (egg robber)', 1.5],
['Plateosaurus (flat lizard)', 7.9],
['Sauronithoides (narrow-clawed lizard)', 2.0],
['Seismosaurus (tremor lizard)', 45.7],
['Spinosaurus (spiny lizard)', 12.2],
['Supersaurus (super lizard)', 30.5],
['Tyrannosaurus (tyrant lizard)', 15.2],
['Ultrasaurus (ultra lizard)', 30.5],
['Velociraptor (swift robber)', 1.8]]);
var options = {
title: 'Lengths of dinosaurs, in meters',
legend: { position: 'none' }
};
var chart = new google.visualization.Histogram(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_areaChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2013', 1000, 400],
['2014', 1170, 460],
['2015', 660, 1120],
['2016', 1030, 540]
]);
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: '#333'}},
vAxis: {minValue: 0}
};
var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_steppedAreaChart() {
var data = google.visualization.arrayToDataTable([
['Director (Year)', 'Rotten Tomatoes', 'IMDB'],
['Alfred Hitchcock (1935)', 8.4, 7.9],
['Ralph Thomas (1959)', 6.9, 6.5],
['Don Sharp (1978)', 6.5, 6.4],
['James Hawes (2008)', 4.4, 6.2]
]);
var options = {
title: 'The decline of \'The 39 Steps\'',
vAxis: {title: 'Accumulated Rating'},
isStacked: true
};
var chart = new google.visualization.SteppedAreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_lineChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance'
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_pieChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
function test_bubbleChart() {
var data = google.visualization.arrayToDataTable([
['ID', 'Life Expectancy', 'Fertility Rate', 'Region', 'Population'],
['CAN', 80.66, 1.67, 'North America', 33739900],
['DEU', 79.84, 1.36, 'Europe', 81902307],
['DNK', 78.6, 1.84, 'Europe', 5523095],
['EGY', 72.73, 2.78, 'Middle East', 79716203],
['GBR', 80.05, 2, 'Europe', 61801570],
['IRN', 72.49, 1.7, 'Middle East', 73137148],
['IRQ', 68.09, 4.77, 'Middle East', 31090763],
['ISR', 81.55, 2.96, 'Middle East', 7485600],
['RUS', 68.6, 1.54, 'Europe', 141850000],
['USA', 78.09, 2.05, 'North America', 307007000]
]);
var options = {
title: 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',
hAxis: {title: 'Life Expectancy'},
vAxis: {title: 'Fertility Rate'},
bubble: {textStyle: {fontSize: 11}}
};
var chart = new google.visualization.BubbleChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function test_treemap() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Location', 'Parent', 'Market trade volume (size)', 'Market increase/decrease (color)'],
['Global', null, 0, 0],
['America', 'Global', 0, 0],
['Europe', 'Global', 0, 0],
['Asia', 'Global', 0, 0],
['Australia', 'Global', 0, 0],
['Africa', 'Global', 0, 0],
['Brazil', 'America', 11, 10],
['USA', 'America', 52, 31],
['Mexico', 'America', 24, 12],
['Canada', 'America', 16, -23],
['France', 'Europe', 42, -11],
['Germany', 'Europe', 31, -2],
['Sweden', 'Europe', 22, -13],
['Italy', 'Europe', 17, 4],
['UK', 'Europe', 21, -5],
['China', 'Asia', 36, 4],
['Japan', 'Asia', 20, -12],
['India', 'Asia', 40, 63],
['Laos', 'Asia', 4, 34],
['Mongolia', 'Asia', 1, -5],
['Israel', 'Asia', 12, 24],
['Iran', 'Asia', 18, 13],
['Pakistan', 'Asia', 11, -52],
['Egypt', 'Africa', 21, 0],
['S. Africa', 'Africa', 30, 43],
['Sudan', 'Africa', 12, 2],
['Congo', 'Africa', 10, 12],
['Zaire', 'Africa', 8, 10]
]);
// Create and draw the visualization.
var tree = new google.visualization.TreeMap(document.getElementById('chart_div'));
tree.draw(data, {
minColor: '#f00',
midColor: '#ddd',
maxColor: '#0d0',
headerHeight: 15,
fontColor: 'black',
showScale: true});
}
function test_table() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Salary');
data.addColumn('boolean', 'Full Time Employee');
data.addRows([
['Mike', {v: 10000, f: '$10,000'}, true],
['Jim', {v:8000, f: '$8,000'}, false],
['Alice', {v: 12500, f: '$12,500'}, true],
['Bob', {v: 7000, f: '$7,000'}, true]
]);
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true});
}
function test_timeline() {
var container = document.getElementById('example1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'President' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ],
[ 'Adams', new Date(1797, 2, 3), new Date(1801, 2, 3) ],
[ 'Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3) ]]);
chart.draw(dataTable);
}
function test_candlestickChart() {
var data = google.visualization.arrayToDataTable([
['Mon', 20, 28, 38, 45],
['Tue', 31, 38, 55, 66],
['Wed', 50, 55, 77, 80],
['Thu', 77, 77, 66, 50],
['Fri', 68, 66, 22, 15]
// Treat first row as data as well.
], true);
var options = {
legend:'none'
};
var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
+535 -86
View File
@@ -130,7 +130,7 @@ declare module google {
maxValue?: any;
}
function arrayToDataTable(data: any[]): DataTable;
function arrayToDataTable(data: any[], firstRowIsData?: boolean): DataTable;
//#endregion
//#region DataView
@@ -139,72 +139,39 @@ declare module google {
export class DataView {
constructor(data: DataTable);
constructor(data: DataView);
setColumns(columnIndexes: number[]): void;
setColumns(columnIndexes: any[]): void;
}
//#endregion
//#region GeoChart
//https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
export class GeoChart {
constructor(element: Element);
// https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=fr&csw=1#Methods
export class GeoChart extends ChartBase {
draw(data: DataTable, options: GeoChartOptions): void;
getSelection(): GeoChartSelection[];
setSelection(selection: VisualizationSelectionArray[]): void;
clearChart(): void;
}
// https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=fr&csw=1#Configuration_Options
export interface GeoChartOptions {
backgroundColor?: any;
colorAxis?: GeoChartColorAxis;
colorAxis?: ChartColorAxis;
datalessRegionColor?: string;
displayMode?: string;
enableRegionInteractivity?: boolean;
height?: number;
keepAspectRatio?: boolean;
legend?: GeoChartLegend;
legend?: ChartLegend;
region?: string;
magnifyingGlass?: GeoChartMagnifyingGlass;
markerOpacity?: number;
resolution?: string;
sizeAxis?: GeoChartAxis;
tooltip?: GeoChartTooltip;
sizeAxis?: ChartSizeAxis;
tooltip?: ChartTooltip;
width?: number;
}
export interface GeoChartAxis {
maxSize?: number;
maxValue?: number;
minSize?: number;
minValue?: number;
}
export interface GeoChartColorAxis extends GeoChartAxis {
minValue?: number;
maxValue?: number;
values?: number[];
colors?: string[];
}
export interface GeoChartTextStyle {
color?: string;
fontName?: string;
fontSize?: number;
bold?: boolean;
italic?: boolean;
}
export interface GeoChartLegend {
numberFormat?: string;
textStyle?: GeoChartTextStyle;
}
export interface GeoChartMagnifyingGlass {
enable?: boolean;
zoomFactor?: number;
}
export interface GeoChartTooltip {
textStyle?: GeoChartTextStyle;
trigger?: string;
}
export interface GeoChartRegionClickEvent {
region: string;
}
@@ -215,6 +182,67 @@ declare module google {
//#endregion
//#region Common
export interface ChartAnnotations {
boxStyle?: ChartBoxStyle;
textStyle?: ChartTextStyle;
}
export interface ChartBoxStyle {
stroke?: string;
strokeWidth?: number;
rx?: number;
ry?: number;
gradient?: {
color1: string;
color2: string;
x1: string;
y1: string;
x2: string;
y2: string;
useObjectBoundingBoxUnits?: boolean;
}
}
export interface ChartTextStyle {
fontName?: string;
fontSize?: number;
bold?: boolean;
italic?: boolean;
color?: string;
auraColor?: string;
opacity?: number;
}
export interface ChartCrosshair {
color?: string;
focused?: {
color?: string;
opacity?: number;
}
opacity?: number;
orientation?: string;
selected?: {
color?: string;
opacity?: number;
}
trigger?: string;
}
export interface ChartExplorer {
actions?: string[];
axis?: string;
keepInBounds?: boolean;
maxZoomIn?: number;
maxZoomOut?: number;
zoomDelta?: number;
}
export interface ChartStroke {
stroke: string;
strokeWidth: number;
fill: string;
}
export interface ChartArea {
top: any;
left: any;
@@ -222,19 +250,12 @@ declare module google {
height: any;
}
export interface ChartTextStyle {
color?: string;
fontName?: string;
fontSize?: number;
bold?: boolean;
italic?: boolean;
}
export interface ChartLegend {
alignment?: string;
maxLines?: number;
position?: string;
textStyle?: ChartTextStyle;
numberFormat?: string;
}
// https://google-developers.appspot.com/chart/interactive/docs/animation
@@ -298,6 +319,14 @@ declare module google {
height: number;
}
export interface ChartColorAxis {
minValue?: number;
maxValue?: number;
values?: number[];
colors?: string[];
legend?: ChartLegend;
}
export interface ChartLayoutInterface {
getBoundingBox(id: string): ChartBoundingBox;
getChartAreaBoundingBox(): ChartBoundingBox;
@@ -307,34 +336,91 @@ declare module google {
getYLocation(position: number, axisIndex?: number): number;
}
export interface GroupWidth {
groupWidth: any; // number | string
}
export interface VisualizationSelectionArray {
column?: number;
row?: number;
}
class ChartBase {
constructor(element: Element);
getSelection(): any[];
setSelection(selection: any[]): void;
clearChart(): void;
getImageURI(): string;
}
class CoreChartBase extends ChartBase {
getBoundingBox(id: string): ChartBoundingBox;
getChartAreaBoundingBox(): ChartBoundingBox;
getChartLayoutInterface(): ChartLayoutInterface;
getHAxisValue(position: number, axisIndex?: number): number;
getVAxisValue(position: number, axisIndex?: number): number;
getXLocation(position: number, axisIndex?: number): number;
getYLocation(position: number, axisIndex?: number): number;
}
//#endregion
//#region ScatterChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart
export class ScatterChart extends CoreChartBase {
draw(data: DataTable, options?: ScatterChartOptions): void;
draw(data: DataView, options?: ScatterChartOptions): void;
}
export interface ScatterChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
annotations?: ChartAnnotations;
axisTitlesPosition?: string; // in, out, none
backgroundColor?: any;
chartArea?: ChartArea;
colors?: string[];
crosshair?: ChartCrosshair;
curveType?: string;
dataOpacity?: number;
enableInteractivity?: boolean;
explorer?: ChartExplorer;
fontSize?: number;
fontName?: string;
forceIFrame?: boolean;
hAxis?: ChartAxis;
height?: number;
legend?: ChartLegend;
lineWidth?: number;
pointSize?: number;
selectionMode?: string;
series?: any;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxis?: ChartAxis;
width?: number;
}
//#endregion
//#region ColumnChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart
export class ColumnChart {
constructor(element: Element);
// https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart#Methods
draw(data: DataTable, options?: ColumnChartOptions): void;
draw(data: DataView, options?: ColumnChartOptions): void;
getChartLayoutInterface(): ChartLayoutInterface;
getSelection(): any[];
setSelection(selection: any[]): void;
clearChart(): void;
export class ColumnChart extends CoreChartBase {
draw(data: DataTable, options: ColumnChartOptions): void;
draw(data: DataView, options: ColumnChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/columnchart#Configuration_Options
export interface ColumnChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
annotations?: ChartAnnotations;
axisTitlesPosition?: string; // in, out, none
backgroundColor?: any;
bar?: ColumnChartBarOptions;
bar?: GroupWidth;
chartArea?: ChartArea;
colors?: string[];
enableInteractivity?: boolean;
@@ -358,36 +444,29 @@ declare module google {
width?: number;
}
export interface ColumnChartBarOptions {
groupWidth: any;
}
//#endregion
//#region LineChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart
export class LineChart {
constructor(element: Element);
// https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Methods
draw(data: DataTable, options: any): void;
draw(data: DataView, options: any): void;
getChartLayoutInterface(): ChartLayoutInterface;
getSelection(): any[];
setSelection(selection: any[]): void;
clearChart(): void;
export class LineChart extends CoreChartBase {
draw(data: DataTable, options: LineChartOptions): void;
draw(data: DataView, options: LineChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Configuration_Options
export interface LineChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
annotations?: ChartAnnotations;
axisTitlesPosition?: string;
backgroundColor?: any;
chartArea?: ChartArea;
colors?: string[];
crosshair?: ChartCrosshair;
curveType?: string;
dataOpacity?: number;
enableInteractivity?: boolean;
explorer?: ChartExplorer;
focusTarget?: string;
fontSize?: number;
fontName?: string;
@@ -396,6 +475,7 @@ declare module google {
interpolateNulls?: boolean;
legend?: ChartLegend;
lineWidth?: number;
orientation?: string;
pointSize?: number;
reverseCategories?: boolean;
selectionMode?: string // single / multiple
@@ -417,9 +497,10 @@ declare module google {
export interface BarChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
annotations?: ChartAnnotations;
axisTitlesPosition?: string; // in, out, none
backgroundColor?: any;
bar?: ColumnChartBarOptions;
bar?: GroupWidth;
chartArea?: ChartArea;
colors?: string[];
dataOpacity?: number;
@@ -427,6 +508,7 @@ declare module google {
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxes?: any;
hAxis?: ChartAxis;
height?: number;
isStacked?: boolean;
@@ -444,21 +526,388 @@ declare module google {
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart
export class BarChart {
constructor(element: Element);
export class BarChart extends CoreChartBase {
draw(data: DataTable, options: BarChartOptions): void;
draw(data: DataView, options: BarChartOptions): void;
getBoundingBox(id: string): ChartBoundingBox;
getChartAreaBoundingBox(): ChartBoundingBox;
getChartLayoutInterface(): ChartLayoutInterface;
getHAxisValue(position: number, axisIndex?: number): number;
getVAxisValue(position: number, axisIndex?: number): number;
getXLocation(position: number, axisIndex?: number): number;
getYLocation(position: number, axisIndex?: number): number;
getSelection(): any[];
setSelection(selection: any[]): void;
clearChart(): void;
}
//#endregion
//#region Histogram
// https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram
export class Histogram extends CoreChartBase {
draw(data: DataTable, options: HistogramOptions): void;
draw(data: DataView, options: HistogramOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram#Configuration_Options
export interface HistogramOptions {
animation?: TransitionAnimation;
axisTitlesPosition?: string; // in, out, none
backgroundColor?: any;
bar?: GroupWidth;
chartArea?: ChartArea;
colors?: string[];
dataOpacity?: number;
enableInteractivity?: boolean;
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxis?: ChartAxis;
histogram?: HistogramHistogramOptions;
height?: number;
interpolateNulls?: boolean;
isStacked?: boolean;
legend?: ChartLegend;
orientation?: string;
reverseCategories?: boolean;
series?: any;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxes?: any;
vAxis?: ChartAxis;
width?: number;
}
export interface HistogramHistogramOptions {
bucketSize?: number;
hideBucketItems?: boolean;
lastBucketPercentile?: number;
}
//#endregion
//#region AreaChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart
export class AreaChart extends CoreChartBase {
draw(data: DataTable, options: AreaChartOptions): void;
draw(data: DataView, options: AreaChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options
export interface AreaChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
areaOpacity?: number;
axisTitlesPosition?: string;
backgroundColor?: any;
chartArea?: ChartArea;
colors?: string[];
crosshair?: ChartCrosshair;
dataOpacity?: number;
enableInteractivity?: boolean;
explorer?: ChartExplorer;
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxis?: ChartAxis;
height?: number;
interpolateNulls?: boolean;
isStacked?: boolean;
legend?: ChartLegend;
lineWidth?: number;
orientation?: string;
pointSize?: number;
reverseCategories?: boolean;
selectionMode?: string // single / multiple
series?: any;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxes?: any;
vAxis?: ChartAxis;
width?: number;
}
//#endregion
//#region SteppedAreaChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart
export class SteppedAreaChart extends CoreChartBase {
draw(data: DataTable, options: SteppedAreaChartOptions): void;
draw(data: DataView, options: SteppedAreaChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart#Configuration_Options
export interface SteppedAreaChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
areaOpacity?: number;
axisTitlesPosition?: string;
backgroundColor?: any;
chartArea?: ChartArea;
colors?: string[];
connectSteps?: boolean;
enableInteractivity?: boolean;
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxis?: ChartAxis;
height?: number;
interpolateNulls?: boolean;
isStacked?: boolean;
legend?: ChartLegend;
reverseCategories?: boolean;
selectionMode?: string // single / multiple
series?: any;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxes?: any;
vAxis?: ChartAxis;
width?: number;
}
//#endregion
//#region PieChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart
export class PieChart extends CoreChartBase {
draw(data: DataTable, options: PieChartOptions): void;
draw(data: DataView, options: PieChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/piechart#Configuration_Options
export interface PieChartOptions {
backgroundColor?: any;
chartArea?: ChartArea;
colors?: string[];
enableInteractivity?: boolean;
fontSize?: number;
fontName?: string;
height?: number;
is3D?: boolean;
legend?: ChartLegend;
pieHole?: number;
pieSliceBorderColor?: string;
pieSliceText?: string;
pieSliceTextStyle?: ChartTextStyle;
pieStartAngle?: number;
reverseCategories?: boolean;
pieResidueSliceColor?: string;
pieResidueSliceLabel?: string;
slices?: any;
sliceVisibilityThreshold?: number;
title?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
width?: number;
}
//#endregion
//#region BubbleChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart
export class BubbleChart extends CoreChartBase {
draw(data: DataTable, options?: BubbleChartOptions): void;
draw(data: DataView, options?: BubbleChartOptions): void;
}
export interface BubbleChartOptions {
animation?: TransitionAnimation;
axisTitlesPosition?: string; // in, out, none
backgroundColor?: any;
bubble?: ChartBubble;
chartArea?: ChartArea;
colors?: string[];
colorAxis?: ChartColorAxis;
enableInteractivity?: boolean;
explorer?: ChartExplorer;
fontSize?: number;
fontName?: string;
forceIFrame?: boolean;
hAxis?: ChartAxis;
height?: number;
legend?: ChartLegend;
selectionMode?: string;
series?: any;
sizeAxis?: ChartSizeAxis;
sortBubblesBySize?: boolean;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxis?: ChartAxis;
width?: number;
}
export interface ChartBubble {
opacity?: number;
stroke?: string;
textStyle?: ChartTextStyle;
}
export interface ChartSizeAxis {
maxSize?: number;
maxValue?: number;
minSize?: number;
minValue?: number;
}
//#endregion
//#region TreeMap
// https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap
export class TreeMap extends ChartBase {
draw(data: DataTable, options?: TreeMapOptions): void;
draw(data: DataView, options?: TreeMapOptions): void;
goUpAndDraw(): void;
getMaxPossibleDepth(): number;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/treemap#Configuration_Options
export interface TreeMapOptions {
fontColor?: string;
fontFamily?: string;
fontSize?: number;
forceIFrame?: boolean;
headerColor?: string;
headerHeight?: number;
headerHighlightColor?: string;
hintOpacity?: number;
maxColor?: string;
maxDepth?: number;
maxHighlightColor?: string;
maxPostDepth?: number;
maxColorValue?: number;
midColor?: string;
midHighlightColor?: string;
minColor?: string;
minHighlightColor?: string;
minColorValue?: number;
showScale?: boolean;
showTooltips?: boolean;
textStyle?: ChartTextStyle;
title?: string;
titleTextStyle?: ChartTextStyle;
useWeightedAverageForAggregation?: boolean;
}
//#endregion
//#region Table
// https://google-developers.appspot.com/chart/interactive/docs/gallery/table
export class Table extends ChartBase {
draw(data: DataTable, options?: TableOptions): void;
draw(data: DataView, options?: TableOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/table#Configuration_Options
export interface TableOptions {
allowHtml?: boolean;
alternatingRowStyle?: boolean;
cssClassName?: CssClassNames;
firstRowNumber?: number;
height?: string;
page?: string;
pageSize?: number;
rtlTable?: boolean;
scrollLeftStartPosition?: number;
showRowNumber?: boolean;
sort?: string;
sortAscending?: boolean;
sortColumn?: number;
startPage?: number;
width?: string;
}
export interface CssClassNames {
headerRow?: string;
tableRow?: string;
oddTableRow?: string;
selectedTableRow?: string;
hoverTableRow?: string;
headerCell?: string;
tableCell?: string;
rowNumberCell?: string;
}
//#endregion
//#region Timeline
// https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline
export class Timeline {
constructor(element: Element);
draw(data: DataTable, options?: TimelineOptions): void;
draw(data: DataView, options?: TimelineOptions): void;
clearChart(): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/timeline#Configuration_Options
export interface TimelineOptions {
avoidOverlappingGridLines?: boolean;
backgroundColor?: any;
colors?: string[];
enableInteractivity?: boolean;
forceIFrame?: boolean;
height?: number;
timeline?: {
barLabelStyle?: LabelStyle;
colorByRowLabel?: boolean;
groupByRowLabel?: boolean;
rowLabelStyle?: LabelStyle;
showRowLabels?: boolean;
singleColor?: string;
}
width?: number;
}
export interface LabelStyle {
color: string;
fontName: string;
fontSize: string;
}
//#endregion
//#region CandlestickChart
// https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart
export class CandlestickChart extends CoreChartBase {
draw(data: DataTable, options: CandlestickChartOptions): void;
draw(data: DataView, options: CandlestickChartOptions): void;
}
// https://google-developers.appspot.com/chart/interactive/docs/gallery/candlestickchart#Configuration_Options
export interface CandlestickChartOptions {
aggregationTarget?: string;
animation?: TransitionAnimation;
axisTitlesPosition?: string;
backgroundColor?: any;
bar?: GroupWidth;
candlestick?: {
hollowIsRising?: boolean;
fallingColor?: ChartStroke;
risingColor?: ChartStroke;
}
chartArea?: ChartArea;
colors?: string[];
enableInteractivity?: boolean;
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxis?: ChartAxis;
height?: number;
legend?: ChartLegend;
orientation?: string;
reverseCategories?: boolean;
selectionMode?: string // single / multiple
series?: any;
theme?: string;
title?: string;
titlePosition?: string;
titleTextStyle?: ChartTextStyle;
tooltip?: ChartTooltip;
vAxes?: any;
vAxis?: ChartAxis;
width?: number;
}
//#endregion
+4 -4
View File
@@ -1,10 +1,10 @@
/// <reference path="../googlemaps/google.maps.d.ts" />
// Type definitions for CSS3 InfoBubble with tabs for Google Maps API V3
// Project: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src/
// Definitions by: Johan Nilsson https://github.com/Dashue
// Definitions by: Johan Nilsson <https://github.com/Dashue>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../googlemaps/google.maps.d.ts" />
/**
* @name CSS3 InfoBubble with tabs for Google Maps API V3
* @version 0.8
@@ -105,4 +105,4 @@ declare module google.maps.infobubble {
*/
shadowStyle?: number;
}
}
}
+37 -25
View File
@@ -1,6 +1,7 @@
// Type definitions for Hammer.js 1.0.10
// Type definitions for Hammer.js 1.1.3
// Project: http://eightmedia.github.com/hammer.js/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Drew Noakes <https://drewnoakes.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -31,8 +32,6 @@ interface HammerStatic {
plugins: any;
gestures: any;
READY: boolean;
}
declare class HammerInstance {
@@ -42,40 +41,51 @@ declare class HammerInstance {
off(gesture: string, handler: (event: HammerEvent) => void): HammerInstance;
enable(toggle: boolean): HammerInstance;
// You shouldn't use this, this is an internally method use by the gestures. Only use it when you know what you're doing! You can read the sourcecode about how to use this.
// You shouldn't normally use this internal method. Only use it when you know what you're doing! You can read the sourcecode for information about how to use this.
trigger(gesture: string, eventData: HammerGestureEventData): HammerInstance;
}
// Gesture Options : https://github.com/EightMedia/hammer.js/wiki/Getting-Started#gesture-options
interface HammerOptions {
behavior?: {
contentZooming?: string;
tapHighlightColor?: string;
touchAction?: string;
touchCallout?: string;
userDrag?: string;
userSelect?: string;
};
doubleTapDistance?: number;
doubleTapInterval?: number;
drag?: boolean;
drag_block_horizontal?: boolean;
drag_block_vertical?: boolean;
drag_lock_to_axis?: boolean;
drag_max_touches?: number;
drag_min_distance?: number;
dragBlockHorizontal?: boolean;
dragBlockVertical?: boolean;
dragDistanceCorrection?: boolean;
dragLockMinDistance?: number;
dragLockToAxis?: boolean;
dragMaxTouches?: number;
dragMinDistance?: number;
gesture?: boolean;
hold?: boolean;
hold_threshold?: number;
hold_timeout?: number;
prevent_default?: boolean;
prevent_mouseevents?: boolean;
holdThreshold?: number;
holdTimeout?: number;
preventDefault?: boolean;
preventMouse?: boolean;
release?: boolean;
show_touches?: boolean;
stop_browser_behavior?: any;
showTouches?: boolean;
swipe?: boolean;
swipe_max_touches?: number;
swipe_velocity?: number;
swipeMaxTouches?: number;
swipeMinTouches?: number;
swipeVelocityX?: number;
swipeVelocityY?: number;
tap?: boolean;
tap_always?: boolean;
tap_max_distance?: number;
tap_max_touchtime?: number;
doubletap_distance?: number;
doubletap_interval?: number;
tapAlways?: boolean;
tapMaxDistance?: number;
tapMaxTime?: number;
touch?: boolean;
transform?: boolean;
transform_always_block?: boolean;
transform_min_rotation?: number;
transform_min_scale?: number;
transformMinRotation?: number;
transformMinScale?: number;
}
interface HammerGestureEventData {
@@ -106,6 +116,8 @@ interface HammerGestureEventData {
}
interface HammerPoint {
clientX: number;
clientY: number;
pageX: number;
pageY: number;
}
+2 -1
View File
@@ -1,7 +1,8 @@
// Type definitions for highlight.js
// Project: https://github.com/isagalaev/highlight.js
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee/>
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "highlight.js"
{
module hljs
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Humane 3.0
// Project: http://wavded.github.com/humane-js/
// Definitions by: jmvrbanac <https://github.com/jmvrbanac>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface HumaneOptions {
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for i18next (v1.5.10 incl. jQuery)
// Type definitions for i18next v1.5.10
// Project: http://i18next.com
// Definitions by: Maarten Docter <https://github.com/mdocter> - Blog: http://www.maartendocter.nl
// Definitions by: Maarten Docter <https://github.com/mdocter>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Sources: https://github.com/jamuhl/i18next/
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for iScroll Lite 4.1
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/> and Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for iScroll 4.2
// Project: http://cubiq.org/iscroll-4
// Definitions by: Boris Yankov <https://github.com/borisyankov/> and Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christiaan Rakowski <https://github.com/csrakowski/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+4
View File
@@ -111,3 +111,7 @@ declare module Ix {
forIn<T, TResult>(source: Enumerable<T>, resultSelector: EnumerableFunc<T, TResult>): Enumerable<TResult>;
}
}
declare module "ix" {
export = Ix;
}
+12 -6
View File
@@ -54,8 +54,10 @@ declare module Ix {
some(predicate?: EnumerablePredicate<T>, thisArg?: any): boolean; // alias
average(selector?: EnumerableFunc<T, number>): number;
max(selector?: EnumerableFunc<T, number>): number;
min(selector?: EnumerableFunc<T, number>): number;
max(): T;
max<TResult>(selector: EnumerableFunc<T, TResult>): TResult;
min(): T;
min<TResult>(selector: EnumerableFunc<T, TResult>): TResult;
sum(selector?: EnumerableFunc<T, number>): number;
concat<T>(...sources: Enumerable<T>[]): Enumerable<T>;
@@ -91,16 +93,16 @@ declare module Ix {
comparer?: EqualityComparer<TKey, TKey>): Enumerable<TResult>;
groupBy<TKey, TElement>(
keySelector: (item: T) => TKey,
elementSelector: (item: T) => TElement): Grouping<TKey, TElement>;
elementSelector: (item: T) => TElement): Enumerable<Grouping<TKey, TElement>>;
groupBy<TKey>(
keySelector: (item: T) => TKey): Grouping<TKey, T>;
keySelector: (item: T) => TKey): Enumerable<Grouping<TKey, T>>;
// if need to set comparer without resultSelector
groupBy<TKey, TElement>(
keySelector: (item: T) => TKey,
elementSelector: (item: T) => TElement,
_: boolean,
comparer: EqualityComparer<TKey, TKey>): Grouping<TKey, TElement>;
comparer: EqualityComparer<TKey, TKey>): Enumerable<Grouping<TKey, TElement>>;
// if need to set resultSelector without elementSelector
groupBy<TKey, TResult>(
keySelector: (item: T) => TKey,
@@ -112,7 +114,7 @@ declare module Ix {
keySelector: (item: T) => TKey,
_: boolean,
__: boolean,
comparer: EqualityComparer<TKey, TKey>): Grouping<TKey, T>;
comparer: EqualityComparer<TKey, TKey>): Enumerable<Grouping<TKey, T>>;
groupJoin<TInner, TOuterKey, TInnerKey, TResult>(
inner: Enumerable<TInner>,
@@ -249,3 +251,7 @@ declare module Ix {
var Enumerable: EnumerableStatic;
}
declare module "l2o" {
export = Ix;
}
+2 -2
View File
@@ -1,7 +1,7 @@
// Type definitions for Jasmine-fixture 1.0.7
// Project: https://github.com/searls/jasmine-fixture
// Definitions by: Craig Brett <https://github.com/craigbrett17/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/** Affixes the given jquery selectors into the body and will be removed after each spec
* @param {string} selector The JQuery selector to be added to the dom
@@ -13,4 +13,4 @@ interface JQuery {
* @param {string} selector The JQuery selector to be added to the dom
*/
affix(selector: string): JQuery;
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Jasmine-JQuery 1.5.8
// Project: https://github.com/velesin/jasmine-jquery
// Definitions by: Gregor Stamac <https://github.com/gstamac/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jasmine/jasmine.d.ts"/>
/// <reference path="../jquery/jquery.d.ts"/>
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Jasmine 2.0
// Project: http://pivotal.github.com/jasmine/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function describe(description: string, specDefinitions: () => void): void;
@@ -1,7 +1,7 @@
// Type definitions for Jasmine 1.3
// Project: http://pivotal.github.com/jasmine/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function describe(description: string, specDefinitions: () => void): void;
+244 -76
View File
@@ -29,27 +29,6 @@ var funcArr: Function[] = [];
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var validOpts: Joi.ValidationOptions = null;
validOpts = {abortEarly: bool};
validOpts = {convert: bool};
validOpts = {allowUnknown: bool};
validOpts = {skipFunctions: bool};
validOpts = {stripUnknown: bool};
validOpts = {language: bool};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var renOpts: Joi.RenameOptions = null;
renOpts = {alias: bool};
renOpts = {multiple: bool};
renOpts = {override: bool};
var validErr: Joi.ValidationError = null;
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var schema: Joi.Schema = null;
var anySchema: Joi.AnySchema<Joi.Schema> = null;
@@ -61,9 +40,66 @@ var binSchema: Joi.BinarySchema = null;
var dateSchema: Joi.DateSchema = null;
var funcSchema: Joi.FunctionSchema = null;
var objSchema: Joi.ObjectSchema = null;
var altSchema: Joi.AlternativesSchema = null;
var schemaArr: Joi.Schema[] = [];
var ref: Joi.Reference = null;
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var validOpts: Joi.ValidationOptions = null;
validOpts = {abortEarly: bool};
validOpts = {convert: bool};
validOpts = {allowUnknown: bool};
validOpts = {skipFunctions: bool};
validOpts = {stripUnknown: bool};
validOpts = {language: bool};
validOpts = {context: obj};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var renOpts: Joi.RenameOptions = null;
renOpts = {alias: bool};
renOpts = {multiple: bool};
renOpts = {override: bool};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var whenOpts: Joi.WhenOptions = null;
whenOpts = {is: schema};
whenOpts = {is: schema, then: schema};
whenOpts = {is: schema, otherwise: schema};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var refOpts: Joi.ReferenceOptions = null;
refOpts = {alias: bool};
refOpts = {multiple: bool};
refOpts = {override: bool};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var validErr: Joi.ValidationError = null;
var validErrItem: Joi.ValidationErrorItem;
validErrItem= {
message: str,
type: str,
path: str
};
validErrItem = {
message: str,
type: str,
path: str,
options: validOpts
};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
schema = anySchema;
@@ -76,6 +112,8 @@ schema = dateSchema;
schema = funcSchema;
schema = objSchema;
schema = ref;
anySchema = anySchema;
anySchema = numSchema;
anySchema = strSchema;
@@ -99,18 +137,22 @@ schemaMap = {
anySchema = Joi.any();
anySchema.validate(x, (err: Joi.ValidationError, value: any) => {
});
module common {
anySchema = anySchema.allow(x);
anySchema = anySchema.allow(x, x);
anySchema = anySchema.allow([x, x, x]);
anySchema = anySchema.valid(x);
anySchema = anySchema.valid(x, x);
anySchema = anySchema.valid([x, x, x]);
anySchema = anySchema.invalid(x);
anySchema = anySchema.invalid(x, x);
anySchema = anySchema.invalid([x, x, x]);
anySchema = anySchema.default(x);
anySchema = anySchema.required();
anySchema = anySchema.optional();
anySchema = anySchema.forbidden();
anySchema = anySchema.description(str);
anySchema = anySchema.notes(str);
@@ -118,8 +160,16 @@ module common {
anySchema = anySchema.tags(str);
anySchema = anySchema.tags(strArr);
anySchema = anySchema.meta(obj);
anySchema = anySchema.example(obj);
anySchema = anySchema.unit(str);
anySchema = anySchema.options(validOpts);
anySchema = anySchema.strict();
anySchema = anySchema.concat(x);
altSchema = anySchema.when(str, whenOpts);
altSchema = anySchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -140,14 +190,23 @@ arrSchema = arrSchema.excludes([numSchema, strSchema]);
// - - - - - - - -
module common {
arrSchema = arrSchema.allow(anyArr);
arrSchema = arrSchema.valid(anyArr);
arrSchema = arrSchema.invalid(anyArr);
arrSchema = arrSchema.default(anyArr);
module common_copy_paste {
// use search & replace from any
anySchema = anySchema.allow(x);
anySchema = anySchema.allow(x, x);
anySchema = anySchema.allow([x, x, x]);
anySchema = anySchema.valid(x);
anySchema = anySchema.valid(x, x);
anySchema = anySchema.valid([x, x, x]);
anySchema = anySchema.invalid(x);
anySchema = anySchema.invalid(x, x);
anySchema = anySchema.invalid([x, x, x]);
anySchema = anySchema.default(x);
arrSchema = arrSchema.required();
arrSchema = arrSchema.optional();
arrSchema = arrSchema.forbidden();
arrSchema = arrSchema.description(str);
arrSchema = arrSchema.notes(str);
@@ -155,8 +214,16 @@ module common {
arrSchema = arrSchema.tags(str);
arrSchema = arrSchema.tags(strArr);
arrSchema = arrSchema.meta(obj);
arrSchema = arrSchema.example(obj);
arrSchema = arrSchema.unit(str);
arrSchema = arrSchema.options(validOpts);
arrSchema = arrSchema.strict();
arrSchema = arrSchema.concat(x);
altSchema = arrSchema.when(str, whenOpts);
altSchema = arrSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -164,14 +231,22 @@ module common {
boolSchema = Joi.bool();
boolSchema = Joi.boolean();
module common {
boolSchema = boolSchema.allow(bool);
boolSchema = boolSchema.valid(bool);
boolSchema = boolSchema.invalid(bool);
boolSchema = boolSchema.default(bool);
module common_copy_paste {
boolSchema = boolSchema.allow(x);
boolSchema = boolSchema.allow(x, x);
boolSchema = boolSchema.allow([x, x, x]);
boolSchema = boolSchema.valid(x);
boolSchema = boolSchema.valid(x, x);
boolSchema = boolSchema.valid([x, x, x]);
boolSchema = boolSchema.invalid(x);
boolSchema = boolSchema.invalid(x, x);
boolSchema = boolSchema.invalid([x, x, x]);
boolSchema = boolSchema.default(x);
boolSchema = boolSchema.required();
boolSchema = boolSchema.optional();
boolSchema = boolSchema.forbidden();
boolSchema = boolSchema.description(str);
boolSchema = boolSchema.notes(str);
@@ -179,8 +254,16 @@ module common {
boolSchema = boolSchema.tags(str);
boolSchema = boolSchema.tags(strArr);
boolSchema = boolSchema.meta(obj);
boolSchema = boolSchema.example(obj);
boolSchema = boolSchema.unit(str);
boolSchema = boolSchema.options(validOpts);
boolSchema = boolSchema.strict();
boolSchema = boolSchema.concat(x);
altSchema = boolSchema.when(str, whenOpts);
altSchema = boolSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -192,13 +275,21 @@ binSchema = binSchema.max(num);
binSchema = binSchema.length(num);
module common {
binSchema = binSchema.allow(bin);
binSchema = binSchema.valid(bin);
binSchema = binSchema.invalid(bin);
binSchema = binSchema.default(bin);
binSchema = binSchema.allow(x);
binSchema = binSchema.allow(x, x);
binSchema = binSchema.allow([x, x, x]);
binSchema = binSchema.valid(x);
binSchema = binSchema.valid(x, x);
binSchema = binSchema.valid([x, x, x]);
binSchema = binSchema.invalid(x);
binSchema = binSchema.invalid(x, x);
binSchema = binSchema.invalid([x, x, x]);
binSchema = binSchema.default(x);
binSchema = binSchema.required();
binSchema = binSchema.optional();
binSchema = binSchema.forbidden();
binSchema = binSchema.description(str);
binSchema = binSchema.notes(str);
@@ -206,8 +297,16 @@ module common {
binSchema = binSchema.tags(str);
binSchema = binSchema.tags(strArr);
binSchema = binSchema.meta(obj);
binSchema = binSchema.example(obj);
binSchema = binSchema.unit(str);
binSchema = binSchema.options(validOpts);
binSchema = binSchema.strict();
binSchema = binSchema.concat(x);
altSchema = binSchema.when(str, whenOpts);
altSchema = binSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -224,23 +323,21 @@ dateSchema = dateSchema.min(num);
dateSchema = dateSchema.max(num);
module common {
dateSchema = dateSchema.allow(date);
dateSchema = dateSchema.valid(date);
dateSchema = dateSchema.invalid(date);
dateSchema = dateSchema.default(date);
dateSchema = dateSchema.allow(num);
dateSchema = dateSchema.valid(num);
dateSchema = dateSchema.invalid(num);
dateSchema = dateSchema.default(num);
dateSchema = dateSchema.allow(str);
dateSchema = dateSchema.valid(str);
dateSchema = dateSchema.invalid(str);
dateSchema = dateSchema.default(str);
dateSchema = dateSchema.allow(x);
dateSchema = dateSchema.allow(x, x);
dateSchema = dateSchema.allow([x, x, x]);
dateSchema = dateSchema.valid(x);
dateSchema = dateSchema.valid(x, x);
dateSchema = dateSchema.valid([x, x, x]);
dateSchema = dateSchema.invalid(x);
dateSchema = dateSchema.invalid(x, x);
dateSchema = dateSchema.invalid([x, x, x]);
dateSchema = dateSchema.default(x);
dateSchema = dateSchema.required();
dateSchema = dateSchema.optional();
dateSchema = dateSchema.forbidden();
dateSchema = dateSchema.description(str);
dateSchema = dateSchema.notes(str);
@@ -248,8 +345,16 @@ module common {
dateSchema = dateSchema.tags(str);
dateSchema = dateSchema.tags(strArr);
dateSchema = dateSchema.meta(obj);
dateSchema = dateSchema.example(obj);
dateSchema = dateSchema.unit(str);
dateSchema = dateSchema.options(validOpts);
dateSchema = dateSchema.strict();
dateSchema = dateSchema.concat(x);
altSchema = dateSchema.when(str, whenOpts);
altSchema = dateSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -265,13 +370,21 @@ numSchema = numSchema.max(num);
numSchema = numSchema.integer();
module common {
numSchema = numSchema.allow(num);
numSchema = numSchema.valid(num);
numSchema = numSchema.invalid(num);
numSchema = numSchema.default(num);
numSchema = numSchema.allow(x);
numSchema = numSchema.allow(x, x);
numSchema = numSchema.allow([x, x, x]);
numSchema = numSchema.valid(x);
numSchema = numSchema.valid(x, x);
numSchema = numSchema.valid([x, x, x]);
numSchema = numSchema.invalid(x);
numSchema = numSchema.invalid(x, x);
numSchema = numSchema.invalid([x, x, x]);
numSchema = numSchema.default(x);
numSchema = numSchema.required();
numSchema = numSchema.optional();
numSchema = numSchema.forbidden();
numSchema = numSchema.description(str);
numSchema = numSchema.notes(str);
@@ -279,8 +392,16 @@ module common {
numSchema = numSchema.tags(str);
numSchema = numSchema.tags(strArr);
numSchema = numSchema.meta(obj);
numSchema = numSchema.example(obj);
numSchema = numSchema.unit(str);
numSchema = numSchema.options(validOpts);
numSchema = numSchema.strict();
numSchema = numSchema.concat(x);
altSchema = numSchema.when(str, whenOpts);
altSchema = numSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -295,29 +416,48 @@ objSchema = objSchema.min(num);
objSchema = objSchema.max(num);
objSchema = objSchema.length(num);
objSchema = objSchema.pattern(exp, schema);
objSchema = objSchema.and(str, str, str);
objSchema = objSchema.and(strArr);
objSchema = objSchema.or(str, str, str);
objSchema = objSchema.or(strArr);
objSchema = objSchema.xor(str, str, str);
objSchema = objSchema.xor(strArr);
objSchema = objSchema.with(str, str);
objSchema = objSchema.with(str, strArr);
objSchema = objSchema.without(str, str);
objSchema = objSchema.without(str, strArr);
objSchema = objSchema.xor(str, str, str);
objSchema = objSchema.xor(strArr);
objSchema = objSchema.or(str, str, str);
objSchema = objSchema.or(strArr);
objSchema = objSchema.rename(str, str);
objSchema = objSchema.rename(str, str, renOpts);
objSchema = objSchema.assert(str, schema, str);
objSchema = objSchema.assert(ref, schema, str);
objSchema = objSchema.unknown();
objSchema = objSchema.unknown(bool);
module common {
objSchema = objSchema.allow(obj);
objSchema = objSchema.valid(obj);
objSchema = objSchema.invalid(obj);
objSchema = objSchema.default(obj);
objSchema = objSchema.allow(x);
objSchema = objSchema.allow(x, x);
objSchema = objSchema.allow([x, x, x]);
objSchema = objSchema.valid(x);
objSchema = objSchema.valid(x, x);
objSchema = objSchema.valid([x, x, x]);
objSchema = objSchema.invalid(x);
objSchema = objSchema.invalid(x, x);
objSchema = objSchema.invalid([x, x, x]);
objSchema = objSchema.default(x);
objSchema = objSchema.required();
objSchema = objSchema.optional();
objSchema = objSchema.forbidden();
objSchema = objSchema.description(str);
objSchema = objSchema.notes(str);
@@ -325,8 +465,16 @@ module common {
objSchema = objSchema.tags(str);
objSchema = objSchema.tags(strArr);
objSchema = objSchema.meta(obj);
objSchema = objSchema.example(obj);
objSchema = objSchema.unit(str);
objSchema = objSchema.options(validOpts);
objSchema = objSchema.strict();
objSchema = objSchema.concat(x);
altSchema = objSchema.when(str, whenOpts);
altSchema = objSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -343,35 +491,43 @@ strSchema = strSchema.token();
strSchema = strSchema.email();
strSchema = strSchema.guid();
strSchema = strSchema.isoDate();
strSchema = strSchema.lowercase();
strSchema = strSchema.uppercase();
strSchema = strSchema.trim();
module common {
strSchema = strSchema.allow(x);
strSchema = strSchema.allow(x, x);
strSchema = strSchema.allow(anyArr);
strSchema = strSchema.allow([x, x, x]);
strSchema = strSchema.valid(x);
strSchema = strSchema.valid(x, x);
strSchema = strSchema.valid(anyArr);
strSchema = strSchema.valid([x, x, x]);
strSchema = strSchema.invalid(x);
strSchema = strSchema.invalid(x, x);
strSchema = strSchema.invalid(anyArr);
strSchema = strSchema.invalid([x, x, x]);
strSchema = strSchema.default(x);
strSchema = strSchema.required();
strSchema = strSchema.optional();
strSchema = strSchema.forbidden();
strSchema = strSchema.description(str);
strSchema = strSchema.notes(str);
strSchema = strSchema.notes(strArr);
strSchema = strSchema.tags(str);
strSchema = strSchema.tags(strArr);
strSchema = strSchema.meta(obj);
strSchema = strSchema.example(obj);
strSchema = strSchema.unit(str);
strSchema = strSchema.options(validOpts);
strSchema = strSchema.strict();
strSchema = strSchema.default(x);
strSchema = strSchema.concat(x);
altSchema = strSchema.when(str, whenOpts);
altSchema = strSchema.when(ref, whenOpts);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -390,6 +546,13 @@ Joi.validate(value, schema, validOpts, (err, value) => {
str = err.details[0].message;
str = err.details[0].type;
});
Joi.validate(value, schema, (err, value) => {
x = value;
str = err.message;
str = err.details[0].path;
str = err.details[0].message;
str = err.details[0].type;
});
// variant
Joi.validate(num, schema, validOpts, (err, value) => {
num = value;
@@ -401,3 +564,8 @@ Joi.validate(value, {});
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
schema = Joi.compile(obj);
Joi.assert(obj, schema);
ref = Joi.ref(str, refOpts);
ref = Joi.ref(str);
+122 -18
View File
@@ -1,8 +1,10 @@
// Type definitions for joi v4.0.0
// Type definitions for joi v4.6.0
// Project: https://github.com/spumko/joi
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// TODO express type of Schema in a type-parameter (.default, .valid, .example etc)
declare module 'joi' {
export interface ValidationOptions {
@@ -18,6 +20,8 @@ declare module 'joi' {
stripUnknown?: boolean;
// overrides individual error messages. Defaults to no override ({}).
language?: Object
// provides an external data set to be used in references
context?: Object;
}
export interface RenameOptions {
@@ -29,6 +33,20 @@ declare module 'joi' {
override?: boolean;
}
export interface WhenOptions {
// the required condition joi type.
is: Schema;
// the alternative schema type if the condition is true. Required if otherwise is missing.
then?: Schema;
// the alternative schema type if the condition is false. Required if then is missing
otherwise?: Schema;
}
export interface ReferenceOptions {
separator?: string;
contextPrefix?: string;
}
export interface ValidationError {
message: string;
details: ValidationErrorItem[];
@@ -48,12 +66,14 @@ declare module 'joi' {
}
export interface Schema extends AnySchema<Schema> {
}
export interface Reference extends Schema {
}
export interface AnySchema<T extends AnySchema<Schema>> {
validate<U>(value: U, options?: ValidationOptions, callback?: (err: ValidationError, value: U) => void): void;
/**
* Whitelists a value
*/
@@ -82,6 +102,11 @@ declare module 'joi' {
*/
optional(): T;
/**
* Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys.
*/
forbidden(): T;
/**
* Annotates the key
*/
@@ -100,7 +125,22 @@ declare module 'joi' {
tags(notes: string[]): T;
/**
* Overrides the global validate() options for the current key and any sub-key
* Attaches metadata to the key.
*/
meta(meta: Object): T;
/**
* Annotates the key with an example value, must be valid.
*/
example(value: any): T;
/**
* Annotates the key with an unit name.
*/
unit(name: string): T;
/**
* Overrides the global validate() options for the current key and any sub-key.
*/
options(options: ValidationOptions): T;
@@ -110,9 +150,20 @@ declare module 'joi' {
strict(): T;
/**
* Sets a default value if the original value is undefined
* Sets a default value if the original value is undefined.
*/
default(value: any): T;
/**
* Returns a new type that is the result of adding the rules of one type to another.
*/
concat(schema: T): T;
/**
* Converts the type into an alternatives type where the conditions are merged into the type definition where:
*/
when(ref: string, options: WhenOptions): AlternativesSchema;
when(ref: Reference, options: WhenOptions): AlternativesSchema;
}
export interface BooleanSchema extends AnySchema<BooleanSchema> {
@@ -187,6 +238,20 @@ declare module 'joi' {
*/
isoDate(): StringSchema;
/**
* Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase.
*/
lowercase(): StringSchema;
/**
* Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase.
*/
uppercase(): StringSchema;
/**
* Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed.
*/
trim(): StringSchema;
}
export interface ArraySchema extends AnySchema<ArraySchema> {
@@ -240,6 +305,29 @@ declare module 'joi' {
*/
length(limit: number): ObjectSchema;
/**
* Specify validation rules for unknown keys matching a pattern.
*/
pattern(regex: RegExp, schema: Schema): ObjectSchema;
/**
* Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well.
*/
and(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
and(peers: string[]): ObjectSchema;
/**
* Defines a relationship between keys where one of the peers is required (and more than one is allowed).
*/
or(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
or(peers: string[]): ObjectSchema;
/**
* Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where:
*/
xor(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
xor(peers: string[]): ObjectSchema;
/**
* Requires the presence of other keys whenever the specified key is present.
*/
@@ -252,22 +340,21 @@ declare module 'joi' {
without(key: string, peers: string): ObjectSchema;
without(key: string, peers: string[]): ObjectSchema;
/**
* Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where:
*/
xor(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
xor(peers: string[]): ObjectSchema;
/**
* Defines a relationship between keys where one of the peers is required (and more than one is allowed).
*/
or(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
or(peers: string[]): ObjectSchema;
/**
* Renames a key to another name (deletes the renamed key).
*/
rename(from: string, to: string, options?: RenameOptions): ObjectSchema;
/**
* Verifies an assertion where.
*/
assert(ref: string, schema: Schema, message: string): ObjectSchema;
assert(ref: Reference, schema: Schema, message: string): ObjectSchema;
/**
* Overrides the handling of unknown keys for the scope of the current object only (does not apply to children).
*/
unknown(allow?:boolean): ObjectSchema;
}
export interface BinarySchema extends AnySchema<BinarySchema> {
@@ -308,6 +395,12 @@ declare module 'joi' {
}
export interface AlternativesSchema extends AnySchema<FunctionSchema> {
try(schemas: Schema[]): AlternativesSchema;
when(ref: string, options: WhenOptions): AlternativesSchema;
when(ref: Reference, options: WhenOptions): AlternativesSchema;
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
/**
@@ -368,10 +461,21 @@ declare module 'joi' {
*/
export function validate<T>(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void;
/**
* Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object).
*/
export function compile(schema: Object): Schema;
/**
* Validates a value against a schema and throws if validation fails.
*/
export function assert(value: any, schema: Schema): void;
/**
* Generates a reference to the value of the named key.
*/
export function ref(key:string, options?: ReferenceOptions): Reference;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for jQRangeSlider 4.2.8
// Project: http://ghusse.github.com/jQRangeSlider
// Definitions by: Dániel Tar https://github.com/qcz
// Definitions by: Dániel Tar <https://github.com/qcz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for jQuery.Address 1.5
// Project: https://github.com/asual/jquery-address
// Definitions by: Martin Duparc <@martinduparc>
// Definitions by: Martin Duparc <https://github.com/martinduparc>
// Definitions: https://github.com/borisyankov/DefinitelyTyped/
/// <reference path="../jquery/jquery.d.ts" />
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for jquery.clientSideLogging.
// Type definitions for jquery.clientSideLogging
// Project: https://github.com/remybach/jQuery.clientSideLogging
// Definitions by: Diullei Gomes <https://github.com/diullei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for jQuery.Colorbox 1.4.15
// Project: http://www.jacklmoore.com/colorbox/
// Definitions by: Gidon Junge <@gjunge>
// Definitions by: Gidon Junge <https://github.com/gjunge>
// Definitions: https://github.com/borisyankov/DefinitelyTyped/
/// <reference path="../jquery/jquery.d.ts" />
+3 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for jQuery.cycle.js 2.9999.81 (15-JAN-2013)
// Type definitions for jQuery.cycle.js
// Project: http://jquery.malsup.com/cycle/
// Definitions by: François Guillot <http://fguillot.developpez.com/>
// Definitions by: François Guillot <http://fguillot.developpez.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -90,4 +90,4 @@ interface Cycle {
interface JQuery {
cycle: Cycle;
}
}

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