mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge remote-tracking branch 'remotes/upstream/switch-0.9.5' into switch-0.9.5
This commit is contained in:
@@ -97,6 +97,7 @@ List of Definitions
|
||||
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
|
||||
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
|
||||
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
|
||||
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
|
||||
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
|
||||
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
|
||||
|
||||
+139
-135
@@ -43,11 +43,11 @@ To avoid cluttering the list of suggestions as you type in your IDE, all interfa
|
||||
**ngMockE2E** does not define a new namespace, but rather modifies some of **ng**'s interfaces.
|
||||
|
||||
Bellow is an example of how to use the interfaces:
|
||||
|
||||
function MainController($scope: ng.IScope, $http: ng.IHttpService) {
|
||||
// code assistance will now be available for $scope and $http
|
||||
}
|
||||
|
||||
```ts
|
||||
function MainController($scope: ng.IScope, $http: ng.IHttpService) {
|
||||
// code assistance will now be available for $scope and $http
|
||||
}
|
||||
```
|
||||
|
||||
## Services and other injectables
|
||||
|
||||
@@ -71,156 +71,160 @@ The **$httpProvider**, thus, is defined by **ng.IHttpProvider**.
|
||||
TypeScript allows for static checking. Among other obvious things, that means you're gonna have to extend interfaces when you need to augment an object whose interface has been defined, because otherwise the compiler will see it as an error to try to assign a value to a unspecified member.
|
||||
|
||||
Consider the following ordinary code:
|
||||
|
||||
function Controller($scope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
|
||||
```ts
|
||||
function Controller($scope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
```
|
||||
That will not produce any compilation error because the compiler does not know the first thing about $scope to do any checking. For that same reason, you will not get any assistance either.
|
||||
|
||||
Now consider this:
|
||||
|
||||
function Controller($scope: ng.IScope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
```ts
|
||||
function Controller($scope: ng.IScope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
```
|
||||
|
||||
Now we annotated `$scope` with the interface `ng.IScope`. The compiler now knows that, among other members, `$scope` has a method called `$broadcast`. That interface, however, does not define a `title` property. The compiler will complain about it.
|
||||
|
||||
Since you are augmenting the $scope object, you should let the compiler know what to expect then:
|
||||
```ts
|
||||
interface ICustomScope extends ng.IScope {
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface ICustomScope extends ng.IScope {
|
||||
title: string;
|
||||
}
|
||||
|
||||
function Controller($scope: ng.ICustomScope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
function Controller($scope: ng.ICustomScope) {
|
||||
$scope.$broadcast('myEvent');
|
||||
$scope.title = 'Yabadabadu';
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Working with $resource
|
||||
```ts
|
||||
/// <reference path="angular.d.ts" />
|
||||
/// <reference path="angular-resource.d.ts" />
|
||||
|
||||
/// <reference path="angular.d.ts" />
|
||||
/// <reference path="angular-resource.d.ts" />
|
||||
// We have the option to define arguments for a custom resource
|
||||
interface IArticleParameters {
|
||||
id: number;
|
||||
}
|
||||
|
||||
// We have the option to define arguments for a custom resource
|
||||
interface IArticleParameters {
|
||||
id: number;
|
||||
interface IArticleResource extends ng.resource.IResource<IArticleResource> {
|
||||
title: string;
|
||||
text: string;
|
||||
date: Date;
|
||||
author: number;
|
||||
|
||||
// Although all actions defined on IArticleResourceClass are avaiable with
|
||||
// the '$' prefix, we have the choice to expose only what we will use
|
||||
$publish(): IArticleResource;
|
||||
$unpublish(): IArticleResource;
|
||||
}
|
||||
|
||||
// Let's define a custom resource
|
||||
interface IArticleResourceClass extends ng.resource.IResourceClass<IArticleResource> {
|
||||
// Overload get to accept our custom parameters
|
||||
get(): ng.resource.IResource;
|
||||
get(params: IArticleParameters, onSuccess: Function): IArticleResource;
|
||||
|
||||
// Add our custom resource actions
|
||||
publish(): IArticleResource;
|
||||
publish(params: IArticleParameters): IArticleResource;
|
||||
unpublish(params: IArticleParameters): IArticleResource;
|
||||
}
|
||||
|
||||
function MainController($resource: ng.resource.IResourceService) {
|
||||
|
||||
// IntelliSense will provide IActionDescriptor interface and will validate
|
||||
// your assignment against it
|
||||
var publishDescriptor: ng.resource.IActionDescriptor;
|
||||
publishDescriptor = {
|
||||
method: 'GET',
|
||||
isArray: false
|
||||
};
|
||||
|
||||
// I could still create a descriptor without the interface...
|
||||
var unpublishDescriptor = {
|
||||
method: 'POST'
|
||||
}
|
||||
|
||||
// Let's define a custom resource
|
||||
interface IArticleResourceClass extends ng.resource.IResourceClass {
|
||||
// Overload get to accept our custom parameters
|
||||
get(): ng.resource.IResource;
|
||||
get(params: IArticleParameters, onSuccess: Function): IArticleResource;
|
||||
// A call to the $resource service returns a IResourceClass. Since
|
||||
// our own IArticleResourceClass defines 2 more actions, we cast the return
|
||||
// value to make the compiler aware of that
|
||||
var articleResource = $resource<IArticleResource, IArticleResourceClass>('/articles/:id', null, {
|
||||
publish : publishDescriptor,
|
||||
unpublish : unpublishDescriptor
|
||||
});
|
||||
|
||||
// Add our custom resource actions
|
||||
publish(): IArticleResource;
|
||||
publish(params: IArticleParameters): IArticleResource;
|
||||
unpublish(params: IArticleParameters): IArticleResource;
|
||||
}
|
||||
|
||||
interface IArticleResource extends ng.resource.IResource {
|
||||
title: string;
|
||||
text: string;
|
||||
date: Date;
|
||||
author: number;
|
||||
|
||||
// Although all actions defined on IArticleResourceClass are avaiable with
|
||||
// the '$' prefix, we have the choice to expose only what we will use
|
||||
$publish(): IArticleResource;
|
||||
$unpublish(): IArticleResource;
|
||||
}
|
||||
|
||||
function MainController($resource: ng.resource.IResourceService) {
|
||||
|
||||
// IntelliSense will provide IActionDescriptor interface and will validate
|
||||
// your assignment against it
|
||||
var publishDescriptor: ng.resource.IActionDescriptor;
|
||||
publishDescriptor = {
|
||||
method: 'GET',
|
||||
isArray: false
|
||||
};
|
||||
|
||||
// I could still create a descriptor without the interface...
|
||||
var unpublishDescriptor = {
|
||||
method: 'POST'
|
||||
}
|
||||
|
||||
// A call to the $resource service returns a IResourceClass. Since
|
||||
// our own IArticleResourceClass defines 2 more actions, we cast the return
|
||||
// value to make the compiler aware of that
|
||||
var articleResource = <IArticleResourceClass> $resource('/articles/:id', null, {
|
||||
publish : publishDescriptor,
|
||||
unpublish : unpublishDescriptor
|
||||
});
|
||||
|
||||
// Now we can do this
|
||||
articleResource.unpublish({ id: 1 });
|
||||
|
||||
// IResourceClass.get() will be automatically available here
|
||||
var article: IArticleResource = articleResource.get({id: 1}, function success() {
|
||||
// Again, default + custom action here...
|
||||
article.title = 'New Title';
|
||||
article.$save();
|
||||
article.$publish();
|
||||
});
|
||||
}
|
||||
|
||||
### Working with $resource in angular-1.0 definitions
|
||||
|
||||
/// <reference path="angular-1.0.d.ts" />
|
||||
/// <reference path="angular-resource-1.0.d.ts" />
|
||||
|
||||
// Let's define a custom resource
|
||||
interface IArticleResourceClass extends ng.resource.IResourceClass {
|
||||
publish: ng.resource.IActionCall;
|
||||
unpublish: ng.resource.IActionCall;
|
||||
}
|
||||
interface IArticleResource extends ng.resource.IResource {
|
||||
title: string;
|
||||
text: string;
|
||||
date: Date;
|
||||
author: number;
|
||||
$publish: ng.resource.IActionCall;
|
||||
$unpublish: ng.resource.IActionCall;
|
||||
}
|
||||
|
||||
function MainController($resource: ng.resource.IResourceService) {
|
||||
|
||||
// IntelliSense will provide IActionDescriptor interface and will validate
|
||||
// your assignment against it
|
||||
var publishDescriptor: ng.resource.IActionDescriptor;
|
||||
publishDescriptor = {
|
||||
method: 'GET',
|
||||
isArray: false
|
||||
};
|
||||
|
||||
// I could still create a descriptor without the interface...
|
||||
var unpublishDescriptor = {
|
||||
method: 'POST'
|
||||
}
|
||||
|
||||
// A call to the $resource service returns a IResourceClass. Since
|
||||
// our own IArticleResourceClass defines 2 more actions, we cast the return
|
||||
// value to make the compiler aware of that
|
||||
var articles = <IArticleResourceClass> $resource('/articles/:id', null, {
|
||||
publish : publishDescriptor,
|
||||
unpublish : unpublishDescriptor
|
||||
});
|
||||
|
||||
// Now we can do this
|
||||
articles.unpublish({ id: 1 });
|
||||
|
||||
// IResourceClass.get() will be automatically available here
|
||||
var article = <IArticleResource> articles.get({id: 1});
|
||||
// Now we can do this
|
||||
articleResource.unpublish({ id: 1 });
|
||||
|
||||
// IResourceClass.get() will be automatically available here
|
||||
var article: IArticleResource = articleResource.get({id: 1}, function success() {
|
||||
// Again, default + custom action here...
|
||||
article.title = 'New Title';
|
||||
article.$save();
|
||||
article.$publish();
|
||||
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
### Working with $resource in angular-1.0 definitions
|
||||
```ts
|
||||
/// <reference path="angular-1.0.d.ts" />
|
||||
/// <reference path="angular-resource-1.0.d.ts" />
|
||||
|
||||
// Let's define a custom resource
|
||||
interface IArticleResourceClass extends ng.resource.IResourceClass {
|
||||
publish: ng.resource.IActionCall;
|
||||
unpublish: ng.resource.IActionCall;
|
||||
}
|
||||
interface IArticleResource extends ng.resource.IResource {
|
||||
title: string;
|
||||
text: string;
|
||||
date: Date;
|
||||
author: number;
|
||||
$publish: ng.resource.IActionCall;
|
||||
$unpublish: ng.resource.IActionCall;
|
||||
}
|
||||
|
||||
function MainController($resource: ng.resource.IResourceService) {
|
||||
|
||||
// IntelliSense will provide IActionDescriptor interface and will validate
|
||||
// your assignment against it
|
||||
var publishDescriptor: ng.resource.IActionDescriptor;
|
||||
publishDescriptor = {
|
||||
method: 'GET',
|
||||
isArray: false
|
||||
};
|
||||
|
||||
// I could still create a descriptor without the interface...
|
||||
var unpublishDescriptor = {
|
||||
method: 'POST'
|
||||
}
|
||||
|
||||
// A call to the $resource service returns a IResourceClass. Since
|
||||
// our own IArticleResourceClass defines 2 more actions, we cast the return
|
||||
// value to make the compiler aware of that
|
||||
var articles = <IArticleResourceClass> $resource('/articles/:id', null, {
|
||||
publish : publishDescriptor,
|
||||
unpublish : unpublishDescriptor
|
||||
});
|
||||
|
||||
// Now we can do this
|
||||
articles.unpublish({ id: 1 });
|
||||
|
||||
// IResourceClass.get() will be automatically available here
|
||||
var article = <IArticleResource> articles.get({id: 1});
|
||||
|
||||
// Again, default + custom action here...
|
||||
article.title = 'New Title';
|
||||
article.$save();
|
||||
article.$publish();
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/// <reference path="angular-resource.d.ts" />
|
||||
|
||||
interface IMyResource extends ng.resource.IResource<IMyResource> { };
|
||||
interface IMyResourceClass extends ng.resource.IResourceClass<IMyResource> { };
|
||||
|
||||
///////////////////////////////////////
|
||||
// IActionDescriptor
|
||||
///////////////////////////////////////
|
||||
@@ -14,9 +17,9 @@ actionDescriptor.params = { key: 'value' };
|
||||
///////////////////////////////////////
|
||||
// IResourceClass
|
||||
///////////////////////////////////////
|
||||
var resourceClass: ng.resource.IResourceClass;
|
||||
var resource: ng.resource.IResource;
|
||||
var resourceArray: ng.resource.IResource[];
|
||||
var resourceClass: IMyResourceClass;
|
||||
var resource: IMyResource;
|
||||
var resourceArray: IMyResource[];
|
||||
|
||||
resource = resourceClass.delete();
|
||||
resource = resourceClass.delete({ key: 'value' });
|
||||
@@ -63,13 +66,22 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' });
|
||||
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { });
|
||||
resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }, function () { });
|
||||
|
||||
///////////////////////////////////////
|
||||
// IResourceService
|
||||
///////////////////////////////////////
|
||||
var resourceService: ng.resource.IResourceService;
|
||||
resourceClass = resourceService<IMyResource, IMyResourceClass>('test');
|
||||
resourceClass = resourceService<IMyResource>('test');
|
||||
resourceClass = resourceService('test');
|
||||
|
||||
///////////////////////////////////////
|
||||
// IModule
|
||||
///////////////////////////////////////
|
||||
var mod: ng.IModule;
|
||||
var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction;
|
||||
var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction<IMyResource>;
|
||||
var resourceService: ng.resource.IResourceService;
|
||||
|
||||
resourceClass = resourceServiceFactoryFunction<IMyResourceClass>(resourceService);
|
||||
|
||||
resourceServiceFactoryFunction = function (resourceService) { return resourceClass };
|
||||
mod = mod.factory('factory name', resourceServiceFactoryFunction);
|
||||
|
||||
Vendored
+69
-60
@@ -1,7 +1,6 @@
|
||||
// Type definitions for Angular JS 1.2 (ngResource module)
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// Definitions: https://github.com/daptiv/DefinitelyTyped
|
||||
|
||||
/// <reference path="angular.d.ts" />
|
||||
|
||||
@@ -19,10 +18,19 @@ declare module ng.resource {
|
||||
// that deeply.
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IResourceService {
|
||||
|
||||
<T extends IResource<T>, U extends IResourceClass<T>>(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actionDescriptors?: any): U;
|
||||
<T extends IResource<T>>(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actionDescriptors?: any): IResourceClass<T>;
|
||||
(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actionDescriptors?: any): IResourceClass;
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actionDescriptors?: any): IResourceClass<IResource<any>>;
|
||||
}
|
||||
|
||||
// Just a reference to facilitate describing new actions
|
||||
@@ -42,65 +50,66 @@ declare module ng.resource {
|
||||
// PATCH (in other words, methods with body). Otherwise, it's going
|
||||
// to be considered as parameters to the request.
|
||||
// https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465
|
||||
interface IResourceClass {
|
||||
get(): IResource;
|
||||
get(dataOrParams: any): IResource;
|
||||
get(dataOrParams: any, success: Function): IResource;
|
||||
get(success: Function, error?: Function): IResource;
|
||||
get(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
save(): IResource;
|
||||
save(dataOrParams: any): IResource;
|
||||
save(dataOrParams: any, success: Function): IResource;
|
||||
save(success: Function, error?: Function): IResource;
|
||||
save(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
query(): IResource[];
|
||||
query(dataOrParams: any): IResource[];
|
||||
query(dataOrParams: any, success: Function): IResource[];
|
||||
query(success: Function, error?: Function): IResource[];
|
||||
query(params: any, data: any, success?: Function, error?: Function): IResource[];
|
||||
remove(): IResource;
|
||||
remove(dataOrParams: any): IResource;
|
||||
remove(dataOrParams: any, success: Function): IResource;
|
||||
remove(success: Function, error?: Function): IResource;
|
||||
remove(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
delete(): IResource;
|
||||
delete(dataOrParams: any): IResource;
|
||||
delete(dataOrParams: any, success: Function): IResource;
|
||||
delete(success: Function, error?: Function): IResource;
|
||||
delete(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
interface IResourceClass<T extends IResource<T>> {
|
||||
get(): T;
|
||||
get(dataOrParams: any): T;
|
||||
get(dataOrParams: any, success: Function): T;
|
||||
get(success: Function, error?: Function): T;
|
||||
get(params: any, data: any, success?: Function, error?: Function): T;
|
||||
save(): T;
|
||||
save(dataOrParams: any): T;
|
||||
save(dataOrParams: any, success: Function): T;
|
||||
save(success: Function, error?: Function): T;
|
||||
save(params: any, data: any, success?: Function, error?: Function): T;
|
||||
query(): T[];
|
||||
query(dataOrParams: any): T[];
|
||||
query(dataOrParams: any, success: Function): T[];
|
||||
query(success: Function, error?: Function): T[];
|
||||
query(params: any, data: any, success?: Function, error?: Function): T[];
|
||||
remove(): T;
|
||||
remove(dataOrParams: any): T;
|
||||
remove(dataOrParams: any, success: Function): T;
|
||||
remove(success: Function, error?: Function): T;
|
||||
remove(params: any, data: any, success?: Function, error?: Function): T;
|
||||
delete(): T;
|
||||
delete(dataOrParams: any): T;
|
||||
delete(dataOrParams: any, success: Function): T;
|
||||
delete(success: Function, error?: Function): T;
|
||||
delete(params: any, data: any, success?: Function, error?: Function): T;
|
||||
}
|
||||
|
||||
interface IResource {
|
||||
$get(): IResource;
|
||||
$get(dataOrParams: any): IResource;
|
||||
$get(dataOrParams: any, success: Function): IResource;
|
||||
$get(success: Function, error?: Function): IResource;
|
||||
$get(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
$save(): IResource;
|
||||
$save(dataOrParams: any): IResource;
|
||||
$save(dataOrParams: any, success: Function): IResource;
|
||||
$save(success: Function, error?: Function): IResource;
|
||||
$save(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
$query(): IResource[];
|
||||
$query(dataOrParams: any): IResource[];
|
||||
$query(dataOrParams: any, success: Function): IResource[];
|
||||
$query(success: Function, error?: Function): IResource[];
|
||||
$query(params: any, data: any, success?: Function, error?: Function): IResource[];
|
||||
$remove(): IResource;
|
||||
$remove(dataOrParams: any): IResource;
|
||||
$remove(dataOrParams: any, success: Function): IResource;
|
||||
$remove(success: Function, error?: Function): IResource;
|
||||
$remove(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
$delete(): IResource;
|
||||
$delete(dataOrParams: any): IResource;
|
||||
$delete(dataOrParams: any, success: Function): IResource;
|
||||
$delete(success: Function, error?: Function): IResource;
|
||||
$delete(params: any, data: any, success?: Function, error?: Function): IResource;
|
||||
interface IResource<T extends IResource<T>> {
|
||||
$get(): T;
|
||||
$get(dataOrParams: any): T;
|
||||
$get(dataOrParams: any, success: Function): T;
|
||||
$get(success: Function, error?: Function): T;
|
||||
$get(params: any, data: any, success?: Function, error?: Function): T;
|
||||
$save(): T;
|
||||
$save(dataOrParams: any): T;
|
||||
$save(dataOrParams: any, success: Function): T;
|
||||
$save(success: Function, error?: Function): T;
|
||||
$save(params: any, data: any, success?: Function, error?: Function): T;
|
||||
$query(): T[];
|
||||
$query(dataOrParams: any): T[];
|
||||
$query(dataOrParams: any, success: Function): T[];
|
||||
$query(success: Function, error?: Function): T[];
|
||||
$query(params: any, data: any, success?: Function, error?: Function): T[];
|
||||
$remove(): T;
|
||||
$remove(dataOrParams: any): T;
|
||||
$remove(dataOrParams: any, success: Function): T;
|
||||
$remove(success: Function, error?: Function): T;
|
||||
$remove(params: any, data: any, success?: Function, error?: Function): T;
|
||||
$delete(): T;
|
||||
$delete(dataOrParams: any): T;
|
||||
$delete(dataOrParams: any, success: Function): T;
|
||||
$delete(success: Function, error?: Function): T;
|
||||
$delete(params: any, data: any, success?: Function, error?: Function): T;
|
||||
}
|
||||
|
||||
/** when creating a resource factory via IModule.factory */
|
||||
interface IResourceServiceFactoryFunction {
|
||||
($resource: ng.resource.IResourceService): ng.resource.IResourceClass;
|
||||
interface IResourceServiceFactoryFunction<T extends IResource<T>> {
|
||||
($resource: ng.resource.IResourceService): IResourceClass<T>;
|
||||
<U extends IResourceClass<T>>($resource: ng.resource.IResourceService): U;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +118,6 @@ declare module ng {
|
||||
|
||||
interface IModule {
|
||||
/** creating a resource service factory */
|
||||
factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction): IModule;
|
||||
factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction<any>): IModule;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -80,7 +80,7 @@ declare module angularScenario {
|
||||
}
|
||||
|
||||
export interface Input {
|
||||
enter(value: any);
|
||||
enter(value: any): any;
|
||||
check(): any;
|
||||
select(radioButtonValue: any): any;
|
||||
val(): Future;
|
||||
|
||||
Vendored
+15
-14
@@ -127,15 +127,15 @@ declare module ng {
|
||||
// this is necessary to be able to access the scoped attributes. it's not very elegant
|
||||
// because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
|
||||
// this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
|
||||
[name: string]: any;
|
||||
|
||||
// Adds the CSS class value specified by the classVal parameter to the
|
||||
// element. If animations are enabled then an animation will be triggered
|
||||
[name: string]: any;
|
||||
|
||||
// Adds the CSS class value specified by the classVal parameter to the
|
||||
// element. If animations are enabled then an animation will be triggered
|
||||
// for the class addition.
|
||||
$addClass(classVal: string): void;
|
||||
|
||||
// Removes the CSS class value specified by the classVal parameter from the
|
||||
// element. If animations are enabled then an animation will be triggered for
|
||||
// Removes the CSS class value specified by the classVal parameter from the
|
||||
// element. If animations are enabled then an animation will be triggered for
|
||||
// the class removal.
|
||||
$removeClass(classVal: string): void;
|
||||
|
||||
@@ -143,12 +143,12 @@ declare module ng {
|
||||
$set(key: string, value: any): void;
|
||||
|
||||
// Observes an interpolated attribute.
|
||||
// The observer function will be invoked once during the next $digest
|
||||
// following compilation. The observer is then invoked whenever the
|
||||
// The observer function will be invoked once during the next $digest
|
||||
// following compilation. The observer is then invoked whenever the
|
||||
// interpolated value changes.
|
||||
$observe(name: string, fn:(value?:any)=>any): Function;
|
||||
|
||||
// A map of DOM element attribute names to the normalized name. This is needed
|
||||
// A map of DOM element attribute names to the normalized name. This is needed
|
||||
// to do reverse lookup from normalized name back to actual name.
|
||||
$attr: Object;
|
||||
}
|
||||
@@ -451,12 +451,12 @@ declare module ng {
|
||||
then<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
then<TResult>(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
|
||||
|
||||
|
||||
|
||||
catch<TResult>(onRejected: (reason: any) => IHttpPromise<TResult>): IPromise<TResult>;
|
||||
catch<TResult>(onRejected: (reason: any) => IPromise<TResult>): IPromise<TResult>;
|
||||
catch<TResult>(onRejected: (reason: any) => TResult): IPromise<TResult>;
|
||||
|
||||
|
||||
finally<TResult>(finallyCallback: ()=>any):IPromise<TResult>;
|
||||
}
|
||||
|
||||
@@ -700,7 +700,7 @@ declare module ng {
|
||||
valueOf(value: any): any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// SCEDelegateProvider
|
||||
// see http://docs.angularjs.org/api/ng.$sceDelegateProvider
|
||||
@@ -709,7 +709,7 @@ declare module ng {
|
||||
resourceUrlBlacklist(blacklist: any[]): void;
|
||||
resourceUrlWhitelist(whitelist: any[]): void;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Directive
|
||||
// see http://docs.angularjs.org/api/ng.$compileProvider#directive
|
||||
@@ -793,6 +793,7 @@ declare module ng {
|
||||
annotate(inlineAnnotadedFunction: any[]): string[];
|
||||
get (name: string): any;
|
||||
instantiate(typeConstructor: Function, locals?: any): any;
|
||||
invoke(inlineAnnotadedFunction: any[]): any;
|
||||
invoke(func: Function, context?: any, locals?: any): any;
|
||||
}
|
||||
|
||||
|
||||
+52
-47
@@ -1,20 +1,21 @@
|
||||
/// <reference path="ember.d.ts" />
|
||||
/// <reference path="../handlebars/handlebars.d.ts" />
|
||||
|
||||
|
||||
var App;
|
||||
|
||||
App = Em.Application.create();
|
||||
|
||||
App.president = Em.Object.create({
|
||||
name: "Barack Obama"
|
||||
name: 'Barack Obama'
|
||||
});
|
||||
App.country = Em.Object.create({
|
||||
presidentNameBinding: 'MyApp.president.name'
|
||||
});
|
||||
App.country.get('presidentName');
|
||||
App.president = Em.Object.create({
|
||||
firstName: "Barack",
|
||||
lastName: "Obama",
|
||||
firstName: 'Barack',
|
||||
lastName: 'Obama',
|
||||
fullName: function () {
|
||||
return this.get('firstName') + ' ' + this.get('lastName');
|
||||
}.property()
|
||||
@@ -24,47 +25,51 @@ App.president.get('fullName');
|
||||
declare class MyPerson extends Em.Object {
|
||||
static createMan(): MyPerson;
|
||||
}
|
||||
var Person = Em.Object.extend<typeof MyPerson>({
|
||||
|
||||
var Person1 = Em.Object.extend<typeof MyPerson>({
|
||||
say: (thing) => {
|
||||
alert(thing);
|
||||
}
|
||||
});
|
||||
|
||||
declare class MyPerson2 extends Em.Object {
|
||||
helloWorld(): void;
|
||||
}
|
||||
var tom = Person.create<MyPerson2>({
|
||||
name: "Tom Dale",
|
||||
helloWorld: () => {
|
||||
this.say("Hi my name is " + this.get('name'));
|
||||
var tom = Person1.create<MyPerson2>({
|
||||
name: 'Tom Dale',
|
||||
helloWorld: function() {
|
||||
this.say('Hi my name is ' + this.get('name'));
|
||||
}
|
||||
});
|
||||
tom.helloWorld();
|
||||
|
||||
Person.reopen({ isPerson: true });
|
||||
Person.create().get('isPerson');
|
||||
Person1.reopen({ isPerson: true });
|
||||
Person1.create<Em.Object>().get('isPerson');
|
||||
|
||||
Person.reopenClass({
|
||||
Person1.reopenClass({
|
||||
createMan: () => {
|
||||
return Person.create({ isMan: true })
|
||||
return Person1.create({ isMan: true });
|
||||
}
|
||||
});
|
||||
Person.createMan().get('isMan');
|
||||
// ReSharper disable once DuplicatingLocalDeclaration
|
||||
declare var Person1: typeof MyPerson;
|
||||
Person1.createMan().get('isMan');
|
||||
|
||||
var person = Person.create({
|
||||
firstName: "Yehuda",
|
||||
lastName: "Katz"
|
||||
var person = Person1.create<Em.Object>({
|
||||
firstName: 'Yehuda',
|
||||
lastName: 'Katz'
|
||||
});
|
||||
person.addObserver('fullName', () => { });
|
||||
person.set('firstName', "Brohuda");
|
||||
person.addObserver('fullName', null, () => { });
|
||||
person.set('firstName', 'Brohuda');
|
||||
|
||||
App.todosController = Em.Object.create({
|
||||
todos: [
|
||||
Em.Object.create({ isDone: false })
|
||||
],
|
||||
remaining: () => {
|
||||
remaining: (function() {
|
||||
var todos = this.get('todos');
|
||||
return todos.filterProperty('isDone', false).get('length');
|
||||
}.property('todos.@each.isDone')
|
||||
}).property('todos.@each.isDone')
|
||||
});
|
||||
|
||||
var todos = App.todosController.get('todos');
|
||||
@@ -86,29 +91,29 @@ App.husband.set('householdIncome', 90000);
|
||||
App.wife.get('householdIncome');
|
||||
|
||||
App.user = Em.Object.create({
|
||||
fullName: "Kara Gates"
|
||||
fullName: 'Kara Gates'
|
||||
});
|
||||
App.userView = Em.View.create({
|
||||
userNameBinding: Em.Binding.oneWay('App.user.fullName')
|
||||
});
|
||||
App.user.set('fullName', "Krang Gates");
|
||||
App.userView.set('userName', "Truckasaurus Gates");
|
||||
App.user.set('fullName', 'Krang Gates');
|
||||
App.userView.set('userName', 'Truckasaurus Gates');
|
||||
App.user.get('fullName');
|
||||
|
||||
App = Em.Application.create({
|
||||
rootElement: '#sidebar'
|
||||
});
|
||||
|
||||
var view = Em.View.create({
|
||||
var view = Em.View.create<Em.View>({
|
||||
templateName: 'say-hello',
|
||||
name: "Bob"
|
||||
name: 'Bob'
|
||||
});
|
||||
view.appendTo('#container');
|
||||
view.append();
|
||||
view.remove();
|
||||
|
||||
App.AlertView = Em.View.extend({
|
||||
priority: "p4",
|
||||
priority: 'p4',
|
||||
isUrgent: true
|
||||
});
|
||||
|
||||
@@ -121,21 +126,21 @@ App.ListingView = Em.View.extend({
|
||||
|
||||
App.userController = Em.Object.create({
|
||||
content: Em.Object.create({
|
||||
firstName: "Albert",
|
||||
lastName: "Hofmann",
|
||||
firstName: 'Albert',
|
||||
lastName: 'Hofmann',
|
||||
posts: 25,
|
||||
hobbies: "Riding bicycles"
|
||||
hobbies: 'Riding bicycles'
|
||||
})
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('highlight', (property, options) => {
|
||||
Handlebars.registerHelper('highlight', function(property, options) {
|
||||
var value = Em.Handlebars.get(this, property, options);
|
||||
return new Handlebars.SafeString('<span class="highlight">' + value + '</span>');
|
||||
});
|
||||
|
||||
App.MyText = Em.TextField.extend({
|
||||
formBlurredBinding: 'App.adminController.formBlurred',
|
||||
change: (evt) => {
|
||||
change: function() {
|
||||
this.set('formBlurred', true);
|
||||
}
|
||||
});
|
||||
@@ -145,26 +150,26 @@ var textArea = Em.TextArea.create({
|
||||
});
|
||||
|
||||
App.ClickableView = Em.View.extend({
|
||||
click: (evt) => {
|
||||
alert("ClickableView was clicked!");
|
||||
click: () => {
|
||||
alert('ClickableView was clicked!');
|
||||
}
|
||||
});
|
||||
|
||||
var container = Em.ContainerView.create();
|
||||
var container = Em.ContainerView.create<Em.ContainerView>();
|
||||
container.append();
|
||||
var coolView = App.CoolView.create(),
|
||||
childViews = container.get('childViews');
|
||||
childViews.pushObject(coolView);
|
||||
|
||||
Person = Em.Object.extend({
|
||||
sayHello: () => {
|
||||
console.log("Hello from " + this.get('name'));
|
||||
var Person2 = Em.Object.extend<typeof Em.Object>({
|
||||
sayHello: function() {
|
||||
console.log('Hello from ' + this.get('name'));
|
||||
}
|
||||
});
|
||||
var people = [
|
||||
Person.create({ name: "Juan" }),
|
||||
Person.create({ name: "Charles" }),
|
||||
Person.create({ name: "Majd" })
|
||||
Person2.create({ name: 'Juan' }),
|
||||
Person2.create({ name: 'Charles' }),
|
||||
Person2.create({ name: 'Majd' })
|
||||
];
|
||||
people.invoke('sayHello');
|
||||
|
||||
@@ -172,19 +177,19 @@ var arr = [Em.Object.create(), Em.Object.create()];
|
||||
arr.setEach('name', 'unknown');
|
||||
arr.getEach('name');
|
||||
|
||||
Person = Em.Object.extend({
|
||||
var Person3 = Em.Object.extend<typeof Em.Object>({
|
||||
name: null,
|
||||
isHappy: false
|
||||
});
|
||||
var people2 = [
|
||||
Person.create({ name: 'Yehuda', isHappy: true }),
|
||||
Person.create({ name: 'Majd', isHappy: false })
|
||||
Person3.create({ name: 'Yehuda', isHappy: true }),
|
||||
Person3.create({ name: 'Majd', isHappy: false })
|
||||
];
|
||||
people2.every((person, index, self) => {
|
||||
if (person.get('isHappy')) { return true; }
|
||||
people2.every((person: Em.Object) => {
|
||||
return !!person.get('isHappy');
|
||||
});
|
||||
people2.some((person, index, self) => {
|
||||
if (person.get('isHappy')) { return true; }
|
||||
people2.some((person: Em.Object) => {
|
||||
return !!person.get('isHappy');
|
||||
});
|
||||
people2.everyProperty('isHappy', true);
|
||||
people2.someProperty('isHappy', true);
|
||||
|
||||
Vendored
+102
-721
File diff suppressed because it is too large
Load Diff
Vendored
+2
-2
@@ -111,8 +111,8 @@ interface GlobalizeStatic {
|
||||
addCultureInfo(cultureName: string, info: Object): void;
|
||||
addCultureInfo(info: Object): void;
|
||||
findClosestCulture(cultureSelector: string): GlobalizeStatic;
|
||||
format(value: number, format: string, cultureSelector?: string);
|
||||
format(value: Date, format: string, cultureSelector?: string);
|
||||
format(value: number, format: string, cultureSelector?: string): string;
|
||||
format(value: Date, format: string, cultureSelector?: string): string;
|
||||
localize(key: string, cultureSelector?: string): string;
|
||||
|
||||
parseDate(value: string, format?: string, cultureSelector?: string): Date;
|
||||
|
||||
@@ -1,77 +1,79 @@
|
||||
/// <reference path="handlebars.d.ts" />
|
||||
import Handlebars = require('handlebars');
|
||||
|
||||
|
||||
var context = {
|
||||
author: { firstName: "Alan", lastName: "Johnson" },
|
||||
body: "I Love Handlebars",
|
||||
author: { firstName: 'Alan', lastName: 'Johnson' },
|
||||
body: 'I Love Handlebars',
|
||||
comments: [{
|
||||
author: { firstName: "Yehuda", lastName: "Katz" },
|
||||
body: "Me too!"
|
||||
author: { firstName: 'Yehuda', lastName: 'Katz' },
|
||||
body: 'Me too!'
|
||||
}]
|
||||
};
|
||||
Handlebars.registerHelper('fullName', (person) => {
|
||||
return person.firstName + " " + person.lastName;
|
||||
return person.firstName + ' ' + person.lastName;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('agree_button', () => {
|
||||
Handlebars.registerHelper('agree_button', function() {
|
||||
return new Handlebars.SafeString(
|
||||
"<button>I agree. I " + this.emotion + " " + this.name + "</button>"
|
||||
'<button>I agree. I ' + this.emotion + ' ' + this.name + '</button>'
|
||||
);
|
||||
});
|
||||
|
||||
var source = "<p>Hello, my name is {{name}}. I am from {{hometown}}. I have " +
|
||||
"{{kids.length}} kids:</p>" +
|
||||
"<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
|
||||
var source = '<p>Hello, my name is {{name}}. I am from {{hometown}}. I have ' +
|
||||
'{{kids.length}} kids:</p>' +
|
||||
'<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>';
|
||||
var template = Handlebars.compile(source);
|
||||
var data = { "name": "Alan", "hometown": "Somewhere, TX",
|
||||
"kids": [{"name": "Jimmy", "age": "12"}, {"name": "Sally", "age": "4"}]};
|
||||
var data = { 'name': 'Alan', 'hometown': 'Somewhere, TX',
|
||||
'kids': [{'name': 'Jimmy', 'age': '12'}, {'name': 'Sally', 'age': '4'}]};
|
||||
var result = template(data);
|
||||
|
||||
Handlebars.registerHelper('link_to', (context) => {
|
||||
return "<a href='" + context.url + "'>" + context.body + "</a>";
|
||||
return '<a href="' + context.url + '">' + context.body + '</a>';
|
||||
});
|
||||
|
||||
var context2 = { posts: [{url: "/hello-world", body: "Hello World!"}] };
|
||||
var source2 = "<ul>{{#posts}}<li>{{{link_to this}}}</li>{{/posts}}</ul>"
|
||||
var context2 = { posts: [{url: '/hello-world', body: 'Hello World!'}] };
|
||||
var source2 = '<ul>{{#posts}}<li>{{{link_to this}}}</li>{{/posts}}</ul>';
|
||||
|
||||
var template2 = Handlebars.compile(source2);
|
||||
template2(context2);
|
||||
|
||||
Handlebars.registerHelper('link_to', (title, context) => {
|
||||
return "<a href='/posts" + context.url + "'>" + title + "!</a>"
|
||||
return '<a href="/posts' + context.url + '">' + title + '!</a>';
|
||||
});
|
||||
|
||||
var context3 = { posts: [{url: "/hello-world", body: "Hello World!"}] };
|
||||
var source3 = '<ul>{{#posts}}<li>{{{link_to "Post" this}}}</li>{{/posts}}</ul>'
|
||||
var context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] };
|
||||
var source3 = '<ul>{{#posts}}<li>{{{link_to "Post" this}}}</li>{{/posts}}</ul>';
|
||||
var template3 = Handlebars.compile(source3);
|
||||
template3(context3);
|
||||
|
||||
var source4 = "<ul>{{#people}}<li>{{#link}}{{name}}{{/link}}</li>{{/people}}</ul>";
|
||||
Handlebars.registerHelper('link', (context, options) => {
|
||||
var source4 = '<ul>{{#people}}<li>{{#link}}{{name}}{{/link}}</li>{{/people}}</ul>';
|
||||
Handlebars.registerHelper('link', function(context) {
|
||||
return '<a href="/people/' + this.id + '">' + context.fn(this) + '</a>';
|
||||
});
|
||||
var template4 = Handlebars.compile(source4);
|
||||
var data2 = { "people": [
|
||||
{ "name": "Alan", "id": 1 },
|
||||
{ "name": "Yehuda", "id": 2 }
|
||||
var data2 = { 'people': [
|
||||
{ 'name': 'Alan', 'id': 1 },
|
||||
{ 'name': 'Yehuda', 'id': 2 }
|
||||
]};
|
||||
template4(data2);
|
||||
|
||||
var source5 = "<ul>{{#people}}<li>{{> link}}</li>{{/people}}</ul>";
|
||||
Handlebars.registerPartial('link', '<a href="/people/{{id}}">{{name}}</a>')
|
||||
var source5 = '<ul>{{#people}}<li>{{> link}}</li>{{/people}}</ul>';
|
||||
Handlebars.registerPartial('link', '<a href="/people/{{id}}">{{name}}</a>');
|
||||
var template5 = Handlebars.compile(source5);
|
||||
var data3 = { "people": [
|
||||
{ "name": "Alan", "id": 1 },
|
||||
{ "name": "Yehuda", "id": 2 }
|
||||
var data3 = { 'people': [
|
||||
{ 'name': 'Alan', 'id': 1 },
|
||||
{ 'name': 'Yehuda', 'id': 2 }
|
||||
]};
|
||||
template5(data3);
|
||||
|
||||
Handlebars.registerHelper('list', (items, fn) => {
|
||||
var out = "<ul>";
|
||||
var out = '<ul>';
|
||||
for(var i=0, l=items.length; i<l; i++) {
|
||||
out = out + "<li>" + fn(items[i]) + "</li>";
|
||||
out = out + '<li>' + fn(items[i]) + '</li>';
|
||||
}
|
||||
return out + "</ul>";
|
||||
return out + '</ul>';
|
||||
});
|
||||
Handlebars.registerHelper('fullName', (person) => {
|
||||
return person.firstName + " " + person.lastName;
|
||||
});
|
||||
return person.firstName + ' ' + person.lastName;
|
||||
});
|
||||
|
||||
Vendored
+32
-23
@@ -4,30 +4,39 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module Handlebars {
|
||||
function registerHelper(name: string, fn: Function, inverse?: boolean): void;
|
||||
function registerPartial(name: string, str: any): void;
|
||||
function K(): void;
|
||||
function createFrame(object: any): any;
|
||||
function Exception(message: string): void;
|
||||
class SafeString {
|
||||
constructor(str: string);
|
||||
static toString(): string;
|
||||
}
|
||||
function parse(input: string): boolean;
|
||||
var logger: Logger;
|
||||
function log(level: number, obj: any): void;
|
||||
function compile(input: any, options?: any): (context: any, options?: any) => string;
|
||||
declare var Handlebars: HandlebarsStatic;
|
||||
|
||||
interface Logger {
|
||||
DEBUG: number;
|
||||
INFO: number;
|
||||
WARN: number;
|
||||
ERROR: number;
|
||||
level: number;
|
||||
interface HandlebarsStatic {
|
||||
registerHelper(name: string, fn: Function, inverse?: boolean): void;
|
||||
registerPartial(name: string, str: any): void;
|
||||
K(): void;
|
||||
createFrame(object: any): any;
|
||||
Exception(message: string): void;
|
||||
SafeString: typeof SafeString;
|
||||
parse(input: string): boolean;
|
||||
logger: Logger;
|
||||
log(level: number, obj: any): void;
|
||||
compile(input: any, options?: any): (context: any, options?: any) => string;
|
||||
Logger: typeof Logger;
|
||||
}
|
||||
|
||||
methodMap: { [level: number]: string };
|
||||
declare class SafeString {
|
||||
constructor(str: string);
|
||||
static toString(): string;
|
||||
}
|
||||
|
||||
log(level: number, obj: string): void;
|
||||
}
|
||||
interface Logger {
|
||||
DEBUG: number;
|
||||
INFO: number;
|
||||
WARN: number;
|
||||
ERROR: number;
|
||||
level: number;
|
||||
|
||||
methodMap: { [level: number]: string };
|
||||
|
||||
log(level: number, obj: string): void;
|
||||
}
|
||||
|
||||
declare module "handlebars" {
|
||||
export = Handlebars;
|
||||
}
|
||||
|
||||
Vendored
+7
-7
@@ -1011,7 +1011,7 @@ interface HighchartsChartObject {
|
||||
setTitle(title: HighchartsTitleOptions): void;
|
||||
setTitle(title: HighchartsTitleOptions, subtitle: HighchartsSubtitleOptions): void;
|
||||
showLoading(): void;
|
||||
showLoading(str: string);
|
||||
showLoading(str: string): void;
|
||||
xAxis: HighchartsAxisObject[];
|
||||
yAxis: HighchartsAxisObject[];
|
||||
|
||||
@@ -1058,7 +1058,7 @@ interface HighchartsStatic {
|
||||
setOptions(options: HighchartsOptions): HighchartsOptions;
|
||||
getOptions(): HighchartsOptions;
|
||||
|
||||
map(array: any[], any): any[];
|
||||
map(array: any[], fn: Function): any[];
|
||||
}
|
||||
declare var Highcharts: HighchartsStatic;
|
||||
|
||||
@@ -1088,16 +1088,16 @@ interface HighchartsPointObject {
|
||||
}
|
||||
|
||||
interface HighchartsSeriesObject {
|
||||
addPoint(options: any);
|
||||
addPoint(options: any, redraw: boolean, shift: boolean);
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: boolean);
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: HighchartsAnimation);
|
||||
addPoint(options: any): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: boolean): void;
|
||||
addPoint(options: any, redraw: boolean, shift: boolean, animation: HighchartsAnimation): void;
|
||||
chart: HighchartsChartObject;
|
||||
data: HighchartsDataPoint[];
|
||||
hide(): void;
|
||||
options: HighchartsSeriesOptions;
|
||||
remove(): void;
|
||||
remove(redraw: boolean);
|
||||
remove(redraw: boolean): void;
|
||||
name: string;
|
||||
points: HighchartsPointObject[];
|
||||
select(): void;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path="html2canvas.d.ts" />
|
||||
|
||||
var element: HTMLElement;
|
||||
|
||||
html2canvas(element);
|
||||
html2canvas(element, {});
|
||||
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
// Type definitions for html2canvas.js v0.4.1
|
||||
// Project: https://github.com/niklasvh/html2canvas
|
||||
// Definitions by: Richard Hepburn <https://github.com/rwhepburn/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
declare module Html2Canvas {
|
||||
interface Html2CanvasOptions {
|
||||
/** Whether to allow cross-origin images to taint the canvas */
|
||||
allowTaint?: boolean;
|
||||
|
||||
/** Canvas background color, if none is specified in DOM. Set undefined for transparent */
|
||||
background?: string;
|
||||
|
||||
/** Define the heigt of the canvas in pixels. If null, renders with full height of the window. */
|
||||
height?: number;
|
||||
|
||||
/** Whether to render each letter seperately. Necessary if letter-spacing is used. */
|
||||
letterRendering?: boolean;
|
||||
|
||||
/** Whether to log events in the console. */
|
||||
logging?: boolean;
|
||||
|
||||
/** Url to the proxy which is to be used for loading cross-origin images. If left empty, cross-origin images won't be loaded. */
|
||||
proxy?: string;
|
||||
|
||||
/** Whether to test each image if it taints the canvas before drawing them */
|
||||
taintTest?: boolean;
|
||||
|
||||
/** Timeout for loading images, in milliseconds. Setting it to 0 will result in no timeout. */
|
||||
timeout?: number;
|
||||
|
||||
/** Define the width of the canvas in pixels. If null, renders with full width of the window. */
|
||||
width?: number;
|
||||
|
||||
/** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */
|
||||
useCORS?: boolean;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface Html2CanvasStatic {
|
||||
|
||||
/**
|
||||
* Renders an HTML element to a canvas so that a screenshot can be generated.
|
||||
*
|
||||
* The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
|
||||
* but builds the screenshot based on the information available on the page.
|
||||
*
|
||||
* @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
|
||||
*/
|
||||
(element: HTMLElement): void;
|
||||
/**
|
||||
* Renders an HTML element to a canvas so that a screenshot can be generated.
|
||||
*
|
||||
* The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot,
|
||||
* but builds the screenshot based on the information available on the page.
|
||||
*
|
||||
* @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window.
|
||||
* @param {Html2CanvasOptions} options The options object that controls how the element will be rendered.
|
||||
*/
|
||||
(element: HTMLElement, options: Html2Canvas.Html2CanvasOptions): void;
|
||||
}
|
||||
|
||||
declare var html2canvas: Html2CanvasStatic;
|
||||
@@ -410,6 +410,11 @@ function test_animatedSelector() {
|
||||
animateIt();
|
||||
}
|
||||
|
||||
function test_easing() {
|
||||
var result: number = $.easing.linear(3);
|
||||
var result: number = $.easing.swing(3);
|
||||
}
|
||||
|
||||
function test_append() {
|
||||
$('.inner').append('<p>Test</p>');
|
||||
$('.container').append($('h2'));
|
||||
|
||||
Vendored
+8
@@ -348,6 +348,13 @@ interface JQueryEventConstructor {
|
||||
new (name: string, eventProperties?: any): JQueryEventObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* The interface used to specify easing functions.
|
||||
*/
|
||||
interface JQueryEasing {
|
||||
linear(p: number): number;
|
||||
swing(p: number): number;
|
||||
}
|
||||
|
||||
/*
|
||||
Static members of jQuery (those on $ and jQuery themselves)
|
||||
@@ -647,6 +654,7 @@ interface JQueryStatic {
|
||||
|
||||
Animation(elem: any, properties: any, options: any): any;
|
||||
|
||||
easing: JQueryEasing;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+56
-55
@@ -6,7 +6,7 @@
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface JQueryMobileEvent { (event: Event, ui): void; }
|
||||
interface JQueryMobileEvent { (event: Event, ui: any): void; }
|
||||
|
||||
interface DialogOptions {
|
||||
closeBtn?: string;
|
||||
@@ -208,7 +208,7 @@ interface JQueryMobileOptions {
|
||||
ajaxEnabled?: boolean;
|
||||
allowCrossDomainPages?: boolean;
|
||||
autoInitializePage?: boolean;
|
||||
buttonMarkup;
|
||||
buttonMarkup: any;
|
||||
defaultDialogTransition?: string;
|
||||
defaultPageTransition?: string;
|
||||
getMaxScrollForTransition?: number;
|
||||
@@ -227,43 +227,43 @@ interface JQueryMobileOptions {
|
||||
pushStateEnabled?: boolean;
|
||||
subPageUrlKey?: string;
|
||||
touchOverflowEnabled?: boolean;
|
||||
transitionFallbacks;
|
||||
transitionFallbacks: any;
|
||||
}
|
||||
|
||||
interface JQueryMobileEvents {
|
||||
tap;
|
||||
taphold;
|
||||
swipe;
|
||||
swipeleft;
|
||||
swiperight;
|
||||
tap: any;
|
||||
taphold: any;
|
||||
swipe: any;
|
||||
swipeleft: any;
|
||||
swiperight: any;
|
||||
|
||||
vmouseover;
|
||||
vmouseout;
|
||||
vmousedown;
|
||||
vmousemove;
|
||||
vmouseup;
|
||||
vclick;
|
||||
vmousecancel;
|
||||
vmouseover: any;
|
||||
vmouseout: any;
|
||||
vmousedown: any;
|
||||
vmousemove: any;
|
||||
vmouseup: any;
|
||||
vclick: any;
|
||||
vmousecancel: any;
|
||||
|
||||
orientationchange;
|
||||
scrollstart;
|
||||
scrollstop;
|
||||
orientationchange: any;
|
||||
scrollstart: any;
|
||||
scrollstop: any;
|
||||
|
||||
pagebeforeload;
|
||||
pageload;
|
||||
pageloadfailed;
|
||||
pagebeforechange;
|
||||
pagechange;
|
||||
pagechangefailed;
|
||||
pagebeforeshow;
|
||||
pagebeforehide;
|
||||
pageshow;
|
||||
pagehide;
|
||||
pagebeforecreate;
|
||||
pagecreate;
|
||||
pageinit;
|
||||
pageremove;
|
||||
updatelayout;
|
||||
pagebeforeload: any;
|
||||
pageload: any;
|
||||
pageloadfailed: any;
|
||||
pagebeforechange: any;
|
||||
pagechange: any;
|
||||
pagechangefailed: any;
|
||||
pagebeforeshow: any;
|
||||
pagebeforehide: any;
|
||||
pageshow: any;
|
||||
pagehide: any;
|
||||
pagebeforecreate: any;
|
||||
pagecreate: any;
|
||||
pageinit: any;
|
||||
pageremove: any;
|
||||
updatelayout: any;
|
||||
}
|
||||
|
||||
interface ChangePageOptions {
|
||||
@@ -307,37 +307,38 @@ interface JQueryMobile extends JQueryMobileOptions {
|
||||
loadPage(url: any, options?: LoadPageOptions): void;
|
||||
loading(command: string, options?: LoaderOptions): void;
|
||||
|
||||
base;
|
||||
base: any;
|
||||
silentScroll(yPos: number): void;
|
||||
activePage;
|
||||
activePage: JQuery;
|
||||
|
||||
options: JQueryMobileOptions;
|
||||
|
||||
transitionFallbacks;
|
||||
showPageLoadingMsg();
|
||||
hidePageLoadingMsg();
|
||||
loader;
|
||||
page;
|
||||
transitionFallbacks: any;
|
||||
showPageLoadingMsg(): void;
|
||||
hidePageLoadingMsg(): void;
|
||||
loader: any;
|
||||
page: any;
|
||||
|
||||
touchOverflow;
|
||||
showCategory;
|
||||
path;
|
||||
touchOverflow: any;
|
||||
showCategory: any;
|
||||
path: any;
|
||||
|
||||
dialog;
|
||||
popup;
|
||||
fixedtoolbar;
|
||||
button;
|
||||
collapsible;
|
||||
collapsibleset;
|
||||
textinput;
|
||||
slider;
|
||||
checkboxradio;
|
||||
selectmenu;
|
||||
listview;
|
||||
dialog: any;
|
||||
popup: any;
|
||||
fixedtoolbar: any;
|
||||
button: any;
|
||||
collapsible: any;
|
||||
collapsibleset: any;
|
||||
textinput: any;
|
||||
slider: any;
|
||||
checkboxradio: any;
|
||||
selectmenu: any;
|
||||
listview: any;
|
||||
defaultHomeScroll: number;
|
||||
}
|
||||
|
||||
interface JQuerySupport {
|
||||
touchOverflow;
|
||||
touchOverflow: any;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
@@ -56,7 +56,7 @@ function test_computed() {
|
||||
function MyViewModel1() {
|
||||
this.price = ko.observable(25.99);
|
||||
|
||||
this.formattedPrice = ko.computed({
|
||||
this.formattedPrice = ko.computed<string>({
|
||||
read: function () {
|
||||
return '$' + this.price().toFixed(2);
|
||||
},
|
||||
@@ -124,7 +124,7 @@ function test_observableArrays() {
|
||||
myObservableArray.unshift('Some new value');
|
||||
myObservableArray.shift();
|
||||
myObservableArray.reverse();
|
||||
myObservableArray.sort(function (left, right) { return left.lastName == right.lastName ? 0 : (left.lastName < right.lastName ? -1 : 1) });
|
||||
myObservableArray.sort(function (left, right) { return left == right ? 0 : (left < right ? -1 : 1) });
|
||||
myObservableArray.splice(1, 3);
|
||||
|
||||
myObservableArray.remove('Blah');
|
||||
|
||||
Vendored
+27
-12
@@ -1158,7 +1158,7 @@ declare module 'mapsjs' {
|
||||
* @param {renderer} r The renderer delegate function with
|
||||
* signature renderer(quadview).
|
||||
*/
|
||||
setRenderer(r: tile.renderer): void;
|
||||
setRenderer(r: any): void;
|
||||
|
||||
/**
|
||||
* Notifies the tile layer to check for changes to its renderer.
|
||||
@@ -1548,7 +1548,7 @@ declare module 'mapsjs' {
|
||||
* This should be called if the data changes or if, due to extent
|
||||
* changes, the density changes.
|
||||
*/
|
||||
notifyRecompute(): void;
|
||||
notifyRecompute(extents?: envelope): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1753,7 +1753,7 @@ declare module 'mapsjs' {
|
||||
* The bitmap or vector tile requestor using MapDotNet REST services.
|
||||
* @class requestorMDN
|
||||
*/
|
||||
export class requestorMDN extends requestor {
|
||||
export class requestorMDNRest extends requestor {
|
||||
constructor(endpoint: string, options?: {
|
||||
dataFormat?: string;
|
||||
timeoutMs?: number;
|
||||
@@ -2249,7 +2249,22 @@ declare module 'mapsjs' {
|
||||
* @param {number} [durationMs] Duration in miliseconds.
|
||||
* @param {function} [completeAction] Callback to perform on animaton complete.
|
||||
*/
|
||||
setMapCenterToGeolocationAnimate(durationMs?: number, completeAction?: () => void): void;
|
||||
setMapCenterToGeolocationAnimate(durationMs?: number, completeAction?: () => void): void;
|
||||
|
||||
/**
|
||||
* Offsets the current map center by the specified deltas in pixels.
|
||||
* @param {number} [dx] offset x in pixels.
|
||||
* @param {number} [dy] offset y in pixels.
|
||||
*/
|
||||
offsetMapCenterByPixelDelta(dx: number, dy: number): void;
|
||||
|
||||
/**
|
||||
* Offsets the current map center by the specified deltas in pixels - animated version.
|
||||
* @param {number} [dx] offset x in pixels.
|
||||
* @param {number} [dy] offset y in pixels.
|
||||
* @param {number} [durationMs] animation duration in mS.
|
||||
*/
|
||||
offsetMapCenterByPixelDeltaAnimate(dx: number, dy: number, durationMs?: number): void;
|
||||
|
||||
/**
|
||||
* Gets the current zoom level.
|
||||
@@ -2382,15 +2397,15 @@ declare module 'mapsjs' {
|
||||
popTileLayer(): tile.layer;
|
||||
|
||||
/**
|
||||
* Removes a tile layer off the display stack by reference
|
||||
* @param {tile.layer} tl - a tile layer
|
||||
*/
|
||||
removeTileLayer(tl: tile.layer): void;
|
||||
* Removes a tile layer off the display stack by reference
|
||||
* @param {tile.layer} tl A tile layer to remove.
|
||||
*/
|
||||
removeTileLayer(tl: tile.layer): void;
|
||||
|
||||
/**
|
||||
* Removes all tile layers off the display stack
|
||||
*/
|
||||
removeAllTileLayers(): void;
|
||||
/**
|
||||
* Removes all tile layers off the display stack
|
||||
*/
|
||||
removeAllTileLayers(): void;
|
||||
|
||||
/**
|
||||
* Gets the current number of tile layers in the display stack.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
""
|
||||
Vendored
+10
-10
@@ -140,10 +140,10 @@ declare module "ffi" {
|
||||
* accept C callback functions.
|
||||
*/
|
||||
export var Callback: {
|
||||
new (retType, argTypes: any[], abi: number, fn: Function): NodeBuffer;
|
||||
new (retType, argTypes: any[], fn: Function): NodeBuffer;
|
||||
(retType, argTypes: any[], abi: number, fn: Function): NodeBuffer;
|
||||
(retType, argTypes: any[], fn: Function): NodeBuffer;
|
||||
new (retType: any, argTypes: any[], abi: number, fn: Function): NodeBuffer;
|
||||
new (retType: any, argTypes: any[], fn: Function): NodeBuffer;
|
||||
(retType: any, argTypes: any[], abi: number, fn: Function): NodeBuffer;
|
||||
(retType: any, argTypes: any[], fn: Function): NodeBuffer;
|
||||
}
|
||||
|
||||
export var ffiType: {
|
||||
@@ -200,7 +200,7 @@ declare module "ref" {
|
||||
/** To invoke when `ref.get` is invoked on a buffer of this type. */
|
||||
get(buffer: NodeBuffer, offset: number): any;
|
||||
/** To invoke when `ref.set` is invoked on a buffer of this type. */
|
||||
set(buffer: NodeBuffer, offset: number, value): void;
|
||||
set(buffer: NodeBuffer, offset: number, value: any): void;
|
||||
/** The name to use during debugging for this datatype. */
|
||||
name?: string;
|
||||
/** The alignment of this datatype when placed inside a struct. */
|
||||
@@ -214,9 +214,9 @@ declare module "ref" {
|
||||
/** Get the memory address of buffer. */
|
||||
export function address(buffer: NodeBuffer): number;
|
||||
/** Allocate the memory with the given value written to it. */
|
||||
export function alloc(type: Type, value?): NodeBuffer;
|
||||
export function alloc(type: Type, value?: any): NodeBuffer;
|
||||
/** Allocate the memory with the given value written to it. */
|
||||
export function alloc(type: string, value?): NodeBuffer;
|
||||
export function alloc(type: string, value?: any): NodeBuffer;
|
||||
|
||||
/**
|
||||
* Allocate the memory with the given string written to it with the given
|
||||
@@ -310,9 +310,9 @@ declare module "ref" {
|
||||
offset?: number): NodeBuffer;
|
||||
|
||||
/** Write pointer if the indirection is 1, otherwise write value. */
|
||||
export function set(buffer: NodeBuffer, offset: number, value, type?: Type): void;
|
||||
export function set(buffer: NodeBuffer, offset: number, value: any, type?: Type): void;
|
||||
/** Write pointer if the indirection is 1, otherwise write value. */
|
||||
export function set(buffer: NodeBuffer, offset: number, value, type?: string): void;
|
||||
export function set(buffer: NodeBuffer, offset: number, value: any, type?: string): void;
|
||||
/** Write the string as a NULL terminated. Default encoding is utf8. */
|
||||
export function writeCString(buffer: NodeBuffer, offset: number,
|
||||
string: string, encoding?: string): void;
|
||||
@@ -347,7 +347,7 @@ declare module "ref" {
|
||||
* Attach object to buffer such.
|
||||
* It prevents object from being garbage collected until buffer does.
|
||||
*/
|
||||
export function _attach(buffer: NodeBuffer, object: Object);
|
||||
export function _attach(buffer: NodeBuffer, object: Object): void;
|
||||
|
||||
/** Same as ref.reinterpret, except that this version does not attach buffer. */
|
||||
export function _reinterpret(buffer: NodeBuffer, size: number,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
""
|
||||
Vendored
+52
-45
@@ -67,6 +67,13 @@ declare var Buffer: {
|
||||
* *
|
||||
************************************************/
|
||||
|
||||
interface ErrnoException extends Error {
|
||||
errno?: any;
|
||||
code?: string;
|
||||
path?: string;
|
||||
syscall?: string;
|
||||
}
|
||||
|
||||
interface EventEmitter {
|
||||
addListener(event: string, listener: Function): EventEmitter;
|
||||
on(event: string, listener: Function): EventEmitter;
|
||||
@@ -746,87 +753,87 @@ declare module "fs" {
|
||||
export interface ReadStream extends stream.ReadableStream { }
|
||||
export interface WriteStream extends stream.WritableStream { }
|
||||
|
||||
export function rename(oldPath: string, newPath: string, callback?: Function): void;
|
||||
export function rename(oldPath: string, newPath: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function renameSync(oldPath: string, newPath: string): void;
|
||||
export function truncate(path: string, callback?: Function): void;
|
||||
export function truncate(path: string, len: number, callback?: Function): void;
|
||||
export function truncate(path: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function truncate(path: string, len: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function truncateSync(path: string, len?: number): void;
|
||||
export function ftruncate(fd: number, callback?: Function): void;
|
||||
export function ftruncate(fd: number, len: number, callback?: Function): void;
|
||||
export function ftruncate(fd: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function ftruncate(fd: number, len: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function ftruncateSync(fd: number, len?: number): void;
|
||||
export function chown(path: string, uid: number, gid: number, callback?: Function): void;
|
||||
export function chown(path: string, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function chownSync(path: string, uid: number, gid: number): void;
|
||||
export function fchown(fd: number, uid: number, gid: number, callback?: Function): void;
|
||||
export function fchown(fd: number, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function fchownSync(fd: number, uid: number, gid: number): void;
|
||||
export function lchown(path: string, uid: number, gid: number, callback?: Function): void;
|
||||
export function lchown(path: string, uid: number, gid: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function lchownSync(path: string, uid: number, gid: number): void;
|
||||
export function chmod(path: string, mode: number, callback?: Function): void;
|
||||
export function chmod(path: string, mode: string, callback?: Function): void;
|
||||
export function chmod(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function chmod(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function chmodSync(path: string, mode: number): void;
|
||||
export function chmodSync(path: string, mode: string): void;
|
||||
export function fchmod(fd: number, mode: number, callback?: Function): void;
|
||||
export function fchmod(fd: number, mode: string, callback?: Function): void;
|
||||
export function fchmod(fd: number, mode: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function fchmod(fd: number, mode: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function fchmodSync(fd: number, mode: number): void;
|
||||
export function fchmodSync(fd: number, mode: string): void;
|
||||
export function lchmod(path: string, mode: number, callback?: Function): void;
|
||||
export function lchmod(path: string, mode: string, callback?: Function): void;
|
||||
export function lchmod(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function lchmod(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function lchmodSync(path: string, mode: number): void;
|
||||
export function lchmodSync(path: string, mode: string): void;
|
||||
export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function stat(path: string, callback?: (err: ErrnoException, stats: Stats) => any): void;
|
||||
export function lstat(path: string, callback?: (err: ErrnoException, stats: Stats) => any): void;
|
||||
export function fstat(fd: number, callback?: (err: ErrnoException, stats: Stats) => any): void;
|
||||
export function statSync(path: string): Stats;
|
||||
export function lstatSync(path: string): Stats;
|
||||
export function fstatSync(fd: number): Stats;
|
||||
export function link(srcpath: string, dstpath: string, callback?: Function): void;
|
||||
export function link(srcpath: string, dstpath: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function linkSync(srcpath: string, dstpath: string): void;
|
||||
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void;
|
||||
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
|
||||
export function readlink(path: string, callback?: (err: Error, linkString: string) => any): void;
|
||||
export function readlink(path: string, callback?: (err: ErrnoException, linkString: string) => any): void;
|
||||
export function readlinkSync(path: string): string;
|
||||
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => any): void;
|
||||
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: Error, resolvedPath: string) =>any): void;
|
||||
export function realpath(path: string, callback?: (err: ErrnoException, resolvedPath: string) => any): void;
|
||||
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: ErrnoException, resolvedPath: string) =>any): void;
|
||||
export function realpathSync(path: string, cache?: {[path: string]: string}): void;
|
||||
export function unlink(path: string, callback?: Function): void;
|
||||
export function unlink(path: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function unlinkSync(path: string): void;
|
||||
export function rmdir(path: string, callback?: Function): void;
|
||||
export function rmdir(path: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function rmdirSync(path: string): void;
|
||||
export function mkdir(path: string, callback?: Function): void;
|
||||
export function mkdir(path: string, mode: number, callback?: Function): void;
|
||||
export function mkdir(path: string, mode: string, callback?: Function): void;
|
||||
export function mkdir(path: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function mkdir(path: string, mode: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function mkdir(path: string, mode: string, callback?: (err?: ErrnoException) => void): void;
|
||||
export function mkdirSync(path: string, mode?: number): void;
|
||||
export function mkdirSync(path: string, mode?: string): void;
|
||||
export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void;
|
||||
export function readdir(path: string, callback?: (err: ErrnoException, files: string[]) => void): void;
|
||||
export function readdirSync(path: string): string[];
|
||||
export function close(fd: number, callback?: Function): void;
|
||||
export function close(fd: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function closeSync(fd: number): void;
|
||||
export function open(path: string, flags: string, callback?: (err: Error, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, callback?: (err: ErrnoException, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: number, callback?: (err: ErrnoException, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: string, callback?: (err: ErrnoException, fd: number) => any): void;
|
||||
export function openSync(path: string, flags: string, mode?: number): number;
|
||||
export function openSync(path: string, flags: string, mode?: string): number;
|
||||
export function utimes(path: string, atime: number, mtime: number, callback?: Function): void;
|
||||
export function utimes(path: string, atime: number, mtime: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function utimesSync(path: string, atime: number, mtime: number): void;
|
||||
export function futimes(fd: number, atime: number, mtime: number, callback?: Function): void;
|
||||
export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function futimesSync(fd: number, atime: number, mtime: number): void;
|
||||
export function fsync(fd: number, callback?: Function): void;
|
||||
export function fsync(fd: number, callback?: (err?: ErrnoException) => void): void;
|
||||
export function fsyncSync(fd: number): void;
|
||||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
|
||||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: ErrnoException, written: number, buffer: NodeBuffer) => void): void;
|
||||
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: ErrnoException, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void;
|
||||
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
|
||||
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: ErrnoException, data: any) => void): void;
|
||||
export function readFile(filename: string, callback: (err: ErrnoException, data: NodeBuffer) => void ): void;
|
||||
export function readFileSync(filename: string, options?: { flag?: string; }): NodeBuffer;
|
||||
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
|
||||
export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
|
||||
export function writeFile(filename: string, data: any, callback?: (err: ErrnoException) => void): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: ErrnoException) => void): void;
|
||||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: ErrnoException) => void): void;
|
||||
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
|
||||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
|
||||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
|
||||
export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: ErrnoException) => void): void;
|
||||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: ErrnoException) => void): void;
|
||||
export function appendFile(filename: string, data: any, callback?: (err: ErrnoException) => void): void;
|
||||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
|
||||
export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
|
||||
|
||||
Vendored
+58
-58
@@ -175,13 +175,13 @@ interface QUnitAssert {
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
deepEqual(actual: any, expected: any, message?: string);
|
||||
deepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
|
||||
*
|
||||
* The equal assertion uses the simple comparison operator (==) to compare the actual
|
||||
* and expected arguments. When they are equal, the assertion passes; otherwise, it fails.
|
||||
* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
|
||||
* When it fails, both actual and expected values are displayed in the test result,
|
||||
* in addition to a given message.
|
||||
*
|
||||
@@ -189,7 +189,7 @@ interface QUnitAssert {
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
equal(actual: any, expected: any, message?: string);
|
||||
equal(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* An inverted deep recursive comparison assertion, working on primitive types,
|
||||
@@ -203,13 +203,13 @@ interface QUnitAssert {
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notDeepEqual(actual: any, expected: any, message?: string);
|
||||
notDeepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notEqual assertion uses the simple inverted comparison operator (!=) to compare
|
||||
* the actual and expected arguments. When they aren't equal, the assertion passes;
|
||||
* the actual and expected arguments. When they aren't equal, the assertion passes: any;
|
||||
* otherwise, it fails. When it fails, both actual and expected values are displayed
|
||||
* in the test result, in addition to a given message.
|
||||
*
|
||||
@@ -217,25 +217,25 @@ interface QUnitAssert {
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notEqual(actual: any, expected: any, message?: string);
|
||||
notEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
notPropEqual(actual: any, expected: any, message?: string);
|
||||
notPropEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
propEqual(actual: any, expected: any, message?: string);
|
||||
propEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notStrictEqual assertion uses the strict inverted comparison operator (!==)
|
||||
* to compare the actual and expected arguments. When they aren't equal, the assertion
|
||||
* passes; otherwise, it fails. When it fails, both actual and expected values are
|
||||
* passes: any; otherwise, it fails. When it fails, both actual and expected values are
|
||||
* displayed in the test result, in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notStrictEqual(actual: any, expected: any, message?: string);
|
||||
notStrictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
|
||||
@@ -248,7 +248,7 @@ interface QUnitAssert {
|
||||
* @param state Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
ok(state: any, message?: string);
|
||||
ok(state: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A strict type and value comparison assertion.
|
||||
@@ -260,7 +260,7 @@ interface QUnitAssert {
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
strictEqual(actual: any, expected: any, message?: string);
|
||||
strictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* Assertion to test if a callback throws an exception when run.
|
||||
@@ -272,13 +272,13 @@ interface QUnitAssert {
|
||||
* @param expected Error Object to compare
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
throws(block: () => any, expected: any, message?: string);
|
||||
throws(block: () => any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* @param block Function to execute
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
throws(block: () => any, message?: string);
|
||||
throws(block: () => any, message?: string): any;
|
||||
}
|
||||
|
||||
interface QUnitStatic extends QUnitAssert{
|
||||
@@ -291,7 +291,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
|
||||
*/
|
||||
start(decrement?: number);
|
||||
start(decrement?: number): any;
|
||||
|
||||
/**
|
||||
* Stop the testrunner to wait for async tests to run. Call start() to continue.
|
||||
@@ -302,7 +302,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
|
||||
*/
|
||||
stop(increment? : number);
|
||||
stop(increment? : number): any;
|
||||
|
||||
/* CALLBACKS */
|
||||
|
||||
@@ -314,14 +314,14 @@ interface QUnitStatic extends QUnitAssert{
|
||||
*
|
||||
* @param callback Callback to execute
|
||||
*/
|
||||
begin(callback: () => any);
|
||||
begin(callback: () => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
done(callback: (details: DoneCallbackObject) => any);
|
||||
done(callback: (details: DoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever an assertion completes.
|
||||
@@ -331,35 +331,35 @@ interface QUnitStatic extends QUnitAssert{
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
log(callback: (details: LogCallbackObject) => any);
|
||||
log(callback: (details: LogCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
moduleDone(callback: (details: ModuleDoneCallbackObject) => any);
|
||||
moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
moduleStart(callback: (details: ModuleStartCallbackObject) => any);
|
||||
moduleStart(callback: (details: ModuleStartCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
testDone(callback: (details: TestDoneCallbackObject) => any);
|
||||
testDone(callback: (details: TestDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
testStart(callback: (details: TestStartCallbackObject) => any);
|
||||
testStart(callback: (details: TestStartCallbackObject) => any): any;
|
||||
|
||||
/* CONFIGURATION */
|
||||
|
||||
@@ -381,7 +381,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
asyncTest(name: string, expected: number, test: () => any);
|
||||
asyncTest(name: string, expected: number, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
@@ -392,7 +392,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
* @param name Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
asyncTest(name: string, test: () => any);
|
||||
asyncTest(name: string, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Specify how many assertions are expected to run within a test.
|
||||
@@ -403,7 +403,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
*
|
||||
* @param amount Number of assertions in this test.
|
||||
*/
|
||||
expect(amount: number);
|
||||
expect(amount: number): any;
|
||||
|
||||
/**
|
||||
* Group related tests under a single label.
|
||||
@@ -415,7 +415,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
* @param name Label for this group of tests
|
||||
* @param lifecycle Callbacks to run before and after each test
|
||||
*/
|
||||
module(name: string, lifecycle?: LifecycleObject);
|
||||
module(name: string, lifecycle?: LifecycleObject): any;
|
||||
|
||||
/**
|
||||
* Add a test to run.
|
||||
@@ -429,18 +429,18 @@ interface QUnitStatic extends QUnitAssert{
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
test(title: string, expected: number, test: (assert: QUnitAssert) => any);
|
||||
test(title: string, expected: number, test: (assert: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* @param title Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
test(title: string, test: (assert: QUnitAssert) => any);
|
||||
test(title: string, test: (assert: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
|
||||
*/
|
||||
equiv(a: any, b: any);
|
||||
equiv(a: any, b: any): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
|
||||
raises: any;
|
||||
@@ -448,7 +448,7 @@ interface QUnitStatic extends QUnitAssert{
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L897
|
||||
*/
|
||||
push(result, actual, expected, message): any;
|
||||
push(result: any, actual: any, expected: any, message: string): any;
|
||||
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L839
|
||||
@@ -470,13 +470,13 @@ interface QUnitStatic extends QUnitAssert{
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function deepEqual(actual: any, expected: any, message?: string);
|
||||
declare function deepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
|
||||
*
|
||||
* The equal assertion uses the simple comparison operator (==) to compare the actual
|
||||
* and expected arguments. When they are equal, the assertion passes; otherwise, it fails.
|
||||
* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
|
||||
* When it fails, both actual and expected values are displayed in the test result,
|
||||
* in addition to a given message.
|
||||
*
|
||||
@@ -484,7 +484,7 @@ declare function deepEqual(actual: any, expected: any, message?: string);
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function equal(actual: any, expected: any, message?: string);
|
||||
declare function equal(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* An inverted deep recursive comparison assertion, working on primitive types,
|
||||
@@ -498,7 +498,7 @@ declare function equal(actual: any, expected: any, message?: string);
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notDeepEqual(actual: any, expected: any, message?: string);
|
||||
declare function notDeepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
@@ -512,7 +512,7 @@ declare function notDeepEqual(actual: any, expected: any, message?: string);
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notEqual(actual: any, expected: any, message?: string);
|
||||
declare function notEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
@@ -526,7 +526,7 @@ declare function notEqual(actual: any, expected: any, message?: string);
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notStrictEqual(actual: any, expected: any, message?: string);
|
||||
declare function notStrictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
|
||||
@@ -539,7 +539,7 @@ declare function notStrictEqual(actual: any, expected: any, message?: string);
|
||||
* @param state Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function ok(state: any, message?: string);
|
||||
declare function ok(state: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A strict type and value comparison assertion.
|
||||
@@ -551,7 +551,7 @@ declare function ok(state: any, message?: string);
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function strictEqual(actual: any, expected: any, message?: string);
|
||||
declare function strictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* Assertion to test if a callback throws an exception when run.
|
||||
@@ -563,13 +563,13 @@ declare function strictEqual(actual: any, expected: any, message?: string);
|
||||
* @param expected Error Object to compare
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function throws(block: () => any, expected: any, message?: string);
|
||||
declare function throws(block: () => any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* @param block Function to execute
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function throws(block: () => any, message?: string);
|
||||
declare function throws(block: () => any, message?: string): any;
|
||||
|
||||
/* ASYNC CONTROL */
|
||||
|
||||
@@ -580,7 +580,7 @@ declare function throws(block: () => any, message?: string);
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
|
||||
*/
|
||||
declare function start(decrement?: number);
|
||||
declare function start(decrement?: number): any;
|
||||
|
||||
/**
|
||||
* Stop the testrunner to wait for async tests to run. Call start() to continue.
|
||||
@@ -591,7 +591,7 @@ declare function start(decrement?: number);
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
|
||||
*/
|
||||
declare function stop(increment? : number);
|
||||
declare function stop(increment? : number): any;
|
||||
|
||||
/* CALLBACKS */
|
||||
|
||||
@@ -603,14 +603,14 @@ declare function stop(increment? : number);
|
||||
*
|
||||
* @param callback Callback to execute
|
||||
*/
|
||||
declare function begin(callback: () => any);
|
||||
declare function begin(callback: () => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function done(callback: (details: DoneCallbackObject) => any);
|
||||
declare function done(callback: (details: DoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever an assertion completes.
|
||||
@@ -620,35 +620,35 @@ declare function done(callback: (details: DoneCallbackObject) => any);
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function log(callback: (details: LogCallbackObject) => any);
|
||||
declare function log(callback: (details: LogCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any);
|
||||
declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function moduleStart(callback: (name: string) => any);
|
||||
declare function moduleStart(callback: (name: string) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function testDone(callback: (details: TestDoneCallbackObject) => any);
|
||||
declare function testDone(callback: (details: TestDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function testStart(callback: (details: TestStartCallbackObject) => any);
|
||||
declare function testStart(callback: (details: TestStartCallbackObject) => any): any;
|
||||
|
||||
/* TEST */
|
||||
|
||||
@@ -662,7 +662,7 @@ declare function testStart(callback: (details: TestStartCallbackObject) => any);
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function asyncTest(name: string, expected?: any, test?: () => any);
|
||||
declare function asyncTest(name: string, expected?: any, test?: () => any): any;
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
@@ -673,7 +673,7 @@ declare function asyncTest(name: string, expected?: any, test?: () => any);
|
||||
* @param name Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function asyncTest(name: string, test: () => any);
|
||||
declare function asyncTest(name: string, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Specify how many assertions are expected to run within a test.
|
||||
@@ -684,7 +684,7 @@ declare function asyncTest(name: string, test: () => any);
|
||||
*
|
||||
* @param amount Number of assertions in this test.
|
||||
*/
|
||||
declare function expect(amount: number);
|
||||
declare function expect(amount: number): any;
|
||||
|
||||
// ** conflict with TypeScript module keyword. Must be used on QUnit namespace
|
||||
//declare var module: (name: string, lifecycle?: LifecycleObject) => any;
|
||||
@@ -701,20 +701,20 @@ declare function expect(amount: number);
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any);
|
||||
declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* @param title Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function test(title: string, test: (assert?: QUnitAssert) => any);
|
||||
declare function test(title: string, test: (assert?: QUnitAssert) => any): any;
|
||||
|
||||
declare function notPropEqual(actual: any, expected: any, message?: string);
|
||||
declare function notPropEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
declare function propEqual(actual: any, expected: any, message?: string);
|
||||
declare function propEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
|
||||
declare function equiv(a: any, b: any);
|
||||
declare function equiv(a: any, b: any): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
|
||||
declare var raises: any;
|
||||
|
||||
Vendored
+2
-2
@@ -290,7 +290,7 @@ interface RequireDefine {
|
||||
* callback param deps module dependencies
|
||||
* callback return module definition
|
||||
**/
|
||||
(deps: string[], ready: (...deps: any[]) => any): void;
|
||||
(deps: string[], ready: Function): void;
|
||||
|
||||
/**
|
||||
* Define module with simplified CommonJS wrapper.
|
||||
@@ -310,7 +310,7 @@ interface RequireDefine {
|
||||
* callback deps module dependencies
|
||||
* callback return module definition
|
||||
**/
|
||||
(name: string, deps: string[], ready: (...deps: any[]) => any): void;
|
||||
(name: string, deps: string[], ready: Function): void;
|
||||
}
|
||||
|
||||
// Ambient declarations for 'require' and 'define'
|
||||
|
||||
Vendored
+26
-20
@@ -43,11 +43,12 @@ interface Response {
|
||||
|
||||
interface Server {
|
||||
use: (... handler: any[]) => any;
|
||||
post: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
|
||||
put: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
|
||||
del: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
|
||||
get: (route: any, routeCallBack: (req: Request, res: Response, next: Function ) => any) => any;
|
||||
head: (route: any, routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
|
||||
post: (route: any, routeCallBack: RequestHadler) => any;
|
||||
patch: (route: any, routeCallBack: RequestHadler) => any;
|
||||
put: (route: any, routeCallBack: RequestHadler) => any;
|
||||
del: (route: any, routeCallBack: RequestHadler) => any;
|
||||
get: (route: any, routeCallBack: RequestHadler) => any;
|
||||
head: (route: any, routeCallBack: RequestHadler) => any;
|
||||
on: (event: string, callback: Function) => any;
|
||||
name: string;
|
||||
version: string;
|
||||
@@ -57,7 +58,7 @@ interface Server {
|
||||
address: () => addressInterface;
|
||||
listen: (... args: any[]) => any;
|
||||
close: (... args: any[]) => any;
|
||||
pre: (routeCallBack: (req: Request, res: Response, next: Function) => any) => any;
|
||||
pre: (routeCallBack: RequestHadler) => any;
|
||||
|
||||
}
|
||||
|
||||
@@ -115,13 +116,17 @@ interface ThrottleOptions {
|
||||
overrides?: Object;
|
||||
}
|
||||
|
||||
interface RequestHadler {
|
||||
(req: Request, res: Response, next: Function): any;
|
||||
}
|
||||
|
||||
declare module "restify" {
|
||||
export function createServer(options?: ServerOptions): Server;
|
||||
|
||||
export function createJsonClient(options?: ClientOptions): Client;
|
||||
export function createStringClient(options?: ClientOptions): Client;
|
||||
export function createClient(options?: ClientOptions): HttpClient;
|
||||
|
||||
|
||||
export class ConflictError { constructor(message?: any); }
|
||||
export class InvalidArguementError { constructor(message?: any); }
|
||||
export class RestError { constructor(message?: any); }
|
||||
@@ -140,18 +145,19 @@ declare module "restify" {
|
||||
export class ResourceNotFoundError { constructor(message: any); }
|
||||
export class WrongAcceptError { constructor(message: any); }
|
||||
|
||||
export function acceptParser(parser: any);
|
||||
export function authorizationParser();
|
||||
export function dateParser(skew?: number);
|
||||
export function queryParser(options?: Object);
|
||||
export function urlEncodedBodyParser(options?: Object);
|
||||
export function jsonp(options?: Object);
|
||||
export function gzipResponse(options?: Object);
|
||||
export function bodyParser(options?: Object);
|
||||
export function requestLogger(options?: Object);
|
||||
export function serveStatic(options?: Object);
|
||||
export function throttle(options?: ThrottleOptions);
|
||||
export function conditionalRequest(options?: Object);
|
||||
export function auditLogger(options?: Object);
|
||||
export function acceptParser(parser: any): RequestHadler;
|
||||
export function authorizationParser(): RequestHadler;
|
||||
export function dateParser(skew?: number): RequestHadler;
|
||||
export function queryParser(options?: Object): RequestHadler;
|
||||
export function urlEncodedBodyParser(options?: Object): RequestHadler[];
|
||||
export function jsonp(): RequestHadler;
|
||||
export function gzipResponse(options?: Object): RequestHadler;
|
||||
export function bodyParser(options?: Object): RequestHadler[];
|
||||
export function requestLogger(options?: Object): RequestHadler;
|
||||
export function serveStatic(options?: Object): RequestHadler;
|
||||
export function throttle(options?: ThrottleOptions): RequestHadler;
|
||||
export function conditionalRequest(): RequestHadler[];
|
||||
export function auditLogger(options?: Object): Function;
|
||||
export function fullResponse(): RequestHadler;
|
||||
export var defaultResponseHeaders : any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user