Comparing version 2.3.0 to 2.4.0
2.4.0 / 2018-08-08 | ||
================== | ||
**others** | ||
* [[`6a84a0a`](http://github.com/node-modules/mm/commit/6a84a0a9c01a8e68e08eb63b4d587b73cb8fd74a)] - refactor(tsd): use Interface Function Type so that egg-mock can extends this; (#42) (paranoidjk <<hust2012jiangkai@gmail.com>>) | ||
2.3.0 / 2018-08-07 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -1,8 +0,22 @@ | ||
declare function mm(target: any, key: string, prop: any): void; | ||
declare namespace mm { | ||
export type Request = ( | ||
url: string | RegExp | { url: string, host: string}, | ||
data: any, | ||
headers?: object, | ||
delay?: number, | ||
) => MockMate; | ||
export type RequestError = ( | ||
url: string | RegExp | { url: string, host: string}, | ||
reqError: string | Error, | ||
resError: string | Error, | ||
delay?: number | ||
) => MockMate; | ||
export interface MockMate { | ||
(target: any, key: string, prop: any): void; | ||
/** | ||
* Mock async function error. | ||
*/ | ||
function error(mod: any, method: string, error?: string | Error, props?: object, timeout?: number): typeof mm; | ||
error: (mod: any, method: string, error?: string | Error, props?: object, timeout?: number) => MockMate; | ||
@@ -12,3 +26,3 @@ /** | ||
*/ | ||
function data(mod: any, method: string, data: any, timeout?: number): typeof mm; | ||
data: (mod: any, method: string, data: any, timeout?: number) => MockMate; | ||
@@ -18,3 +32,3 @@ /** | ||
*/ | ||
function empty(mod: any, method: string, timeout?: number): typeof mm; | ||
empty: (mod: any, method: string, timeout?: number) => MockMate; | ||
@@ -24,3 +38,3 @@ /** | ||
*/ | ||
function datas(mod: any, method: string, datas: any, timeout?: number): typeof mm; | ||
datas: (mod: any, method: string, datas: any, timeout?: number) => MockMate; | ||
@@ -30,3 +44,3 @@ /** | ||
*/ | ||
function syncError(mod: any, method: string, error?: string | Error, props?: object): void; | ||
syncError: (mod: any, method: string, error?: string | Error, props?: object) => void; | ||
@@ -36,3 +50,3 @@ /** | ||
*/ | ||
function syncData(mod: any, method: string, data?: any): void; | ||
syncData: (mod: any, method: string, data?: any) => void; | ||
@@ -42,3 +56,3 @@ /** | ||
*/ | ||
function syncEmpty(mod: any, method: string): void; | ||
syncEmpty: (mod: any, method: string) => void; | ||
@@ -48,37 +62,19 @@ /** | ||
*/ | ||
function restore(): typeof mm; | ||
restore: () => MockMate; | ||
const http: { | ||
request: ( | ||
url: string | RegExp | { url: string, host: string}, | ||
data: any, | ||
headers?: object, | ||
delay?: number, | ||
) => typeof mm, | ||
requestError: ( | ||
url: string | RegExp | { url: string, host: string}, | ||
reqError: string | Error, | ||
resError: string | Error, | ||
delay?: number | ||
) => typeof mm, | ||
} | ||
http: { | ||
request: Request; | ||
requestError: RequestError, | ||
}; | ||
const https: { | ||
request: ( | ||
url: string | RegExp | { url: string, host: string}, | ||
data: any, | ||
headers?: object, | ||
delay?: number, | ||
) => typeof mm, | ||
requestError: ( | ||
url: string | RegExp | { url: string, host: string}, | ||
reqError: string | Error, | ||
resError: string | Error, | ||
delay?: number | ||
) => typeof mm, | ||
} | ||
https: { | ||
request: Request; | ||
requestError: RequestError, | ||
}; | ||
} | ||
declare const mm: MockMate; | ||
export = mm; | ||
export default mm; | ||
{ | ||
"name": "mm", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "mock mate, mock http request, fs access and so on.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28339
543