@types/angularjs
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.5 (ngAnimate module) |
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.5 component router |
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.4 (ngCookies module) |
@@ -6,2 +6,3 @@ // Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) | ||
import * as angular from 'angular'; | ||
@@ -26,3 +27,3 @@ declare module "angular-mocks/ngMock" { | ||
/////////////////////////////////////////////////////////////////////////////// | ||
declare namespace angular { | ||
declare module 'angular' { | ||
@@ -34,3 +35,3 @@ /////////////////////////////////////////////////////////////////////////// | ||
interface IAngularStatic { | ||
mock: IMockStatic; | ||
mock: IMockStatic; | ||
} | ||
@@ -40,22 +41,22 @@ | ||
interface IInjectStatic { | ||
(...fns: Function[]): any; | ||
(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works | ||
strictDi(val?: boolean): void; | ||
(...fns: Function[]): any; | ||
(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works | ||
strictDi(val?: boolean): void; | ||
} | ||
interface IMockStatic { | ||
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump | ||
dump(obj: any): string; | ||
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump | ||
dump(obj: any): string; | ||
inject: IInjectStatic | ||
inject: IInjectStatic | ||
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.module | ||
module: { | ||
(...modules: any[]): any; | ||
sharedInjector(): void; | ||
} | ||
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.module | ||
module: { | ||
(...modules: any[]): any; | ||
sharedInjector(): void; | ||
} | ||
// see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate | ||
TzDate(offset: number, timestamp: number): Date; | ||
TzDate(offset: number, timestamp: string): Date; | ||
// see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate | ||
TzDate(offset: number, timestamp: number): Date; | ||
TzDate(offset: number, timestamp: string): Date; | ||
} | ||
@@ -69,3 +70,3 @@ | ||
interface IExceptionHandlerProvider extends IServiceProvider { | ||
mode(mode: string): void; | ||
mode(mode: string): void; | ||
} | ||
@@ -79,5 +80,5 @@ | ||
interface ITimeoutService { | ||
flush(delay?: number): void; | ||
flushNext(expectedDelay?: number): void; | ||
verifyNoPendingTasks(): void; | ||
flush(delay?: number): void; | ||
flushNext(expectedDelay?: number): void; | ||
verifyNoPendingTasks(): void; | ||
} | ||
@@ -91,3 +92,3 @@ | ||
interface IIntervalService { | ||
flush(millis?: number): number; | ||
flush(millis?: number): number; | ||
} | ||
@@ -101,8 +102,8 @@ | ||
interface ILogService { | ||
assertEmpty(): void; | ||
reset(): void; | ||
assertEmpty(): void; | ||
reset(): void; | ||
} | ||
interface ILogCall { | ||
logs: string[]; | ||
logs: string[]; | ||
} | ||
@@ -138,208 +139,207 @@ | ||
interface IHttpBackendService { | ||
/** | ||
* Flushes all pending requests using the trained responses. | ||
* @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed. | ||
*/ | ||
flush(count?: number): void; | ||
/** | ||
* Flushes all pending requests using the trained responses. | ||
* @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed. | ||
*/ | ||
flush(count?: number): void; | ||
/** | ||
* Resets all request expectations, but preserves all backend definitions. | ||
*/ | ||
resetExpectations(): void; | ||
/** | ||
* Resets all request expectations, but preserves all backend definitions. | ||
*/ | ||
resetExpectations(): void; | ||
/** | ||
* Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. | ||
*/ | ||
verifyNoOutstandingExpectation(): void; | ||
/** | ||
* Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. | ||
*/ | ||
verifyNoOutstandingExpectation(): void; | ||
/** | ||
* Verifies that there are no outstanding requests that need to be flushed. | ||
*/ | ||
verifyNoOutstandingRequest(): void; | ||
/** | ||
* Verifies that there are no outstanding requests that need to be flushed. | ||
*/ | ||
verifyNoOutstandingRequest(): void; | ||
/** | ||
* Creates a new request expectation. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param method HTTP method. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param method HTTP method. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for DELETE requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
/** | ||
* Creates a new request expectation for DELETE requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
*/ | ||
expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for GET requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
*/ | ||
expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for GET requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
*/ | ||
expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for HEAD requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
*/ | ||
expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for HEAD requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object to be compared with the HTTP headers in the request. | ||
*/ | ||
expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for JSONP requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
*/ | ||
expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for JSONP requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
*/ | ||
expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for PATCH requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for PATCH requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for POST requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for POST requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for PUT requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new request expectation for PUT requests. | ||
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param method HTTP method. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param method HTTP method. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for DELETE requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for DELETE requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for GET requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for GET requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for HEAD requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for HEAD requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for JSONP requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for PATCH requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for POST requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
/** | ||
* Creates a new backend definition for PUT requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
*/ | ||
whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
} | ||
export module mock { | ||
// returned interface by the the mocked HttpBackendService expect/when methods | ||
interface IRequestHandler { | ||
/** | ||
* Creates a new backend definition for JSONP requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
* Controls the response for a matched request using a function to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text. | ||
*/ | ||
whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; | ||
respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler; | ||
/** | ||
* Creates a new backend definition for PATCH requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
* Controls the response for a matched request using supplied static data to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param status HTTP status code to add to the response. | ||
* @param data Data to add to the response. | ||
* @param headers Headers object to add to the response. | ||
* @param responseText Response text to add to the response. | ||
*/ | ||
whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; | ||
/** | ||
* Creates a new backend definition for POST requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
* Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param data Data to add to the response. | ||
* @param headers Headers object to add to the response. | ||
* @param responseText Response text to add to the response. | ||
*/ | ||
whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; | ||
// Available when ngMockE2E is loaded | ||
/** | ||
* Creates a new backend definition for PUT requests. | ||
* Returns an object with respond method that controls how a matched request is handled. | ||
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. | ||
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. | ||
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. | ||
* Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) | ||
*/ | ||
whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; | ||
} | ||
passThrough(): IRequestHandler; | ||
} | ||
export module mock { | ||
// returned interface by the the mocked HttpBackendService expect/when methods | ||
interface IRequestHandler { | ||
/** | ||
* Controls the response for a matched request using a function to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text. | ||
*/ | ||
respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler; | ||
/** | ||
* Controls the response for a matched request using supplied static data to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param status HTTP status code to add to the response. | ||
* @param data Data to add to the response. | ||
* @param headers Headers object to add to the response. | ||
* @param responseText Response text to add to the response. | ||
*/ | ||
respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; | ||
/** | ||
* Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. | ||
* Returns the RequestHandler object for possible overrides. | ||
* @param data Data to add to the response. | ||
* @param headers Headers object to add to the response. | ||
* @param responseText Response text to add to the response. | ||
*/ | ||
respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; | ||
// Available when ngMockE2E is loaded | ||
/** | ||
* Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) | ||
*/ | ||
passThrough(): IRequestHandler; | ||
} | ||
} | ||
} | ||
@@ -352,2 +352,4 @@ | ||
//declare var module: (...modules: any[]) => any; | ||
declare var inject: angular.IInjectStatic; | ||
declare global { | ||
export var inject: angular.IInjectStatic; | ||
} |
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.5 (ngResource module) |
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.3 (ngRoute module) |
@@ -0,0 +0,0 @@ // Type definitions for Angular JS 1.3 (ngSanitize module) |
{ | ||
"name": "@types/angularjs", | ||
"version": "1.5.13-alpha", | ||
"version": "1.5.14-alpha", | ||
"description": "TypeScript definitions for Angular JS 1.5", | ||
@@ -8,7 +8,9 @@ "main": "", | ||
"author": "Diego Vilar <http://github.com/diegovilar>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
}, | ||
"license": "MIT", | ||
"typings": "index.d.ts", | ||
"dependencies": { | ||
"@types/jquery": "*" | ||
} | ||
"dependencies": {} | ||
} |
# Installation | ||
> `npm install --save @types/angularjs` | ||
> `npm install --save @types/angular` | ||
@@ -8,12 +8,12 @@ # Summary | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/angularjs | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/angular | ||
Additional Details | ||
* Last updated: Wed, 25 May 2016 04:19:58 GMT | ||
* Last updated: Wed, 06 Jul 2016 21:42:27 GMT | ||
* File structure: UMD | ||
* Library Dependencies: jquery | ||
* Module Dependencies: none | ||
* Global values: angular, ng, inject | ||
* Module Dependencies: angular | ||
* Global values: angular, ng, global | ||
# Credits | ||
These definitions were written by Diego Vilar <http://github.com/diegovilar>. |
@@ -7,7 +7,9 @@ { | ||
], | ||
"moduleDependencies": [], | ||
"moduleDependencies": [ | ||
"angular" | ||
], | ||
"libraryMajorVersion": "1", | ||
"libraryMinorVersion": "5", | ||
"libraryName": "Angular JS 1.5", | ||
"typingsPackageName": "angularjs", | ||
"typingsPackageName": "angular", | ||
"projectName": "http://angularjs.org", | ||
@@ -20,3 +22,3 @@ "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", | ||
"ng", | ||
"inject" | ||
"global" | ||
], | ||
@@ -26,3 +28,4 @@ "declaredModules": [ | ||
"angular-mocks/ngMockE2E", | ||
"angular-mocks/ngAnimateMock" | ||
"angular-mocks/ngAnimateMock", | ||
"angular" | ||
], | ||
@@ -39,3 +42,3 @@ "files": [ | ||
], | ||
"contentHash": "7b85b2189b4d0f43a7c2e2a851777b076bf212db1a2b5b95d1675530a2ff5315" | ||
"contentHash": "8f251e42d01608a14348ef5720624b239525df452490c873639fa45d6309b9d7" | ||
} |
Sorry, the diff of this file is too big to display
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
-100%3145
0.22%0
-100%167845
-0.14%1
Infinity%- Removed
- Removed
- Removed