mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge branch 'master' into fix-react-datepicker-props
This commit is contained in:
commit
c54cc2ea4e
1
3d-bin-packing/index.d.ts
vendored
1
3d-bin-packing/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/betterwaysystems/packer
|
||||
// Definitions by: Jeongho Nam <http://samchon.org>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="typescript-stl" />
|
||||
/// <reference types="samchon-framework" />
|
||||
|
||||
@ -1680,7 +1680,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](swig-email-templates/swig-email-templates.d.ts) [swig-email-templates](https://github.com/andrewrk/swig-email-templates) by [Adam Babcock](https://github.com/mrhen)
|
||||
* [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002)
|
||||
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
|
||||
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano), [Luca Trazzi](https://github.com/lucax88x)
|
||||
* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder), [Clayton Lautier](https://github.com/claylaut)
|
||||
* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
- [ ] I tried using the latest `xxxx/xxxx.d.ts` file in this repo and had problems.
|
||||
- [ ] I tried using the `@types/xxxx` package and had problems.
|
||||
- [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
|
||||
- [ ] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/). (Please ask any appropriate questions there).
|
||||
- [ ] I want to talk about `xxxx/xxxx.d.ts`.
|
||||
- The authors of that type definition are cc/ @....
|
||||
- [ ] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see `Definitions by:` in `index.d.ts`) so they can respond.
|
||||
- Authors: @....
|
||||
|
||||
32
README.md
32
README.md
@ -224,6 +224,38 @@ If the standard is still a draft, it belongs here.
|
||||
Use a name beginning with `dom-` and include a link to the standard as the "Project" link in the header.
|
||||
When it graduates draft mode, we may remove it from DefinitelyTyped and deprecate the associated `@types` package.
|
||||
|
||||
#### I want to update a package to a new major version
|
||||
|
||||
Before making your change, please create a new subfolder with the current version e.g. `v2`, and copy existing files to it. You will need to:
|
||||
|
||||
1. Update the relative paths in `tsconfig.json` as well as `tslint.json`.
|
||||
2. Add path mapping rules to ensure that tests are running against the intended version.
|
||||
|
||||
For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/history/v2/tsconfig.json) looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": ["../../"],
|
||||
"paths": {
|
||||
"history": [ "history/v2" ]
|
||||
},
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"history-tests.ts"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Please note that unless upgrading something backwards-compatible like `node`, all packages depending of the updated package need a path mapping to it, as well as packages depending on *those*.
|
||||
For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`;
|
||||
transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router-bootstrap/tsconfig.json).
|
||||
|
||||
Also, `/// <reference types=".." />` will not work with path mapping, so dependencies must use `import`.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT license.
|
||||
|
||||
1
alt/index.d.ts
vendored
1
alt/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/goatslacker/alt
|
||||
// Definitions by: Michael Shearer <https://github.com/Shearerbeard>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
///<reference types="react"/>
|
||||
|
||||
|
||||
8
angular-gridster/index.d.ts
vendored
8
angular-gridster/index.d.ts
vendored
@ -32,7 +32,7 @@ declare module "angular" {
|
||||
// width of grid columns. "auto" will divide the width of the grid evenly among the columns
|
||||
colWidth?: string;
|
||||
|
||||
// height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels,
|
||||
// height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels,
|
||||
// '/2' is half the column width, '*5' is five times the column width, etc.
|
||||
rowHeight?: string;
|
||||
|
||||
@ -84,7 +84,7 @@ declare module "angular" {
|
||||
// options to pass to resizable handler
|
||||
resizable?: {
|
||||
|
||||
// whether the items are resizable
|
||||
// whether the items are resizable
|
||||
enabled?: boolean;
|
||||
|
||||
// location of the resize handles
|
||||
@ -104,7 +104,7 @@ declare module "angular" {
|
||||
// options to pass to draggable handler
|
||||
draggable?: {
|
||||
|
||||
// whether the items are resizable
|
||||
// whether the items are resizable
|
||||
enabled?: boolean;
|
||||
|
||||
// Distance in pixels from the edge of the viewport after which the viewport should scroll, relative to pointer
|
||||
@ -142,4 +142,4 @@ declare module "angular" {
|
||||
col: number;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ testApp.config((
|
||||
$buttonConfig: ng.ui.bootstrap.IButtonConfig,
|
||||
$datepickerConfig: ng.ui.bootstrap.IDatepickerConfig,
|
||||
$datepickerPopupConfig: ng.ui.bootstrap.IDatepickerPopupConfig,
|
||||
$dropdownConfig: ng.ui.bootstrap.IDropdownConfig,
|
||||
$modalProvider: ng.ui.bootstrap.IModalProvider,
|
||||
$paginationConfig: ng.ui.bootstrap.IPaginationConfig,
|
||||
$pagerConfig: ng.ui.bootstrap.IPagerConfig,
|
||||
@ -47,13 +48,18 @@ testApp.config((
|
||||
$datepickerConfig.showWeeks = false;
|
||||
$datepickerConfig.startingDay = 1;
|
||||
$datepickerConfig.yearRange = 10;
|
||||
|
||||
|
||||
$datepickerConfig.monthColumns = 3;
|
||||
$datepickerConfig.yearColumns = 9;
|
||||
$datepickerConfig.yearRows = 6;
|
||||
$datepickerConfig.ngModelOptions.allowInvalid = false;
|
||||
$datepickerConfig.ngModelOptions.timezone = "EST";
|
||||
$datepickerConfig.ngModelOptions.updateOn = "click";
|
||||
|
||||
|
||||
/**
|
||||
* $datepickerPopupConfig tests
|
||||
*/
|
||||
$datepickerPopupConfig.altInputFormats = ["mm/dd/YYYY", "mm-dd-YY"];
|
||||
$datepickerPopupConfig.appendToBody = true;
|
||||
$datepickerPopupConfig.currentText = 'Select Today';
|
||||
$datepickerPopupConfig.clearText = 'Reset Selection';
|
||||
@ -63,8 +69,18 @@ testApp.config((
|
||||
$datepickerPopupConfig.datepickerPopupTemplateUrl = 'template.html';
|
||||
$datepickerPopupConfig.datepickerTemplateUrl = 'template.html';
|
||||
$datepickerPopupConfig.html5Types.date = 'MM-dd-yyyy';
|
||||
$datepickerPopupConfig.html5Types['datetime-local'] = 'yyyy-MM-ddTHH:mm:ss.sss';
|
||||
$datepickerPopupConfig.html5Types.month = 'yyyy-MM';
|
||||
$datepickerPopupConfig.onOpenFocus = false;
|
||||
$datepickerPopupConfig.showButtonBar = false;
|
||||
$datepickerPopupConfig.placement = "auto bottom left";
|
||||
|
||||
|
||||
/**
|
||||
* $dropdownConfig tests
|
||||
*/
|
||||
$dropdownConfig.appendToOpenClass = "some-thing";
|
||||
$dropdownConfig.openClass = "show";
|
||||
|
||||
|
||||
/**
|
||||
@ -77,6 +93,7 @@ testApp.config((
|
||||
* $paginationConfig tests
|
||||
*/
|
||||
$paginationConfig.boundaryLinks = true;
|
||||
$paginationConfig.boundaryLinkNumbers = true;
|
||||
$paginationConfig.directionLinks = false;
|
||||
$paginationConfig.firstText = 'First Page';
|
||||
$paginationConfig.itemsPerPage = 25;
|
||||
@ -88,6 +105,7 @@ testApp.config((
|
||||
$paginationConfig.rotate = false;
|
||||
$paginationConfig.templateUrl = 'template.html';
|
||||
$paginationConfig.totalItems = 13;
|
||||
$paginationConfig.forceEllipses = true;
|
||||
|
||||
|
||||
/**
|
||||
@ -121,11 +139,14 @@ testApp.config((
|
||||
$timepickerConfig.hourStep = 2;
|
||||
$timepickerConfig.meridians = ['-AM-', '-PM-'];
|
||||
$timepickerConfig.minuteStep = 5;
|
||||
$timepickerConfig.secondStep = 5;
|
||||
$timepickerConfig.mousewheel = false;
|
||||
$timepickerConfig.readonlyInput = true;
|
||||
$timepickerConfig.showMeridian = false;
|
||||
$timepickerConfig.arrowkeys = false;
|
||||
$timepickerConfig.showSpinners = false;
|
||||
$timepickerConfig.showSeconds = true;
|
||||
$timepickerConfig.templateUrl = "template.html";
|
||||
|
||||
/**
|
||||
* $tooltipProvider tests
|
||||
|
||||
95
angular-ui-bootstrap/index.d.ts
vendored
95
angular-ui-bootstrap/index.d.ts
vendored
@ -11,6 +11,7 @@ export type IAccordionConfig = angular.ui.bootstrap.IAccordionConfig;
|
||||
export type IButtonConfig = angular.ui.bootstrap.IButtonConfig;
|
||||
export type IDatepickerConfig = angular.ui.bootstrap.IDatepickerConfig;
|
||||
export type IDatepickerPopupConfig = angular.ui.bootstrap.IDatepickerPopupConfig;
|
||||
export type IDropdownConfig = angular.ui.bootstrap.IDropdownConfig;
|
||||
export type IModalProvider = angular.ui.bootstrap.IModalProvider;
|
||||
export type IModalService = angular.ui.bootstrap.IModalService;
|
||||
export type IModalServiceInstance = angular.ui.bootstrap.IModalServiceInstance;
|
||||
@ -54,6 +55,11 @@ declare module 'angular' {
|
||||
toggleEvent?: string;
|
||||
}
|
||||
|
||||
interface IDropdownConfigNgOptions extends angular.INgModelOptions {
|
||||
allowInvalid?: boolean;
|
||||
timezone?: string;
|
||||
}
|
||||
|
||||
interface IDatepickerConfig {
|
||||
/**
|
||||
* Format of day in month.
|
||||
@ -166,9 +172,45 @@ declare module 'angular' {
|
||||
* @default false
|
||||
*/
|
||||
shortcutPropagation?: boolean;
|
||||
|
||||
/**
|
||||
* The number of columns displayed in month selection.
|
||||
*
|
||||
* @default 3
|
||||
*/
|
||||
monthColumns?: number;
|
||||
|
||||
/**
|
||||
* The number of columns displayed in year selection.
|
||||
*
|
||||
* @default 5
|
||||
*/
|
||||
yearColumns?: number;
|
||||
|
||||
/**
|
||||
* The number of rows displayed in year selection
|
||||
*
|
||||
* @default 4
|
||||
*/
|
||||
yearRows?: number;
|
||||
|
||||
/**
|
||||
* All supported angular ngModelOptions plus some
|
||||
*
|
||||
* @default {}
|
||||
*/
|
||||
ngModelOptions?: IDropdownConfigNgOptions
|
||||
}
|
||||
|
||||
interface IDatepickerPopupConfig {
|
||||
|
||||
/**
|
||||
* A list of alternate formats acceptable for manual entry.
|
||||
*
|
||||
* @default []
|
||||
*/
|
||||
altInputFormats?: string[];
|
||||
|
||||
/**
|
||||
* The format for displayed dates.
|
||||
*
|
||||
@ -247,8 +289,26 @@ declare module 'angular' {
|
||||
* @default true
|
||||
*/
|
||||
onOpenFocus?: boolean;
|
||||
|
||||
/**
|
||||
* Passing in 'auto' separated by a space before the placement will enable auto positioning, e.g: "auto bottom-left". The popup will attempt to position where it fits in the closest scrollable ancestor.
|
||||
*
|
||||
* @default 'auto bottom-left'
|
||||
*/
|
||||
placement?: string;
|
||||
}
|
||||
|
||||
interface IDropdownConfig {
|
||||
/**
|
||||
* @default: 'uib-dropdown-open'
|
||||
*/
|
||||
appendToOpenClass?: string;
|
||||
|
||||
/**
|
||||
* @default: 'open'
|
||||
*/
|
||||
openClass?: string;
|
||||
}
|
||||
|
||||
interface IModalProvider {
|
||||
/**
|
||||
@ -543,6 +603,13 @@ declare module 'angular' {
|
||||
*/
|
||||
boundaryLinks?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to always display the first and last page numbers. If max-size is smaller than the number of pages, then the first and last page numbers are still shown with ellipses in-between as necessary. NOTE: max-size refers to the center of the range. This option may add up to 2 more numbers on each side of the displayed range for the end value and what would be an ellipsis but is replaced by a number because it is sequential.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
boundaryLinkNumbers?: boolean;
|
||||
|
||||
/**
|
||||
* Text for First button.
|
||||
*
|
||||
@ -563,6 +630,13 @@ declare module 'angular' {
|
||||
* @default 'template/pagination/pagination.html'
|
||||
*/
|
||||
templateUrl?: string;
|
||||
|
||||
/**
|
||||
* Also displays ellipses when rotate is true and max-size is smaller than the number of pages.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
forceEllipses?: boolean;
|
||||
}
|
||||
|
||||
interface IPagerConfig {
|
||||
@ -679,6 +753,13 @@ declare module 'angular' {
|
||||
*/
|
||||
minuteStep?: number;
|
||||
|
||||
/**
|
||||
* Number of seconds to increase or decrease when using a button.
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
secondStep?: number;
|
||||
|
||||
/**
|
||||
* Whether to display 12H or 24H mode.
|
||||
*
|
||||
@ -720,6 +801,20 @@ declare module 'angular' {
|
||||
* @default true
|
||||
*/
|
||||
showSpinners?: boolean;
|
||||
|
||||
/**
|
||||
* Show seconds input.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
showSeconds?: boolean;
|
||||
|
||||
/**
|
||||
* Add the ability to override the template used on the component.
|
||||
*
|
||||
* @default 'uib/template/timepicker/timepicker.html'
|
||||
*/
|
||||
templateUrl?: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
4
angular/angular-component-router.d.ts
vendored
4
angular/angular-component-router.d.ts
vendored
@ -1,9 +1,9 @@
|
||||
/* tslint:disable:dt-header variable-name */
|
||||
// Type definitions for Angular JS 1.5 component router
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: David Reher <http://github.com/davidreher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare namespace angular {
|
||||
/**
|
||||
* `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed
|
||||
@ -263,7 +263,7 @@ declare namespace angular {
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: (value: any) => void): Object;
|
||||
subscribe(onNext: (value: any) => void): {};
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
// issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/369
|
||||
// https://github.com/witoldsz/angular-http-auth/blob/master/src/angular-http-auth.js
|
||||
/**
|
||||
@ -7,12 +6,14 @@
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-empty no-shadowed-variable */
|
||||
|
||||
class AuthService {
|
||||
/**
|
||||
* Holds all the requests which failed due to 401 response,
|
||||
* so they can be re-requested in future, once login is completed.
|
||||
*/
|
||||
buffer: { config: ng.IRequestConfig; deferred: ng.IDeferred<any>; }[] = [];
|
||||
buffer: Array<{ config: ng.IRequestConfig; deferred: ng.IDeferred<any>; }> = [];
|
||||
|
||||
/**
|
||||
* Required by HTTP interceptor.
|
||||
@ -20,34 +21,35 @@ class AuthService {
|
||||
*/
|
||||
pushToBuffer = function(config: ng.IRequestConfig, deferred: ng.IDeferred<any>) {
|
||||
this.buffer.push({
|
||||
config: config,
|
||||
deferred: deferred
|
||||
config,
|
||||
deferred
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$get = [
|
||||
'$rootScope', '$injector', <any>function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) {
|
||||
var $http: ng.IHttpService; //initialized later because of circular dependency problem
|
||||
'$rootScope', '$injector', function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) {
|
||||
let $http: ng.IHttpService; //initialized later because of circular dependency problem
|
||||
function retry(config: ng.IRequestConfig, deferred: ng.IDeferred<any>) {
|
||||
$http = $http || $injector.get<ng.IHttpService>('$http');
|
||||
$http(config).then(function (response) {
|
||||
$http(config).then(function(response) {
|
||||
deferred.resolve(response);
|
||||
});
|
||||
}
|
||||
function retryAll() {
|
||||
for (var i = 0; i < this.buffer.length; ++i) {
|
||||
retry(this.buffer[i].config, this.buffer[i].deferred);
|
||||
for (const request of this.buffer) {
|
||||
retry(request.config, request.deferred);
|
||||
}
|
||||
|
||||
this.buffer = [];
|
||||
}
|
||||
|
||||
return {
|
||||
loginConfirmed: function () {
|
||||
loginConfirmed() {
|
||||
$rootScope.$broadcast('event:auth-loginConfirmed');
|
||||
retryAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} as any
|
||||
];
|
||||
}
|
||||
|
||||
@ -59,20 +61,20 @@ angular.module('http-auth-interceptor', [])
|
||||
* $http interceptor.
|
||||
* On 401 response - it stores the request and broadcasts 'event:angular-auth-loginRequired'.
|
||||
*/
|
||||
.config(['$httpProvider', 'authServiceProvider', <any>function ($httpProvider: ng.IHttpProvider, authServiceProvider: any) {
|
||||
.config(['$httpProvider', 'authServiceProvider', function($httpProvider: ng.IHttpProvider, authServiceProvider: any) {
|
||||
|
||||
$httpProvider.defaults.headers.common = {'Authorization': 'Bearer token'};
|
||||
$httpProvider.defaults.headers.common = {Authorization: 'Bearer token'};
|
||||
$httpProvider.defaults.headers.get['Authorization'] = 'Bearer token';
|
||||
$httpProvider.defaults.headers.post['Authorization'] = function (config:ng.IRequestConfig):string { return 'Bearer token'; }
|
||||
$httpProvider.defaults.headers.post['Authorization'] = function(config: ng.IRequestConfig): string { return 'Bearer token'; };
|
||||
|
||||
var interceptor = ['$rootScope', '$q', <any>function ($rootScope: ng.IScope, $q: ng.IQService) {
|
||||
const interceptor = ['$rootScope', '$q', function($rootScope: ng.IScope, $q: ng.IQService) {
|
||||
function success(response: ng.IHttpPromiseCallbackArg<any>) {
|
||||
return response;
|
||||
}
|
||||
|
||||
function error(response: ng.IHttpPromiseCallbackArg<any>) {
|
||||
if (response.status === 401) {
|
||||
var deferred = $q.defer<void>();
|
||||
const deferred = $q.defer<void>();
|
||||
authServiceProvider.pushToBuffer(response.config, deferred);
|
||||
$rootScope.$broadcast('event:auth-loginRequired');
|
||||
return deferred.promise;
|
||||
@ -81,14 +83,13 @@ angular.module('http-auth-interceptor', [])
|
||||
return $q.reject(response);
|
||||
}
|
||||
|
||||
return function (promise: ng.IHttpPromise<any>) {
|
||||
return function(promise: ng.IHttpPromise<any>) {
|
||||
return promise.then(success, error);
|
||||
}
|
||||
};
|
||||
|
||||
}];
|
||||
} as any];
|
||||
$httpProvider.interceptors.push(interceptor);
|
||||
}]);
|
||||
|
||||
} as any]);
|
||||
|
||||
namespace HttpAndRegularPromiseTests {
|
||||
interface Person {
|
||||
@ -96,7 +97,7 @@ namespace HttpAndRegularPromiseTests {
|
||||
lastName: string;
|
||||
}
|
||||
|
||||
interface ExpectedResponse extends Person { }
|
||||
type ExpectedResponse = Person;
|
||||
|
||||
interface SomeControllerScope extends ng.IScope {
|
||||
person: Person;
|
||||
@ -106,13 +107,13 @@ namespace HttpAndRegularPromiseTests {
|
||||
nothing?: string;
|
||||
}
|
||||
|
||||
var someController: Function = ($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) => {
|
||||
$http.get<ExpectedResponse>("http://somewhere/some/resource")
|
||||
function someController($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) {
|
||||
$http.get<ExpectedResponse>('http://somewhere/some/resource')
|
||||
.success((data: ExpectedResponse) => {
|
||||
$scope.person = data;
|
||||
});
|
||||
|
||||
$http.get<ExpectedResponse>("http://somewhere/some/resource")
|
||||
$http.get<ExpectedResponse>('http://somewhere/some/resource')
|
||||
.then((response: ng.IHttpPromiseCallbackArg<ExpectedResponse>) => {
|
||||
// typing lost, so something like
|
||||
// var i: number = response.data
|
||||
@ -120,7 +121,7 @@ namespace HttpAndRegularPromiseTests {
|
||||
$scope.person = response.data;
|
||||
});
|
||||
|
||||
$http.get<ExpectedResponse>("http://somewhere/some/resource")
|
||||
$http.get<ExpectedResponse>('http://somewhere/some/resource')
|
||||
.then((response: ng.IHttpPromiseCallbackArg<ExpectedResponse>) => {
|
||||
// typing lost, so something like
|
||||
// var i: number = response.data
|
||||
@ -128,47 +129,48 @@ namespace HttpAndRegularPromiseTests {
|
||||
$scope.person = response.data;
|
||||
});
|
||||
|
||||
var aPromise: ng.IPromise<Person> = $q.when({ firstName: "Jack", lastName: "Sparrow" });
|
||||
const aPromise: ng.IPromise<Person> = $q.when({ firstName: 'Jack', lastName: 'Sparrow' });
|
||||
aPromise.then((person: Person) => {
|
||||
$scope.person = person;
|
||||
});
|
||||
|
||||
var bPromise: ng.IPromise<number> = $q.when(42);
|
||||
const bPromise: ng.IPromise<number> = $q.when(42);
|
||||
bPromise.then((answer: number) => {
|
||||
$scope.theAnswer = answer;
|
||||
});
|
||||
|
||||
var cPromise: ng.IPromise<string[]> = $q.when(["a", "b", "c"]);
|
||||
const cPromise: ng.IPromise<string[]> = $q.when(['a', 'b', 'c']);
|
||||
cPromise.then((letters: string[]) => {
|
||||
$scope.letters = letters;
|
||||
});
|
||||
|
||||
// When $q.when is passed an IPromise<T>, it returns an IPromise<T>
|
||||
var dPromise: ng.IPromise<string> = $q.when($q.when("ALBATROSS!"));
|
||||
const dPromise: ng.IPromise<string> = $q.when($q.when('ALBATROSS!'));
|
||||
dPromise.then((snack: string) => {
|
||||
$scope.snack = snack;
|
||||
});
|
||||
|
||||
// $q.when may be called without arguments
|
||||
var ePromise: ng.IPromise<void> = $q.when();
|
||||
const ePromise: ng.IPromise<void> = $q.when();
|
||||
ePromise.then(() => {
|
||||
$scope.nothing = "really nothing";
|
||||
$scope.nothing = 'really nothing';
|
||||
});
|
||||
}
|
||||
|
||||
// Test that we can pass around a type-checked success/error Promise Callback
|
||||
var anotherController: Function = ($scope: SomeControllerScope, $http:
|
||||
ng.IHttpService, $q: ng.IQService) => {
|
||||
|
||||
var buildFooData: Function = () => 42;
|
||||
|
||||
var doFoo: Function = (callback: ng.IHttpPromiseCallback<ExpectedResponse>) => {
|
||||
$http.get<ExpectedResponse>('/foo', buildFooData())
|
||||
.success(callback);
|
||||
// Test that we can pass around a type-checked success/error Promise Callback
|
||||
function anotherController($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) {
|
||||
function buildFooData(): ng.IRequestShortcutConfig {
|
||||
return {};
|
||||
}
|
||||
|
||||
doFoo((data: any) => console.log(data));
|
||||
}
|
||||
function doFoo(callback: ng.IHttpPromiseCallback<ExpectedResponse>) {
|
||||
$http
|
||||
.get<ExpectedResponse>('/foo', buildFooData())
|
||||
.success(callback);
|
||||
};
|
||||
|
||||
doFoo((data: any) => console.log(data));
|
||||
};
|
||||
}
|
||||
|
||||
// Test for AngularJS Syntax
|
||||
@ -178,9 +180,9 @@ namespace My.Namespace {
|
||||
}
|
||||
|
||||
// IModule Registering Test
|
||||
var mod = angular.module('tests', []);
|
||||
mod.controller('name', function ($scope: ng.IScope) { });
|
||||
mod.controller('name', ['$scope', function ($scope: ng.IScope) { }]);
|
||||
let mod = angular.module('tests', []);
|
||||
mod.controller('name', function($scope: ng.IScope) { });
|
||||
mod.controller('name', ['$scope', function($scope: ng.IScope) { }]);
|
||||
mod.controller('name', class {
|
||||
// Uncommenting the next line should lead to a type error because this signature isn't compatible
|
||||
// with the signature of the `$onChanges` hook:
|
||||
@ -188,7 +190,7 @@ mod.controller('name', class {
|
||||
});
|
||||
mod.controller({
|
||||
MyCtrl: class{},
|
||||
MyCtrl2: function() {},
|
||||
MyCtrl2: function() {}, // tslint:disable-line:object-literal-shorthand
|
||||
MyCtrl3: ['$fooService', function($fooService: any) { }]
|
||||
});
|
||||
mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => {
|
||||
@ -201,7 +203,7 @@ mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => {
|
||||
scope.$watch(() => foo, () => el.text(foo));
|
||||
};
|
||||
});
|
||||
mod.directive('myDirectiveB', ['$rootScope', function ($rootScope: ng.IRootScopeService) {
|
||||
mod.directive('myDirectiveB', ['$rootScope', function($rootScope: ng.IRootScopeService) {
|
||||
return {
|
||||
link(scope, el, attrs) {
|
||||
el.click(e => {
|
||||
@ -218,38 +220,37 @@ mod.directive({
|
||||
template: 'my-bar-dir.tpl.html'
|
||||
})]
|
||||
});
|
||||
mod.factory('name', function ($scope: ng.IScope) { })
|
||||
mod.factory('name', ['$scope', function ($scope: ng.IScope) { }])
|
||||
mod.factory('name', function($scope: ng.IScope) { });
|
||||
mod.factory('name', ['$scope', function($scope: ng.IScope) { }]);
|
||||
mod.factory({
|
||||
name1: function (foo: any) { },
|
||||
name2: ['foo', function (foo: any) { }]
|
||||
name1: function(foo: any) { }, // tslint:disable-line:object-literal-shorthand
|
||||
name2: ['foo', function(foo: any) { }]
|
||||
});
|
||||
mod.filter('name', function ($scope: ng.IScope) { })
|
||||
mod.filter('name', ['$scope', function ($scope: ng.IScope) { }])
|
||||
mod.filter('name', function($scope: ng.IScope) { });
|
||||
mod.filter('name', ['$scope', function($scope: ng.IScope) { }]);
|
||||
mod.filter({
|
||||
name1: function (foo: any) { },
|
||||
name2: ['foo', function (foo: any) { }]
|
||||
name1: function(foo: any) { }, // tslint:disable-line:object-literal-shorthand
|
||||
name2: ['foo', function(foo: any) { }]
|
||||
});
|
||||
mod.provider('name', function ($scope: ng.IScope) { return { $get: () => { } } })
|
||||
mod.provider('name', function($scope: ng.IScope) { return { $get: () => { } }; });
|
||||
mod.provider('name', TestProvider);
|
||||
mod.provider('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.provider('name', ['$scope', function($scope: ng.IScope) { } as any]);
|
||||
mod.provider(My.Namespace);
|
||||
mod.service('name', function ($scope: ng.IScope) { })
|
||||
mod.service('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.service('name', function($scope: ng.IScope) { });
|
||||
mod.service('name', ['$scope', function($scope: ng.IScope) { } as any]);
|
||||
mod.service({
|
||||
MyCtrl: class{},
|
||||
MyCtrl2: function() {},
|
||||
MyCtrl2: function() {}, // tslint:disable-line:object-literal-shorthand
|
||||
MyCtrl3: ['$fooService', function($fooService: any) { }]
|
||||
});
|
||||
mod.constant('name', 23);
|
||||
mod.constant('name', "23");
|
||||
mod.constant('name', '23');
|
||||
mod.constant(My.Namespace);
|
||||
mod.value('name', 23);
|
||||
mod.value('name', "23");
|
||||
mod.value('name', '23');
|
||||
mod.value(My.Namespace);
|
||||
mod.decorator('name', function($scope:ng.IScope){ });
|
||||
mod.decorator('name', ['$scope', <any>function($scope: ng.IScope){ }]);
|
||||
|
||||
mod.decorator('name', function($scope: ng.IScope) {});
|
||||
mod.decorator('name', ['$scope', function($scope: ng.IScope) {} as any]);
|
||||
|
||||
class TestProvider implements ng.IServiceProvider {
|
||||
constructor(private $scope: ng.IScope) {
|
||||
@ -261,23 +262,23 @@ class TestProvider implements ng.IServiceProvider {
|
||||
|
||||
// QProvider tests
|
||||
angular.module('qprovider-test', [])
|
||||
.config(['$qProvider', function ($qProvider: ng.IQProvider) {
|
||||
.config(['$qProvider', function($qProvider: ng.IQProvider) {
|
||||
const provider: ng.IQProvider = $qProvider.errorOnUnhandledRejections(false);
|
||||
const currentValue: boolean = $qProvider.errorOnUnhandledRejections();
|
||||
}]);
|
||||
|
||||
// Promise signature tests
|
||||
var foo: ng.IPromise<number>;
|
||||
let foo: ng.IPromise<number>;
|
||||
foo.then((x) => {
|
||||
// x is inferred to be a number
|
||||
return "asdf";
|
||||
return 'asdf';
|
||||
}).then((x) => {
|
||||
// x is inferred to be string
|
||||
x.length;
|
||||
const len = x.length;
|
||||
return 123;
|
||||
}).then((x) => {
|
||||
// x is infered to be a number
|
||||
x.toFixed();
|
||||
const fixed = x.toFixed();
|
||||
return;
|
||||
}).then((x) => {
|
||||
// x is infered to be void
|
||||
@ -336,15 +337,14 @@ namespace TestQ {
|
||||
result = $q.all<TResult>([promiseAny, promiseAny]);
|
||||
}
|
||||
{
|
||||
let result: angular.IPromise<{[id: string]: any;}>;
|
||||
let result: angular.IPromise<{[id: string]: any; }>;
|
||||
result = $q.all({a: promiseAny, b: promiseAny});
|
||||
}
|
||||
{
|
||||
let result: angular.IPromise<{a: number; b: string;}>;
|
||||
result = $q.all<{a: number; b: string;}>({a: promiseAny, b: promiseAny});
|
||||
let result: angular.IPromise<{a: number; b: string; }>;
|
||||
result = $q.all<{a: number; b: string; }>({a: promiseAny, b: promiseAny});
|
||||
}
|
||||
|
||||
|
||||
// $q.defer
|
||||
{
|
||||
let result: angular.IDeferred<TResult>;
|
||||
@ -397,11 +397,10 @@ namespace TestQ {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var httpFoo: ng.IHttpPromise<number>;
|
||||
let httpFoo: ng.IHttpPromise<number>;
|
||||
httpFoo.then((x) => {
|
||||
// When returning a promise the generic type must be inferred.
|
||||
var innerPromise : ng.IPromise<number>;
|
||||
var innerPromise: ng.IPromise<number>;
|
||||
return innerPromise;
|
||||
}).then((x) => {
|
||||
// must still be number.
|
||||
@ -409,13 +408,12 @@ httpFoo.then((x) => {
|
||||
});
|
||||
|
||||
httpFoo.success((data, status, headers, config) => {
|
||||
var h = headers("test");
|
||||
const h = headers('test');
|
||||
h.charAt(0);
|
||||
var hs = headers();
|
||||
hs["content-type"].charAt(1);
|
||||
const hs = headers();
|
||||
hs['content-type'].charAt(1);
|
||||
});
|
||||
|
||||
|
||||
// Deferred signature tests
|
||||
namespace TestDeferred {
|
||||
var any: any;
|
||||
@ -432,8 +430,8 @@ namespace TestDeferred {
|
||||
// deferred.resolve
|
||||
{
|
||||
let result: void;
|
||||
result = <void>deferred.resolve();
|
||||
result = <void>deferred.resolve(tResult);
|
||||
result = deferred.resolve() as void;
|
||||
result = deferred.resolve(tResult) as void;
|
||||
}
|
||||
|
||||
// deferred.reject
|
||||
@ -458,7 +456,7 @@ namespace TestDeferred {
|
||||
}
|
||||
|
||||
namespace TestInjector {
|
||||
let $injector: angular.auto.IInjectorService;
|
||||
var $injector: angular.auto.IInjectorService;
|
||||
|
||||
$injector.strictDi = true;
|
||||
|
||||
@ -466,10 +464,9 @@ namespace TestInjector {
|
||||
$injector.annotate(() => {}, true);
|
||||
}
|
||||
|
||||
|
||||
// Promise signature tests
|
||||
namespace TestPromise {
|
||||
var result: any;
|
||||
let result: any;
|
||||
var any: any;
|
||||
|
||||
interface TResult {
|
||||
@ -494,63 +491,61 @@ namespace TestPromise {
|
||||
var promise: angular.IPromise<TResult>;
|
||||
|
||||
// promise.then
|
||||
result = <angular.IPromise<any>>promise.then((result) => any);
|
||||
result = <angular.IPromise<any>>promise.then((result) => any, (any) => any);
|
||||
result = <angular.IPromise<any>>promise.then((result) => any, (any) => any, (any) => any);
|
||||
result = promise.then((result) => any) as angular.IPromise<any>;
|
||||
result = promise.then((result) => any, (any) => any) as angular.IPromise<any>;
|
||||
result = promise.then((result) => any, (any) => any, (any) => any) as angular.IPromise<any>;
|
||||
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => result);
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => result, (any) => any);
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => result, (any) => any, (any) => any);
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise);
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise, (any) => any);
|
||||
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise, (any) => any, (any) => any);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>>promise.then((result) => tresultHttpPromise);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>>promise.then((result) => tresultHttpPromise, (any) => any);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>>promise.then((result) => tresultHttpPromise, (any) => any, (any) => any);
|
||||
result = promise.then((result) => result) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => result, (any) => any) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => result, (any) => any, (any) => any) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => tresultPromise) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => tresultPromise, (any) => any) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => tresultPromise, (any) => any, (any) => any) as angular.IPromise<TResult>;
|
||||
result = promise.then((result) => tresultHttpPromise) as angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>;
|
||||
result = promise.then((result) => tresultHttpPromise, (any) => any) as angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>;
|
||||
result = promise.then((result) => tresultHttpPromise, (any) => any, (any) => any) as angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>;
|
||||
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => tother);
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => tother, (any) => any);
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => tother, (any) => any, (any) => any);
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise);
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise, (any) => any);
|
||||
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise, (any) => any, (any) => any);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>>promise.then((result) => totherHttpPromise);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>>promise.then((result) => totherHttpPromise, (any) => any);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>>promise.then((result) => totherHttpPromise, (any) => any, (any) => any);
|
||||
result = promise.then((result) => tother) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => tother, (any) => any) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => tother, (any) => any, (any) => any) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => totherPromise) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => totherPromise, (any) => any) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => totherPromise, (any) => any, (any) => any) as angular.IPromise<TOther>;
|
||||
result = promise.then((result) => totherHttpPromise) as angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>;
|
||||
result = promise.then((result) => totherHttpPromise, (any) => any) as angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>;
|
||||
result = promise.then((result) => totherHttpPromise, (any) => any, (any) => any) as angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>;
|
||||
|
||||
// promise.catch
|
||||
result = <angular.IPromise<any>>promise.catch((err) => any);
|
||||
result = <angular.IPromise<TResult>>promise.catch((err) => tresult);
|
||||
result = <angular.IPromise<TResult>>promise.catch((err) => tresultPromise);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>>promise.catch((err) => tresultHttpPromise);
|
||||
result = <angular.IPromise<TOther>>promise.catch((err) => tother);
|
||||
result = <angular.IPromise<TOther>>promise.catch((err) => totherPromise);
|
||||
result = <angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>>promise.catch((err) => totherHttpPromise);
|
||||
result = promise.catch((err) => any) as angular.IPromise<any>;
|
||||
result = promise.catch((err) => tresult) as angular.IPromise<TResult>;
|
||||
result = promise.catch((err) => tresultPromise) as angular.IPromise<TResult>;
|
||||
result = promise.catch((err) => tresultHttpPromise) as angular.IPromise<ng.IHttpPromiseCallbackArg<TResult>>;
|
||||
result = promise.catch((err) => tother) as angular.IPromise<TOther>;
|
||||
result = promise.catch((err) => totherPromise) as angular.IPromise<TOther>;
|
||||
result = promise.catch((err) => totherHttpPromise) as angular.IPromise<ng.IHttpPromiseCallbackArg<TOther>>;
|
||||
|
||||
// promise.finally
|
||||
result = <angular.IPromise<TResult>>promise.finally(() => any);
|
||||
result = <angular.IPromise<TResult>>promise.finally(() => tresult);
|
||||
result = <angular.IPromise<TResult>>promise.finally(() => tother);
|
||||
result = promise.finally(() => any) as angular.IPromise<TResult>;
|
||||
result = promise.finally(() => tresult) as angular.IPromise<TResult>;
|
||||
result = promise.finally(() => tother) as angular.IPromise<TResult>;
|
||||
}
|
||||
|
||||
|
||||
function test_angular_forEach() {
|
||||
var values: { [key: string]: string } = { name: 'misko', gender: 'male' };
|
||||
var log: string[] = [];
|
||||
angular.forEach(values, function (value, key) {
|
||||
const values: { [key: string]: string } = { name: 'misko', gender: 'male' };
|
||||
const log: string[] = [];
|
||||
angular.forEach(values, function(value, key) {
|
||||
this.push(key + ': ' + value);
|
||||
}, log);
|
||||
//expect(log).toEqual(['name: misko', 'gender: male']);
|
||||
}
|
||||
|
||||
// angular.element() tests
|
||||
var element = angular.element("div.myApp");
|
||||
var scope: ng.IScope = element.scope();
|
||||
var isolateScope: ng.IScope = element.isolateScope();
|
||||
let element = angular.element('div.myApp');
|
||||
let scope: ng.IScope = element.scope();
|
||||
let isolateScope: ng.IScope = element.isolateScope();
|
||||
isolateScope = element.find('div.foo').isolateScope();
|
||||
isolateScope = element.children().isolateScope();
|
||||
|
||||
|
||||
// $timeout signature tests
|
||||
namespace TestTimeout {
|
||||
interface TResult {
|
||||
@ -590,25 +585,24 @@ namespace TestTimeout {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function test_IAttributes(attributes: ng.IAttributes){
|
||||
function test_IAttributes(attributes: ng.IAttributes) {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
test_IAttributes({
|
||||
$normalize: function (classVal){ return "foo" },
|
||||
$addClass: function (classVal){},
|
||||
$removeClass: function(classVal){},
|
||||
$updateClass: function(newClass, oldClass){},
|
||||
$set: function(key, value){},
|
||||
$observe: function(name: any, fn: any){
|
||||
$normalize(classVal) { return 'foo'; },
|
||||
$addClass(classVal) {},
|
||||
$removeClass(classVal) {},
|
||||
$updateClass(newClass, oldClass) {},
|
||||
$set(key, value) {},
|
||||
$observe(name: any, fn: any) {
|
||||
return fn;
|
||||
},
|
||||
$attr: {}
|
||||
});
|
||||
|
||||
class SampleDirective implements ng.IDirective {
|
||||
public restrict = 'A';
|
||||
restrict = 'A';
|
||||
name = 'doh';
|
||||
|
||||
compile(templateElement: ng.IAugmentedJQuery) {
|
||||
@ -617,7 +611,7 @@ class SampleDirective implements ng.IDirective {
|
||||
};
|
||||
}
|
||||
|
||||
static instance():ng.IDirective {
|
||||
static instance(): ng.IDirective {
|
||||
return new SampleDirective();
|
||||
}
|
||||
|
||||
@ -627,7 +621,7 @@ class SampleDirective implements ng.IDirective {
|
||||
}
|
||||
|
||||
class SampleDirective2 implements ng.IDirective {
|
||||
public restrict = 'EAC';
|
||||
restrict = 'EAC';
|
||||
|
||||
compile(templateElement: ng.IAugmentedJQuery) {
|
||||
return {
|
||||
@ -635,7 +629,7 @@ class SampleDirective2 implements ng.IDirective {
|
||||
};
|
||||
}
|
||||
|
||||
static instance():ng.IDirective {
|
||||
static instance(): ng.IDirective {
|
||||
return new SampleDirective2();
|
||||
}
|
||||
|
||||
@ -654,7 +648,7 @@ angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpo
|
||||
$interpolate('', true)(scope);
|
||||
$interpolate('', true, 'html')(scope);
|
||||
$interpolate('', true, 'html', true)(scope);
|
||||
var defer = $q.defer();
|
||||
const defer = $q.defer();
|
||||
defer.reject();
|
||||
defer.resolve();
|
||||
defer.promise.then(function(d) {
|
||||
@ -670,7 +664,7 @@ angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpo
|
||||
.finally((): any => {
|
||||
return null;
|
||||
});
|
||||
var promise = new $q((resolve) => {
|
||||
let promise = new $q((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
|
||||
@ -785,25 +779,25 @@ angular.module('docsTimeDirective', [])
|
||||
.directive('myCurrentTime', ['$interval', 'dateFilter', function($interval: any, dateFilter: any) {
|
||||
|
||||
return {
|
||||
link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs:ng.IAttributes) {
|
||||
var format: any,
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) {
|
||||
let format: any,
|
||||
timeoutId: any;
|
||||
|
||||
function updateTime() {
|
||||
element.text(dateFilter(new Date(), format));
|
||||
}
|
||||
|
||||
scope.$watch(attrs['myCurrentTime'], function (value: any) {
|
||||
scope.$watch(attrs['myCurrentTime'], function(value: any) {
|
||||
format = value;
|
||||
updateTime();
|
||||
});
|
||||
|
||||
element.on('$destroy', function () {
|
||||
element.on('$destroy', function() {
|
||||
$interval.cancel(timeoutId);
|
||||
});
|
||||
|
||||
// start the UI update process; save the timeoutId for canceling
|
||||
timeoutId = $interval(function () {
|
||||
timeoutId = $interval(function() {
|
||||
updateTime(); // update DOM
|
||||
}, 1000);
|
||||
}
|
||||
@ -832,19 +826,18 @@ angular.module('docsTransclusionExample', [])
|
||||
transclude: true,
|
||||
scope: {},
|
||||
templateUrl: 'my-dialog.html',
|
||||
link: function (scope: ng.IScope, element: ng.IAugmentedJQuery) {
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery) {
|
||||
scope['name'] = 'Jeff';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
angular.module('docsIsoFnBindExample', [])
|
||||
.controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) {
|
||||
$scope.name = 'Tobias';
|
||||
$scope.hideDialog = function () {
|
||||
$scope.hideDialog = function() {
|
||||
$scope.dialogIsHidden = true;
|
||||
$timeout(function () {
|
||||
$timeout(function() {
|
||||
$scope.dialogIsHidden = false;
|
||||
}, 2000);
|
||||
};
|
||||
@ -854,7 +847,7 @@ angular.module('docsIsoFnBindExample', [])
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
scope: {
|
||||
'close': '&onClose'
|
||||
close: '&onClose'
|
||||
},
|
||||
templateUrl: 'my-dialog-close.html'
|
||||
};
|
||||
@ -863,7 +856,7 @@ angular.module('docsIsoFnBindExample', [])
|
||||
angular.module('dragModule', [])
|
||||
.directive('myDraggable', ['$document', function($document: any) {
|
||||
return function(scope: any, element: any, attr: any) {
|
||||
var startX = 0, startY = 0, x = 0, y = 0;
|
||||
let startX = 0, startY = 0, x = 0, y = 0;
|
||||
|
||||
element.css({
|
||||
position: 'relative',
|
||||
@ -903,8 +896,8 @@ angular.module('docsTabsExample', [])
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
scope: {},
|
||||
controller: function($scope: ng.IScope) {
|
||||
var panes: any = $scope['panes'] = [];
|
||||
controller($scope: ng.IScope) {
|
||||
const panes: any = $scope['panes'] = [];
|
||||
|
||||
$scope['select'] = function(pane: any) {
|
||||
angular.forEach(panes, function(pane: any) {
|
||||
@ -931,7 +924,7 @@ angular.module('docsTabsExample', [])
|
||||
scope: {
|
||||
title: '@'
|
||||
},
|
||||
link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
|
||||
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
|
||||
tabsCtrl.addPane(scope);
|
||||
},
|
||||
templateUrl: 'my-pane.html'
|
||||
@ -945,7 +938,7 @@ angular.module('multiSlotTranscludeExample', [])
|
||||
button: 'button',
|
||||
list: 'ul',
|
||||
},
|
||||
link: function(scope, element, attrs, ctrl, transclude) {
|
||||
link(scope, element, attrs, ctrl, transclude) {
|
||||
// without scope
|
||||
transclude().appendTo(element);
|
||||
transclude(clone => clone.appendTo(element));
|
||||
@ -960,52 +953,52 @@ angular.module('multiSlotTranscludeExample', [])
|
||||
|
||||
angular.module('componentExample', [])
|
||||
.component('counter', {
|
||||
require: {'ctrl': '^ctrl'},
|
||||
require: {ctrl: '^ctrl'},
|
||||
bindings: {
|
||||
count: '='
|
||||
},
|
||||
controller: 'CounterCtrl',
|
||||
controllerAs: 'counterCtrl',
|
||||
template: function () {
|
||||
template() {
|
||||
return '';
|
||||
},
|
||||
transclude: {
|
||||
'el': 'target'
|
||||
el: 'target'
|
||||
}
|
||||
})
|
||||
.component('anotherCounter', {
|
||||
controller: function(){},
|
||||
controller() {},
|
||||
require: {
|
||||
'parent': '^parentCtrl'
|
||||
parent: '^parentCtrl'
|
||||
},
|
||||
template: '',
|
||||
transclude: true
|
||||
});
|
||||
|
||||
interface copyExampleUser {
|
||||
interface ICopyExampleUser {
|
||||
name?: string;
|
||||
email?: string;
|
||||
gender?: string;
|
||||
}
|
||||
|
||||
interface copyExampleScope {
|
||||
interface ICopyExampleScope {
|
||||
|
||||
user: copyExampleUser;
|
||||
master: copyExampleUser;
|
||||
update: (copyExampleUser: copyExampleUser) => any;
|
||||
user: ICopyExampleUser;
|
||||
master: ICopyExampleUser;
|
||||
update: (copyExampleUser: ICopyExampleUser) => any;
|
||||
reset: () => any;
|
||||
}
|
||||
|
||||
angular.module('copyExample', [])
|
||||
.controller('ExampleController', ['$scope', function ($scope: copyExampleScope) {
|
||||
.controller('ExampleController', ['$scope', function($scope: ICopyExampleScope) {
|
||||
$scope.master = { };
|
||||
|
||||
$scope.update = function (user) {
|
||||
$scope.update = function(user) {
|
||||
// Example with 1 argument
|
||||
$scope.master = angular.copy(user);
|
||||
};
|
||||
|
||||
$scope.reset = function () {
|
||||
$scope.reset = function() {
|
||||
// Example with 2 arguments
|
||||
angular.copy($scope.master, $scope.user);
|
||||
};
|
||||
@ -1022,9 +1015,14 @@ namespace locationTests {
|
||||
*/
|
||||
|
||||
// given url http://example.com/#/some/path?foo=bar&baz=xoxo
|
||||
var searchObject = $location.search();
|
||||
const searchObject = $location.search();
|
||||
// => {foo: 'bar', baz: 'xoxo'}
|
||||
|
||||
function assert(condition: boolean) {
|
||||
if (!condition) {
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
// set foo to 'yipee'
|
||||
$location.search('foo', 'yipee');
|
||||
@ -1041,29 +1039,29 @@ namespace locationTests {
|
||||
// in browser with HTML5 history support:
|
||||
// open http://example.com/#!/a -> rewrite to http://example.com/a
|
||||
// (replacing the http://example.com/#!/a history record)
|
||||
$location.path() == '/a'
|
||||
assert($location.path() === '/a');
|
||||
|
||||
$location.path('/foo');
|
||||
$location.absUrl() == 'http://example.com/foo'
|
||||
assert($location.absUrl() === 'http://example.com/foo');
|
||||
|
||||
$location.search() == {}
|
||||
assert($location.search() === {});
|
||||
$location.search({ a: 'b', c: true });
|
||||
$location.absUrl() == 'http://example.com/foo?a=b&c'
|
||||
assert($location.absUrl() === 'http://example.com/foo?a=b&c');
|
||||
|
||||
$location.path('/new').search('x=y');
|
||||
$location.url() == 'new?x=y'
|
||||
$location.absUrl() == 'http://example.com/new?x=y'
|
||||
assert($location.url() === 'new?x=y');
|
||||
assert($location.absUrl() === 'http://example.com/new?x=y');
|
||||
|
||||
// in browser without html5 history support:
|
||||
// open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y
|
||||
// (again replacing the http://example.com/new?x=y history item)
|
||||
$location.path() == '/new'
|
||||
$location.search() == { x: 'y' }
|
||||
assert($location.path() === '/new');
|
||||
assert($location.search() === { x: 'y' });
|
||||
|
||||
$location.path('/foo/bar');
|
||||
$location.path() == '/foo/bar'
|
||||
$location.url() == '/foo/bar?x=y'
|
||||
$location.absUrl() == 'http://example.com/#!/foo/bar?x=y'
|
||||
assert($location.path() === '/foo/bar');
|
||||
assert($location.url() === '/foo/bar?x=y');
|
||||
assert($location.absUrl() === 'http://example.com/#!/foo/bar?x=y');
|
||||
}
|
||||
|
||||
// NgModelController
|
||||
@ -1074,7 +1072,7 @@ function NgModelControllerTyping() {
|
||||
|
||||
// See https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$validators
|
||||
ngModel.$validators['validCharacters'] = function(modelValue, viewValue) {
|
||||
var value = modelValue || viewValue;
|
||||
const value = modelValue || viewValue;
|
||||
return /[0-9]+/.test(value) &&
|
||||
/[a-z]+/.test(value) &&
|
||||
/[A-Z]+/.test(value) &&
|
||||
@ -1082,7 +1080,7 @@ function NgModelControllerTyping() {
|
||||
};
|
||||
|
||||
ngModel.$asyncValidators['uniqueUsername'] = function(modelValue, viewValue) {
|
||||
var value = modelValue || viewValue;
|
||||
const value = modelValue || viewValue;
|
||||
return $http.get('/api/users/' + value).
|
||||
then(function resolved() {
|
||||
return $q.reject('exists');
|
||||
@ -1092,67 +1090,67 @@ function NgModelControllerTyping() {
|
||||
};
|
||||
}
|
||||
|
||||
var $filter: angular.IFilterService;
|
||||
let $filter: angular.IFilterService;
|
||||
|
||||
function testFilter() {
|
||||
|
||||
var items: string[];
|
||||
$filter("filter")(items, "test");
|
||||
$filter("filter")(items, {name: "test"});
|
||||
$filter("filter")(items, (val, index, array) => {
|
||||
$filter('filter')(items, 'test');
|
||||
$filter('filter')(items, {name: 'test'});
|
||||
$filter('filter')(items, (val, index, array) => {
|
||||
return true;
|
||||
});
|
||||
$filter("filter")(items, (val, index, array) => {
|
||||
$filter('filter')(items, (val, index, array) => {
|
||||
return true;
|
||||
}, (actual, expected) => {
|
||||
return actual == expected;
|
||||
return actual === expected;
|
||||
});
|
||||
}
|
||||
|
||||
function testCurrency() {
|
||||
$filter("currency")(126);
|
||||
$filter("currency")(126, "$", 2);
|
||||
$filter('currency')(126);
|
||||
$filter('currency')(126, '$', 2);
|
||||
}
|
||||
|
||||
function testNumber() {
|
||||
$filter("number")(167);
|
||||
$filter("number")(167, 2);
|
||||
$filter('number')(167);
|
||||
$filter('number')(167, 2);
|
||||
}
|
||||
|
||||
function testDate() {
|
||||
$filter("date")(new Date());
|
||||
$filter("date")(new Date(), 'yyyyMMdd');
|
||||
$filter("date")(new Date(), 'yyyyMMdd', '+0430');
|
||||
$filter('date')(new Date());
|
||||
$filter('date')(new Date(), 'yyyyMMdd');
|
||||
$filter('date')(new Date(), 'yyyyMMdd', '+0430');
|
||||
}
|
||||
|
||||
function testJson() {
|
||||
var json: string = $filter("json")({test:true}, 2);
|
||||
const json: string = $filter('json')({test: true}, 2);
|
||||
}
|
||||
|
||||
function testLowercase() {
|
||||
var lower: string = $filter("lowercase")('test');
|
||||
const lower: string = $filter('lowercase')('test');
|
||||
}
|
||||
|
||||
function testUppercase() {
|
||||
var lower: string = $filter("uppercase")('test');
|
||||
const lower: string = $filter('uppercase')('test');
|
||||
}
|
||||
|
||||
function testLimitTo() {
|
||||
var limitTo = $filter("limitTo");
|
||||
var filtered: number[] = $filter("limitTo")([1,2,3], 5);
|
||||
filtered = $filter("limitTo")([1,2,3], 5, 2);
|
||||
const limitTo = $filter('limitTo');
|
||||
let filtered: number[] = $filter('limitTo')([1, 2, 3], 5);
|
||||
filtered = $filter('limitTo')([1, 2, 3], 5, 2);
|
||||
|
||||
var filteredString: string = $filter("limitTo")("124", 4);
|
||||
filteredString = $filter("limitTo")(124, 4);
|
||||
let filteredString: string = $filter('limitTo')('124', 4);
|
||||
filteredString = $filter('limitTo')(124, 4);
|
||||
}
|
||||
|
||||
function testOrderBy() {
|
||||
var filtered: number[] = $filter("orderBy")([1,2,3], "test");
|
||||
filtered = $filter("orderBy")([1,2,3], "test", true);
|
||||
filtered = $filter("orderBy")([1,2,3], ['prop1', 'prop2']);
|
||||
filtered = $filter("orderBy")([1,2,3], (val: number) => 1);
|
||||
var filtered2: string[] = $filter("orderBy")(["1","2","3"], (val: string) => 1);
|
||||
filtered2 = $filter("orderBy")(["1","2","3"], [
|
||||
let filtered: number[] = $filter('orderBy')([1, 2, 3], 'test');
|
||||
filtered = $filter('orderBy')([1, 2, 3], 'test', true);
|
||||
filtered = $filter('orderBy')([1, 2, 3], ['prop1', 'prop2']);
|
||||
filtered = $filter('orderBy')([1, 2, 3], (val: number) => 1);
|
||||
let filtered2: string[] = $filter('orderBy')(['1', '2', '3'], (val: string) => 1);
|
||||
filtered2 = $filter('orderBy')(['1', '2', '3'], [
|
||||
(val: string) => 1,
|
||||
(val: string) => 2
|
||||
]);
|
||||
@ -1160,28 +1158,26 @@ function testOrderBy() {
|
||||
|
||||
function testDynamicFilter() {
|
||||
// Test with separate variables
|
||||
var dateFilter = $filter("date");
|
||||
var myDate = new Date();
|
||||
dateFilter(myDate , "EEE, MMM d");
|
||||
const dateFilter = $filter('date');
|
||||
const myDate = new Date();
|
||||
dateFilter(myDate , 'EEE, MMM d');
|
||||
|
||||
// Test with dynamic name
|
||||
var filterName = 'date';
|
||||
var dynDateFilter = $filter<ng.IFilterDate>(filterName);
|
||||
const filterName = 'date';
|
||||
const dynDateFilter = $filter<ng.IFilterDate>(filterName);
|
||||
dynDateFilter(new Date());
|
||||
}
|
||||
|
||||
interface MyCustomFilter {
|
||||
(value: string): string;
|
||||
}
|
||||
type MyCustomFilter = (value: string) => string;
|
||||
|
||||
function testCustomFilter() {
|
||||
var filterCustom = $filter<MyCustomFilter>('custom');
|
||||
var filtered: string = filterCustom("test");
|
||||
const filterCustom = $filter<MyCustomFilter>('custom');
|
||||
const filtered: string = filterCustom('test');
|
||||
}
|
||||
|
||||
function parseTyping() {
|
||||
var $parse: angular.IParseService;
|
||||
var compiledExp = $parse('a.b.c');
|
||||
const compiledExp = $parse('a.b.c');
|
||||
if (compiledExp.constant) {
|
||||
return compiledExp({});
|
||||
} else if (compiledExp.literal) {
|
||||
@ -1191,8 +1187,8 @@ function parseTyping() {
|
||||
|
||||
function parseWithParams() {
|
||||
var $parse: angular.IParseService;
|
||||
var compiledExp = $parse('a.b.c', () => null);
|
||||
var compiledExp = $parse('a.b.c', null, false);
|
||||
const compiledExp1 = $parse('a.b.c', () => null);
|
||||
const compiledExp2 = $parse('a.b.c', null, false);
|
||||
}
|
||||
|
||||
function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjectorService {
|
||||
@ -1211,8 +1207,8 @@ function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjector
|
||||
}
|
||||
|
||||
function testIHttpParamSerializerJQLikeProvider() {
|
||||
let serializer: angular.IHttpParamSerializer;
|
||||
var serializer: angular.IHttpParamSerializer;
|
||||
serializer({
|
||||
a: "b"
|
||||
a: 'b'
|
||||
});
|
||||
}
|
||||
|
||||
91
angular/index.d.ts
vendored
91
angular/index.d.ts
vendored
@ -27,7 +27,7 @@ import ng = angular;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
declare namespace angular {
|
||||
|
||||
type Injectable<T extends Function> = T | (string | T)[];
|
||||
type Injectable<T extends Function> = T | Array<string | T>;
|
||||
|
||||
// not directly implemented, but ensures that constructed class implements $get
|
||||
interface IServiceProviderClass {
|
||||
@ -64,7 +64,7 @@ declare namespace angular {
|
||||
* @param config an object for defining configuration options for the application. The following keys are supported:
|
||||
* - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
|
||||
*/
|
||||
bootstrap(element: string|Element|JQuery|Document, modules?: (string|Function|any[])[], config?: IAngularBootstrapConfig): auto.IInjectorService;
|
||||
bootstrap(element: string|Element|JQuery|Document, modules?: Array<string|Function|any[]>, config?: IAngularBootstrapConfig): auto.IInjectorService;
|
||||
|
||||
/**
|
||||
* Creates a deep copy of source, which should be an object or an array.
|
||||
@ -122,7 +122,7 @@ declare namespace angular {
|
||||
fromJson(json: string): any;
|
||||
identity<T>(arg?: T): T;
|
||||
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
|
||||
isArray(value: any): value is Array<any>;
|
||||
isArray(value: any): value is any[];
|
||||
isDate(value: any): value is Date;
|
||||
isDefined(value: any): boolean;
|
||||
isElement(value: any): boolean;
|
||||
@ -514,7 +514,7 @@ declare namespace angular {
|
||||
$watchCollection<T>(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void;
|
||||
|
||||
$watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void;
|
||||
$watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void;
|
||||
$watchGroup(watchExpressions: Array<{ (scope: IScope): any }>, listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void;
|
||||
|
||||
$parent: IScope;
|
||||
$root: IRootScopeService;
|
||||
@ -662,9 +662,9 @@ declare namespace angular {
|
||||
}
|
||||
|
||||
interface IFilterOrderByItem {
|
||||
value: any,
|
||||
type: string,
|
||||
index: any
|
||||
value: any;
|
||||
type: string;
|
||||
index: any;
|
||||
}
|
||||
|
||||
interface IFilterOrderByComparatorFunc {
|
||||
@ -756,7 +756,7 @@ declare namespace angular {
|
||||
* @param comparator Function used to determine the relative order of value pairs.
|
||||
* @return An array containing the items from the specified collection, ordered by a comparator function based on the values computed using the expression predicate.
|
||||
*/
|
||||
<T>(array: T[], expression: string|((value: T) => any)|(((value: T) => any)|string)[], reverse?: boolean, comparator?: IFilterOrderByComparatorFunc): T[];
|
||||
<T>(array: T[], expression: string|((value: T) => any)|Array<((value: T) => any)|string>, reverse?: boolean, comparator?: IFilterOrderByComparatorFunc): T[];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1023,7 +1023,7 @@ declare namespace angular {
|
||||
all<T1, T2, T3, T4>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise <T4>]): IPromise<[T1, T2, T3, T4]>;
|
||||
all<T1, T2, T3>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>]): IPromise<[T1, T2, T3]>;
|
||||
all<T1, T2>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>]): IPromise<[T1, T2]>;
|
||||
all<TAll>(promises: IPromise<TAll>[]): IPromise<TAll[]>;
|
||||
all<TAll>(promises: Array<IPromise<TAll>>): IPromise<TAll[]>;
|
||||
/**
|
||||
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
|
||||
*
|
||||
@ -1284,11 +1284,11 @@ declare namespace angular {
|
||||
}
|
||||
|
||||
interface ITemplateLinkingFunctionOptions {
|
||||
parentBoundTranscludeFn?: ITranscludeFunction,
|
||||
parentBoundTranscludeFn?: ITranscludeFunction;
|
||||
transcludeControllers?: {
|
||||
[controller: string]: { instance: IController }
|
||||
},
|
||||
futureParentElement?: JQuery
|
||||
};
|
||||
futureParentElement?: JQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1510,7 +1510,9 @@ declare namespace angular {
|
||||
(data: any, headersGetter: IHttpHeadersGetter, status: number): any;
|
||||
}
|
||||
|
||||
type HttpHeaderType = {[requestType: string]:string|((config:IRequestConfig) => string)};
|
||||
interface HttpHeaderType {
|
||||
[requestType: string]: string|((config: IRequestConfig) => string);
|
||||
}
|
||||
|
||||
interface IHttpRequestConfigHeaders {
|
||||
[requestType: string]: any;
|
||||
@ -1593,7 +1595,7 @@ declare namespace angular {
|
||||
* Register service factories (names or implementations) for interceptors which are called before and after
|
||||
* each request.
|
||||
*/
|
||||
interceptors: (string | Injectable<IHttpInterceptorFactory>)[];
|
||||
interceptors: Array<string | Injectable<IHttpInterceptorFactory>>;
|
||||
useApplyAsync(): boolean;
|
||||
useApplyAsync(value: boolean): IHttpProvider;
|
||||
|
||||
@ -1603,7 +1605,7 @@ declare namespace angular {
|
||||
* @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
|
||||
* otherwise, returns the current configured value.
|
||||
*/
|
||||
useLegacyPromiseExtensions(value:boolean) : boolean | IHttpProvider;
|
||||
useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -1687,16 +1689,15 @@ declare namespace angular {
|
||||
valueOf(value: any): any;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// SCEDelegateProvider
|
||||
// see http://docs.angularjs.org/api/ng.$sceDelegateProvider
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface ISCEDelegateProvider extends IServiceProvider {
|
||||
resourceUrlBlacklist(blacklist: any[]): void;
|
||||
resourceUrlWhitelist(whitelist: any[]): void;
|
||||
resourceUrlBlacklist(): any[];
|
||||
resourceUrlBlacklist(blacklist: any[]): void;
|
||||
resourceUrlWhitelist(): any[];
|
||||
resourceUrlWhitelist(whitelist: any[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1936,33 +1937,33 @@ declare namespace angular {
|
||||
annotate(fn: Function, strictDi?: boolean): string[];
|
||||
annotate(inlineAnnotatedFunction: any[]): string[];
|
||||
get<T>(name: string, caller?: string): T;
|
||||
get(name: '$anchorScroll'): IAnchorScrollService
|
||||
get(name: '$cacheFactory'): ICacheFactoryService
|
||||
get(name: '$compile'): ICompileService
|
||||
get(name: '$controller'): IControllerService
|
||||
get(name: '$document'): IDocumentService
|
||||
get(name: '$exceptionHandler'): IExceptionHandlerService
|
||||
get(name: '$filter'): IFilterService
|
||||
get(name: '$http'): IHttpService
|
||||
get(name: '$httpBackend'): IHttpBackendService
|
||||
get(name: '$httpParamSerializer'): IHttpParamSerializer
|
||||
get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer
|
||||
get(name: '$interpolate'): IInterpolateService
|
||||
get(name: '$interval'): IIntervalService
|
||||
get(name: '$locale'): ILocaleService
|
||||
get(name: '$location'): ILocationService
|
||||
get(name: '$log'): ILogService
|
||||
get(name: '$parse'): IParseService
|
||||
get(name: '$q'): IQService
|
||||
get(name: '$rootElement'): IRootElementService
|
||||
get(name: '$rootScope'): IRootScopeService
|
||||
get(name: '$sce'): ISCEService
|
||||
get(name: '$sceDelegate'): ISCEDelegateService
|
||||
get(name: '$templateCache'): ITemplateCacheService
|
||||
get(name: '$templateRequest'): ITemplateRequestService
|
||||
get(name: '$timeout'): ITimeoutService
|
||||
get(name: '$window'): IWindowService
|
||||
get<T>(name: '$xhrFactory'): IXhrFactory<T>
|
||||
get(name: '$anchorScroll'): IAnchorScrollService;
|
||||
get(name: '$cacheFactory'): ICacheFactoryService;
|
||||
get(name: '$compile'): ICompileService;
|
||||
get(name: '$controller'): IControllerService;
|
||||
get(name: '$document'): IDocumentService;
|
||||
get(name: '$exceptionHandler'): IExceptionHandlerService;
|
||||
get(name: '$filter'): IFilterService;
|
||||
get(name: '$http'): IHttpService;
|
||||
get(name: '$httpBackend'): IHttpBackendService;
|
||||
get(name: '$httpParamSerializer'): IHttpParamSerializer;
|
||||
get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer;
|
||||
get(name: '$interpolate'): IInterpolateService;
|
||||
get(name: '$interval'): IIntervalService;
|
||||
get(name: '$locale'): ILocaleService;
|
||||
get(name: '$location'): ILocationService;
|
||||
get(name: '$log'): ILogService;
|
||||
get(name: '$parse'): IParseService;
|
||||
get(name: '$q'): IQService;
|
||||
get(name: '$rootElement'): IRootElementService;
|
||||
get(name: '$rootScope'): IRootScopeService;
|
||||
get(name: '$sce'): ISCEService;
|
||||
get(name: '$sceDelegate'): ISCEDelegateService;
|
||||
get(name: '$templateCache'): ITemplateCacheService;
|
||||
get(name: '$templateRequest'): ITemplateRequestService;
|
||||
get(name: '$timeout'): ITimeoutService;
|
||||
get(name: '$window'): IWindowService;
|
||||
get<T>(name: '$xhrFactory'): IXhrFactory<T>;
|
||||
has(name: string): boolean;
|
||||
instantiate<T>(typeConstructor: Function, locals?: any): T;
|
||||
invoke(inlineAnnotatedFunction: any[]): any;
|
||||
|
||||
20
angular/tslint.json
Normal file
20
angular/tslint.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
"rules": {
|
||||
"class-name": true,
|
||||
"curly": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-shadowed-variable": true,
|
||||
"quotemark": [true, "single"],
|
||||
"align": true,
|
||||
"callable-types": false,
|
||||
"forbidden-types": false,
|
||||
"indent": [true, "spaces"],
|
||||
"interface-name": false,
|
||||
"linebreak-style": [true, "LF"],
|
||||
"no-empty-interface": false,
|
||||
"unified-signatures": false,
|
||||
"variable-name": [true, "check-format"],
|
||||
"void-return": false
|
||||
}
|
||||
}
|
||||
1
antd/index.d.ts
vendored
1
antd/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: http://ant.design
|
||||
// Definitions by: bang88 <https://github.com/bang88>, Bruce Mitchener <https://github.com/waywardmonkeys/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="react" />
|
||||
|
||||
|
||||
1
aphrodite/index.d.ts
vendored
1
aphrodite/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/Khan/aphrodite
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
@ -8,3 +8,21 @@ autosize(document.querySelector('textarea'));
|
||||
|
||||
// from a single element
|
||||
autosize(document.getElementById('my-textarea'));
|
||||
|
||||
// update a NodeList
|
||||
autosize.update(document.querySelectorAll('textarea'));
|
||||
|
||||
// update a single Node
|
||||
autosize.update(document.querySelector('textarea'));
|
||||
|
||||
// update a single element
|
||||
autosize.update(document.getElementById('my-textarea'));
|
||||
|
||||
// destroy a NodeList
|
||||
autosize.destroy(document.querySelectorAll('textarea'));
|
||||
|
||||
// destroy a single Node
|
||||
autosize.destroy(document.querySelector('textarea'));
|
||||
|
||||
// destroy a single element
|
||||
autosize.destroy(document.getElementById('my-textarea'));
|
||||
|
||||
6
autosize/index.d.ts
vendored
6
autosize/index.d.ts
vendored
@ -1,12 +1,16 @@
|
||||
// Type definitions for jquery.autosize 3.0.7
|
||||
// Project: http://www.jacklmoore.com/autosize/
|
||||
// Definitions by: Aaron T. King <https://github.com/kingdango>
|
||||
// Definitions by: Aaron T. King <https://github.com/kingdango>, keika299 <https://github.com/keika299>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace autosize {
|
||||
interface AutosizeStatic {
|
||||
(el: Element): void;
|
||||
(el: NodeList): void;
|
||||
update(el: Element): void;
|
||||
update(el: NodeList): void;
|
||||
destroy(el: Element): void;
|
||||
destroy(el: NodeList): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
bookshelf/index.d.ts
vendored
1
bookshelf/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: http://bookshelfjs.org/
|
||||
// Definitions by: Andrew Schurman <http://github.com/arcticwaters>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import Knex = require('knex');
|
||||
import knex = require('knex');
|
||||
|
||||
6
cannon/cannon-tests.ts
Normal file
6
cannon/cannon-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import cannon = require("cannon");
|
||||
|
||||
var aabb = new cannon.AABB()
|
||||
|
||||
aabb.setFromPoints([new cannon.Vec3(1,2,3)]);
|
||||
|
||||
1000
cannon/index.d.ts
vendored
Normal file
1000
cannon/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@ -17,6 +17,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ecmarkup-tests.ts"
|
||||
"cannon-tests.ts"
|
||||
]
|
||||
}
|
||||
1
chai-enzyme/index.d.ts
vendored
1
chai-enzyme/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/producthunt/chai-enzyme
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
|
||||
/// <reference types="enzyme" />
|
||||
|
||||
16
comment-json/comment-json-tests.ts
Normal file
16
comment-json/comment-json-tests.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import * as commentJson from 'comment-json';
|
||||
|
||||
const result = commentJson.parse(`
|
||||
/**
|
||||
block comment at the top
|
||||
*/
|
||||
// comment at the top
|
||||
{
|
||||
// comment for a
|
||||
// comment line 2 for a
|
||||
/* block comment */
|
||||
"a": 1 // comment at right
|
||||
}
|
||||
// comment at the bottom
|
||||
`);
|
||||
const str = commentJson.stringify(result);
|
||||
8
comment-json/index.d.ts
vendored
Normal file
8
comment-json/index.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// Type definitions for comment-json 1.1
|
||||
// Project: https://github.com/kaelzhang/node-comment-json
|
||||
// Definitions by: Jason Dent <https://github.com/Jason3S>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export type Reviver = (k: number | string, v: any) => any;
|
||||
export function parse(json: string, reviver?: Reviver, removes_comments?: boolean): any;
|
||||
export function stringify(value: any, replacer?: any, space?: string | number): string;
|
||||
20
comment-json/tsconfig.json
Normal file
20
comment-json/tsconfig.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"comment-json-tests.ts"
|
||||
]
|
||||
}
|
||||
1
comment-json/tslint.json
Normal file
1
comment-json/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
2
cordova-plugin-inappbrowser/index.d.ts
vendored
2
cordova-plugin-inappbrowser/index.d.ts
vendored
@ -168,6 +168,8 @@ interface InAppBrowser extends Window {
|
||||
removeEventListener(type: string, callback: (event: Event) => void): void;
|
||||
/** Closes the InAppBrowser window. */
|
||||
close(): void;
|
||||
/** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */
|
||||
hide(): void;
|
||||
/**
|
||||
* Displays an InAppBrowser window that was opened hidden. Calling this has no effect
|
||||
* if the InAppBrowser was already visible.
|
||||
|
||||
3
credit-card-type/index.d.ts
vendored
3
credit-card-type/index.d.ts
vendored
@ -10,7 +10,8 @@ declare namespace creditCardType {
|
||||
interface CreditCardTypeInfo {
|
||||
niceType?: string
|
||||
type?: CardBrand
|
||||
pattern?: RegExp
|
||||
prefixPattern?: RegExp
|
||||
exactPattern?: RegExp
|
||||
gaps?: Array<number>
|
||||
lengths?: Array<number>
|
||||
code?: {
|
||||
|
||||
3
crypto-js/aes/index.d.ts
vendored
Normal file
3
crypto-js/aes/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { AES } from '../index';
|
||||
|
||||
export = AES;
|
||||
3
crypto-js/core/index.d.ts
vendored
Normal file
3
crypto-js/core/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import * as Core from '../index';
|
||||
|
||||
export = Core;
|
||||
4
crypto-js/enc-base64/index.d.ts
vendored
Normal file
4
crypto-js/enc-base64/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { enc } from '../index';
|
||||
|
||||
declare const Base64: typeof enc.Base64;
|
||||
export = Base64;
|
||||
4
crypto-js/enc-hex/index.d.ts
vendored
Normal file
4
crypto-js/enc-hex/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { enc } from '../index';
|
||||
|
||||
declare const Hex: typeof enc.Hex;
|
||||
export = Hex;
|
||||
4
crypto-js/enc-latin1/index.d.ts
vendored
Normal file
4
crypto-js/enc-latin1/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { enc } from '../index';
|
||||
|
||||
declare const Latin1: typeof enc.Latin1;
|
||||
export = Latin1;
|
||||
4
crypto-js/enc-utf16/index.d.ts
vendored
Normal file
4
crypto-js/enc-utf16/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { enc } from '../index';
|
||||
|
||||
declare const Utf16: typeof enc.Utf16;
|
||||
export = Utf16;
|
||||
4
crypto-js/enc-utf8/index.d.ts
vendored
Normal file
4
crypto-js/enc-utf8/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { enc } from '../index';
|
||||
|
||||
declare const Utf8: typeof enc.Utf8;
|
||||
export = Utf8;
|
||||
3
crypto-js/evpkdf/index.d.ts
vendored
Normal file
3
crypto-js/evpkdf/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { EvpKDF } from '../index';
|
||||
|
||||
export = EvpKDF;
|
||||
4
crypto-js/format-hex/index.d.ts
vendored
Normal file
4
crypto-js/format-hex/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { format } from '../index';
|
||||
|
||||
declare const Hex: typeof format.Hex;
|
||||
export = Hex;
|
||||
4
crypto-js/format-openssl/index.d.ts
vendored
Normal file
4
crypto-js/format-openssl/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { format } from '../index';
|
||||
|
||||
declare const OpenSSL: typeof format.OpenSSL;
|
||||
export = OpenSSL;
|
||||
3
crypto-js/hmac-md5/index.d.ts
vendored
Normal file
3
crypto-js/hmac-md5/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacMD5 } from '../index';
|
||||
|
||||
export = HmacMD5;
|
||||
3
crypto-js/hmac-ripemd160/index.d.ts
vendored
Normal file
3
crypto-js/hmac-ripemd160/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacRIPEMD160 } from '../index';
|
||||
|
||||
export = HmacRIPEMD160;
|
||||
3
crypto-js/hmac-sha1/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha1/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA1 } from '../index';
|
||||
|
||||
export = HmacSHA1;
|
||||
3
crypto-js/hmac-sha224/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha224/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA224 } from '../index';
|
||||
|
||||
export = HmacSHA224;
|
||||
3
crypto-js/hmac-sha256/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha256/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA256 } from '../index';
|
||||
|
||||
export = HmacSHA256;
|
||||
3
crypto-js/hmac-sha3/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha3/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA3 } from '../index';
|
||||
|
||||
export = HmacSHA3;
|
||||
3
crypto-js/hmac-sha384/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha384/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA384 } from '../index';
|
||||
|
||||
export = HmacSHA384;
|
||||
3
crypto-js/hmac-sha512/index.d.ts
vendored
Normal file
3
crypto-js/hmac-sha512/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { HmacSHA512 } from '../index';
|
||||
|
||||
export = HmacSHA512;
|
||||
1
crypto-js/index.d.ts
vendored
1
crypto-js/index.d.ts
vendored
@ -114,4 +114,3 @@ declare namespace CryptoJS {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
crypto-js/lib-typedarrays/index.d.ts
vendored
Normal file
2
crypto-js/lib-typedarrays/index.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare const LibTypedarrays: any;
|
||||
export = LibTypedarrays;
|
||||
3
crypto-js/md5/index.d.ts
vendored
Normal file
3
crypto-js/md5/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { MD5 } from '../index';
|
||||
|
||||
export = MD5;
|
||||
4
crypto-js/mode-cfb/index.d.ts
vendored
Normal file
4
crypto-js/mode-cfb/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { mode } from '../index';
|
||||
|
||||
declare const CFB: typeof mode.CFB;
|
||||
export = CFB;
|
||||
4
crypto-js/mode-ctr-gladman/index.d.ts
vendored
Normal file
4
crypto-js/mode-ctr-gladman/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { mode } from '../index';
|
||||
|
||||
declare const CTRGladman: typeof mode.CTRGladman;
|
||||
export = CTRGladman;
|
||||
4
crypto-js/mode-ctr/index.d.ts
vendored
Normal file
4
crypto-js/mode-ctr/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { mode } from '../index';
|
||||
|
||||
declare const CTR: typeof mode.CTR;
|
||||
export = CTR;
|
||||
4
crypto-js/mode-ecb/index.d.ts
vendored
Normal file
4
crypto-js/mode-ecb/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { mode } from '../index';
|
||||
|
||||
declare const ECB: typeof mode.ECB;
|
||||
export = ECB;
|
||||
4
crypto-js/mode-ofb/index.d.ts
vendored
Normal file
4
crypto-js/mode-ofb/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { mode } from '../index';
|
||||
|
||||
declare const OFB: typeof mode.OFB;
|
||||
export = OFB;
|
||||
4
crypto-js/pad-ansix923/index.d.ts
vendored
Normal file
4
crypto-js/pad-ansix923/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const AnsiX923: typeof pad.AnsiX923;
|
||||
export = AnsiX923;
|
||||
4
crypto-js/pad-iso10126/index.d.ts
vendored
Normal file
4
crypto-js/pad-iso10126/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const Iso10126: typeof pad.Iso10126;
|
||||
export = Iso10126;
|
||||
4
crypto-js/pad-iso97971/index.d.ts
vendored
Normal file
4
crypto-js/pad-iso97971/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const Iso97971: typeof pad.Iso97971;
|
||||
export = Iso97971;
|
||||
4
crypto-js/pad-nopadding/index.d.ts
vendored
Normal file
4
crypto-js/pad-nopadding/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const NoPadding: typeof pad.NoPadding;
|
||||
export = NoPadding;
|
||||
4
crypto-js/pad-pkcs7/index.d.ts
vendored
Normal file
4
crypto-js/pad-pkcs7/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const Pkcs7: typeof pad.Pkcs7;
|
||||
export = Pkcs7;
|
||||
4
crypto-js/pad-zeropadding/index.d.ts
vendored
Normal file
4
crypto-js/pad-zeropadding/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { pad } from '../index';
|
||||
|
||||
declare const ZeroPadding: typeof pad.ZeroPadding;
|
||||
export = ZeroPadding;
|
||||
3
crypto-js/pbkdf2/index.d.ts
vendored
Normal file
3
crypto-js/pbkdf2/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { PBKDF2 } from '../index';
|
||||
|
||||
export = PBKDF2;
|
||||
3
crypto-js/rabbit-legacy/index.d.ts
vendored
Normal file
3
crypto-js/rabbit-legacy/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { RabbitLegacy } from '../index';
|
||||
|
||||
export = RabbitLegacy;
|
||||
3
crypto-js/rabbit/index.d.ts
vendored
Normal file
3
crypto-js/rabbit/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { Rabbit } from '../index';
|
||||
|
||||
export = Rabbit;
|
||||
3
crypto-js/rc4/index.d.ts
vendored
Normal file
3
crypto-js/rc4/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { RC4 } from '../index';
|
||||
|
||||
export = RC4;
|
||||
3
crypto-js/ripemd160/index.d.ts
vendored
Normal file
3
crypto-js/ripemd160/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { RIPEMD160 } from '../index';
|
||||
|
||||
export = RIPEMD160;
|
||||
3
crypto-js/sha1/index.d.ts
vendored
Normal file
3
crypto-js/sha1/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA1 } from '../index';
|
||||
|
||||
export = SHA1;
|
||||
3
crypto-js/sha224/index.d.ts
vendored
Normal file
3
crypto-js/sha224/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA224 } from '../index';
|
||||
|
||||
export = SHA224;
|
||||
3
crypto-js/sha256/index.d.ts
vendored
Normal file
3
crypto-js/sha256/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA256 } from '../index';
|
||||
|
||||
export = SHA256;
|
||||
3
crypto-js/sha3/index.d.ts
vendored
Normal file
3
crypto-js/sha3/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA3 } from '../index';
|
||||
|
||||
export = SHA3;
|
||||
3
crypto-js/sha384/index.d.ts
vendored
Normal file
3
crypto-js/sha384/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA384 } from '../index';
|
||||
|
||||
export = SHA384;
|
||||
3
crypto-js/sha512/index.d.ts
vendored
Normal file
3
crypto-js/sha512/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SHA512 } from '../index';
|
||||
|
||||
export = SHA512;
|
||||
184
crypto-js/test/submodule-tests.ts
Normal file
184
crypto-js/test/submodule-tests.ts
Normal file
@ -0,0 +1,184 @@
|
||||
import Core = require('../core');
|
||||
import X64Core = require('../x64-core');
|
||||
import LibTypedarrays = require('../lib-typedarrays');
|
||||
// ---
|
||||
import MD5 = require('../md5');
|
||||
import SHA1 = require('../sha1');
|
||||
import SHA256 = require('../sha256');
|
||||
import SHA224 = require('../sha224');
|
||||
import SHA512 = require('../sha512');
|
||||
import SHA384 = require('../sha384');
|
||||
import SHA3 = require('../sha3');
|
||||
import RIPEMD160 = require('../ripemd160');
|
||||
// ---
|
||||
import HmacMD5 = require('../hmac-md5');
|
||||
import HmacSHA1 = require('../hmac-sha1');
|
||||
import HmacSHA256 = require('../hmac-sha256');
|
||||
import HmacSHA224 = require('../hmac-sha224');
|
||||
import HmacSHA512 = require('../hmac-sha512');
|
||||
import HmacSHA384 = require('../hmac-sha384');
|
||||
import HmacSHA3 = require('../hmac-sha3');
|
||||
import HmacRIPEMD160 = require('../hmac-ripemd160');
|
||||
// ---
|
||||
import PBKDF2 = require('../pbkdf2');
|
||||
// ---
|
||||
import AES = require('../aes');
|
||||
import TripleDES = require('../tripledes');
|
||||
import RC4 = require('../rc4');
|
||||
import Rabbit = require('../rabbit');
|
||||
import RabbitLegacy = require('../rabbit-legacy');
|
||||
import EvpKDF = require('../evpkdf');
|
||||
// ---
|
||||
import FormatOpenSSL = require('../format-openssl');
|
||||
import FormatHex = require('../format-hex');
|
||||
// ---
|
||||
import EncLatin1 = require('../enc-latin1');
|
||||
import EncUtf8 = require('../enc-utf8');
|
||||
import EncHex = require('../enc-hex');
|
||||
import EncUtf16 = require('../enc-utf16');
|
||||
import EncBase64 = require('../enc-base64');
|
||||
// ---
|
||||
import ModeCFB = require('../mode-cfb');
|
||||
import ModeCTR = require('../mode-ctr');
|
||||
import ModeCTRGladman = require('../mode-ctr-gladman');
|
||||
import ModeOFB = require('../mode-ofb');
|
||||
import ModeECB = require('../mode-ecb');
|
||||
// ---
|
||||
import PadPkcs7 = require('../pad-pkcs7');
|
||||
import PadAnsiX923 = require('../pad-ansix923');
|
||||
import PadIso10126 = require('../pad-iso10126');
|
||||
import PadIso97971 = require('../pad-iso97971');
|
||||
import PadZeroPadding = require('../pad-zeropadding');
|
||||
import PadNoPadding = require('../pad-nopadding');
|
||||
|
||||
// Hashers
|
||||
var str: string;
|
||||
str = MD5('some message');
|
||||
str = MD5('some message', 'some key');
|
||||
|
||||
str = SHA1('some message');
|
||||
str = SHA1('some message', 'some key', { any: true });
|
||||
|
||||
str = FormatOpenSSL('some message');
|
||||
str = FormatOpenSSL('some message', 'some key');
|
||||
|
||||
|
||||
// Ciphers
|
||||
var encrypted: CryptoJS.WordArray;
|
||||
var decrypted: CryptoJS.DecryptedMessage;
|
||||
|
||||
encrypted = <CryptoJS.WordArray>AES.encrypt("Message", "Secret Passphrase");
|
||||
decrypted = AES.decrypt(encrypted, "Secret Passphrase");
|
||||
|
||||
encrypted = <CryptoJS.WordArray>Core.DES.encrypt("Message", "Secret Passphrase");
|
||||
decrypted = Core.DES.decrypt(encrypted, "Secret Passphrase");
|
||||
|
||||
encrypted = TripleDES.encrypt("Message", "Secret Passphrase");
|
||||
decrypted = TripleDES.decrypt(encrypted, "Secret Passphrase");
|
||||
|
||||
|
||||
encrypted = Rabbit.encrypt("Message", "Secret Passphrase");
|
||||
decrypted = Rabbit.decrypt(encrypted, "Secret Passphrase");
|
||||
|
||||
encrypted = RC4.encrypt("Message", "Secret Passphrase");
|
||||
decrypted = RC4.decrypt(encrypted, "Secret Passphrase");
|
||||
|
||||
encrypted = Core.RC4Drop.encrypt("Message", "Secret Passphrase");
|
||||
encrypted = Core.RC4Drop.encrypt("Message", "Secret Passphrase", { drop: 3072 / 4 });
|
||||
decrypted = Core.RC4Drop.decrypt(encrypted, "Secret Passphrase", { drop: 3072 / 4 });
|
||||
|
||||
var key = EncHex.parse('000102030405060708090a0b0c0d0e0f');
|
||||
var iv = EncHex.parse('101112131415161718191a1b1c1d1e1f');
|
||||
encrypted = AES.encrypt("Message", key, { iv: iv });
|
||||
|
||||
encrypted = AES.encrypt("Message", "Secret Passphrase", {
|
||||
mode: ModeCFB,
|
||||
padding: PadAnsiX923
|
||||
});
|
||||
|
||||
|
||||
// The Cipher Output
|
||||
encrypted = AES.encrypt("Message", "Secret Passphrase");
|
||||
alert(encrypted.key);
|
||||
// 74eb593087a982e2a6f5dded54ecd96d1fd0f3d44a58728cdcd40c55227522223
|
||||
alert(encrypted.iv);
|
||||
// 7781157e2629b094f0e3dd48c4d786115
|
||||
alert(encrypted.salt);
|
||||
// 7a25f9132ec6a8b34
|
||||
alert(encrypted.ciphertext);
|
||||
// 73e54154a15d1beeb509d9e12f1e462a0
|
||||
alert(encrypted);
|
||||
// U2FsdGVkX1+iX5Ey7GqLND5UFUoV0b7rUJ2eEvHkYqA=
|
||||
|
||||
var JsonFormatter = {
|
||||
stringify: function(cipherParams: any) {
|
||||
// create json object with ciphertext
|
||||
var jsonObj: any = {
|
||||
ct: cipherParams.ciphertext.toString(EncBase64)
|
||||
};
|
||||
// optionally add iv and salt
|
||||
if (cipherParams.iv) {
|
||||
jsonObj.iv = cipherParams.iv.toString();
|
||||
}
|
||||
if (cipherParams.salt) {
|
||||
jsonObj.s = cipherParams.salt.toString();
|
||||
}
|
||||
// stringify json object
|
||||
return JSON.stringify(jsonObj);
|
||||
},
|
||||
parse: function (jsonStr: any) {
|
||||
// parse json string
|
||||
var jsonObj = JSON.parse(jsonStr);
|
||||
// extract ciphertext from json object, and create cipher params object
|
||||
var cipherParams = (<any>Core).lib.CipherParams.create({
|
||||
ciphertext: EncBase64.parse(jsonObj.ct)
|
||||
});
|
||||
// optionally extract iv and salt
|
||||
if (jsonObj.iv) {
|
||||
cipherParams.iv = EncHex.parse(jsonObj.iv);
|
||||
}
|
||||
if (jsonObj.s) {
|
||||
cipherParams.salt = EncHex.parse(jsonObj.s);
|
||||
} return cipherParams;
|
||||
}
|
||||
};
|
||||
encrypted = AES.encrypt("Message", "Secret Passphrase", {
|
||||
format: JsonFormatter
|
||||
});
|
||||
alert(encrypted);
|
||||
// {"ct":"tZ4MsEnfbcDOwqau68aOrQ==","iv":"8a8c8fd8fe33743d3638737ea4a00698","s":"ba06373c8f57179c"}
|
||||
decrypted = AES.decrypt(encrypted, "Secret Passphrase", {
|
||||
format: JsonFormatter
|
||||
});
|
||||
alert(decrypted.toString(EncUtf8)); // Message
|
||||
|
||||
|
||||
// Progressive Ciphering
|
||||
var key = EncHex.parse('000102030405060708090a0b0c0d0e0f');
|
||||
var iv = EncHex.parse('101112131415161718191a1b1c1d1e1f');
|
||||
var aesEncryptor = Core.algo.AES.createEncryptor(key, { iv: iv });
|
||||
var ciphertextPart1 = aesEncryptor.process("Message Part 1");
|
||||
var ciphertextPart2 = aesEncryptor.process("Message Part 2");
|
||||
var ciphertextPart3 = aesEncryptor.process("Message Part 3");
|
||||
var ciphertextPart4 = aesEncryptor.finalize();
|
||||
var aesDecryptor = Core.algo.AES.createDecryptor(key, { iv: iv });
|
||||
var plaintextPart1 = aesDecryptor.process(ciphertextPart1);
|
||||
var plaintextPart2 = aesDecryptor.process(ciphertextPart2);
|
||||
var plaintextPart3 = aesDecryptor.process(ciphertextPart3);
|
||||
var plaintextPart4 = aesDecryptor.process(ciphertextPart4);
|
||||
var plaintextPart5 = aesDecryptor.finalize();
|
||||
|
||||
|
||||
// Encoders
|
||||
var words = EncBase64.parse('SGVsbG8sIFdvcmxkIQ==');
|
||||
var base64 = EncBase64.stringify(words);
|
||||
var words = EncLatin1.parse('Hello, World!');
|
||||
var latin1 = EncLatin1.stringify(words);
|
||||
var words = EncHex.parse('48656c6c6f2c20576f726c6421');
|
||||
var hex = EncHex.stringify(words);
|
||||
var words = EncUtf8.parse('𤭢');
|
||||
var utf8 = EncUtf8.stringify(words);
|
||||
var words = EncUtf16.parse('Hello, World!');
|
||||
var utf16 = EncUtf16.stringify(words);
|
||||
var words = Core.enc.Utf16LE.parse('Hello, World!');
|
||||
var utf16 = Core.enc.Utf16LE.stringify(words);
|
||||
3
crypto-js/tripledes/index.d.ts
vendored
Normal file
3
crypto-js/tripledes/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { TripleDES } from '../index';
|
||||
|
||||
export = TripleDES;
|
||||
@ -18,6 +18,51 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"crypto-js-tests.ts"
|
||||
"crypto-js-tests.ts",
|
||||
"test/submodule-tests.ts",
|
||||
"core/index.d.ts",
|
||||
"x64-core/index.d.ts",
|
||||
"lib-typedarrays/index.d.ts",
|
||||
"md5/index.d.ts",
|
||||
"sha1/index.d.ts",
|
||||
"sha256/index.d.ts",
|
||||
"sha224/index.d.ts",
|
||||
"sha512/index.d.ts",
|
||||
"sha384/index.d.ts",
|
||||
"sha3/index.d.ts",
|
||||
"ripemd160/index.d.ts",
|
||||
"hmac-md5/index.d.ts",
|
||||
"hmac-sha1/index.d.ts",
|
||||
"hmac-sha256/index.d.ts",
|
||||
"hmac-sha224/index.d.ts",
|
||||
"hmac-sha512/index.d.ts",
|
||||
"hmac-sha384/index.d.ts",
|
||||
"hmac-sha3/index.d.ts",
|
||||
"hmac-ripemd160/index.d.ts",
|
||||
"pbkdf2/index.d.ts",
|
||||
"aes/index.d.ts",
|
||||
"tripledes/index.d.ts",
|
||||
"rc4/index.d.ts",
|
||||
"rabbit/index.d.ts",
|
||||
"rabbit-legacy/index.d.ts",
|
||||
"evpkdf/index.d.ts",
|
||||
"format-openssl/index.d.ts",
|
||||
"format-hex/index.d.ts",
|
||||
"enc-latin1/index.d.ts",
|
||||
"enc-utf8/index.d.ts",
|
||||
"enc-hex/index.d.ts",
|
||||
"enc-utf16/index.d.ts",
|
||||
"enc-base64/index.d.ts",
|
||||
"mode-cfb/index.d.ts",
|
||||
"mode-ctr/index.d.ts",
|
||||
"mode-ctr-gladman/index.d.ts",
|
||||
"mode-ofb/index.d.ts",
|
||||
"mode-ecb/index.d.ts",
|
||||
"pad-pkcs7/index.d.ts",
|
||||
"pad-ansix923/index.d.ts",
|
||||
"pad-iso10126/index.d.ts",
|
||||
"pad-iso97971/index.d.ts",
|
||||
"pad-zeropadding/index.d.ts",
|
||||
"pad-nopadding/index.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
3
crypto-js/x64-core/index.d.ts
vendored
Normal file
3
crypto-js/x64-core/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import * as X64Core from '../index';
|
||||
|
||||
export = X64Core;
|
||||
2
d3-array/index.d.ts
vendored
2
d3-array/index.d.ts
vendored
@ -121,7 +121,7 @@ export function extent<T>(array: T[], accessor: (datum: T, index: number, array:
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T, U extends Numeric>(array: T[], accessor: (datum: T, index: number, array: T[]) => U): [U | Primitive, U | Primitive] | [undefined, undefined];
|
||||
export function extent<T, U extends Numeric>(array: T[], accessor: (datum: T, index: number, array: T[]) => U): [U, U ] | [undefined, undefined];
|
||||
|
||||
/**
|
||||
* Return the mean of an array of numbers
|
||||
|
||||
1819
devextreme/index.d.ts
vendored
1819
devextreme/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,31 @@ docDBClient.createStoredProcedure('collection', procedure, undefined, (error, re
|
||||
}
|
||||
});
|
||||
|
||||
var userDefinedFunction: docDB.UserDefinedFunction = {
|
||||
id: 'udf1',
|
||||
body: function () {
|
||||
console.log('foo');
|
||||
}
|
||||
};
|
||||
|
||||
docDBClient.createUserDefinedFunction('collection', userDefinedFunction, undefined, (error, result) => {
|
||||
if (error) {
|
||||
throw new Error(error.body);
|
||||
}
|
||||
else {
|
||||
console.log('Created function: ' + result.id);
|
||||
}
|
||||
});
|
||||
|
||||
docDBClient.queryUserDefinedFunctions('collection', "SELECT * FROM root", undefined).toArray((error, results) => {
|
||||
if (error) {
|
||||
throw new Error(error.body);
|
||||
}
|
||||
else {
|
||||
console.log('Number of functions in collection: ' + results.length);
|
||||
}
|
||||
});
|
||||
|
||||
var trigger: docDB.Trigger = {
|
||||
id: 'trigger-one',
|
||||
body: function () {
|
||||
|
||||
33
documentdb/index.d.ts
vendored
33
documentdb/index.d.ts
vendored
@ -154,6 +154,10 @@ interface ProcedureMeta extends AbstractMeta {
|
||||
body: string;
|
||||
}
|
||||
|
||||
/** Represents the meta data for a user-defined function. */
|
||||
interface UserDefinedFunctionMeta extends AbstractMeta {
|
||||
}
|
||||
|
||||
/** Represents the meta data for a trigger. */
|
||||
interface TriggerMeta extends AbstractMeta {
|
||||
body: string;
|
||||
@ -181,6 +185,13 @@ export interface Procedure extends UniqueId {
|
||||
body(...params: any[]): void;
|
||||
}
|
||||
|
||||
/** Represents a DocumentDB user-defined function. */
|
||||
export interface UserDefinedFunction extends UniqueId {
|
||||
|
||||
/** The function representing the user-defined function. */
|
||||
body(...params: any[]): void;
|
||||
}
|
||||
|
||||
/** Represents a DocumentDB trigger. */
|
||||
export interface Trigger extends UniqueId {
|
||||
/** The type of the trigger. Should be either 'pre' or 'post'. */
|
||||
@ -290,6 +301,19 @@ export declare class DocumentClient {
|
||||
*/
|
||||
public createStoredProcedure(collectionLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback<ProcedureMeta>): void;
|
||||
|
||||
/**
|
||||
* Create a UserDefinedFunction.
|
||||
* <p>
|
||||
* DocumentDB supports JavaScript UDFs which can be used inside queries, stored procedures and triggers. <br>
|
||||
* For additional details, refer to the server-side JavaScript API documentation.
|
||||
* </p>
|
||||
* @param collectionLink - The self-link of the collection.
|
||||
* @param udf - Represents the body of the userDefinedFunction.
|
||||
* @param [options] - The request options.
|
||||
* @param callback - The callback for the request.
|
||||
*/
|
||||
public createUserDefinedFunction(collectionLink: string, udf: UserDefinedFunction, options: RequestOptions, callback: RequestCallback<UserDefinedFunctionMeta>): void;
|
||||
|
||||
/**
|
||||
* Create a trigger.
|
||||
* <p>
|
||||
@ -349,6 +373,15 @@ export declare class DocumentClient {
|
||||
*/
|
||||
public queryStoredProcedures(collectionLink: string, query: string | SqlQuerySpec): QueryIterator<ProcedureMeta>;
|
||||
|
||||
/**
|
||||
* Query the user-defined functions for the collection.
|
||||
* @param collectionLink - The self-link of the collection.
|
||||
* @param query - A SQL query string.
|
||||
* @param [options] - Represents the feed options.
|
||||
* @returns - An instance of queryIterator to handle reading feed.
|
||||
*/
|
||||
public queryUserDefinedFunctions(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<UserDefinedFunctionMeta>;
|
||||
|
||||
/**
|
||||
* Query the documents for the collection.
|
||||
* @param collectionLink - The self-link of the collection.
|
||||
|
||||
@ -16,10 +16,10 @@ var src = {
|
||||
}
|
||||
};
|
||||
|
||||
var tgt = {name: 'Brandon'};
|
||||
var tgt = { name: 'Brandon' };
|
||||
|
||||
dot.copy('stuff.phone', 'wanna.haves.phone', src, tgt, [(arg: any) => {
|
||||
return arg;
|
||||
return arg;
|
||||
}]);
|
||||
|
||||
dot.transfer('stuff.phone', 'wanna.haves.phone', src, tgt);
|
||||
@ -37,17 +37,17 @@ var row = {
|
||||
};
|
||||
|
||||
dot.object(row, (arg: any) => {
|
||||
return arg;
|
||||
return arg;
|
||||
});
|
||||
|
||||
dot.str('this.is.my.string', 'value', tgt);
|
||||
|
||||
var newObj = {
|
||||
some: {
|
||||
nested: {
|
||||
value: 'Hi there!'
|
||||
}
|
||||
}
|
||||
some: {
|
||||
nested: {
|
||||
value: 'Hi there!'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var val = dot.pick('some.nested.value', newObj);
|
||||
@ -62,4 +62,9 @@ val = dot.remove('some.nested.value', newObj);
|
||||
// or use the alias `del`
|
||||
val = dot.del('some.nested.value', newObj);
|
||||
|
||||
var dotWithArrow = new dot('=>');
|
||||
// convert object to dot object
|
||||
var result = {};
|
||||
dot.dot({ test: 'something' }, result);
|
||||
result = dot.dot({ test: 'something' });
|
||||
|
||||
var dotWithArrow = new dot('=>');
|
||||
|
||||
25
dot-object/index.d.ts
vendored
25
dot-object/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for Dot-Object v1.4.1
|
||||
// Type definitions for Dot-Object v1.4.2
|
||||
// Project: https://github.com/rhalff/dot-object
|
||||
// Definitions by: Niko Kovačič <https://github.com/nkovacic>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@ -6,14 +6,14 @@
|
||||
|
||||
declare namespace DotObject {
|
||||
interface DotConstructor extends Dot {
|
||||
new(separator: string): Dot;
|
||||
new (separator: string): Dot;
|
||||
}
|
||||
|
||||
interface ModifierFunctionWrapper {
|
||||
(arg: any): any;
|
||||
}
|
||||
|
||||
interface Dot {
|
||||
interface Dot {
|
||||
/**
|
||||
*
|
||||
* Copy a property from one object to another object.
|
||||
@ -34,11 +34,6 @@ declare namespace DotObject {
|
||||
* Convert object to dotted-key/value pair
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* var tgt = dot.dot(obj)
|
||||
*
|
||||
* or
|
||||
*
|
||||
* var tgt = {}
|
||||
* dot.dot(obj, tgt)
|
||||
*
|
||||
@ -46,6 +41,18 @@ declare namespace DotObject {
|
||||
* @param {Object} tgt target object
|
||||
*/
|
||||
dot(obj: any, tgt: any): void
|
||||
/**
|
||||
*
|
||||
* Convert object to dotted-key/value pair
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* var tgt = dot.dot(obj)
|
||||
* @param {Object} obj source object
|
||||
* @return {Object} result
|
||||
*/
|
||||
dot(obj: any): any
|
||||
|
||||
/**
|
||||
*
|
||||
* Remove value from an object using dot notation.
|
||||
@ -166,4 +173,4 @@ declare var dot: DotObject.DotConstructor;
|
||||
|
||||
declare module 'dot-object' {
|
||||
export = dot;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
/// <reference types="ecmarkup" />
|
||||
|
||||
import * as emu from "ecmarkup";
|
||||
|
||||
emu.build("string", (path: string) => Promise.resolve("string"), {
|
||||
contributors: "string",
|
||||
copyright: true,
|
||||
date: new Date(),
|
||||
location: "string",
|
||||
oldToc: true,
|
||||
toc: true,
|
||||
shortname: "string",
|
||||
stage: "string",
|
||||
status: "proposal",
|
||||
title: "string",
|
||||
version: "string",
|
||||
verbose: true
|
||||
}).then((spec: emu.Spec) => {
|
||||
const output = spec.toHTML();
|
||||
const biblio = spec.exportBiblio();
|
||||
});
|
||||
32
ecmarkup/index.d.ts
vendored
32
ecmarkup/index.d.ts
vendored
@ -1,32 +0,0 @@
|
||||
// Type definitions for emarkup v3.3.2
|
||||
// Project: http://github.com/bterlson/ecmarkup
|
||||
// Definitions by: Ron Buckton <https://github.com/rbuckton>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Spec {
|
||||
spec: this;
|
||||
location: string;
|
||||
opts: Options;
|
||||
rootPath: string;
|
||||
rootDir: string;
|
||||
namespace: string;
|
||||
toHTML(): string;
|
||||
exportBiblio(): any;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
status?: "proposal" | "draft" | "standard";
|
||||
version?: string;
|
||||
title?: string;
|
||||
shortname?: string;
|
||||
stage?: string | null;
|
||||
copyright?: boolean;
|
||||
date?: Date;
|
||||
location?: string;
|
||||
contributors?: string;
|
||||
toc?: boolean;
|
||||
oldToc?: boolean;
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
export function build(path: string, fetch: (path: string) => PromiseLike<string>, opts?: Options): PromiseLike<Spec | undefined>;
|
||||
@ -1,3 +1,5 @@
|
||||
import * as elasticjs from 'elastic.js';
|
||||
|
||||
let body = new elasticjs.Request({})
|
||||
.query(new elasticjs.MatchQuery('title_field', 'testQuery'))
|
||||
.facet(new elasticjs.TermsFacet('tags').field('tags'))
|
||||
|
||||
4
elastic.js/index.d.ts
vendored
4
elastic.js/index.d.ts
vendored
@ -3,6 +3,10 @@
|
||||
// Definitions by: Oleksii Trekhleb <https://ua.linkedin.com/in/trekhleb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = elasticjs;
|
||||
|
||||
export as namespace elasticjs;
|
||||
|
||||
declare module elasticjs {
|
||||
|
||||
export interface Facet {}
|
||||
|
||||
1
enzyme/index.d.ts
vendored
1
enzyme/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/airbnb/enzyme
|
||||
// Definitions by: Marian Palkus <https://github.com/MarianPalkus>, Cap3 <http://www.cap3.de>, Ivo Stratev <https://github.com/NoHomey>, Tom Crockett <https://github.com/pelotom>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import { ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react";
|
||||
|
||||
|
||||
1
fixed-data-table/index.d.ts
vendored
1
fixed-data-table/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/facebook/fixed-data-table
|
||||
// Definitions by: Petar Paar <https://github.com/pepaar>, Stephen Jelfs <https://github.com/stephenjelfs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="react"/>
|
||||
|
||||
|
||||
1
flux/index.d.ts
vendored
1
flux/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: http://facebook.github.io/flux/
|
||||
// Definitions by: Steve Baker <https://github.com/stkb/>, Giedrius Grabauskas <https://github.com/GiedriusGrabauskas/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="react" />
|
||||
/// <reference types="fbemitter" />
|
||||
|
||||
1
fluxxor/index.d.ts
vendored
1
fluxxor/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/BinaryMuse/fluxxor
|
||||
// Definitions by: Yuichi Murata <https://github.com/mrk21>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="react" />
|
||||
/// <reference types="eventemitter3" />
|
||||
|
||||
23
forever-monitor/forever-monitor-tests.ts
Normal file
23
forever-monitor/forever-monitor-tests.ts
Normal file
@ -0,0 +1,23 @@
|
||||
// Test from https://github.com/foreverjs/forever-monitor
|
||||
|
||||
import * as forever from "forever-monitor";
|
||||
forever.start('script')
|
||||
.on("start", () => console.log("started"));
|
||||
|
||||
forever.kill(10, true);
|
||||
|
||||
const child = new (forever.Monitor)('your-filename.js', {
|
||||
max: 3,
|
||||
silent: true,
|
||||
args: []
|
||||
});
|
||||
|
||||
child.on('exit', function() {
|
||||
console.log('your-filename.js has exited after 3 restarts');
|
||||
});
|
||||
|
||||
child.start()
|
||||
.on("start", () => console.log("started"))
|
||||
.restart()
|
||||
.stop()
|
||||
.on("exit", () => console.log("STOPPED"))
|
||||
93
forever-monitor/index.d.ts
vendored
Normal file
93
forever-monitor/index.d.ts
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
// Type definitions for forever-monitor 1.7
|
||||
// Project: https://github.com/nodejitsu/forever-monitor#readme
|
||||
// Definitions by: Shun Takahashi <https://github.com/shuntksh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface SpawnWith {
|
||||
customFds: number[];
|
||||
setsid: boolean;
|
||||
uid: number;
|
||||
gid: number;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
silent?: boolean;
|
||||
uid?: string;
|
||||
pidFile?: string;
|
||||
max?: number;
|
||||
killTree?: boolean;
|
||||
minUptime?: number;
|
||||
spinSleepTime?: number;
|
||||
command?: string;
|
||||
args?: string[];
|
||||
sourceDir?: string;
|
||||
watch?: boolean;
|
||||
watchIgnoreDotFiles?: boolean;
|
||||
watchIgnorePatters?: string[];
|
||||
watchDirectory?: string;
|
||||
spawnWith?: SpawnWith;
|
||||
env?: { [envKey: string]: string; };
|
||||
cwd?: string;
|
||||
logFile?: string;
|
||||
outFile?: string;
|
||||
errFile?: string;
|
||||
parser?: (command: string, args: string[]) => { command: string, args: string[] };
|
||||
}
|
||||
|
||||
export function start(script: string, options?: Options): Monitor;
|
||||
export function kill(pid: number, killTree?: boolean, signal?: string, callback?: () => any): void;
|
||||
export function checkProcess(pid: number): boolean;
|
||||
export const version: string;
|
||||
|
||||
export class Monitor extends NodeJS.EventEmitter {
|
||||
|
||||
/**
|
||||
* @param script - Location of the target script to run.
|
||||
* @param [options] - Configuration for this instance.
|
||||
*/
|
||||
constructor(script: string, options?: Options);
|
||||
|
||||
/**
|
||||
* @description Start the process that this instance is configured for
|
||||
* @param [restart] - Value indicating whether this is a restart.
|
||||
*/
|
||||
start(restart?: boolean): this;
|
||||
|
||||
/**
|
||||
* @description Tries to spawn the target Forever child process.
|
||||
*/
|
||||
trySpawn(): boolean;
|
||||
|
||||
/**
|
||||
* @description Restarts the target script associated with this instance.
|
||||
*/
|
||||
restart(): this;
|
||||
|
||||
/**
|
||||
* @description Stops the target script associated with this instance. Prevents it from auto-respawning
|
||||
*/
|
||||
stop(): this;
|
||||
|
||||
/**
|
||||
* @description Kills the ChildProcess object associated with this instance
|
||||
* @param [forceStop] - Value indicating whether short circuit forever auto-restart
|
||||
*/
|
||||
kill(forceStop?: boolean): this;
|
||||
|
||||
/**
|
||||
* @description Sends a message to a forked ChildProcess object associated with this instance
|
||||
*/
|
||||
send(msg?: any): this;
|
||||
|
||||
/**
|
||||
* respond with JSON for this instance
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
* @param command - Command string to parse
|
||||
* @param args - Additional default arguments
|
||||
*/
|
||||
parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]});
|
||||
}
|
||||
20
forever-monitor/tsconfig.json
Normal file
20
forever-monitor/tsconfig.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"forever-monitor-tests.ts"
|
||||
]
|
||||
}
|
||||
1
forever-monitor/tslint.json
Normal file
1
forever-monitor/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
2
gaea-model/index.d.ts
vendored
2
gaea-model/index.d.ts
vendored
@ -2,6 +2,8 @@
|
||||
// Project: https://github.com/ascoders/gaea-model
|
||||
// Definitions by: ascoders <https://github.com/ascoders>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export as namespace GaeaModel;
|
||||
|
||||
28
globule/globule-tests.ts
Normal file
28
globule/globule-tests.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import * as globule from 'globule';
|
||||
|
||||
let filepaths: string[];
|
||||
|
||||
filepaths = globule.find('**/*.js');
|
||||
filepaths = globule.find(['**/*.js']);
|
||||
filepaths = globule.find('**/*.js', '**/*.less');
|
||||
filepaths = globule.find('*.js', { matchBase: true });
|
||||
filepaths = globule.find('**/*.js', '**/*.less', { filter: 'isFile' });
|
||||
filepaths = globule.find('**/*.js', '**/*.less', { filter: /jQuery/i.test });
|
||||
filepaths = globule.find({ src: '**/*.js' });
|
||||
|
||||
filepaths = globule.match('*.js', '/home/code');
|
||||
filepaths = globule.match('*.js', '/home/code', { matchBase: true });
|
||||
|
||||
let bResult: boolean;
|
||||
bResult = globule.isMatch('*.js', '/home/code');
|
||||
bResult = globule.isMatch('*.js', '/home/code', { matchBase: true });
|
||||
|
||||
let mappings = globule.mapping(['*.js']);
|
||||
let len = mappings.length;
|
||||
let src = mappings[0].src;
|
||||
let dest = mappings[0].dest;
|
||||
|
||||
mappings = globule.mapping(['*.js'], { srcBase: '/home/code' });
|
||||
mappings = globule.mapping(['*.js', '*.less']);
|
||||
mappings = globule.mapping(['*.js'], ['*.less']);
|
||||
|
||||
87
globule/index.d.ts
vendored
Normal file
87
globule/index.d.ts
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
// Type definitions for globule 1.1
|
||||
// Project: https://github.com/cowboy/node-globule
|
||||
// Definitions by: Dusan Radovanovic <https://github.com/durad>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import minimatch = require('minimatch');
|
||||
import glob = require('glob');
|
||||
|
||||
interface FindOptions extends glob.IOptions {
|
||||
src?: string;
|
||||
filter?: string | ((filepath?: string, options?: any) => boolean);
|
||||
nonull?: boolean;
|
||||
matchBase?: boolean;
|
||||
srcBase?: string;
|
||||
prefixBase?: boolean;
|
||||
}
|
||||
|
||||
interface MappingOptions extends FindOptions {
|
||||
srcBase?: string;
|
||||
destBase?: string;
|
||||
ext?: string;
|
||||
extDot?: 'first' | 'last';
|
||||
flatten?: boolean;
|
||||
rename?: (p: string) => string;
|
||||
}
|
||||
|
||||
interface OneMapping {
|
||||
src: string[];
|
||||
dest: string;
|
||||
}
|
||||
|
||||
interface GlobuleStatic {
|
||||
/**
|
||||
* Match one or more globbing patterns against one or more file paths.
|
||||
* Returns a uniqued array of all file paths that match any of the specified globbing patterns.
|
||||
*/
|
||||
match(patterns: string | string[], filepaths: string | string[], options?: minimatch.IOptions): string[];
|
||||
|
||||
/**
|
||||
* Tests pattern(s) against against one or more file paths and returns true if any files were matched, otherwise false.
|
||||
*/
|
||||
isMatch(patterns: string | string[], filepaths: string | string[], options?: minimatch.IOptions): boolean;
|
||||
|
||||
/**
|
||||
* Returns a unique array of all file or directory paths that match the given globbing pattern(s)
|
||||
*/
|
||||
find(pattern: string | string[], options?: FindOptions): string[];
|
||||
|
||||
/**
|
||||
* Returns a unique array of all file or directory paths that match the given globbing pattern(s)
|
||||
*/
|
||||
find(options: FindOptions): string[];
|
||||
|
||||
/**
|
||||
* Returns a unique array of all file or directory paths that match the given globbing pattern(s)
|
||||
*/
|
||||
find(pattern: string | string[], pattern2: string | string[], options?: FindOptions): string[];
|
||||
|
||||
/**
|
||||
* Returns a unique array of all file or directory paths that match the given globbing pattern(s)
|
||||
*/
|
||||
find(pattern: string, pattern2: string, pattern3: string | string[], options?: FindOptions): string[];
|
||||
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], options?: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(options: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], filepaths2: string[], options?: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], filepaths2: string[], filepaths3: string[], options?: MappingOptions): OneMapping[];
|
||||
}
|
||||
|
||||
declare var globule: GlobuleStatic;
|
||||
export = globule;
|
||||
|
||||
20
globule/tsconfig.json
Normal file
20
globule/tsconfig.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"globule-tests.ts"
|
||||
]
|
||||
}
|
||||
1
globule/tslint.json
Normal file
1
globule/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
2
googlemaps/index.d.ts
vendored
2
googlemaps/index.d.ts
vendored
@ -784,7 +784,7 @@ declare namespace google.maps {
|
||||
open(map?: Map|StreetViewPanorama, anchor?: MVCObject): void;
|
||||
setContent(content: string|Node): void;
|
||||
setOptions(options: InfoWindowOptions): void;
|
||||
setPosition(position: LatLng): void;
|
||||
setPosition(position: LatLng|LatLngLiteral): void;
|
||||
setZIndex(zIndex: number): void;
|
||||
}
|
||||
|
||||
|
||||
1
halogen/index.d.ts
vendored
1
halogen/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/yuanyan/halogen
|
||||
// Definitions by: Vincent Rouffiat <https://github.com/steller>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as react from "react";
|
||||
|
||||
|
||||
4
hapi/index.d.ts
vendored
4
hapi/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for hapi 13.0.0
|
||||
// Type definitions for hapi 16.0.0
|
||||
// Project: http://github.com/spumko/hapi
|
||||
// Definitions by: Jason Swearingen <http://github.com/jasonswearingen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@ -1206,7 +1206,7 @@ export class Request extends Events.EventEmitter {
|
||||
/** the raw request headers (references request.raw.headers).*/
|
||||
headers: IDictionary<string>;
|
||||
/** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/
|
||||
id: number;
|
||||
id: string;
|
||||
/** request information */
|
||||
info: {
|
||||
/** the request preferred encoding. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user