zhizhi/node_modules/dingtalk-jsapi/mock/index.d.ts

25 lines
987 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import '../lib/polyfills/objectKeys';
interface IMockData {
payload: object;
isSuccess: boolean;
}
declare type IMockFunction = (params: any) => Promise<any>;
/**
* 一旦调用 init当前环境下的接口调用将会走 mock 的数据(可选择部分或者全部)
* @memberof MockApi
*/
export declare const init: (config?: {
/** 初始化时配置的api等同于 batchAppendMockApiResult */
mockApiMap?: {
[method: string]: IMockData | IMockFunction;
} | undefined;
/** 只有当配置了api才会走 mock */
isOnlyMockWhenConfig?: boolean | undefined;
} | undefined) => void;
export declare const emitEvent: (eventName: string) => void;
export declare const appendMockApiResult: (method: string, result: IMockFunction | IMockData, disableMockFilter?: ((params: any) => boolean) | undefined) => void;
export declare const batchAppendMockApiResult: (mockApiMap: {
[method: string]: IMockData | IMockFunction;
}) => void;
export {};