import type { PluginDefinition } from '../types'; /** * catch error options */ export type CatchErrorOptions = { /** * error catch handler */ handler?: (error: any) => Promise; }; /** * regist catch error plugin on current promise request * @param request request promise * @param options catch error options */ export declare function registCatchError any>(request: Request, options?: CatchErrorOptions): (config?: Parameters[0]) => ReturnType; /** * 注册异常处理插件 * 只在regist graphqls上运行 (and 自定义条件下) * @param options 插件配置 */ export declare const createCatchErrorPlugin: PluginDefinition; declare module '../types' { interface RequestCustomConfig { /** * enable catch error * or catch error by Promise.catch locally * @default false */ catchError?: boolean; } }