interface.uts 11.4 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 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
   * manifest.json 中应用appid,即DCloud appid。	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
27 28 29 30
   */
  appId?: string,
  /**
   * `manifest.json` 中应用名称。
DCloud-yyl's avatar
DCloud-yyl 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
47 48 49 50
   */
  appName?: string,
  /**
   * `manifest.json` 中应用版本名称。
DCloud-yyl's avatar
DCloud-yyl 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
67 68 69 70
   */
  appVersion?: string,
  /**
   * `manifest.json` 中应用版本名号。
DCloud-yyl's avatar
DCloud-yyl 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
87 88 89
   */
  appVersionCode?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
   * 应用设置的语言en、zh-Hans、zh-Hant、fr、es	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
107 108 109
   */
  appLanguage?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
   * 应用设置的语言	
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
127 128 129 130 131
   */
  language?: string,
  /**
   * 引擎版本号。已废弃,仅为了向下兼容保留
   * @deprecated 已废弃,仅为了向下兼容保留
DCloud-yyl's avatar
DCloud-yyl 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
148 149 150
   */
  version?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
   * 应用资源(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 已提交
171 172 173 174
   * }
   */
  appWgtVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
   * 小程序宿主语言	
   * 
   * @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 已提交
195 196 197 198 199
   * }
   */
  hostLanguage?: string,
  /**
   * App、小程序宿主版本。
DCloud-yyl's avatar
DCloud-yyl 已提交
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
   * 
   * @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 已提交
219 220 221 222
   * }
   */
  hostVersion?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
   * 小程序宿主名称	
   * 
   * @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 已提交
243 244 245 246
   * }
   */
  hostName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
   * 小程序宿主包名	
   * 
   * @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 已提交
267 268 269 270
   * }
   */
  hostPackageName?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
   * 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 已提交
291 292 293 294 295
   * }
   */
  hostSDKVersion?: string,
  /**
   * 系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)
DCloud-yyl's avatar
DCloud-yyl 已提交
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
   * 
   * @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 已提交
315 316 317 318 319
   * }
   */
  hostTheme?: string,
  /**
   * 是否uni-app x
DCloud-yyl's avatar
DCloud-yyl 已提交
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
340 341
   */
  isUniAppX ?: boolean,
DCloud-yyl's avatar
DCloud-yyl 已提交
342
  
DCloud-yyl's avatar
DCloud-yyl 已提交
343 344
  /**
   * uni 编译器版本
DCloud-yyl's avatar
DCloud-yyl 已提交
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
   * @deprecated 已废弃,仅为了向下兼容保留
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
362 363 364
   */
  uniCompileVersion ?: string,
  /**
DCloud-yyl's avatar
DCloud-yyl 已提交
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
   * uni 编译器版本
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
   */
  uniCompilerVersion ?: string,
  /**
   * uni-app 运行平台。
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	}
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
406
   */
DCloud-yyl's avatar
DCloud-yyl 已提交
407
  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 已提交
408 409
  /**
   * uni 运行时版本
DCloud-yyl's avatar
DCloud-yyl 已提交
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
430 431 432 433
   */
  uniRuntimeVersion ?: string,
  /**
   * uni 编译器版本号
DCloud-yyl's avatar
DCloud-yyl 已提交
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
   * @deprecated 已废弃,仅为了向下兼容保留
   * 
   * @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 已提交
455 456
   */
  uniCompileVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
  /**
   * uni 编译器版本号
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.0"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "x",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
   */
  uniCompilerVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
481 482
  /**
   * uni 运行时版本号
DCloud-yyl's avatar
DCloud-yyl 已提交
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
   * 
   * @uniPlatform
   * {
   * 	"app": {
   * 		"android": {
   * 			"osVer": "5.0",
   * 			"uniVer": "√",
   * 			"unixVer": "3.9+"
   * 		},
   * 		"ios": {
   * 			"osVer": "12.0",
   * 			"uniVer": "√",
   * 			"unixVer": "4.11"
   * 		}
   * 	},
   *   "web": {
   *     "uniVer": "x",
   *     "unixVer": "x"
   *   }
   * }
DCloud-yyl's avatar
DCloud-yyl 已提交
503 504
   */
  uniRuntimeVersionCode?: number,
DCloud-yyl's avatar
DCloud-yyl 已提交
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577
  /**
   * 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 已提交
578 579 580 581 582 583 584 585 586 587 588
}

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


export interface Uni {
  /**
    * GetAppBaseInfo(Object object)
DCloud-yyl's avatar
DCloud-yyl 已提交
589
    * @description 
DCloud-yyl's avatar
DCloud-yyl 已提交
590 591 592 593
    * 获取app基本信息
    * @param {GetAppBaseInfoOptions} options [options=包含所有字段的过滤对象]  过滤的字段对象, 不传参数默认为获取全部字段。
    * @return {object}
    * @tutorial https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html
DCloud-yyl's avatar
DCloud-yyl 已提交
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
    * @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 已提交
613 614 615 616 617 618 619 620 621
    * @example
     ```typescript
      uni.getAppBaseInfo({
        filter:[]
      })
     ```
    */
  getAppBaseInfo(options?: GetAppBaseInfoOptions | null): GetAppBaseInfoResult;
}