cross-magic
Version:
跨平台公共模块
96 lines (87 loc) • 1.75 kB
text/typescript
import UiConfig from '../mgrs/ui/uiConfig'
import EnvConfig from '../mgrs/env/envConfig'
import NativeConfig from '../mgrs/native/nativeConfig'
import NetworkConfig from '../mgrs/network/networkConfig'
import StorageConfig from '../mgrs/storage/storageConfig'
import { RunTimeData } from '../runTime/runTime'
import VueRouter from 'vue-router/types'
import { VueConstructor } from 'vue/types'
import { Store } from 'vuex/types'
export type VueParams = {
vue: {
vueClass: VueConstructor
/**
* 根组件Vue
*/
rootVue: any
/**
* 根组件dom
*/
rootDom: string
}
router?: VueRouter
store?: Store<any>
}
/**
* ApplicationConfig
* Application类的构造函数参数
*/
type ApplicationConfig = {
/**
* 运行环境数据
*/
runTimeData: RunTimeData
/**
* vue相关参数
*/
vueParams: VueParams
/**
* app运行hooks函数
*/
hooks?: {
/**
* app启动前的钩子函数
*/
beforeStart?: Function
/**
* app初始化完毕之后的钩子函数
*/
started?: Function
}
/**
* app,rem适配参数
*/
remAdaptive?: {
/**
* 设计宽度
* 如375,750
*/
designWidth: number
/**
* 适配比例
* 如100的话,则1rem===100px
*/
ratio: number
}
/**
* 提供给UiMgr使用,可选
*/
uiConfig?: UiConfig
/**
* 提供给EnvMgr使用,可选
*/
envConfig?: EnvConfig
/**
* 提供给NativeMgr使用,可选
*/
nativeConfig?: NativeConfig
/**
* 提供给NetworkMgr使用,可选
*/
networkConfig?: NetworkConfig
/**
* 提供给StorageMgr使用,可选
*/
storageConfig?: StorageConfig
}
export default ApplicationConfig