From 677ea9db4c08d54e9fd4f37741151f845e43cfba Mon Sep 17 00:00:00 2001 From: zengyawen Date: Mon, 28 Nov 2022 20:32:22 +0800 Subject: [PATCH] update docs Signed-off-by: zengyawen --- .../reference/apis/js-apis-configuration.md | 27 +++++++ .../apis/js-apis-configurationconstant.md | 74 +++++++++++++++++++ .../reference/apis/js-apis-dispatchInfo.md | 22 ++++++ 3 files changed, 123 insertions(+) create mode 100644 zh-cn/application-dev/reference/apis/js-apis-configuration.md create mode 100644 zh-cn/application-dev/reference/apis/js-apis-configurationconstant.md create mode 100644 zh-cn/application-dev/reference/apis/js-apis-dispatchInfo.md diff --git a/zh-cn/application-dev/reference/apis/js-apis-configuration.md b/zh-cn/application-dev/reference/apis/js-apis-configuration.md new file mode 100644 index 0000000000..d8a1dc4782 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-configuration.md @@ -0,0 +1,27 @@ +# Configuration + +Configuration模块提供环境变化信息的能力。 + +> **说明:** +> +> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## 导入模块 + +```js +import Configuration from '@ohos.application.Configuration'; +``` + +## 属性 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase + + | 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | -------- | -------- | -------- | -------- | +| language | string | 是 | 是 | 表示应用程序的当前语言。 | +| colorMode | [ColorMode](js-apis-configurationconstant.md) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 | +| direction9+ | Direction | 是 | 否 | 表示屏幕方向,取值范围:水平方向(DIRECTION_HORIZONTAL),垂直方向(DIRECTION_VERTICAL)。 | +| screenDensity9+ | ScreenDensity | 是 | 否 | 表示屏幕分辨率,取值范围:SCREEN_DENSITY_SDPI(120)、SCREEN_DENSITY_MDPI(160)、SCREEN_DENSITY_LDPI(240)、SCREEN_DENSITY_XLDPI(320)、SCREEN_DENSITY_XXLDPI(480)、SCREEN_DENSITY_XXXLDPI(640)。 | +| displayId9+ | number | 是 | 否 | 表示应用所在的物理屏幕Id。 | +| hasPointerDevice9+ | boolean | 是 | 否 | 指示指针类型设备是否已连接,如键鼠、触控板等。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-configurationconstant.md b/zh-cn/application-dev/reference/apis/js-apis-configurationconstant.md new file mode 100644 index 0000000000..32a553012a --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-configurationconstant.md @@ -0,0 +1,74 @@ +# ConfigurationConstant + +ConfigurationConstant模块提供配置信息枚举值定义的能力。 + +> **说明:** +> +> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## 导入模块 + + +```js +import ConfigurationConstant from '@ohos.application.ConfigurationConstant'; +``` + +## ConfigurationConstant.ColorMode + +使用时通过ConfigurationConstant.ColorMode获取。 + +**示例:** + +``` +ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT +``` + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase + +| 名称 | 值 | 说明 | +| -------- | -------- | -------- | +| COLOR_MODE_NOT_SET | -1 | 未设置颜色模式。 | +| COLOR_MODE_DARK | 0 | 深色模式。 | +| COLOR_MODE_LIGHT | 1 | 浅色模式。 | + + +## ConfigurationConstant.Direction9+ + +使用时通过ConfigurationConstant.Direction获取。 + +**示例:** + +``` +ConfigurationConstant.Direction.DIRECTION_VERTICAL +``` + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase + +| 名称 | 值 | 说明 | +| -------- | -------- | -------- | +| DIRECTION_NOT_SET | -1 | 未设置方向。 | +| DIRECTION_VERTICAL | 0 | 垂直方向。 | +| DIRECTION_HORIZONTAL | 1 | 水平方向。 | + + +## ConfigurationConstant.ScreenDensity9+ + +使用时通过ConfigurationConstant.ScreenDensity获取。 + +**示例:** + +``` +ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET +``` + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase + +| 名称 | 值 | 说明 | +| -------- | -------- | -------- | +| SCREEN_DENSITY_NOT_SET | 0 | 未设置屏幕分辨率。 | +| SCREEN_DENSITY_SDPI | 120 | 屏幕分辨率为"sdpi"。 | +| SCREEN_DENSITY_MDPI | 160 | 屏幕分辨率为"mdpi"。 | +| SCREEN_DENSITY_LDPI | 240 | 屏幕分辨率为"ldpi"。 | +| SCREEN_DENSITY_XLDPI | 320 | 屏幕分辨率为"xldpi"。 | +| SCREEN_DENSITY_XXLDPI | 480 | 屏幕分辨率为"xxldpi"。 | +| SCREEN_DENSITY_XXXLDPI | 640 | 屏幕分辨率为"xxxldpi"。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-dispatchInfo.md b/zh-cn/application-dev/reference/apis/js-apis-dispatchInfo.md new file mode 100644 index 0000000000..d2f5391c69 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-dispatchInfo.md @@ -0,0 +1,22 @@ +# DispatchInfo + + + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + + + +调度信息类 + +## DispatchInfo + +**系统能力**: 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework.FreeInstall + +**系统API:**此接口为系统接口,三方应用不支持调用 + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------------------ | ------ | ---- | ---- | ------------------------ | +| version | string | 是 | 否 | 包含dispatchInfo版本信息 | +| dispatchAPIVersion | string | 是 | 否 | 包含免安装接口版本号 | + -- GitLab