Merge remote-tracking branch 'upstream/master' into AddMixpanel

This commit is contained in:
Knut Eirik Leira Hjelle
2014-06-11 09:47:37 +02:00
54 changed files with 4825 additions and 2536 deletions
+1
View File
@@ -270,6 +270,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))
+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
@@ -1,3 +1,5 @@
/// <reference path="../jquery/jquery.d.ts" />
// Type definitions for AmplifyJs 1.1.0
// Project: http://amplifyjs.com/
// Definitions by: Jonas Eriksson <https://github.com/joeriks/>
@@ -6,8 +8,28 @@
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;
}
+20 -3
View File
@@ -78,12 +78,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 +108,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 +142,3 @@ module UiViewScrollProviderTests {
$uiViewScrollProvider.useAnchorScroll();
}]);
}
+1
View File
@@ -86,6 +86,7 @@ declare module ng.ui {
get(): IState[];
current: IState;
params: IStateParamsService;
reload(): void;
}
interface IStateParamsService {
+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: '/'});
+74 -4
View File
@@ -30,17 +30,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 +111,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;
}
+50 -11
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;
@@ -241,6 +278,8 @@ declare module ng {
$parent: IScope;
$root: IRootScopeService;
$id: string;
// Hidden members
+4
View File
@@ -0,0 +1,4 @@
declare module "ansicolors" {
var colors: {[index: string]: (s: string) => string;};
export = colors;
}
+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) { },
+25 -24
View File
@@ -3,8 +3,8 @@
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface AsyncMultipleResultsCallback<T> { (err: string, results: T[]): any; }
interface AsyncSingleResultCallback<T> { (err: string, result: T): void; }
interface AsyncMultipleResultsCallback<T> { (err: Error, results: T[]): any; }
interface AsyncSingleResultCallback<T> { (err: Error, result: T): void; }
interface AsyncTimesCallback<T> { (n: number, callback: AsyncMultipleResultsCallback<T>): void; }
interface AsyncIterator<T, R> { (item: T, callback: AsyncSingleResultCallback<R>): void; }
@@ -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>;
@@ -27,28 +28,28 @@ interface Async {
forEach<T,R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>): void;
forEachSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>): void;
forEachLimit<T, R>(arr: T[], limit: number, iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>): void;
map<T, R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>);
mapSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>);
filter<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
select<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
filterSeries<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
selectSeries<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
reject<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
rejectSeries<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>);
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>);
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>);
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>);
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>);
detect<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
detectSeries<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
sortBy<T, V>(arr: T[], iterator: AsyncIterator<T, V>, callback: AsyncMultipleResultsCallback<T>);
some<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
any<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>);
every<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any);
all<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any);
concat<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>);
concatSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>);
map<T, R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R>, callback: AsyncMultipleResultsCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
select<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
filterSeries<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
selectSeries<T, R>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
reject<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
rejectSeries<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>): any;
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>): any;
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncSingleResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
detectSeries<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
sortBy<T, V>(arr: T[], iterator: AsyncIterator<T, V>, callback: AsyncMultipleResultsCallback<T>): any;
some<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
any<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: AsyncMultipleResultsCallback<T>): any;
every<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncIterator<T, boolean>, callback: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncIterator<T, R[]>, callback: AsyncMultipleResultsCallback<R>): any;
// Control Flow
series<T>(tasks: T[], callback?: AsyncMultipleResultsCallback<T>): void;
@@ -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;
}
+62
View File
@@ -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
////////////////////
Vendored
+1 -1
View File
@@ -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;
+1795 -1681
View File
File diff suppressed because it is too large Load Diff
+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;
}
+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
@@ -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);
}
+531 -62
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,27 +139,21 @@ 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;
@@ -180,12 +174,6 @@ declare module google {
minSize?: number;
minValue?: number;
}
export interface GeoChartColorAxis extends GeoChartAxis {
minValue?: number;
maxValue?: number;
values?: number[];
colors?: string[];
}
export interface GeoChartTextStyle {
color?: string;
fontName?: string;
@@ -215,6 +203,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,14 +271,6 @@ 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;
@@ -298,6 +339,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 +356,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 +464,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 +495,7 @@ declare module google {
interpolateNulls?: boolean;
legend?: ChartLegend;
lineWidth?: number;
orientation?: string;
pointSize?: number;
reverseCategories?: boolean;
selectionMode?: string // single / multiple
@@ -417,9 +517,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 +528,7 @@ declare module google {
focusTarget?: string;
fontSize?: number;
fontName?: string;
hAxes?: any;
hAxis?: ChartAxis;
height?: number;
isStacked?: boolean;
@@ -444,21 +546,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?: string;
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
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for jquery.validation 1.11.1
// Project: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
// Project: http://jqueryvalidation.org/
// Definitions by: https://github.com/fdecampredon , https://github.com/johnnyreilly
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+3
View File
@@ -3114,6 +3114,9 @@ function test_parseHTML() {
$( "<ol></ol>" )
.append( nodeNames.join( "" ) )
.appendTo( $log );
// parse HTML with all parameters
$.parseHTML( str, document, true );
}
// http://api.jquery.com/jQuery.parseJSON/
+9
View File
@@ -1252,6 +1252,15 @@ interface JQueryStatic {
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
*/
parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
/**
* Parses a string into an array of DOM nodes.
*
* @param data HTML string to be parsed
* @param context DOM element to serve as the context in which the HTML fragment will be created
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
*/
parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
}
/**
+647 -624
View File
File diff suppressed because it is too large Load Diff
+16
View File
@@ -30,6 +30,22 @@ function test_asyncCommand() {
});
}
function test_asyncCommand_isExecuting() {
var primaryCommand = ko.asyncCommand({
execute: (complete) => {
$.when().always(complete);
},
canExecute: (isExecuting) => {
return !isExecuting;
}
});
var firstRun = true;
var canCancel = ko.computed(() => {
return firstRun && !primaryCommand.isExecuting();
});
}
function test_dirtyFlag() {
var viewModel;
viewModel.dirtyFlag = new ko.DirtyFlag(viewModel.model);
+5 -1
View File
@@ -58,6 +58,10 @@ interface KoliteCommand {
execute(...args: any[]): any;
}
interface KoliteAsyncCommand extends KoliteCommand {
isExecuting: KnockoutObservable<boolean>;
}
interface KoLiteCommandOptions {
execute?: any;
canExecute?: (isExecuting: boolean) => any;
@@ -65,7 +69,7 @@ interface KoLiteCommandOptions {
interface KnockoutStatic {
command(options: KoLiteCommandOptions): KoliteCommand;
asyncCommand(optons: KoLiteCommandOptions): KoliteCommand;
asyncCommand(optons: KoLiteCommandOptions): KoliteAsyncCommand;
}
interface KnockoutUtils {
+91 -3
View File
@@ -183,6 +183,14 @@ result = <number[]>_.first([1, 2, 3], function (num) {
result = <IFoodOrganic[]>_.first(foodsOrganic, 'organic');
result = <IFoodType[]>_.first(foodsType, { 'type': 'fruit' });
result = <number>_([1, 2, 3]).first();
result = <number[]>_([1, 2, 3]).first(2).value();
result = <number[]>_([1, 2, 3]).first(function (num) {
return num < 3;
}).value();
result = <IFoodOrganic[]>_(foodsOrganic).first('organic').value();
result = <IFoodType[]>_(foodsType).first({ 'type': 'fruit' }).value();
result = <number>_.head([1, 2, 3]);
result = <number[]>_.head([1, 2, 3], 2);
result = <number[]>_.head([1, 2, 3], function (num) {
@@ -191,12 +199,28 @@ result = <number[]>_.head([1, 2, 3], function (num) {
result = <IFoodOrganic[]>_.head(foodsOrganic, 'organic');
result = <IFoodType[]>_.head(foodsType, { 'type': 'fruit' });
result = <number>_([1, 2, 3]).head();
result = <number[]>_([1, 2, 3]).head(2).value();
result = <number[]>_([1, 2, 3]).head(function (num) {
return num < 3;
}).value();
result = <IFoodOrganic[]>_(foodsOrganic).head('organic').value();
result = <IFoodType[]>_(foodsType).head({ 'type': 'fruit' }).value();
result = <number>_.take([1, 2, 3]);
result = <number[]>_.take([1, 2, 3], 2);
result = <number[]>_.take([1, 2, 3], (num) => num < 3);
result = <IFoodOrganic[]>_.take(foodsOrganic, 'organic');
result = <IFoodType[]>_.take(foodsType, { 'type': 'fruit' });
result = <number>_([1, 2, 3]).take();
result = <number[]>_([1, 2, 3]).take(2).value();
result = <number[]>_([1, 2, 3]).take(function (num) {
return num < 3;
}).value();
result = <IFoodOrganic[]>_(foodsOrganic).take('organic').value();
result = <IFoodType[]>_(foodsType).take({ 'type': 'fruit' }).value();
result = <number[]>_.flatten([1, [2], [3, [[4]]]]);
result = <any[]>_.flatten([1, [2], [3, [[4]]]], true);
var result: any
@@ -277,6 +301,22 @@ result = <string[]>_.unique(['A', 'b', 'C', 'a', 'B', 'c'], function (letter) {
result = <number[]>_.unique([1, 2.5, 3, 1.5, 2, 3.5], function (num) { return this.floor(num); }, Math);
result = <{ x: number; }[]>_.unique([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
result = <number[]>_([1, 2, 1, 3, 1]).uniq().value();
result = <number[]>_([1, 1, 2, 2, 3]).uniq(true).value();
result = <string[]>_(['A', 'b', 'C', 'a', 'B', 'c']).uniq(function (letter) {
return letter.toLowerCase();
}).value();
result = <number[]>_([1, 2.5, 3, 1.5, 2, 3.5]).uniq(function (num) { return this.floor(num); }, Math).value();
result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).uniq('x').value();
result = <number[]>_([1, 2, 1, 3, 1]).unique().value();
result = <number[]>_([1, 1, 2, 2, 3]).unique(true).value();
result = <string[]>_(['A', 'b', 'C', 'a', 'B', 'c']).unique(function (letter) {
return letter.toLowerCase();
}).value();
result = <number[]>_([1, 2.5, 3, 1.5, 2, 3.5]).unique(function (num) { return this.floor(num); }, Math).value();
result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').value();
result = <number[]>_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
result = <any[][]>_.zip(['moe', 'larry'], [30, 40], [true, false]);
@@ -357,9 +397,11 @@ result = <IFoodCombined>_.findLast(foodsCombined, 'organic');
result = <number[]>_.forEach([1, 2, 3], function (num) { console.log(num); });
result = <_.Dictionary<number>>_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); });
result = <IFoodType>_.forEach<IFoodType, string>({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) });
result = <number[]>_.each([1, 2, 3], function (num) { console.log(num); });
result = <_.Dictionary<number>>_.each({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); });
result = <IFoodType>_.each<IFoodType, string>({ name: 'apple', type: 'fruit' }, function (value, key) { console.log(value, key) });
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).forEach(function (num) { console.log(num); });
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_(<{ [index: string]: number; }>{ 'one': 1, 'two': 2, 'three': 3 }).forEach(function (num) { console.log(num); });
@@ -419,16 +461,18 @@ result = <IStoogesAge>_.min(stoogesAges, function (stooge) { return stooge.age;
result = <IStoogesAge>_.min(stoogesAges, 'age');
result = <string[]>_.pluck(stoogesAges, 'name');
result = <string[]>_(stoogesAges).pluck('name').value();
result = <number>_.reduce<number, number>([1, 2, 3], function (sum: number, num: number) {
return sum + num;
});
interface ABC {
[index: string]: number;
a: number;
b: number;
c: number;
}
result = <number>_.reduce<number, number>([1, 2, 3], function (sum: number, num: number) {
return sum + num;
});
result = <ABC>_.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) {
r[key] = num * 3;
return r;
@@ -450,6 +494,30 @@ result = <ABC>_.inject({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number
return r;
}, {});
result = <number>_([1, 2, 3]).reduce<number>(function (sum: number, num: number) {
return sum + num;
});
result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).reduce<number, ABC>(function (r: ABC, num: number, key: string) {
r[key] = num * 3;
return r;
}, {});
result = <number>_([1, 2, 3]).foldl<number>(function (sum: number, num: number) {
return sum + num;
});
result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).foldl<number, ABC>(function (r: ABC, num: number, key: string) {
r[key] = num * 3;
return r;
}, {});
result = <number>_([1, 2, 3]).inject<number>(function (sum: number, num: number) {
return sum + num;
});
result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).inject<number, ABC>(function (r: ABC, num: number, key: string) {
r[key] = num * 3;
return r;
}, {});
result = <number[]>_.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, <number[]>[]);
result = <number[]>_.foldr([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, <number[]>[]);
@@ -457,6 +525,10 @@ result = <number[]>_.reject([1, 2, 3, 4, 5, 6], function (num) { return num % 2
result = <IFoodCombined[]>_.reject(foodsCombined, 'organic');
result = <IFoodCombined[]>_.reject(foodsCombined, { 'type': 'fruit' });
result = <number[]>_([1, 2, 3, 4, 5, 6]).reject(function (num) { return num % 2 == 0; }).value();
result = <IFoodCombined[]>_(foodsCombined).reject('organic').value();
result = <IFoodCombined[]>_(foodsCombined).reject({ 'type': 'fruit' }).value();
result = <number>_.sample([1, 2, 3, 4]);
result = <number[]>_.sample([1, 2, 3, 4], 2);
@@ -469,20 +541,29 @@ result = <number>_.size('curly');
result = <boolean>_.some([null, 0, 'yes', false], Boolean);
result = <boolean>_.some(foodsCombined, 'organic');
result = <boolean>_.some(foodsCombined, { 'type': 'meat' });
result = <boolean>_.some(foodsOrganic[0]);
result = <boolean>_.any([null, 0, 'yes', false], Boolean);
result = <boolean>_.any(foodsCombined, 'organic');
result = <boolean>_.any(foodsCombined, { 'type': 'meat' });
result = <boolean>_.any(foodsOrganic[0]);
result = <number[]>_.sortBy([1, 2, 3], function (num) { return Math.sin(num); });
result = <number[]>_.sortBy([1, 2, 3], function (num) { return this.sin(num); }, Math);
result = <string[]>_.sortBy(['banana', 'strawberry', 'apple'], 'length');
result = <number[]>_([1, 2, 3]).sortBy(function (num) { return Math.sin(num); }).value();
result = <number[]>_([1, 2, 3]).sortBy(function (num) { return this.sin(num); }, Math).value();
result = <string[]>_(['banana', 'strawberry', 'apple']).sortBy('length').value();
(function (a: number, b: number, c: number, d: number) { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
result = <IStoogesCombined[]>_.where(stoogesCombined, { 'age': 40 });
result = <IStoogesCombined[]>_.where(stoogesCombined, { 'quotes': ['Poifect!'] });
result = <IStoogesCombined[]>_(stoogesCombined).where({ 'age': 40 }).value();
result = <IStoogesCombined[]>_(stoogesCombined).where({ 'quotes': ['Poifect!'] }).value();
/*************
* Functions *
*************/
@@ -832,6 +913,7 @@ result = <boolean>_.isString('moe');
result = <boolean>_.isUndefined(void 0);
result = <string[]>_.keys({ 'one': 1, 'two': 2, 'three': 3 });
result = <string[]>_({ 'one': 1, 'two': 2, 'three': 3 }).keys().value();
var mergeNames = {
'stooges': [
@@ -877,8 +959,14 @@ result = <HasName>_.omit({ 'name': 'moe', 'age': 40 }, ['age']);
result = <HasName>_.omit({ 'name': 'moe', 'age': 40 }, function (value) {
return typeof value == 'number';
});
result = <HasName>_({ 'name': 'moe', 'age': 40 }).omit('age').value();
result = <HasName>_({ 'name': 'moe', 'age': 40 }).omit(['age']).value();
result = <HasName>_({ 'name': 'moe', 'age': 40 }).omit(function (value) {
return typeof value == 'number';
}).value();
result = <any[][]>_.pairs({ 'moe': 30, 'larry': 40 });
result = <any[][]>_({ 'moe': 30, 'larry': 40 }).pairs().value();
result = <HasName>_.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name');
result = <HasName>_.pick({ 'name': 'moe', '_userid': 'moe1' }, ['name']);
+424
View File
@@ -644,6 +644,104 @@ declare module _ {
whereValue: W): T[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.first
**/
first(): T;
/**
* @see _.first
* @param n The number of elements to return.
**/
first(n: number): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param callback The function called per element.
* @param [thisArg] The this binding of callback.
**/
first(
callback: ListIterator<T, boolean>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param pluckValue "_.pluck" style callback value
**/
first(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param whereValue "_.where" style callback value
**/
first<W>(whereValue: W): LoDashArrayWrapper<T>;
/**
* @see _.first
**/
head(): T;
/**
* @see _.first
* @param n The number of elements to return.
**/
head(n: number): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param callback The function called per element.
* @param [thisArg] The this binding of callback.
**/
head(
callback: ListIterator<T, boolean>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param pluckValue "_.pluck" style callback value
**/
head(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param whereValue "_.where" style callback value
**/
head<W>(whereValue: W): LoDashArrayWrapper<T>;
/**
* @see _.first
**/
take(): T;
/**
* @see _.first
* @param n The number of elements to return.
**/
take(n: number): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param callback The function called per element.
* @param [thisArg] The this binding of callback.
**/
take(
callback: ListIterator<T, boolean>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param pluckValue "_.pluck" style callback value
**/
take(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.first
* @param whereValue "_.where" style callback value
**/
take<W>(whereValue: W): LoDashArrayWrapper<T>;
}
//_.flatten
interface LoDashStatic {
/**
@@ -1750,6 +1848,106 @@ declare module _ {
whereValue?: W): T[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.uniq
**/
uniq<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
/**
* @see _.uniq
**/
uniq<TSort>(
isSorted: boolean,
callback: ListIterator<T, TSort>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.uniq
**/
uniq<TSort>(
callback: ListIterator<T, TSort>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param pluckValue _.pluck style callback
**/
uniq(
isSorted: boolean,
pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param pluckValue _.pluck style callback
**/
uniq(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param whereValue _.where style callback
**/
uniq<W>(
isSorted: boolean,
whereValue: W): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param whereValue _.where style callback
**/
uniq<W>(
whereValue: W): LoDashArrayWrapper<T>;
/**
* @see _.uniq
**/
unique<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
/**
* @see _.uniq
**/
unique<TSort>(
isSorted: boolean,
callback: ListIterator<T, TSort>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.uniq
**/
unique<TSort>(
callback: ListIterator<T, TSort>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param pluckValue _.pluck style callback
**/
unique(
isSorted: boolean,
pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param pluckValue _.pluck style callback
**/
unique(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param whereValue _.where style callback
**/
unique<W>(
isSorted: boolean,
whereValue: W): LoDashArrayWrapper<T>;
/**
* @see _.uniq
* @param whereValue _.where style callback
**/
unique<W>(
whereValue: W): LoDashArrayWrapper<T>;
}
//_.without
interface LoDashStatic {
/**
@@ -2741,6 +2939,14 @@ declare module _ {
callback: ObjectIterator<T, void>,
thisArg?: any): Dictionary<T>;
/**
* @see _.each
**/
forEach<T extends {}, TValue>(
object: T,
callback: ObjectIterator<TValue, void>,
thisArg?: any): T
/**
* @see _.forEach
**/
@@ -2767,6 +2973,14 @@ declare module _ {
object: Dictionary<T>,
callback: ObjectIterator<T, void>,
thisArg?: any): Dictionary<T>;
/**
* @see _.each
**/
each<T extends {}, TValue>(
object: T,
callback: ObjectIterator<TValue, void>,
thisArg?: any): T
}
interface LoDashArrayWrapper<T> {
@@ -3444,6 +3658,22 @@ declare module _ {
property: string): any[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.pluck
**/
pluck<TResult>(
property: string): LoDashArrayWrapper<TResult>;
}
interface LoDashObjectWrapper<T> {
/**
* @see _.pluck
**/
pluck<TResult>(
property: string): LoDashArrayWrapper<TResult>;
}
//_.reduce
interface LoDashStatic {
/**
@@ -3609,6 +3839,100 @@ declare module _ {
thisArg?: any): TResult;
}
interface LoDashArrayWrapper<T> {
/**
* @see _.reduce
**/
reduce<TResult>(
callback: MemoIterator<T, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
reduce<TResult>(
callback: MemoIterator<T, TResult>,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
inject<TResult>(
callback: MemoIterator<T, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
inject<TResult>(
callback: MemoIterator<T, TResult>,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
foldl<TResult>(
callback: MemoIterator<T, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
foldl<TResult>(
callback: MemoIterator<T, TResult>,
thisArg?: any): TResult;
}
interface LoDashObjectWrapper<T> {
/**
* @see _.reduce
**/
reduce<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
reduce<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
inject<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
inject<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
foldl<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
accumulator: TResult,
thisArg?: any): TResult;
/**
* @see _.reduce
**/
foldl<TValue, TResult>(
callback: MemoIterator<TValue, TResult>,
thisArg?: any): TResult;
}
//_.reduceRight
interface LoDashStatic {
/**
@@ -3806,6 +4130,27 @@ declare module _ {
whereValue: W): T[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.reject
**/
reject(
callback: ListIterator<T, boolean>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.reject
* @param pluckValue _.pluck style callback
**/
reject(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.reject
* @param whereValue _.where style callback
**/
reject<W>(whereValue: W): LoDashArrayWrapper<T>;
}
//_.sample
interface LoDashStatic {
/**
@@ -3933,6 +4278,14 @@ declare module _ {
callback?: ListIterator<T, boolean>,
thisArg?: any): boolean;
/**
* @see _.some
**/
some(
collection: {},
callback?: ListIterator<{}, boolean>,
thisArg?: any): boolean;
/**
* @see _.some
* @param pluckValue _.pluck style callback
@@ -4005,6 +4358,14 @@ declare module _ {
callback?: ListIterator<T, boolean>,
thisArg?: any): boolean;
/**
* @see _.some
**/
any(
collection: {},
callback?: ListIterator<{}, boolean>,
thisArg?: any): boolean;
/**
* @see _.some
* @param pluckValue _.pluck style callback
@@ -4118,6 +4479,27 @@ declare module _ {
whereValue: W): T[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.sortBy
**/
sortBy<TSort>(
callback?: ListIterator<T, TSort>,
thisArg?: any): LoDashArrayWrapper<T>;
/**
* @see _.sortBy
* @param pluckValue _.pluck style callback
**/
sortBy(pluckValue: string): LoDashArrayWrapper<T>;
/**
* @see _.sortBy
* @param whereValue _.where style callback
**/
sortBy<W>(whereValue: W): LoDashArrayWrapper<T>;
}
//_.toArray
interface LoDashStatic {
/**
@@ -4166,6 +4548,13 @@ declare module _ {
properties: U): T[];
}
interface LoDashArrayWrapper<T> {
/**
* @see _.where
**/
where<T, U extends {}>(properties: U): LoDashArrayWrapper<T>;
}
/*************
* Functions *
*************/
@@ -5280,6 +5669,13 @@ declare module _ {
keys(object: any): string[];
}
interface LoDashObjectWrapper<T> {
/**
* @see _.keys
**/
keys(): LoDashArrayWrapper<string>
}
//_.mapValues
interface LoDashStatic {
/**
@@ -5391,6 +5787,27 @@ declare module _ {
thisArg?: any): Omitted;
}
interface LoDashObjectWrapper<T> {
/**
* @see _.omit
**/
omit<Omitted>(
...keys: string[]): LoDashObjectWrapper<Omitted>;
/**
* @see _.omit
**/
omit<Omitted>(
keys: string[]): LoDashObjectWrapper<Omitted>;
/**
* @see _.omit
**/
omit<Omitted>(
callback: ObjectIterator<any, boolean>,
thisArg?: any): LoDashObjectWrapper<Omitted>;
}
//_.pairs
interface LoDashStatic {
/**
@@ -5402,6 +5819,13 @@ declare module _ {
pairs(object: any): any[][];
}
interface LoDashObjectWrapper<T> {
/**
* @see _.pairs
**/
pairs(): LoDashArrayWrapper<any[]>;
}
//_.picks
interface LoDashStatic {
/**
+177 -36
View File
@@ -269,8 +269,8 @@ function Sys_CancelEventArgs_Tests() {
}
var ActivateAlertDiv = function (visString: string, msg: string) {
var adiv = $get(divElem);
var aspan = $get(messageElem);
var adiv = <HTMLElement> $get(divElem);
var aspan = <HTMLElement> $get(messageElem);
adiv.style.visibility = visString;
aspan.innerHTML = msg;
}
@@ -338,20 +338,20 @@ function Sys_Component_Tests() {
function Sys_UI_Key_Tests() {
var backspace = Sys.UI.Key.backspace;
var del = Sys.UI.Key.del;
var down = Sys.UI.Key.down;
var end = Sys.UI.Key.end;
var pageDown = Sys.UI.Key.pageDown;
var pageUp = Sys.UI.Key.pageUp;
var home = Sys.UI.Key.home;
var enter = Sys.UI.Key.enter;
var esc = Sys.UI.Key.esc;
var tab = Sys.UI.Key.tab;
var key = Sys.UI.Key.up;
var left = Sys.UI.Key.left;
var right = Sys.UI.Key.right;
var space = Sys.UI.Key.space;
var backspace: number = Sys.UI.Key.backspace;
var del: number = Sys.UI.Key.del;
var down: number = Sys.UI.Key.down;
var end: number = Sys.UI.Key.end;
var pageDown: number = Sys.UI.Key.pageDown;
var pageUp: number = Sys.UI.Key.pageUp;
var home: number = Sys.UI.Key.home;
var enter: number = Sys.UI.Key.enter;
var esc: number = Sys.UI.Key.esc;
var tab: number = Sys.UI.Key.tab;
var key: number = Sys.UI.Key.up;
var left: number = Sys.UI.Key.left;
var right: number = Sys.UI.Key.right;
var space: number = Sys.UI.Key.space;
}
@@ -372,6 +372,117 @@ function Sys_UI_Control_Tests() {
a.dispose();
}
function Sy_UI_Point_Tests() {
var elementRef: Sys.UI.DomElement;
var result: string;
// Get the location of the element
var elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "Before move - Label1 location (x,y) = (" +
elementLoc.x + "," + elementLoc.y + ")<br/>";
// Move the element
Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y);
elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "After move - Label1 location (x,y) = (" +
elementLoc.x + "," + elementLoc.y + ")<br/>";
}
function Sys_UI_DomEvent_Tests() {
var object: any;
Sys.UI.DomEvent.addHandler(object, "eventName", () => { });
Sys.UI.DomEvent.addHandler(object, "eventName", () => { }, true);
Sys.UI.DomEvent.addHandlers(object, object, object, true);
Sys.UI.DomEvent.removeHandler(object, "eventName", () => { });
Sys.UI.DomEvent.clearHandlers(object);
var domEvent = new Sys.UI.DomEvent(object);
var altKey: boolean = domEvent.altKey;
var mouseButton: Sys.UI.MouseButton = domEvent.button;
var charCode: number = domEvent.charCode;
var clientX: number = domEvent.clientX;
var ctrlKey: boolean = domEvent.ctrlKey;
var screenX: number = domEvent.screenX;
var screenY: number = domEvent.screenY;
var target: any = domEvent.target;
var shiftKey: boolean = domEvent.shiftKey;
var type: string = domEvent.type;
}
function Sys_UI_DomElement_Tests() {
// Add CSS class
Sys.UI.DomElement.addCssClass($get("Button1"), "redBackgroundColor");
var elementRef: Sys.UI.DomElement = $get("Label1");
var elementBounds = Sys.UI.DomElement.getBounds(elementRef);
var toggleCssClassMethod = () => {};
var removeCssClassMethod = () => {};
var containsClass = Sys.UI.DomElement.containsCssClass(elementRef, "class-name");
// Add handler using the getElementById method
$addHandler(Sys.UI.DomElement.getElementById("Button1"), "click", toggleCssClassMethod);
// Add handler using the shortcut to the getElementById method
$addHandler($get("Button2"), "click", removeCssClassMethod);
Sys.UI.DomElement.toggleCssClass($get("id"), "redBackgroundColor");
// Add handlers using the $get shortcut to the
// Sys.UI.DomElement.getElementById method
$addHandler($get("Button1"), "click", toggleVisible);
$addHandler($get("Button2"), "click", toggleVisibilityMode);
// This method is called when Button2 is clicked.
function toggleVisible() {
var anElement = $get("Label1");
if (Sys.UI.DomElement.getVisible(anElement)) {
Sys.UI.DomElement.setVisible(anElement, false);
}
else {
Sys.UI.DomElement.setVisible(anElement, true);
}
}
// This method is called when Button1 is clicked.
function toggleVisibilityMode() {
var anElement = $get("Label1");
var visMode = Sys.UI.DomElement.getVisibilityMode(anElement);
var status = visMode;
if (visMode === 0) {
Sys.UI.DomElement.setVisibilityMode(anElement, Sys.UI.VisibilityMode.collapse);
if (document.all) {
anElement.innerText =
"Label1 VisibilityMode: Sys.UI.VisibilityMode.collapse";
}
else {
//Firefox
anElement.textContent =
"Label1 VisibilityMode: Sys.UI.VisibilityMode.collapse";
}
}
else {
Sys.UI.DomElement.setVisibilityMode(anElement, Sys.UI.VisibilityMode.hide);
if (document.all) {
anElement.innerText = "Label1 VisibilityMode: Sys.UI.VisibilityMode.hide";
}
else {
//Firefox
anElement.textContent = "Label1 VisibilityMode: Sys.UI.VisibilityMode.hide";
}
}
}
}
function Sys_Debug_Tests() {
var condition = true;
@@ -519,22 +630,52 @@ function Sys_Net_WebRequestManager_Tests() {
function Sys_WebForms_PageRequestManager_Tests() {
var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
var pageRequestManager: Sys.WebForms.PageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
var eventArgs = pageRequestManager.Empty;
var beginRequestHandler = (sender: any, args: Sys.WebForms.BeginRequestEventArgs) => {
var postBackElement: HTMLElement = args.get_postBackElement();
var webRequest: Sys.Net.WebRequest = args.get_request();
var updatePanelsToUpdate: string[] = args.get_updatePanelsToUpdate();
var empty: Sys.EventArgs = args.Empty;
}
var endRequestHandler = (sender: any, args: Sys.WebForms.EndRequestEventArgs) => {
var dataItems: any = args.get_dataItems();
var error: Error = args.get_error();
var errorHandled: boolean = args.get_errorHandled();
var webRequestExecutor: Sys.Net.WebRequestExecutor = args.get_response();
args.set_errorHandled(true);
var handler = (sender: any, args: any) => { }
}
var initializeRequestHandler = (sender: any, args: Sys.WebForms.InitializeRequestEventArgs) => {
var postBackElement: HTMLElement = args.get_postBackElement();
var webRequestExecutor: Sys.Net.WebRequestExecutor = args.get_request();
var updatePanelsToUpdate: string[] = args.get_updatePanelsToUpdate();
var empty: Sys.EventArgs = args.Empty;
}
var pageLoadedRequestHandler = (sender: any, args: Sys.WebForms.PageLoadedEventArgs) => {
var dataItems: any = args.get_dataItems();
var panelsCreated: HTMLDivElement[] = args.get_panelsCreated();
var panelsUpdated: HTMLDivElement[] = args.get_panelsUpdated();
var empty: Sys.EventArgs = args.Empty;
}
var pageLoadingRequestHandler = (sender: any, args: Sys.WebForms.PageLoadingEventArgs) => {
var dataItems: any = args.get_dataItems();
var panelsDeleted: HTMLDivElement[] = args.get_panelsDeleted();
var panelsUpdating = args.get_panelsUpdating();
var empty: Sys.EventArgs = args.Empty;
}
var isInAsyncPostBack = pageRequestManager.get_isInAsyncPostBack();
var isInAsyncPostBack: boolean = pageRequestManager.get_isInAsyncPostBack();
pageRequestManager.add_beginRequest(handler);
pageRequestManager.add_endRequest(handler);
pageRequestManager.add_initializeRequest(handler);
pageRequestManager.add_pageLoading(handler);
pageRequestManager.add_pageLoaded(handler);
pageRequestManager.remove_beginRequest(handler);
pageRequestManager.remove_pageLoaded(handler);
pageRequestManager.remove_pageLoading(handler);
pageRequestManager.add_beginRequest(beginRequestHandler);
pageRequestManager.add_endRequest(endRequestHandler);
pageRequestManager.add_initializeRequest(initializeRequestHandler);
pageRequestManager.add_pageLoading(pageLoadingRequestHandler);
pageRequestManager.add_pageLoaded(pageLoadedRequestHandler);
pageRequestManager.remove_beginRequest(beginRequestHandler);
pageRequestManager.remove_pageLoaded(pageLoadedRequestHandler);
pageRequestManager.remove_pageLoading(pageLoadingRequestHandler);
pageRequestManager.beginAsyncPostBack();
pageRequestManager.abortPostBack();
pageRequestManager.dispose();
@@ -542,19 +683,19 @@ function Sys_WebForms_PageRequestManager_Tests() {
function Sys_WebForms_EndRequestEventArgs_Tests() {
var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
var pageRequestManager: Sys.WebForms.PageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
var handler = (sender: any, args: Sys.WebForms.EndRequestEventArgs) => {
var error = args.get_error();
var message = error.message;
var name = error.name;
var response = args.get_response();
var dataItems = args.get_dataItems();
var eventArgs = args.Empty;
var error: Error = args.get_error();
var message: string = error.message;
var name: string = error.name;
var response: Sys.Net.WebRequestExecutor = args.get_response();
var dataItems: any = args.get_dataItems();
var eventArgs: Sys.EventArgs = args.Empty;
args.set_errorHandled(true);
var errorHandled = args.get_errorHandled();
var errorHandled: boolean = args.get_errorHandled();
}
pageRequestManager.add_endRequest(handler);
+270 -46
View File
@@ -326,7 +326,6 @@ interface Date {
parseInvariant(value: string, ...formats: string[]): string;
}
declare module MicrosoftAjaxBaseTypeExtensions {
/**
@@ -909,7 +908,7 @@ declare function $find(id: string, parent?: HTMLElement): Sys.Component;
* @param handler The event handler to add.
* @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed.
*/
declare function $addHandler(element: Element, eventName: string, handler: Function, autoRemove?: boolean): void;
declare function $addHandler(element: Sys.UI.DomElement, eventName: string, handler: Function, autoRemove?: boolean): void;
/**
* Provides a shortcut to the addHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
@@ -919,7 +918,7 @@ declare function $addHandler(element: Element, eventName: string, handler: Funct
* @param handlerOwner (Optional) The object instance that is the context for the delegates that should be created from the handlers.
* @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed.
*/
declare function $addHandlers(element: Element, events: any, handlerOwner?: any, autoRemove?: boolean): void;
declare function $addHandlers(element: Sys.UI.DomElement, events: any, handlerOwner?: any, autoRemove?: boolean): void;
/**
* Provides a shortcut to the clearHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
@@ -927,7 +926,7 @@ declare function $addHandlers(element: Element, events: any, handlerOwner?: any,
* @see {@link http://msdn.microsoft.com/en-us/library/bb310959(v=vs.100).aspx}
* @param The DOM element that exposes the events.
*/
declare function $clearHandlers(element: Element): void;
declare function $clearHandlers(element: Sys.UI.DomElement): void;
/**
* Provides a shortcut to the getElementById method of the Sys.UI.DomElement class. This member is static and can be invoked without creating an instance of the class.
@@ -937,9 +936,11 @@ declare function $clearHandlers(element: Element): void;
* @param element
* The parent element to search. The default is the document element.
* @return
* The element
* The Sys.UI.DomElement
*/
declare function $get(id: string, element?: Element): HTMLElement;
declare function $get(id: string): any; // Examples use HTMLElement and DomElement
declare function $get(id: string, element?: HTMLElement): HTMLElement;
declare function $get(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement;
/**
* Provides a shortcut to the removeHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class.
@@ -948,7 +949,9 @@ declare function $get(id: string, element?: Element): HTMLElement;
* @param eventName The name of the DOM event.
* @param handler The event handler to remove.
*/
declare function $removeHandler(element: Element, eventName: string, handler: Function): void;
declare function $removeHandler(element: any, eventName: string, handler: Function): void;
declare function $removeHandler(element: HTMLElement, eventName: string, handler: Function): void;
declare function $removeHandler(element: Sys.UI.DomElement, eventName: string, handler: Function): void;
//#endregion
@@ -1384,7 +1387,7 @@ declare module Sys {
* @param displayCaller
* (Optional) true to indicate that the name of the function that is calling assert should be displayed in the message. The default is false.
*/
static assert(condition: boolean, message?: string, displayCaller?: boolean): void;
static assert(condition: boolean, message?: string, displayCaller?: boolean): void;
/**
* Clears all trace messages from the trace console.
*/
@@ -2250,7 +2253,7 @@ declare module Sys {
* @see {@link http://msdn.microsoft.com/en-us/library/bb310823(v=vs.100).aspx}
*/
// Cannot create definitions for generated proxy classes.
/**
* Contains information about a Web request that is ready to be sent to the current Sys.Net.WebRequestExecutor instance.
* This class represents the type for the second parameter of the callback function added by the add_invokingRequest method.
@@ -2259,7 +2262,7 @@ declare module Sys {
* @see {@link http://msdn.microsoft.com/en-us/library/bb397488(v=vs.100).aspx}
*/
class NetWorkRequestEventArgs {
//#region Constructors
/**
@@ -2536,7 +2539,7 @@ declare module Sys {
set_defaultTimeout(value: number): void;
//#endregion
}
export var WebRequestManager: IWebRequestManager;
@@ -3122,10 +3125,184 @@ declare module Sys {
}
/**
* Defines static methods and properties that provide helper APIs for manipulating and inspecting DOM elements.
* @see {@link http://msdn.microsoft.com/en-us/library/bb383788(v=vs.100).aspx}
*/
class DomElement {
// todo
interface DomElement {
//#region Constructors
/**
* Initializes a new instance of the Sys.UI.DomElement class.
*/
constructor(): void;
//#endregion
//#region Methods
/**
* Adds a CSS class to a DOM element if the class is not already part of the DOM element. This member is static and can be invoked without creating an instance of the class.
* If the element does not support a CSS class, no change is made to the element.
* @param element
* The Sys.UI.DomElement object to add the CSS class to.
* @param className
* The name of the CSS class to add.
*/
addCssClass(element: Sys.UI.DomElement, className: string): void;
/**
* Gets a value that indicates whether the DOM element contains the specified CSS class. This member is static and can be invoked without creating an instance of the class.
* @param element
* The Sys.UI.DomElement object to test for the CSS class.
* @param className
* The name of the CSS class to test for.
* @return
* true if the element contains the specified CSS class; otherwise, false.
*/
containsCssClass(element: Sys.UI.DomElement, className: string): boolean;
/**
* Gets a set of integer coordinates that represent the position, width, and height of a DOM element. This member is static and can be invoked without creating an instance of the class.
*
* @param element
* The Sys.UI.DomElement instance to get the coordinates of.
* @return
* An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the upper-left corner, the width, and the height of the element in pixels.
*/
getBounds(element: Sys.UI.DomElement): Object;
/**
* @param id
* The ID of the element to find.
* @param element
* (optional) The parent element to search in. The default is the document element.
*/
getElementById(id: string): Sys.UI.DomElement;
getElementById(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement;
getElementById(id: string, element?: HTMLElement): HTMLElement;
getElementById(id: string, element: any): any;
/**
* Gets the absolute position of a DOM element relative to the upper-left corner of the owner frame or window. This member is static and can be invoked without creating an instance of the class. *
* @param element
* The target element. *
* @return
* An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the element in pixels.
*/
getLocation(element: Sys.UI.DomElement): Sys.UI.Point;
getLocation(element: any): Object;
/*
* Returns a value that represents the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. This member is static and can be invoked without creating an instance of the class.
* @param element
* The target DOM element.
* @return
* A Sys.UI.VisibilityMode enumeration value that indicates the layout characteristics of element when it is hidden by invoking the setVisible method.
*/
getVisibilityMode(element: Sys.UI.DomElement): Sys.UI.VisibilityMode;
getVisibilityMode(element: any): Sys.UI.VisibilityMode;
/**
* Gets a value that indicates whether a DOM element is currently visible on the Web page. This member is static and can be invoked without creating an instance of the class.
* @param element
* The target DOM element.
* @return
* true if element is visible on the Web page; otherwise, false
*/
getVisible(element: any): boolean;
/**
* Determines whether the specified object is a DOM element.
* @param obj
* An object
* @return
* true if the object is a DOM element; otherwise, false.
*/
isDomElement(obj: any): boolean;
/**
* Raises a bubble event. A bubble event causes an event to be raised and then propagated up the control hierarchy until it is handled.
* @param source
* The DOM element that triggers the event.
* @param args
* The event arguments
*/
raiseBubbleEvent(source: Sys.UI.DomElement, args: EventArgs): void;
raiseBubbleEvent(source: any, args: any): void;
/**
* Removes a CSS class from a DOM element. This member is static and can be invoked without creating an instance of the class. If the element does not include a CSS class, no change is made to the element.
* @param element
* The Sys.UI.DomElement object to remove the CSS class from.
* @param className
* The name of the CSS class to remove.
*/
removeCssClass(element: Sys.UI.DomElement, className: string): void;
removeCssClass(element: HTMLElement, className: string): void;
removeCssClass(element: any, className: string): void;
/**
* Returns the element that has either the specified ID in the specified container, or is the specified element itself.
* The resolveElement method is used to verify that an ID or an object can be resolved as an element. *
* @param elementOrElementId
* The element to resolve, or the ID of the element to resolve. This parameter can be null.
* @param containerElement
* (Optional) The specified container.
* @return
* A DOM element.
*/
resolveElement(elementOrElementId: Sys.UI.DomElement, containerElement?: Sys.UI.DomElement): Sys.UI.DomElement;
resolveElement(elementOrElementId: HTMLElement, containerElement?: HTMLElement): HTMLElement;
resolveElement(elementOrElementId: string): any;
/**
* Sets the position of a DOM element. This member is static and can be invoked without creating an instance of the class.
* he left and top style attributes (upper-left corner) of an element specify the relative position of an element.
* The actual position will depend on the offsetParent property of the target element and the positioning mode of the element. *
* @param element The target element.
* @param x The x-coordinate in pixels.
* @param y The y-coordinate in pixels.
*/
setLocation(element: Sys.UI.DomElement, x: number, y: number): void;
setLocation(element: HTMLElement, x: number, y: number): void;
setLocation(element: any, x: number, y: number): void;
/**
* Sets the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method.
* This member is static and can be invoked without creating an instance of the class.
*
* Use the setVisibilityMode method to set the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method.
* For example, if value is set to Sys.UI.VisibilityMode.collapse, the element uses no space on the page when the setVisible method is called to hide the element.
*
* @param element
* The target DOM element.
* @param value
* A Sys.UI.VisibilityMode enumeration value.
*/
setVisibilityMode(element: Sys.UI.DomElement, value: Sys.UI.VisibilityMode): void;
/**
* Sets a DOM element to be visible or hidden. This member is static and can be invoked without creating an instance of the class.
*
* Use the setVisible method to set a DOM element as visible or hidden on the Web page.
* If you invoke this method with value set to false for an element whose visibility mode is set to "hide," the element will not be visible.
* However, it will occupy space on the page. If the element's visibility mode is set to "collapse," the element will occupy no space in the page.
* For more information about how to set the layout characteristics of hidden DOM elements, see Sys.UI.DomElement setVisibilityMode Method.
*
* @param element
* The target DOM element.
* @param value
* true to make element visible on the Web page; false to hide element.
*/
setVisible(element: Sys.UI.DomElement, value: boolean): void;
setVisible(element: HTMLElement, value: boolean): void;
setVisible(element: any, value: boolean): void;
/**
* Toggles a CSS class in a DOM element. This member is static and can be invoked without creating an instance of the class.
* Use the toggleCssClass method to hide a CSS class of an element if it is shown, or to show a CSS class of an element if it is hidden.
*
* @param element
* The Sys.UI.DomElement object to toggle.
* @param className
* The name of the CSS class to toggle.
*/
toggleCssClass(element: Sys.UI.DomElement, className: string): void;
toggleCssClass(element: HTMLElement, className: string): void;
toggleCssClass(element: any, className: string): void;
//#endregion
}
var DomElement: Sys.UI.DomElement;
/**
* Provides cross-browser access to DOM event properties and helper APIs that are used to attach handlers to DOM element events.
* @see {@link http://msdn.microsoft.com/en-us/library/bb310935(v=vs.100).aspx}
@@ -3244,49 +3421,60 @@ declare module Sys {
*/
charCode: number;
/**
*
* Gets the x-coordinate of the mouse pointer's position relative to the client area of the browser window, excluding window scroll bars.
* @return An integer that represents the x-coordinate in pixels.
*/
clientX: any; // todo
clientX: number;
/**
*
* Gets the y-coordinate of the mouse pointer's position relative to the client area of the browser window, excluding window scroll bars.
* @return An integer that represents the y-coordinate in pixels.
*/
clientY: any; // todo
clientY: number;
/**
*
* Gets a Boolean value that indicates the state of the CTRL key when the associated event occurred.
* @return true if the CTRL key was pressed when the event occurred; otherwise, false.
*/
ctrlKey: any; // todo
ctrlKey: boolean;
/**
*
* Gets the key code of the key that raised the keyUp or keyDown event.
* @return An integer value that represents the key code of the key that was pressed to raise the keyUp or keyDown event.
*/
keyCode: any; // todo
keyCode: number;
/**
*
* Gets the x-coordinate of the mouse pointer's position relative to the object that raised the event.
* @return An integer that represents the x-coordinate in pixels.
*/
offsetX: any; // todo
offsetX: number;
/**
*
* Gets the y-coordinate of the mouse pointer's position relative to the object that raised the event.
* @return An integer that represents the y-coordinate in pixels.
*/
offsetY: any; // todo
offsetY: number;
/**
*
* Gets the x-coordinate of the mouse pointer's position relative to the user's screen.
* @return An integer that represents the x-coordinate in pixels.
*/
screenX: any; // todo
screenX: number;
/**
*
* Gets the y-coordinate of the mouse pointer's position relative to the user's screen.
* @return An integer that represents the y-coordinate in pixels.
*/
screenY: any; // todo
screenY: number;
/**
*
* Gets a Boolean value that indicates the state of the SHIFT key when the associated event occurred.
* @return true if the SHIFT key was pressed when the event occurred; otherwise, false.
*/
shiftKey: any; // todo
shiftKey: boolean;
/**
*
* Gets the object that the event acted on.
* @return An object that represents the target that the event acted on.
*/
target: any; // todo
target: any;
/**
*
* Gets the name of the event that was raised.
* @return A string that represents the name of the event that was raised.
*/
type: any; // todo
type: string;
//#endregion
}
@@ -3359,16 +3547,52 @@ declare module Sys {
// todo
}
/**
* Creates an object that contains a set of integer coordinates that represent a position.
* Creates an object that contains a set of integer coordinates that represent a position. The getLocation method of the Sys.UI.DomElement class returns a Point object.
* @see {@link http://msdn.microsoft.com/en-us/library/bb383992(v=vs.100).aspx} *
*/
class Point {
// todo
//#region Constructors
/**
* Creates an object that contains a set of integer coordinates that represent a position.
* @param x The number of pixels between the location and the left edge of the parent frame.
* @param y The number of pixels between the location and the top edge of the parent frame.
*/
constructor(x: number, y: number);
//#endregion
//#region Fields
/**
* Gets the x-coordinate of a Sys.UI.Point object in pixels. This property is read-only.
* @return A number that represents the x-coordinate of the Point object in pixels.
*/
x: number;
/**
* Gets the y-coordinate of a Sys.UI.Point object in pixels. This property is read-only.
* @return A number that represents the y-coordinate of the Point object in pixels.
*/
y: number;
//#endregion
}
/**
* Describes the layout of a DOM element in the page when the element's visible property is set to false.
* @see {@link http://msdn.microsoft.com/en-us/library/bb397498(v=vs.100).aspx}
*/
enum VisibilityMode {
// todo
/**
* The element is not visible, but it occupies space on the page.
*/
hide,
/**
* The element is not visible, and the space it occupies is collapsed.
*/
collapse
}
}
@@ -3622,7 +3846,7 @@ declare module Sys {
* Manages client partial-page updates of server UpdatePanel controls. In addition, defines properties, events, and methods that can be used to customize a Web page with client script.
* @see {@link http://msdn.microsoft.com/en-us/library/bb311028(v=vs.100).aspx}
*/
class PageRequestManager extends EventArgs {
class PageRequestManager {
//#region Constructors
@@ -3640,7 +3864,7 @@ declare module Sys {
* @param beginRequestHandler
* The name of the handler method that will be called.
*/
add_beginRequest(beginRequestHandler: (sender: any, args: any) => void): void;
add_beginRequest(beginRequestHandler: (sender: any, args: BeginRequestEventArgs) => void): void;
/**
* Raised before the processing of an asynchronous postback starts and the postback request is sent to the server.
* @param beginRequestHandler
@@ -3664,37 +3888,37 @@ declare module Sys {
* @param initializeRequestHandler
* The name of the handler method that will be called.
*/
add_initializeRequest(initializeRequestHandler: (sender: any, args: any) => void): void;
add_initializeRequest(initializeRequestHandler: (sender: any, args: InitializeRequestEventArgs) => void): void;
/**
* Raised during the initialization of the asynchronous postback.
* @param initializeRequestHandler
* The name of the handler method that will be called.
*/
remove_initializeRequest(initializeRequestHandler: (sender: any, args: any) => void): void;
remove_initializeRequest(initializeRequestHandler: (sender: any, args: InitializeRequestEventArgs) => void): void;
/**
* Raised after all content on the page is refreshed as a result of either a synchronous or an asynchronous postback.
* @param pageLoadedHandler
* The name of the handler method that will be called.
*/
add_pageLoaded(pageLoadedHandler: (sender: any, args: any) => void): void;
add_pageLoaded(pageLoadedHandler: (sender: any, args: PageLoadedEventArgs) => void): void;
/**
* Raised after all content on the page is refreshed as a result of either a synchronous or an asynchronous postback.
* @param pageLoadedHandler
* The name of the handler method that will be called.
*/
remove_pageLoaded(pageLoadedHandler: (sender: any, args: any) => void): void;
remove_pageLoaded(pageLoadedHandler: (sender: any, args: PageLoadedEventArgs) => void): void;
/**
* Raised after the response from the server to an asynchronous postback is received but before any content on the page is updated.
* @param pageLoadedHandler
* The name of the handler method that will be called.
*/
add_pageLoading(pageLoadingHandler: (sender: any, args: any) => void): void;
add_pageLoading(pageLoadingHandler: (sender: any, args: PageLoadingEventArgs) => void): void;
/**
* Raised after the response from the server to an asynchronous postback is received but before any content on the page is updated.
* @param pageLoadedHandler
* The name of the handler method that will be called.
*/
remove_pageLoading(pageLoadingHandler: (sender: any, args: any) => void): void;
remove_pageLoading(pageLoadingHandler: (sender: any, args: PageLoadingEventArgs) => void): void;
//#endregion
+3 -3
View File
@@ -67,7 +67,7 @@ declare var Buffer: {
isBuffer(obj: any): boolean;
byteLength(string: string, encoding?: string): number;
concat(list: Buffer[], totalLength?: number): Buffer;
}
};
/************************************************
* *
@@ -1240,14 +1240,14 @@ declare module "assert" {
(block: Function, error: Function, message?: string): void;
(block: Function, error: RegExp, message?: string): void;
(block: Function, error: (err: any) => boolean, message?: string): void;
}
};
export var doesNotThrow: {
(block: Function, message?: string): void;
(block: Function, error: Function, message?: string): void;
(block: Function, error: RegExp, message?: string): void;
(block: Function, error: (err: any) => boolean, message?: string): void;
}
};
export function ifError(value: any): void;
}
+12
View File
@@ -262,6 +262,18 @@ interface Require {
**/
toUrl(module: string): string;
/**
* Returns true if the module has already been loaded and defined.
* @param module Module to check
**/
defined(module: string): boolean;
/**
* Returns true if the module has already been requested or is in the process of loading and should be available at some point.
* @param module Module to check
**/
specified(module: string): boolean;
/**
* On Error override
* @param err
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="rtree.d.ts"/>
var myRTree = RTree(5);
var el = "test";
myRTree.insert({x: 0, y: 0, w: 1, h: 1}, el);
var intersections = myRTree.search({x: 0.5, y: 0.5, w: 1, h: 1});
intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1}, "notTest!");
intersections = myRTree.remove({x: 0.5, y: 0.5, w: 1, h: 1});
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for rtree 1.4.0
// Project: https://github.com/leaflet-extras/RTree
// Definitions by: Omede Firouz <https://github.com/oefirouz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Rectangle {
x: number;
y: number;
w: number;
h: number;
}
interface RTreeStatic {
insert(bounds: Rectangle, element: Object): boolean;
remove(area: Rectangle, element?: Object): any[];
geoJSON(geoJSON: any): void;
bbox(arg1: any, arg2?: any, arg3?: number, arg4?: number): any[];
search(area: Rectangle, return_node?: boolean, return_array?: any[]): any[];
}
interface RTreeFactory {
(max_node_width?: number): RTreeStatic;
}
declare var RTree: RTreeFactory;
+11
View File
@@ -227,6 +227,11 @@ declare module Rx {
concat(sources: IPromise<T>[]): Observable<T>;
concatAll(): T;
concatObservable(): T; // alias for concatAll
concatMap<T2, R>(selector: (value: T, index: number) => Observable<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
concatMap<T2, R>(selector: (value: T, index: number) => IPromise<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
concatMap<R>(selector: (value: T, index: number) => Observable<R>): Observable<R>; // alias for selectConcat
concatMap<R>(selector: (value: T, index: number) => IPromise<R>): Observable<R>; // alias for selectConcat
concatMap<R>(sequence: Observable<R>): Observable<R>; // alias for selectConcat
merge(maxConcurrent: number): T;
merge(other: Observable<T>): Observable<T>;
merge(other: IPromise<T>): Observable<T>;
@@ -293,6 +298,12 @@ declare module Rx {
flatMap<TResult>(other: Observable<TResult>): Observable<TResult>; // alias for selectMany
flatMap<TResult>(other: IPromise<TResult>): Observable<TResult>; // alias for selectMany
selectConcat<T2, R>(selector: (value: T, index: number) => Observable<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>;
selectConcat<T2, R>(selector: (value: T, index: number) => IPromise<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>;
selectConcat<R>(selector: (value: T, index: number) => Observable<R>): Observable<R>;
selectConcat<R>(selector: (value: T, index: number) => IPromise<R>): Observable<R>;
selectConcat<R>(sequence: Observable<R>): Observable<R>;
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Aggregates v2.2.24
// Type definitions for RxJS-Aggregates v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-All v2.2.24
// Type definitions for RxJS-All v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Async v2.2.24
// Type definitions for RxJS-Async v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: zoetrope <https://github.com/zoetrope>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-BackPressure v2.2.24
// Type definitions for RxJS-BackPressure v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Binding v2.2.24
// Type definitions for RxJS-Binding v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Coincidence v2.2.24
// Type definitions for RxJS-Coincidence v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS v2.2.24
// Type definitions for RxJS v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Experimental v2.2.24
// Type definitions for RxJS-Experimental v2.2.25
// Project: https://github.com/Reactive-Extensions/RxJS/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Join v2.2.24
// Type definitions for RxJS-Join v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Lite v2.2.20
// Type definitions for RxJS-Lite v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Testing v2.2.24
// Type definitions for RxJS-Testing v2.2.25
// Project: https://github.com/Reactive-Extensions/RxJS/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Time v2.2.24
// Type definitions for RxJS-Time v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-VirtualTime v2.2.24
// Type definitions for RxJS-VirtualTime v2.2.25
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -8,7 +8,7 @@
declare module Slick {
export interface Column<T extends SlickData> {
header: Header;
header?: Header;
}
export interface Header {
+20 -6
View File
@@ -6,8 +6,8 @@
// Taken from http://dev.w3.org/2011/webrtc/editor/getusermedia.html
interface MediaStreamConstraints {
audio: boolean;
video: boolean;
audio: any;
video: any;
}
declare var MediaStreamConstraints: {
prototype: MediaStreamConstraints;
@@ -40,8 +40,8 @@ declare var MediaTrackConstraint: {
}
interface Navigator {
getUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void , errorCallback: (error: Error) => void );
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void , errorCallback: (error: Error) => void );
getUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void);
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void);
}
interface EventHandler { (event: Event): void; }
@@ -79,6 +79,7 @@ declare var webkitMediaStreamTrackList: {
interface MediaStream {
label: string;
id: string;
getAudioTracks(): MediaStreamTrackList;
getVideoTracks(): MediaStreamTrackList;
ended: boolean;
@@ -99,6 +100,17 @@ declare var webkitMediaStream: {
new (trackContainers: MediaStreamTrack[]): MediaStream;
}
// an - not defined in source doc.
interface SourceInfo {
label: string;
id: string;
kind: string;
facing: string;
}
declare var SourceInfo: {
prototype: SourceInfo;
}
interface LocalMediaStream extends MediaStream {
stop(): void;
}
@@ -115,12 +127,13 @@ interface MediaStreamTrack {
onunmute: (event: Event) => void;
onended: (event: Event) => void;
}
declare var MediaStramTrack: {
declare var MediaStreamTrack: {
prototype: MediaStreamTrack;
new (): MediaStreamTrack;
LIVE: number; // = 0;
MUTED: number; // = 1;
ENDED: number; // = 2;
getSources: (callback: (sources: SourceInfo[]) => void) => void;
}
interface streamURL extends URL {
@@ -136,6 +149,7 @@ interface WebkitURL extends streamURL {
}
declare var webkitURL: {
prototype: WebkitURL;
new (): streamURL;
new (): streamURL;
createObjectURL(stream: MediaStream): string;
}
Vendored
+1 -1
View File
@@ -110,7 +110,7 @@ declare module "ws" {
constructor(options?: IServerOptions, callback?: Function);
close(): void;
handleUpgrade(request: http.ClientRequest, socket: net.Socket,
handleUpgrade(request: http.ServerRequest, socket: net.Socket,
upgradeHead: Buffer, callback: (client: WebSocket) => void): void;
// Events