interface.uts 5.0 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 = {
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
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,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
26
   * 应用设置的语言en、zh-Hans、zh-Hant、fr、es
DCloud-yyl's avatar
DCloud-yyl 已提交
27 28 29
   */
  appLanguage?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
30
   * 应用设置的语言
DCloud-yyl's avatar
DCloud-yyl 已提交
31 32 33 34 35 36 37 38
   */
  language?: string,
  /**
   * 引擎版本号。已废弃,仅为了向下兼容保留
   * @deprecated 已废弃,仅为了向下兼容保留
   */
  version?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
39 40
   * 应用资源(wgt)的版本名称。
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  appWgtVersion?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
58 59
   * 小程序宿主语言
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  hostLanguage?: string,
  /**
   * App、小程序宿主版本。
lizhongyi_'s avatar
lizhongyi_ 已提交
78
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  hostVersion?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
96 97
   * 小程序宿主名称
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
98 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"
   *        }
   *    }
   * }
   */
  hostName?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
115 116
   * 小程序宿主包名
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  hostPackageName?: string,
  /**
lizhongyi_'s avatar
lizhongyi_ 已提交
134 135
   * uni小程序SDK版本、小程序客户端基础库版本
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  hostSDKVersion?: string,
  /**
   * 系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)
lizhongyi_'s avatar
lizhongyi_ 已提交
154
   *
DCloud-yyl's avatar
DCloud-yyl 已提交
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
   * @uniPlatform {
   *    "app": {
   *        "android": {
   *            "osVer": "5.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        },
   *        "ios": {
   *            "osVer": "9.0",
   *  		  	 "uniVer": "√",
   * 			 "unixVer": "x"
   *        }
   *    }
   * }
   */
  hostTheme?: string,
  /**
   * 是否uni-app x
   */
  isUniAppX ?: boolean,
  /**
   * uni 编译器版本
   */
  uniCompileVersion ?: string,
  /**
   * uni-app 运行平台。如:`app`、`mp-weixin`、`web`
   */
  uniPlatform ?: string,
  /**
   * uni 运行时版本
   */
  uniRuntimeVersion ?: string,
  /**
   * uni 编译器版本号
   */
  uniCompileVersionCode?: number,
  /**
   * uni 运行时版本号
   */
  uniRuntimeVersionCode?: number,
}

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


export interface Uni {
  /**
    * GetAppBaseInfo(Object object)
lizhongyi_'s avatar
lizhongyi_ 已提交
206
    * @description
DCloud-yyl's avatar
DCloud-yyl 已提交
207 208 209 210 211 212 213 214 215 216 217 218 219 220
    * 获取app基本信息
    * @param {GetAppBaseInfoOptions} options [options=包含所有字段的过滤对象]  过滤的字段对象, 不传参数默认为获取全部字段。
    * @return {object}
    * @tutorial https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html
    * @uniPlatform {
    *    "app": {
    *        "android": {
    *            "osVer": "4.4",
    *  		  	 "uniVer": "√",
    * 			 "unixVer": "3.9+"
    *        },
    *        "ios": {
    *            "osVer": "9.0",
    *  		  	 "uniVer": "√",
lizhongyi_'s avatar
lizhongyi_ 已提交
221
    * 			 "unixVer": "x"
DCloud-yyl's avatar
DCloud-yyl 已提交
222 223 224 225 226 227 228 229 230 231 232 233
    *        }
    *    }
    * }
    * @example
     ```typescript
      uni.getAppBaseInfo({
        filter:[]
      })
     ```
    */
  getAppBaseInfo(options?: GetAppBaseInfoOptions | null): GetAppBaseInfoResult;
}