interface.uts 7.7 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 55 56 57 58
   * 应用资源(wgt)的版本名称。	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
59 60 61 62
   * }
   */
  appWgtVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
   * 小程序宿主语言	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
83 84 85 86 87
   * }
   */
  hostLanguage?: string,
  /**
   * App、小程序宿主版本。
DCloud-yyl's avatar
DCloud-yyl 已提交
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
107 108 109 110
   * }
   */
  hostVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
   * 小程序宿主名称	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
131 132 133 134
   * }
   */
  hostName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
   * 小程序宿主包名	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
155 156 157 158
   * }
   */
  hostPackageName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
   * uni小程序SDK版本、小程序客户端基础库版本	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
179 180 181 182 183
   * }
   */
  hostSDKVersion?: string,
  /**
   * 系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)
DCloud-yyl's avatar
DCloud-yyl 已提交
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
DCloud-yyl's avatar
DCloud-yyl 已提交
203 204 205 206 207 208 209
   * }
   */
  hostTheme?: string,
  /**
   * 是否uni-app x
   */
  isUniAppX ?: boolean,
DCloud-yyl's avatar
DCloud-yyl 已提交
210
  
DCloud-yyl's avatar
DCloud-yyl 已提交
211 212
  /**
   * uni 编译器版本
DCloud-yyl's avatar
DCloud-yyl 已提交
213
   * @deprecated 已废弃,仅为了向下兼容保留
DCloud-yyl's avatar
DCloud-yyl 已提交
214 215 216
   */
  uniCompileVersion ?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
   * uni 编译器版本
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
DCloud-yyl's avatar
DCloud-yyl 已提交
234 235
   *     "uniVer": "√",
   *     "unixVer": "4.0"
DCloud-yyl's avatar
DCloud-yyl 已提交
236 237 238 239 240 241
   *   }
   * }
   */
  uniCompilerVersion ?: string,
  /**
   * uni-app 运行平台。
DCloud-yyl's avatar
DCloud-yyl 已提交
242
   */
DCloud-yyl's avatar
DCloud-yyl 已提交
243
  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 已提交
244 245 246 247 248 249
  /**
   * uni 运行时版本
   */
  uniRuntimeVersion ?: string,
  /**
   * uni 编译器版本号
DCloud-yyl's avatar
DCloud-yyl 已提交
250
   * @deprecated 已废弃,仅为了向下兼容保留
DCloud-yyl's avatar
DCloud-yyl 已提交
251 252
   */
  uniCompileVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
  /**
   * uni 编译器版本号
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
DCloud-yyl's avatar
DCloud-yyl 已提交
271 272
   *     "uniVer": "√",
   *     "unixVer": "4.0"
DCloud-yyl's avatar
DCloud-yyl 已提交
273 274 275 276
   *   }
   * }
   */
  uniCompilerVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
277 278 279 280
  /**
   * uni 运行时版本号
   */
  uniRuntimeVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
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 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
  /**
   * Android的包名
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "3.97"
   * 		},
   * 		"ios": {
   * 			"osVer": "x",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
   */
  packageName?: string,
  /**
   * iOS的bundleId
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "x",
   * 			"uniVer": "x",
   * 			"unixVer": "x"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
   */
  bundleId?: string,
  /**
   * Android: 应用签名证书的SHA1值(全部为小写,中间不包含“:”)。 为了保证应用的安全性,请使用自己生成的证书(不要使用公共测试证书)。
   * iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "3.97"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
   */
  signature?: string,
DCloud-yyl's avatar
DCloud-yyl 已提交
354 355 356 357 358 359 360 361 362 363 364
}

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


export interface Uni {
  /**
    * GetAppBaseInfo(Object object)
DCloud-yyl's avatar
DCloud-yyl 已提交
365
    * @description 
DCloud-yyl's avatar
DCloud-yyl 已提交
366 367 368 369
    * 获取app基本信息
    * @param {GetAppBaseInfoOptions} options [options=包含所有字段的过滤对象]  过滤的字段对象, 不传参数默认为获取全部字段。
    * @return {object}
    * @tutorial https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html
DCloud-yyl's avatar
DCloud-yyl 已提交
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
    * @uniPlatform
	* {
	* 	"app": {
	* 		"android": {
	* 			"osVer": "5.0",
	* 			"uniVer": "√",
	* 			"unixVer": "3.9+"
	* 		},
	* 		"ios": {
	* 			"osVer": "12.0",
	* 			"uniVer": "√",
	* 			"unixVer": "4.11"
	* 		}
	* 	},
  *   "web": {
  *      "uniVer": "√",
  *      "unixVer": "4.0"
  *   }
	* }
DCloud-yyl's avatar
DCloud-yyl 已提交
389 390 391 392 393 394 395 396 397
    * @example
     ```typescript
      uni.getAppBaseInfo({
        filter:[]
      })
     ```
    */
  getAppBaseInfo(options?: GetAppBaseInfoOptions | null): GetAppBaseInfoResult;
}