import type * as HTTP from '../../types/http'; /** * 请求防抖函数, 取消请求会取消防抖函数执行. * * @template TArgs Type of源函数参数类型. * @template D Type of源函数返回类型. * @template TContext Type of源函数this类型. * @param service 源函数. * @param wait 等待时间, 单位毫秒, 默认200毫秒. 如果非number类型则为源函数this上下文. * @param context 源函数this上下文, 默认`this`. * 注意:this在不同的环境可能有不同的预设值, 如小程序中的this可能是当前组件或者页面, 而浏览器中的this指window, 建议显示指定context. * 对于箭头函数或者bind函数, context失效, 以实际上下文为准. */ declare function debounce(service: (...args: TArgs) => HTTP.IRequestTask, wait?: number | TContext, context?: TContext): (...rest: TArgs) => HTTP.IRequestTask; export default debounce;