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

25 lines
987 B
TypeScript
Raw Normal View History

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 {};