interface.uts 6.9 KB
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1 2 3 4 5 6 7 8 9
export type GetAppBaseInfoOptions = {
  /**
   * @description 过滤字段的字符串数组,假如要获取指定字段,传入此数组。
   */
  filter: Array<string>
};

export type GetAppBaseInfoResult = {
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
10
   * manifest.json 中应用appid,即DCloud appid。	
DCloud-yyl's avatar
DCloud-yyl 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
   */
  appId?: string,
  /**
   * `manifest.json` 中应用名称。
   */
  appName?: string,
  /**
   * `manifest.json` 中应用版本名称。
   */
  appVersion?: string,
  /**
   * `manifest.json` 中应用版本名号。
   */
  appVersionCode?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
26
   * 应用设置的语言en、zh-Hans、zh-Hant、fr、es	
DCloud-yyl's avatar
DCloud-yyl 已提交
27 28 29
   */
  appLanguage?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
30
   * 应用设置的语言	
DCloud-yyl's avatar
DCloud-yyl 已提交
31 32 33 34 35 36 37 38
   */
  language?: string,
  /**
   * 引擎版本号。已废弃,仅为了向下兼容保留
   * @deprecated 已废弃,仅为了向下兼容保留
   */
  version?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
   * 应用资源(wgt)的版本名称。	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
55 56 57 58
   * }
   */
  appWgtVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
   * 小程序宿主语言	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
75 76 77 78 79
   * }
   */
  hostLanguage?: string,
  /**
   * App、小程序宿主版本。
DCloud-yyl's avatar
DCloud-yyl 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
95 96 97 98
   * }
   */
  hostVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
   * 小程序宿主名称	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
115 116 117 118
   * }
   */
  hostName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
   * 小程序宿主包名	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
135 136 137 138
   * }
   */
  hostPackageName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
   * uni小程序SDK版本、小程序客户端基础库版本	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
155 156 157 158 159
   * }
   */
  hostSDKVersion?: string,
  /**
   * 系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)
DCloud-yyl's avatar
DCloud-yyl 已提交
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	}
DCloud-yyl's avatar
DCloud-yyl 已提交
175 176 177 178 179 180 181
   * }
   */
  hostTheme?: string,
  /**
   * 是否uni-app x
   */
  isUniAppX ?: boolean,
DCloud-yyl's avatar
DCloud-yyl 已提交
182
  
DCloud-yyl's avatar
DCloud-yyl 已提交
183 184
  /**
   * uni 编译器版本
DCloud-yyl's avatar
DCloud-yyl 已提交
185
   * @deprecated 已废弃,仅为了向下兼容保留
DCloud-yyl's avatar
DCloud-yyl 已提交
186 187 188
   */
  uniCompileVersion ?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
   * uni 编译器版本
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	}
   * }
   */
  uniCompilerVersion ?: string,
  /**
   * uni-app 运行平台。
DCloud-yyl's avatar
DCloud-yyl 已提交
210
   */
DCloud-yyl's avatar
DCloud-yyl 已提交
211
  uniPlatform ?: 'app' | 'web' | 'mp-weixin' | 'mp-alipay' | 'mp-baidu' | 'mp-toutiao' | 'mp-lark' | 'mp-qq' | 'mp-kuaishou' | 'mp-jd' | 'mp-360' | 'quickapp-webview' | 'quickapp-webview-union' | 'quickapp-webview-huawei',
DCloud-yyl's avatar
DCloud-yyl 已提交
212 213 214 215 216 217
  /**
   * uni 运行时版本
   */
  uniRuntimeVersion ?: string,
  /**
   * uni 编译器版本号
DCloud-yyl's avatar
DCloud-yyl 已提交
218
   * @deprecated 已废弃,仅为了向下兼容保留
DCloud-yyl's avatar
DCloud-yyl 已提交
219 220
   */
  uniCompileVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
  /**
   * uni 编译器版本号
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	}
   * }
   */
  uniCompilerVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
241 242 243 244
  /**
   * uni 运行时版本号
   */
  uniRuntimeVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
  /**
   * Android的包名
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "3.97"
   * 		},
   * 		"ios": {
   * 			"osVer": "x",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	}
   * }
   */
  packageName?: string,
  /**
   * iOS的bundleId
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "x",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	}
   * }
   * @autodoc false
   */
  bundleId?: string,
  /**
   * Android: 应用签名证书的SHA1值(全部为小写,中间不包含“:”)。 为了保证应用的安全性,请使用自己生成的证书(不要使用公共测试证书)。
   * iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "3.97"
   * 		},
   * 		"ios": {
   * 			"osVer": "9.0",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	}
   * }
   */
  signature?: string,
DCloud-yyl's avatar
DCloud-yyl 已提交
307 308 309 310 311 312 313 314 315 316 317
}

/**
 * @param{GetAppBaseInfoOptions} [options=包含所有字段的过滤对象]  过滤的字段对象, 不传参数默认为获取全部字段。
 */
export type GetAppBaseInfo = (options?: GetAppBaseInfoOptions | null) => GetAppBaseInfoResult;


export interface Uni {
  /**
    * GetAppBaseInfo(Object object)
DCloud-yyl's avatar
DCloud-yyl 已提交
318
    * @description 
DCloud-yyl's avatar
DCloud-yyl 已提交
319 320 321 322
    * 获取app基本信息
    * @param {GetAppBaseInfoOptions} options [options=包含所有字段的过滤对象]  过滤的字段对象, 不传参数默认为获取全部字段。
    * @return {object}
    * @tutorial https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html
DCloud-yyl's avatar
DCloud-yyl 已提交
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
    * @uniPlatform
	* {
	* 	"app": {
	* 		"android": {
	* 			"osVer": "5.0",
	* 			"uniVer": "√",
	* 			"unixVer": "3.9+"
	* 		},
	* 		"ios": {
	* 			"osVer": "9.0",
	* 			"uniVer": "√",
	* 			"unixVer": "x"
	* 		}
	* 	},
  *   "web": {
  *      "uniVer": "√",
  *      "unixVer": "4.0"
  *   }
	* }
DCloud-yyl's avatar
DCloud-yyl 已提交
342 343 344 345 346 347 348 349 350
    * @example
     ```typescript
      uni.getAppBaseInfo({
        filter:[]
      })
     ```
    */
  getAppBaseInfo(options?: GetAppBaseInfoOptions | null): GetAppBaseInfoResult;
}