declare type OptionsTypes = {
  /**
   * 延迟/沉睡时间 (毫秒为单位)
   */
  sleep: number | null,

  /**
   * debounce 防抖
   * throttle 节流
   * @description 不传type时，常用于控制后端接口调用频率，默认只有接口调通之后才可以第二次调用
   */
  type?: 'debounce' | 'throttle'
}

/**
 * 节流 防止函数事件高频调用
 * @param func - 事务函数
 * @param options - 其它选项配置
 */
declare function Orderly<F>(func: F, options?: OptionsTypes): F;

export default Orderly;
