import { RouteConfig } from 'vue-router'
import Vue, { ComponentOptions, AsyncComponent } from 'vue'

// 不允许设置path，因为已经在前一个参数指定了

type Component = function | string
interface SdRouteConfig extends Omit<RouteConfig, 'path'> {
  component: Component
}

export default routerService
/**
 * 维护路由信息
 */
declare namespace routerService {
  export { route, routeInFrame }
}
/**
 * 添加一条路由记录
 */
declare function route(path: string, options: SdRouteConfig): Route

/**
 * 添加一条/frame下的路由记录
 */
declare function routeInFrame(path: string, options: SdRouteConfig): Route
/**
 * 根据 path 获取路由记录
 */
declare function route(path: string): Route
declare class Route {
  path: string
  options: SdRouteConfig
  /**
   * 添加一条路由记录
   */
  child(path: string, options: SdRouteConfig): Route
}
