Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
0d1e9382
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0d1e9382
编写于
7月 29, 2022
作者:
H
HelloCrease
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
HelloCrease
<
lian15@huawei.com
>
上级
2e098766
变更
33
展开全部
显示空白变更内容
内联
并排
Showing
33 changed file
with
1830 addition
and
1887 deletion
+1830
-1887
en/application-dev/application-dev-guide-for-gitee.md
en/application-dev/application-dev-guide-for-gitee.md
+3
-1
en/application-dev/application-dev-guide.md
en/application-dev/application-dev-guide.md
+4
-0
en/application-dev/reference/Readme-EN.md
en/application-dev/reference/Readme-EN.md
+3
-3
en/application-dev/ui/Readme-EN.md
en/application-dev/ui/Readme-EN.md
+72
-71
en/application-dev/website.md
en/application-dev/website.md
+176
-176
zh-cn/application-dev/Readme-CN.md
zh-cn/application-dev/Readme-CN.md
+1
-1
zh-cn/application-dev/application-dev-guide-for-gitee.md
zh-cn/application-dev/application-dev-guide-for-gitee.md
+6
-3
zh-cn/application-dev/application-dev-guide.md
zh-cn/application-dev/application-dev-guide.md
+6
-0
zh-cn/application-dev/reference/Readme-CN.md
zh-cn/application-dev/reference/Readme-CN.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
...v/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
+9
-8
zh-cn/application-dev/reference/apis/js-apis-animator.md
zh-cn/application-dev/reference/apis/js-apis-animator.md
+35
-35
zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md
...ation-dev/reference/apis/js-apis-backgroundTaskManager.md
+33
-33
zh-cn/application-dev/reference/apis/js-apis-config-policy.md
...n/application-dev/reference/apis/js-apis-config-policy.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md
...n-dev/reference/apis/js-apis-distributedMissionManager.md
+60
-60
zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
...n-dev/reference/apis/js-apis-enterprise-device-manager.md
+112
-144
zh-cn/application-dev/reference/apis/js-apis-i18n.md
zh-cn/application-dev/reference/apis/js-apis-i18n.md
+134
-134
zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md
...n/application-dev/reference/apis/js-apis-inputconsumer.md
+20
-26
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
+8
-8
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md
...pplication-dev/reference/apis/js-apis-inputeventclient.md
+5
-9
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
+21
-34
zh-cn/application-dev/reference/apis/js-apis-intl.md
zh-cn/application-dev/reference/apis/js-apis-intl.md
+40
-40
zh-cn/application-dev/reference/apis/js-apis-keycode.md
zh-cn/application-dev/reference/apis/js-apis-keycode.md
+334
-334
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
+30
-29
zh-cn/application-dev/reference/apis/js-apis-mediaquery.md
zh-cn/application-dev/reference/apis/js-apis-mediaquery.md
+2
-1
zh-cn/application-dev/reference/apis/js-apis-mouseevent.md
zh-cn/application-dev/reference/apis/js-apis-mouseevent.md
+56
-56
zh-cn/application-dev/reference/apis/js-apis-prompt.md
zh-cn/application-dev/reference/apis/js-apis-prompt.md
+99
-121
zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
...pplication-dev/reference/apis/js-apis-resource-manager.md
+166
-167
zh-cn/application-dev/reference/apis/js-apis-touchevent.md
zh-cn/application-dev/reference/apis/js-apis-touchevent.md
+55
-54
zh-cn/application-dev/reference/apis/js-apis-update.md
zh-cn/application-dev/reference/apis/js-apis-update.md
+41
-41
zh-cn/application-dev/reference/apis/js-apis-workScheduler.md
...n/application-dev/reference/apis/js-apis-workScheduler.md
+40
-40
zh-cn/application-dev/ui/Readme-CN.md
zh-cn/application-dev/ui/Readme-CN.md
+73
-72
zh-cn/application-dev/website.md
zh-cn/application-dev/website.md
+174
-174
未找到文件。
en/application-dev/application-dev-guide-for-gitee.md
浏览文件 @
0d1e9382
...
@@ -54,8 +54,10 @@ To make you better understand how functions work together and jumpstart your app
...
@@ -54,8 +54,10 @@ To make you better understand how functions work together and jumpstart your app
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
They are organized as follows:
They are organized as follows:
-
[
Component Reference (JavaScript-based Web-like Development Paradigm)
](
reference/arkui-js/Readme-EN.md
)
-
[
Component Reference (TypeScript-based Declarative Development Paradigm)
](
reference/arkui-ts/Readme-EN.md
)
-
[
Component Reference (TypeScript-based Declarative Development Paradigm)
](
reference/arkui-ts/Readme-EN.md
)
-
[
Component Reference (JavaScript-based Web-like Development Paradigm)
](
reference/arkui-js/Readme-EN.md
)
-
APIs
-
APIs
-
[
JS and TS APIs
](
reference/apis/Readme-EN.md
)
-
[
JS and TS APIs
](
reference/apis/Readme-EN.md
)
-
Native APIs
-
Native APIs
...
...
en/application-dev/application-dev-guide.md
浏览文件 @
0d1e9382
...
@@ -54,6 +54,10 @@ To make you better understand how functions work together and jumpstart your app
...
@@ -54,6 +54,10 @@ To make you better understand how functions work together and jumpstart your app
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
API references encompass all components and APIs available in OpenHarmony, helping you use and integrate APIs more effectively.
They are organized as follows:
They are organized as follows:
-
[
Component Reference (TypeScript-based Declarative Development Paradigm)
](
reference/arkui-ts/Readme-EN.md
)
-
[
Component Reference (JavaScript-based Web-like Development Paradigm)
](
reference/arkui-js/Readme-EN.md
)
-
[
JS and TS APIs
](
reference/apis/js-apis-DataUriUtils.md
)
-
[
JS and TS APIs
](
reference/apis/js-apis-DataUriUtils.md
)
-
Native APIs
-
Native APIs
-
[
Standard Library
](
reference/native-lib/third_party_libc/musl.md
)
-
[
Standard Library
](
reference/native-lib/third_party_libc/musl.md
)
...
...
en/application-dev/reference/Readme-EN.md
浏览文件 @
0d1e9382
# Development References
# Development References
-
[
JavaScript-based Web-like Development Paradigm
](
arkui-j
s/Readme-EN.md
)
-
[
Component Reference(TypeScript-based Declarative Development Paradigm)
](
arkui-t
s/Readme-EN.md
)
-
[
TypeScript-based Declarative Development Paradigm
](
arkui-t
s/Readme-EN.md
)
-
[
Component Reference(JavaScript-based Web-like Development Paradigm)
](
arkui-j
s/Readme-EN.md
)
-
[
APIs
](
apis/Readme-EN.md
)
-
[
APIs
](
apis/Readme-EN.md
)
- [JS (eTS Included) APIs](apis/Readme-EN.md)
- [JS (eTS Included) APIs](apis/Readme-EN.md)
...
...
en/application-dev/ui/Readme-EN.md
浏览文件 @
0d1e9382
# UI Development
# UI Development
-
[
ArkUI Overview
](
arkui-overview.md
)
-
[
ArkUI Overview
](
arkui-overview.md
)
-
TypeScript-based Declarative Development Paradigm
-
[
Overview
](
ui-ts-overview.md
)
-
Framework Overview
-
File Organization
-
[
Directory Structure
](
ts-framework-directory.md
)
-
[
Rules for Accessing Application Code Files
](
ts-framework-file-access-rules.md
)
-
[
"js" Tag
](
ts-framework-js-tag.md
)
-
Resource Access
-
[
Accessing Application Resources
](
ts-application-resource-access.md
)
-
[
Accessing System Resources
](
ts-system-resource-access.md
)
-
[
Media Resource Types
](
ts-media-resource-type.md
)
-
[
Pixel Units
](
ts-pixel-units.md
)
-
[
Types
](
ts-types.md
)
-
Declarative Syntax
-
[
Overview
](
ts-syntax-intro.md
)
-
General UI Description Specifications
-
[
Basic Concepts
](
ts-general-ui-concepts.md
)
-
Declarative UI Description Specifications
-
[
Configuration Without Parameters
](
ts-parameterless-configuration.md
)
-
[
Configuration with Mandatory Parameters
](
ts-configuration-with-mandatory-parameters.md
)
-
[
Attribute Configuration
](
ts-attribution-configuration.md
)
-
[
Event Configuration
](
ts-event-configuration.md
)
-
[
Child Component Configuration
](
ts-child-component-configuration.md
)
-
Componentization
-
[
@Component
](
ts-component-based-component.md
)
-
[
@Entry
](
ts-component-based-entry.md
)
-
[
@Preview
](
ts-component-based-preview.md
)
-
[
@Builder
](
ts-component-based-builder.md
)
-
[
@Extend
](
ts-component-based-extend.md
)
-
[
@CustomDialog
](
ts-component-based-customdialog.md
)
-
[
@Styles
](
ts-component-based-styles.md
)
-
About UI State Management
-
[
Basic Concepts
](
ts-ui-state-mgmt-concepts.md
)
-
Managing Component States
-
[
@State
](
ts-component-states-state.md
)
-
[
@Prop
](
ts-component-states-prop.md
)
-
[
@Link
](
ts-component-states-link.md
)
-
Managing Application States
-
[
AppStorage
](
ts-application-states-appstorage.md
)
-
[
PersistentStorage
](
ts-application-states-apis-persistentstorage.md
)
-
[
Environment
](
ts-application-states-apis-environment.md
)
-
Managing Other States
-
[
@Observed and @ObjectLink
](
ts-other-states-observed-objectlink.md
)
-
[
@Consume and @Provide
](
ts-other-states-consume-provide.md
)
-
[
@Watch
](
ts-other-states-watch.md
)
-
About Rendering Control Syntax
-
[
if/else
](
ts-rending-control-syntax-if-else.md
)
-
[
ForEach
](
ts-rending-control-syntax-foreach.md
)
-
[
LazyForEach
](
ts-rending-control-syntax-lazyforeach.md
)
-
About @Component
-
[
build Function
](
ts-function-build.md
)
-
[
Initialization of Custom Components' Member Variables
](
ts-custom-component-initialization.md
)
-
[
Custom Component Lifecycle Callbacks
](
ts-custom-component-lifecycle-callbacks.md
)
-
[
Component Creation and Re-initialization
](
ts-component-creation-re-initialization.md
)
-
[
About Syntactic Sugar
](
ts-syntactic-sugar.md
)
-
Common Component Development Guidelines
-
[
Button
](
ui-ts-basic-components-button.md
)
-
[
Web
](
ui-ts-components-web.md
)
-
Common Layout Development Guidelines
-
[
Flex Layout
](
ui-ts-layout-flex.md
)
-
[
Grid Layout
](
ui-ts-layout-grid-container.md
)
-
[
Media Query
](
ui-ts-layout-mediaquery.md
)
-
Experiencing the Declarative UI
-
[
Creating a Declarative UI Project
](
ui-ts-creating-project.md
)
-
[
Getting to Know Components
](
ui-ts-components.md
)
-
[
Creating a Simple Page
](
ui-ts-creating-simple-page.md
)
-
Defining Page Layout and Connection
-
[
Building a Food Data Model
](
ui-ts-building-data-model.md
)
-
[
Building a Food Category List Layout
](
ui-ts-building-category-list-layout.md
)
-
[
Building a Food Category Grid Layout
](
ui-ts-building-category-grid-layout.md
)
-
[
Implementing Page Redirection and Data Transmission
](
ui-ts-page-redirection-data-transmission.md
)
-
JavaScript-based Web-like Development Paradigm
-
JavaScript-based Web-like Development Paradigm
-
[
Overview
](
ui-js-overview.md
)
-
[
Overview
](
ui-js-overview.md
)
-
Framework
-
Framework
...
@@ -73,74 +144,4 @@
...
@@ -73,74 +144,4 @@
-
[
Animation Effect
](
ui-js-animate-dynamic-effects.md
)
-
[
Animation Effect
](
ui-js-animate-dynamic-effects.md
)
-
[
Animation Frame
](
ui-js-animate-frame.md
)
-
[
Animation Frame
](
ui-js-animate-frame.md
)
-
[
Custom Components
](
ui-js-custom-components.md
)
-
[
Custom Components
](
ui-js-custom-components.md
)
-
TypeScript-based Declarative Development Paradigm
-
[
Overview
](
ui-ts-overview.md
)
-
Framework Overview
-
File Organization
-
[
Directory Structure
](
ts-framework-directory.md
)
-
[
Rules for Accessing Application Code Files
](
ts-framework-file-access-rules.md
)
-
[
"js" Tag
](
ts-framework-js-tag.md
)
-
Resource Access
-
[
Accessing Application Resources
](
ts-application-resource-access.md
)
-
[
Accessing System Resources
](
ts-system-resource-access.md
)
-
[
Media Resource Types
](
ts-media-resource-type.md
)
-
[
Pixel Units
](
ts-pixel-units.md
)
-
[
Types
](
ts-types.md
)
-
Declarative Syntax
-
[
Overview
](
ts-syntax-intro.md
)
-
General UI Description Specifications
-
[
Basic Concepts
](
ts-general-ui-concepts.md
)
-
Declarative UI Description Specifications
-
[
Configuration Without Parameters
](
ts-parameterless-configuration.md
)
-
[
Configuration with Mandatory Parameters
](
ts-configuration-with-mandatory-parameters.md
)
-
[
Attribute Configuration
](
ts-attribution-configuration.md
)
-
[
Event Configuration
](
ts-event-configuration.md
)
-
[
Child Component Configuration
](
ts-child-component-configuration.md
)
-
Componentization
-
[
@Component
](
ts-component-based-component.md
)
-
[
@Entry
](
ts-component-based-entry.md
)
-
[
@Preview
](
ts-component-based-preview.md
)
-
[
@Builder
](
ts-component-based-builder.md
)
-
[
@Extend
](
ts-component-based-extend.md
)
-
[
@CustomDialog
](
ts-component-based-customdialog.md
)
-
[
@Styles
](
ts-component-based-styles.md
)
-
About UI State Management
-
[
Basic Concepts
](
ts-ui-state-mgmt-concepts.md
)
-
Managing Component States
-
[
@State
](
ts-component-states-state.md
)
-
[
@Prop
](
ts-component-states-prop.md
)
-
[
@Link
](
ts-component-states-link.md
)
-
Managing Application States
-
[
AppStorage
](
ts-application-states-appstorage.md
)
-
[
PersistentStorage
](
ts-application-states-apis-persistentstorage.md
)
-
[
Environment
](
ts-application-states-apis-environment.md
)
-
Managing Other States
-
[
@Observed and @ObjectLink
](
ts-other-states-observed-objectlink.md
)
-
[
@Consume and @Provide
](
ts-other-states-consume-provide.md
)
-
[
@Watch
](
ts-other-states-watch.md
)
-
About Rendering Control Syntax
-
[
if/else
](
ts-rending-control-syntax-if-else.md
)
-
[
ForEach
](
ts-rending-control-syntax-foreach.md
)
-
[
LazyForEach
](
ts-rending-control-syntax-lazyforeach.md
)
-
About @Component
-
[
build Function
](
ts-function-build.md
)
-
[
Initialization of Custom Components' Member Variables
](
ts-custom-component-initialization.md
)
-
[
Custom Component Lifecycle Callbacks
](
ts-custom-component-lifecycle-callbacks.md
)
-
[
Component Creation and Re-initialization
](
ts-component-creation-re-initialization.md
)
-
[
About Syntactic Sugar
](
ts-syntactic-sugar.md
)
-
Common Component Development Guidelines
-
[
Button
](
ui-ts-basic-components-button.md
)
-
[
Web
](
ui-ts-components-web.md
)
-
Common Layout Development Guidelines
-
[
Flex Layout
](
ui-ts-layout-flex.md
)
-
[
Grid Layout
](
ui-ts-layout-grid-container.md
)
-
[
Media Query
](
ui-ts-layout-mediaquery.md
)
-
Experiencing the Declarative UI
-
[
Creating a Declarative UI Project
](
ui-ts-creating-project.md
)
-
[
Getting to Know Components
](
ui-ts-components.md
)
-
[
Creating a Simple Page
](
ui-ts-creating-simple-page.md
)
-
Defining Page Layout and Connection
-
[
Building a Food Data Model
](
ui-ts-building-data-model.md
)
-
[
Building a Food Category List Layout
](
ui-ts-building-category-list-layout.md
)
-
[
Building a Food Category Grid Layout
](
ui-ts-building-category-grid-layout.md
)
-
[
Implementing Page Redirection and Data Transmission
](
ui-ts-page-redirection-data-transmission.md
)
en/application-dev/website.md
浏览文件 @
0d1e9382
此差异已折叠。
点击以展开。
zh-cn/application-dev/Readme-CN.md
浏览文件 @
0d1e9382
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
-
[
示例代码
](
https://gitee.com/openharmony/app_samples/blob/master/README_zh.md
)
-
[
示例代码
](
https://gitee.com/openharmony/app_samples/blob/master/README_zh.md
)
-
[
Codelabs
](
https://gitee.com/openharmony/codelabs/blob/master/README.md
)
-
[
Codelabs
](
https://gitee.com/openharmony/codelabs/blob/master/README.md
)
-
API参考
-
API参考
-
[
组件参考(基于JS扩展的类Web开发范式)
](
reference/arkui-js/Readme-CN.md
)
-
[
组件参考(基于TS扩展的声明式开发范式)
](
reference/arkui-ts/Readme-CN.md
)
-
[
组件参考(基于TS扩展的声明式开发范式)
](
reference/arkui-ts/Readme-CN.md
)
-
[
组件参考(基于JS扩展的类Web开发范式)
](
reference/arkui-js/Readme-CN.md
)
-
接口
-
接口
-
[
JS及TS API参考
](
reference/apis/Readme-CN.md
)
-
[
JS及TS API参考
](
reference/apis/Readme-CN.md
)
-
Native API
-
Native API
...
...
zh-cn/application-dev/application-dev-guide-for-gitee.md
浏览文件 @
0d1e9382
...
@@ -54,8 +54,11 @@ DevEco Studio工具是OpenHarmony应用开发的推荐IDE工具。
...
@@ -54,8 +54,11 @@ DevEco Studio工具是OpenHarmony应用开发的推荐IDE工具。
API参考提供了OpenHarmony全量组件和接口的参考文档,可以帮助开发者快速查找到指定接口的详细描述和调用方法。
API参考提供了OpenHarmony全量组件和接口的参考文档,可以帮助开发者快速查找到指定接口的详细描述和调用方法。
内容包括:
内容包括:
-
[
组件参考(基于JS扩展的类Web开发范式)
](
reference/arkui-js/Readme-CN.md
)
-
[
组件参考(基于TS扩展的声明式开发范式)
](
reference/arkui-ts/Readme-CN.md
)
-
[
组件参考(基于TS扩展的声明式开发范式)
](
reference/arkui-ts/Readme-CN.md
)
-
[
组件参考(基于JS扩展的类Web开发范式)
](
reference/arkui-js/Readme-CN.md
)
-
接口参考
-
接口参考
-
[
JS及TS API参考
](
reference/apis/Readme-CN.md
)
-
[
JS及TS API参考
](
reference/apis/Readme-CN.md
)
-
Native API
-
Native API
...
...
zh-cn/application-dev/application-dev-guide.md
浏览文件 @
0d1e9382
...
@@ -55,6 +55,12 @@ DevEco Studio工具是OpenHarmony应用开发的推荐IDE工具。
...
@@ -55,6 +55,12 @@ DevEco Studio工具是OpenHarmony应用开发的推荐IDE工具。
API参考提供了OpenHarmony全量组件和接口的参考文档,可以帮助开发者快速查找到指定接口的详细描述和调用方法。
API参考提供了OpenHarmony全量组件和接口的参考文档,可以帮助开发者快速查找到指定接口的详细描述和调用方法。
内容包括:
内容包括:
-
[
组件参考(基于TS扩展的声明式开发范式)
](
reference/arkui-ts/Readme-CN.md
)
-
[
组件参考(基于JS扩展的类Web开发范式)
](
reference/arkui-js/Readme-CN.md
)
-
[
接口参考(JS及TS API)
](
reference/apis/js-apis-DataUriUtils.md
)
-
[
接口参考(JS及TS API)
](
reference/apis/js-apis-DataUriUtils.md
)
-
接口参考(Native API)
-
接口参考(Native API)
-
[
OpenHarmony Native API
](
reference/native-apis/_o_h___native_x_component.md
)
-
[
OpenHarmony Native API
](
reference/native-apis/_o_h___native_x_component.md
)
...
...
zh-cn/application-dev/reference/Readme-CN.md
浏览文件 @
0d1e9382
# 开发参考
# 开发参考
-
[
基于JS扩展的类Web开发范式
](
arkui-j
s/Readme-CN.md
)
-
[
组件参考(基于TS扩展的声明式开发范式)
](
arkui-t
s/Readme-CN.md
)
-
[
基于TS扩展的声明式开发范式
](
arkui-t
s/Readme-CN.md
)
-
[
组件参考(基于JS扩展的类Web开发范式)
](
arkui-j
s/Readme-CN.md
)
-
[
接口参考(JS及TS API)
](
apis/Readme-CN.md
)
-
[
接口参考(JS及TS API)
](
apis/Readme-CN.md
)
-
接口参考(Native API)
-
接口参考(Native API)
-
[
OpenHarmony Native API
](
./native-apis/Readme-CN.md
)
-
[
OpenHarmony Native API
](
./native-apis/Readme-CN.md
)
...
...
zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md
浏览文件 @
0d1e9382
...
@@ -4,13 +4,14 @@
...
@@ -4,13 +4,14 @@
开发者在开发应用时,通过复写该模块的接口,在延迟任务触发的时候,系统会通过接口回调应用,开发者在回调接口里面可以处理自己的任务逻辑。
开发者在开发应用时,通过复写该模块的接口,在延迟任务触发的时候,系统会通过接口回调应用,开发者在回调接口里面可以处理自己的任务逻辑。
>  **说明:**
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
```
```
ts
import
WorkSchedulerExtensionAbility
from
'
@ohos.WorkSchedulerExtensionAbility
'
import
WorkSchedulerExtensionAbility
from
'
@ohos.WorkSchedulerExtensionAbility
'
```
```
...
@@ -25,12 +26,12 @@ onWorkStart(work: workScheduler.WorkInfo): void
...
@@ -25,12 +26,12 @@ onWorkStart(work: workScheduler.WorkInfo): void
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---- | --------------------- | ---- | -------------- |
| ---- | ---------------------
-------------------
| ---- | -------------- |
| work |
[
workScheduler.WorkInfo
](
js-apis-workScheduler.md#workinfo
)
| 是 | 指示要添加到执行队列的工作。 |
| work |
[
workScheduler.WorkInfo
](
js-apis-workScheduler.md#workinfo
)
| 是 | 指示要添加到执行队列的工作。 |
**示例:**
**示例:**
```
```
ts
export
default
class
MyWorkSchedulerExtensionAbility
extends
WorkSchedulerExtensionAbility
{
export
default
class
MyWorkSchedulerExtensionAbility
extends
WorkSchedulerExtensionAbility
{
onWorkStart
(
workInfo
)
{
onWorkStart
(
workInfo
)
{
console
.
log
(
'
MyWorkSchedulerExtensionAbility onWorkStart
'
+
JSON
.
stringify
(
workInfo
));
console
.
log
(
'
MyWorkSchedulerExtensionAbility onWorkStart
'
+
JSON
.
stringify
(
workInfo
));
...
@@ -49,13 +50,13 @@ onWorkStop(work: workScheduler.WorkInfo): void
...
@@ -49,13 +50,13 @@ onWorkStop(work: workScheduler.WorkInfo): void
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---- | --------------------- | ---- | -------------- |
| ---- | ---------------------
-------------------
| ---- | -------------- |
| work |
[
workScheduler.WorkInfo
](
js-apis-workScheduler.md#workinfo
)
| 是 | 指示要添加到执行队列的工作。 |
| work |
[
workScheduler.WorkInfo
](
js-apis-workScheduler.md#workinfo
)
| 是 | 指示要添加到执行队列的工作。 |
**示例:**
**示例:**
```
```
ts
export
default
class
MyWorkSchedulerExtensionAbility
extends
WorkSchedulerExtensionAbility
{
export
default
class
MyWorkSchedulerExtensionAbility
extends
WorkSchedulerExtensionAbility
{
onWorkStop
(
workInfo
)
{
onWorkStop
(
workInfo
)
{
console
.
log
(
'
MyWorkSchedulerExtensionAbility onWorkStop
'
+
JSON
.
stringify
(
workInfo
));
console
.
log
(
'
MyWorkSchedulerExtensionAbility onWorkStop
'
+
JSON
.
stringify
(
workInfo
));
...
...
zh-cn/application-dev/reference/apis/js-apis-animator.md
浏览文件 @
0d1e9382
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
## 导入模块
## 导入模块
```
```
js
import
animator
from
'
@ohos.animator
'
;
import
animator
from
'
@ohos.animator
'
;
```
```
...
@@ -24,17 +24,17 @@ createAnimator(options: AnimatorOptions): AnimatorResult
...
@@ -24,17 +24,17 @@ createAnimator(options: AnimatorOptions): AnimatorResult
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- | -
------- |
| -------
| ----------------------------------- | ---- |
------- |
| options |
[
AnimatorOptions
](
#animatoroptions
)
| 是
| 定义动画选项。
|
| options |
[
AnimatorOptions
](
#animatoroptions
)
| 是
| 定义动画选项。
|
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| --------
|
-------- |
| --------
------------------------- | -----
-------- |
|
[
AnimatorResult
](
#animatorresult
)
| Animator结果接口。 |
|
[
AnimatorResult
](
#animatorresult
)
| Animator结果接口。 |
**示例:**
**示例:**
```
```
html
<!-- hml -->
<!-- hml -->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"Animation"
style=
"height: {{divHeight}}px; width: {{divWidth}}px; background-color: red;"
onclick=
"Show"
>
<div
class=
"Animation"
style=
"height: {{divHeight}}px; width: {{divWidth}}px; background-color: red;"
onclick=
"Show"
>
...
@@ -42,7 +42,7 @@ createAnimator(options: AnimatorOptions): AnimatorResult
...
@@ -42,7 +42,7 @@ createAnimator(options: AnimatorOptions): AnimatorResult
</div>
</div>
```
```
```
```
js
// js
// js
export
default
{
export
default
{
data
:
{
data
:
{
...
@@ -95,11 +95,11 @@ update(options: AnimatorOptions): void
...
@@ -95,11 +95,11 @@ update(options: AnimatorOptions): void
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------
- | -------- | -------- | -
------- |
| -------
| ----------------------------------- | ---- |
------- |
| options |
[
AnimatorOptions
](
#animatoroptions
)
| 是
| 定义动画选项。
|
| options |
[
AnimatorOptions
](
#animatoroptions
)
| 是
| 定义动画选项。
|
**示例:**
**示例:**
```
```
js
animator
.
update
(
options
);
animator
.
update
(
options
);
```
```
...
@@ -112,7 +112,7 @@ play(): void
...
@@ -112,7 +112,7 @@ play(): void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
play
();
animator
.
play
();
```
```
...
@@ -125,7 +125,7 @@ finish(): void
...
@@ -125,7 +125,7 @@ finish(): void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
finish
();
animator
.
finish
();
```
```
...
@@ -138,7 +138,7 @@ pause(): void
...
@@ -138,7 +138,7 @@ pause(): void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
pause
();
animator
.
pause
();
```
```
...
@@ -151,7 +151,7 @@ cancel(): void
...
@@ -151,7 +151,7 @@ cancel(): void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
cancel
();
animator
.
cancel
();
```
```
...
@@ -164,7 +164,7 @@ reverse(): void
...
@@ -164,7 +164,7 @@ reverse(): void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
reverse
();
animator
.
reverse
();
```
```
...
@@ -178,11 +178,11 @@ onframe: (progress: number) => void
...
@@ -178,11 +178,11 @@ onframe: (progress: number) => void
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------
-- | ----
---- | -------- |
| -------- | ------
|
---- | -------- |
| progress | number | 是
| 动画的当前进度。
|
| progress | number | 是
| 动画的当前进度。
|
**示例:**
**示例:**
```
```
js
animator
.
onframe
();
animator
.
onframe
();
```
```
...
@@ -195,7 +195,7 @@ onfinish: () => void
...
@@ -195,7 +195,7 @@ onfinish: () => void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
onfinish
();
animator
.
onfinish
();
```
```
...
@@ -208,7 +208,7 @@ oncancel: () => void
...
@@ -208,7 +208,7 @@ oncancel: () => void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
oncancel
();
animator
.
oncancel
();
```
```
...
@@ -221,7 +221,7 @@ onrepeat: () => void
...
@@ -221,7 +221,7 @@ onrepeat: () => void
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**示例:**
**示例:**
```
```
js
animator
.
onrepeat
();
animator
.
onrepeat
();
```
```
...
@@ -232,12 +232,12 @@ animator.onrepeat();
...
@@ -232,12 +232,12 @@ animator.onrepeat();
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| 名称 | 参数类型 | 必填 | 说明 |
| --------
| -------- | -------- |
-------- |
| --------
-- | ---------------------------------------- | ---- | --------------------------------
-------- |
| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 |
| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 |
| easing | string | 是 | 动画插值曲线,默认为'ease'。 |
| easing | string | 是 | 动画插值曲线,默认为'ease'。 |
| delay | number | 是 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 |
| delay | number | 是 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 |
| fill | "none"
\|
"forwards"
\|
"backwards"
\|
"both" | 是 | 动画执行后是否恢复到初始状态,默认值为"none"。动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。 |
| fill | "none"
\|
"forwards"
\|
"backwards"
\|
"both" | 是 | 动画执行后是否恢复到初始状态,默认值为"none"。动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。 |
| direction
| "normal"
\|
"reverse"
\|
"alternate"
\|
"alternate-reverse" | 是 | 动画播放模式,默认值"normal"。
|
| direction
| "normal"
\|
"reverse"
\|
"alternate"
\|
"alternate-reverse" | 是 | 动画播放模式,默认值"normal"。
|
| iterations | number | 是 | 动画播放次数,默认值1。设置为0时不播放,设置为-1时无限次播放。 |
| iterations | number | 是 | 动画播放次数,默认值1。设置为0时不播放,设置为-1时无限次播放。 |
| begin | number | 是 | 动画插值起点,默认为0。 |
| begin | number | 是 | 动画插值起点,默认为0。 |
| end | number | 是 | 动画插值终点,默认为1。 |
| end | number | 是 | 动画插值终点,默认为1。 |
zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md
浏览文件 @
0d1e9382
...
@@ -8,13 +8,13 @@
...
@@ -8,13 +8,13 @@
应用中存在用户能够直观感受到的且需要一直在后台运行的业务时(如,后台播放音乐),可以使用长时任务机制。
应用中存在用户能够直观感受到的且需要一直在后台运行的业务时(如,后台播放音乐),可以使用长时任务机制。
>

**说明:**
> **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
```
```
js
import
backgroundTaskManager
from
'
@ohos.backgroundTaskManager
'
;
import
backgroundTaskManager
from
'
@ohos.backgroundTaskManager
'
;
```
```
...
@@ -144,7 +144,7 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
...
@@ -144,7 +144,7 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ---------------------------------- | ---- | ------------------------ |
| --------- | ---------------------------------- | ---- | ------------------------
----------------
|
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| bgMode |
[
BackgroundMode
](
#backgroundmode8
)
| 是 | 向系统申请的后台模式。 |
| bgMode |
[
BackgroundMode
](
#backgroundmode8
)
| 是 | 向系统申请的后台模式。 |
| wantAgent |
[
WantAgent
](
js-apis-wantAgent.md
)
| 是 | 通知参数,用于指定长时任务通知点击后跳转的界面。 |
| wantAgent |
[
WantAgent
](
js-apis-wantAgent.md
)
| 是 | 通知参数,用于指定长时任务通知点击后跳转的界面。 |
...
@@ -196,7 +196,7 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
...
@@ -196,7 +196,7 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ---------------------------------- | ---- | ----------------------- |
| --------- | ---------------------------------- | ---- | -----------------------
-----------------
|
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| bgMode |
[
BackgroundMode
](
#backgroundmode8
)
| 是 | 向系统申请的后台模式。 |
| bgMode |
[
BackgroundMode
](
#backgroundmode8
)
| 是 | 向系统申请的后台模式。 |
| wantAgent |
[
WantAgent
](
js-apis-wantAgent.md
)
| 是 | 通知参数,用于指定长时任务通知点击跳转的界面。 |
| wantAgent |
[
WantAgent
](
js-apis-wantAgent.md
)
| 是 | 通知参数,用于指定长时任务通知点击跳转的界面。 |
...
@@ -245,7 +245,7 @@ stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): vo
...
@@ -245,7 +245,7 @@ stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): vo
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------------
---- | ---- |
---------------------- |
| -------- | -------------------------
| ---- | ------------------
---------------------- |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动长时任务的结果。 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动长时任务的结果。 |
...
@@ -276,7 +276,7 @@ stopBackgroundRunning(context: Context): Promise<void>
...
@@ -276,7 +276,7 @@ stopBackgroundRunning(context: Context): Promise<void>
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------
---------------------- | ---- |
--------- |
| ------- | -------
| ---- | -------------------------------
--------- |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
| context | Context | 是 | 应用运行的上下文。
<br>
FA模型的应用Context定义见
[
Context
](
js-apis-Context.md
)
。
<br>
Stage模型的应用Context定义见
[
Context
](
js-apis-ability-context.md
)
。 |
**返回值**
**返回值**
...
@@ -301,7 +301,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
...
@@ -301,7 +301,7 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
延迟挂起信息。
延迟挂起信息。
**系统能力:**
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
**系统能力:**
SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --------------- | ------ | ---- | ---------------------------------------- |
| --------------- | ------ | ---- | ---------------------------------------- |
...
@@ -311,16 +311,16 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
...
@@ -311,16 +311,16 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(()
## BackgroundMode<sup>8+</sup>
## BackgroundMode<sup>8+</sup>
**系统能力:**
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**系统能力:**
SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
| 参数名 | 参数值 | 描述 |
| 参数名 | 参数值 | 描述 |
| ----------------------- | ----
-- | ---------------------------------------
--------------------- |
| ----------------------- | ----
|
--------------------- |
| DATA_TRANSFER | 1 | 数据传输 |
| DATA_TRANSFER | 1 | 数据传输 |
| AUDIO_PLAYBACK | 2 | 音频播放 |
| AUDIO_PLAYBACK | 2 | 音频播放 |
| AUDIO_RECORDING | 3 | 录音 |
| AUDIO_RECORDING | 3 | 录音 |
| LOCATION | 4 | 定位导航 |
| LOCATION | 4 | 定位导航 |
| BLUETOOTH_INTERACTION | 5 | 蓝牙相关 |
| BLUETOOTH_INTERACTION | 5 | 蓝牙相关 |
| MULTI_DEVICE_CONNECTION | 6 | 多设备互联 |
| MULTI_DEVICE_CONNECTION | 6 | 多设备互联 |
| WIFI_INTERACTION | 7
| WLAN相关
<br
/>
**系统API**
:此接口为系统接口,三方应用不支持调用
。 |
| WIFI_INTERACTION | 7
| WLAN相关
<br
/>
此接口为系统接口
。 |
| VOIP | 8
| 音视频通话
<br
/>
**系统API**
:此接口为系统接口,三方应用不支持调用。
|
| VOIP | 8
| 音视频通话
<br
/>
此接口为系统接口。
|
| TASK_KEEPING | 9 | 计算任务(仅在特定设备生效) |
| TASK_KEEPING | 9 | 计算任务(仅在特定设备生效) |
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-config-policy.md
浏览文件 @
0d1e9382
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
>
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
>
> 本模块接口均为系统接口
,三方应用不支持调用
。
> 本模块接口均为系统接口。
## 导入模块
## 导入模块
...
...
zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md
浏览文件 @
0d1e9382
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
## 导入模块
## 导入模块
```
```
js
import
distributedMissionManager
from
'
@ohos.distributedMissionManager
'
import
distributedMissionManager
from
'
@ohos.distributedMissionManager
'
```
```
...
@@ -27,11 +27,11 @@ registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback,
...
@@ -27,11 +27,11 @@ registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback,
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- |
-------- |
| --------- | --------------------------------------- | ---- | -
-------- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 注册监听设备信息。 |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 注册监听设备信息。 |
| options |
[
MissionCallback
](
#missioncallback
)
| 是 | 注册的回调方法。
|
| options |
[
MissionCallback
](
#missioncallback
)
| 是 | 注册的回调方法。
|
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
**示例:**
**示例:**
...
@@ -71,16 +71,16 @@ registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback):
...
@@ -71,16 +71,16 @@ registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback):
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | ----
---- | -------- |
| --------- | ---------------------------------------- |
---- | -------- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 设备信息。
|
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 设备信息。
|
| options |
<a
href=
"#missioncallback"
>
MissionCallback
</a>
| 是
| 注册的回调方法。 |
| options |
<a
href=
"#missioncallback"
>
MissionCallback
</a>
| 是
| 注册的回调方法。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| -------- |
-------- |
| ------------------- | --------
-------- |
| Promise
<
void
>
| promise方式返回执行结果。 |
| Promise
<
void
>
| promise方式返回执行结果。 |
**示例:**
**示例:**
...
@@ -125,10 +125,10 @@ unregisterMissionListener(parameter: MissionDeviceInfo, callback: AsyncCallback&
...
@@ -125,10 +125,10 @@ unregisterMissionListener(parameter: MissionDeviceInfo, callback: AsyncCallback&
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- |
-------- |
| --------- | --------------------------------------- | ---- | -
-------- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 设备信息。
|
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 设备信息。
|
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
**示例:**
**示例:**
...
@@ -154,15 +154,15 @@ unregisterMissionListener(parameter: MissionDeviceInfo): Promise<void>
...
@@ -154,15 +154,15 @@ unregisterMissionListener(parameter: MissionDeviceInfo): Promise<void>
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- | ---
----- |
| --------- | --------------------------------------- | ---- |
----- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 设备信息。 |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 设备信息。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| -------- |
-------- |
| ------------------- | --------
-------- |
| Promise
<
void
>
| promise方式返回执行结果。 |
| Promise
<
void
>
| promise方式返回执行结果。 |
**示例:**
**示例:**
...
@@ -190,10 +190,10 @@ startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback<
...
@@ -190,10 +190,10 @@ startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback<
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- |
-------- |
| --------- | ------------------------------------- | ---- | -
-------- |
| parameter |
[
MissionParameter
](
#missionparameter
)
| 是 | 同步信息。
|
| parameter |
[
MissionParameter
](
#missionparameter
)
| 是 | 同步信息。
|
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
**示例:**
**示例:**
...
@@ -220,15 +220,15 @@ startSyncRemoteMissions(parameter: MissionParameter): Promise<void>
...
@@ -220,15 +220,15 @@ startSyncRemoteMissions(parameter: MissionParameter): Promise<void>
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- | ---
----- |
| --------- | ------------------------------------- | ---- |
----- |
| parameter |
[
MissionParameter
](
#missionparameter
)
| 是
| 同步信息。 |
| parameter |
[
MissionParameter
](
#missionparameter
)
| 是
| 同步信息。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| -------- |
-------- |
| ------------------- | --------
-------- |
| Promise
<
void
>
| promise方式返回执行结果。 |
| Promise
<
void
>
| promise方式返回执行结果。 |
**示例:**
**示例:**
...
@@ -258,10 +258,10 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback<
...
@@ -258,10 +258,10 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback<
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- |
-------- |
| --------- | --------------------------------------- | ---- | -
-------- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 同步信息。
|
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是 | 同步信息。
|
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
| callback | AsyncCallback
<
void
>
| 是
| 执行结果回调函数。 |
**示例:**
**示例:**
...
@@ -286,15 +286,15 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
...
@@ -286,15 +286,15 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明
|
| 参数名 | 类型 | 必填 | 说明
|
| -------- | -------- | -------- | ---
----- |
| --------- | --------------------------------------- | ---- |
----- |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 同步信息。 |
| parameter |
[
MissionDeviceInfo
](
#missiondeviceinfo
)
| 是
| 同步信息。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| -------- |
-------- |
| ------------------- | --------
-------- |
| Promise
<
void
>
| promise方式返回执行结果。 |
| Promise
<
void
>
| promise方式返回执行结果。 |
**示例:**
**示例:**
...
@@ -314,11 +314,11 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
...
@@ -314,11 +314,11 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
表示开始同步后,建立的回调函数。
表示开始同步后,建立的回调函数。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Ability.AbilityRuntime.Mission
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Mission
| 名称 | 类型 | 可读 | 可写 | 说明 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
------------- | -------- | ---- | ---- | ----------
-------- |
| notifyMissionsChanged | function | 是
| 否 | 通知任务变化,返回设备ID。|
| notifyMissionsChanged | function | 是
| 否 | 通知任务变化,返回设备ID。 |
| notifySnapshot | function | 是 | 否 | 通知快照变化,返回设备ID,任务ID |
| notifySnapshot | function | 是 | 否 | 通知快照变化,返回设备ID,任务ID |
| notifyNetDisconnect | function | 是 | 否 | 通知断开连接,返回设备ID,网络状态 |
| notifyNetDisconnect | function | 是 | 否 | 通知断开连接,返回设备ID,网络状态 |
...
@@ -326,11 +326,11 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
...
@@ -326,11 +326,11 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
表示同步时所需参数的枚举。
表示同步时所需参数的枚举。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Ability.AbilityRuntime.Mission
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Mission
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
--- | ------- | ---- | ---- | ---
-------- |
| deviceId
| string | 是 | 是 | 表示设备ID。|
| deviceId
| string | 是 | 是 | 表示设备ID。 |
| fixConflict | boolean | 是 | 是 | 表示是否存在版本冲突。 |
| fixConflict | boolean | 是 | 是 | 表示是否存在版本冲突。 |
| tag | number | 是 | 是 | 表示特定的标签。 |
| tag | number | 是 | 是 | 表示特定的标签。 |
...
@@ -338,8 +338,8 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
...
@@ -338,8 +338,8 @@ stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise<void>
表示注册监听时所需参数的枚举。
表示注册监听时所需参数的枚举。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Ability.AbilityRuntime.Mission
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Mission
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | ------ | ---- | ---- | ------- |
| deviceId | string | 是 | 是 | 表示设备ID。|
| deviceId | string | 是 | 是 | 表示设备ID。 |
\ No newline at end of file
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
浏览文件 @
0d1e9382
...
@@ -18,16 +18,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callba
...
@@ -18,16 +18,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callba
以异步方法根据给定的包名和类名激活设备管理员应用,使用Callback形式返回是否激活成功。
以异步方法根据给定的包名和类名激活设备管理员应用,使用Callback形式返回是否激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | --- | ------------------ |
| -------------- | ----------------------------------- | ---
-
| ------------------ |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
...
@@ -59,18 +57,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId
...
@@ -59,18 +57,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId
以异步方法根据给定的包名和类名激活设备管理员应用,使用Callback形式返回是否激活成功。
以异步方法根据给定的包名和类名激活设备管理员应用,使用Callback形式返回是否激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | --- | ---------------------------- |
| -------------- | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
...
@@ -103,16 +97,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId
...
@@ -103,16 +97,14 @@ enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId
以异步方法根据给定的包名和类名激活设备管理员应用,使用Promise形式返回是否激活成功。
以异步方法根据给定的包名和类名激活设备管理员应用,使用Promise形式返回是否激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | --- | ---------------------------- |
| -------------- | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
...
@@ -149,16 +141,14 @@ disableAdmin(admin: Want, callback: AsyncCallback\<boolean>): void
...
@@ -149,16 +141,14 @@ disableAdmin(admin: Want, callback: AsyncCallback\<boolean>): void
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Callback形式返回是否去激活成功。
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Callback形式返回是否去激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------- | --- | ------------------- |
| -------- | ----------------------------------- | ---
-
| ------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
...
@@ -184,18 +174,14 @@ disableAdmin(admin: Want, userId: number, callback: AsyncCallback\<boolean>): vo
...
@@ -184,18 +174,14 @@ disableAdmin(admin: Want, userId: number, callback: AsyncCallback\<boolean>): vo
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Callback形式返回是否去激活成功。
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Callback形式返回是否去激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------- | --- | ---------------------------- |
| -------- | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
...
@@ -222,16 +208,14 @@ disableAdmin(admin: Want, userId?: number): Promise\<boolean>
...
@@ -222,16 +208,14 @@ disableAdmin(admin: Want, userId?: number): Promise\<boolean>
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Promise形式返回是否去激活成功。
以异步方法根据给定的包名和类名将设备普通管理员应用去激活,使用Promise形式返回是否去激活成功。
**需要权限:**
**需要权限:**
ohos.permission.MANAGE_ADMIN
ohos.permission.MANAGE_ADMIN
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ----------------------------------- | --- | ---------------------------- |
| ------ | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
...
@@ -261,13 +245,12 @@ disableSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void
...
@@ -261,13 +245,12 @@ disableSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void
以异步方法根据给定的包名将设备超级管理员应用去激活,使用Callback形式返回是否去激活成功。
以异步方法根据给定的包名将设备超级管理员应用去激活,使用Callback形式返回是否去激活成功。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------- | --- | ------------------- |
| ---------- | ----------------------- | ---
-
| ------------------- |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
...
@@ -290,13 +273,12 @@ disableSuperAdmin(bundleName: String): Promise\<boolean>
...
@@ -290,13 +273,12 @@ disableSuperAdmin(bundleName: String): Promise\<boolean>
以异步方法根据给定的包名将设备超级管理员应用去激活,使用Promise形式返回是否去激活成功。
以异步方法根据给定的包名将设备超级管理员应用去激活,使用Promise形式返回是否去激活成功。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | --- | ------------ |
| ---------- | ------ | ---
-
| ------------ |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
**返回值:**
**返回值:**
...
@@ -322,13 +304,12 @@ isAdminEnabled(admin: Want, callback: AsyncCallback\<boolean>): void
...
@@ -322,13 +304,12 @@ isAdminEnabled(admin: Want, callback: AsyncCallback\<boolean>): void
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------- | --- | -------------------- |
| -------- | ----------------------------------- | ---
-
| -------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
...
@@ -354,14 +335,12 @@ isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\<boolean>):
...
@@ -354,14 +335,12 @@ isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\<boolean>):
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------- | --- | ---------------------------- |
| -------- | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
...
@@ -388,13 +367,12 @@ isAdminEnabled(admin: Want, userId?: number): Promise\<boolean>
...
@@ -388,13 +367,12 @@ isAdminEnabled(admin: Want, userId?: number): Promise\<boolean>
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Promise形式返回是否处于激活状态。
以异步方法根据给定的包名和类名判断设备管理员应用是否被激活,使用Promise形式返回是否处于激活状态。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ----------------------------------- | --- | ---------------------------- |
| ------ | ----------------------------------- | ---
-
| ---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
...
@@ -424,13 +402,12 @@ isSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void
...
@@ -424,13 +402,12 @@ isSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void
以异步方法根据给定的包名判断设备超级管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
以异步方法根据给定的包名判断设备超级管理员应用是否被激活,使用Callback形式返回是否处于激活状态。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------- | --- | -------------------- |
| ---------- | ----------------------- | ---
-
| -------------------- |
| bundleName | String | 是 | 设备管理员应用 |
| bundleName | String | 是 | 设备管理员应用 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
...
@@ -453,13 +430,12 @@ isSuperAdmin(bundleName: String): Promise\<boolean>
...
@@ -453,13 +430,12 @@ isSuperAdmin(bundleName: String): Promise\<boolean>
以异步方法根据给定的包名判断设备超级管理员应用是否被激活,使用Promise形式返回是否处于激活状态。
以异步方法根据给定的包名判断设备超级管理员应用是否被激活,使用Promise形式返回是否处于激活状态。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | --- | --------- |
| ---------- | ------ | ---
-
| --------- |
| bundleName | String | 是 | 超级设备管理员应用 |
| bundleName | String | 是 | 超级设备管理员应用 |
**返回值:**
**返回值:**
...
@@ -485,13 +461,12 @@ getDeviceSettingsManager(callback: AsyncCallback<DeviceSettingsManager>):
...
@@ -485,13 +461,12 @@ getDeviceSettingsManager(callback: AsyncCallback<DeviceSettingsManager>):
获取DeviceSettingsManager对象,使用callback形式返回DeviceSettingsManager对象。
获取DeviceSettingsManager对象,使用callback形式返回DeviceSettingsManager对象。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------- | --- | ----------------------------------- |
| -------- | --------------------------------------- | ---
-
| ----------------------------------- |
| callback | AsyncCallback<DeviceSettingsManager
>
| 是 | callback方式返回DeviceSettingsManager对象 |
| callback | AsyncCallback<DeviceSettingsManager
>
| 是 | callback方式返回DeviceSettingsManager对象 |
**示例:**
**示例:**
...
@@ -522,8 +497,7 @@ getDeviceSettingsManager(): Promise<DeviceSettingsManager>
...
@@ -522,8 +497,7 @@ getDeviceSettingsManager(): Promise<DeviceSettingsManager>
获取DeviceSettingsManager对象,使用Promise形式返回DeviceSettingsManager对象。
获取DeviceSettingsManager对象,使用Promise形式返回DeviceSettingsManager对象。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**返回值:**
**返回值:**
...
@@ -555,13 +529,12 @@ setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCa
...
@@ -555,13 +529,12 @@ setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCa
设置设备管理员应用的企业信息,使用callback形式返回是否设置成功。
设置设备管理员应用的企业信息,使用callback形式返回是否设置成功。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | --- | ---------------------- |
| -------------- | ----------------------------------- | ---
-
| ---------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| callback | AsyncCallback
\<
boolean
>
| 是 | callback方式返回是否设置企业信息成功 |
| callback | AsyncCallback
\<
boolean
>
| 是 | callback方式返回是否设置企业信息成功 |
...
@@ -591,13 +564,12 @@ setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<boole
...
@@ -591,13 +564,12 @@ setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<boole
设置设备管理员应用的企业信息,使用Promise形式返回是否设置成功。
设置设备管理员应用的企业信息,使用Promise形式返回是否设置成功。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | --- | ------------ |
| -------------- | ----------------------------------- | ---
-
| ------------ |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
...
@@ -632,13 +604,12 @@ getEnterpriseInfo(admin: Want, callback: AsyncCallback<EnterpriseInfo>): v
...
@@ -632,13 +604,12 @@ getEnterpriseInfo(admin: Want, callback: AsyncCallback<EnterpriseInfo>): v
获取设备管理员应用的企业信息,使用callback形式返回设备管理员应用的企业信息。
获取设备管理员应用的企业信息,使用callback形式返回设备管理员应用的企业信息。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------
-------------- |
--- | ------------------------ |
| -------- | ----------------------------------------
| -
--- | ------------------------ |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| callback | AsyncCallback
<
[EnterpriseInfo](#EnterpriseInfo)
>
| 是 | callback方式返回设备管理员应用的企业信息 |
| callback | AsyncCallback
<
[EnterpriseInfo](#EnterpriseInfo)
>
| 是 | callback方式返回设备管理员应用的企业信息 |
...
@@ -665,19 +636,18 @@ getEnterpriseInfo(admin: Want): Promise<EnterpriseInfo>
...
@@ -665,19 +636,18 @@ getEnterpriseInfo(admin: Want): Promise<EnterpriseInfo>
获取设备管理员应用的企业信息,使用Promise形式返回设备管理员应用的企业信息。
获取设备管理员应用的企业信息,使用Promise形式返回设备管理员应用的企业信息。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
SystemCapability.Customization.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ----------------------------------- | --- | ------- |
| ----- | ----------------------------------- | ---
-
| ------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| ----------------------------------------
--------
| ------------------------- |
| ---------------------------------------- | ------------------------- |
| Promise
<
[EnterpriseInfo](#EnterpriseInfo)
>
| Promise方式返回设备管理员应用的企业信息对象 |
| Promise
<
[EnterpriseInfo](#EnterpriseInfo)
>
| Promise方式返回设备管理员应用的企业信息对象 |
**示例:**
**示例:**
...
@@ -699,11 +669,10 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
...
@@ -699,11 +669,10 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
设备管理员应用的企业信息
设备管理员应用的企业信息
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
以下各项对应系统能力均为SystemCapability.Customization.EnterpriseDeviceManager
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ----------- | ---- | ------ | --- | ----------------- |
| ----------- | ---- | ------ | ---
-
| ----------------- |
| name | 只读 | string | 是 | 表示设备管理员应用所属企业的名称。 |
| name | 只读 | string | 是 | 表示设备管理员应用所属企业的名称。 |
| description | 只读 | string | 是 | 表示设备管理员应用所属企业的描述。 |
| description | 只读 | string | 是 | 表示设备管理员应用所属企业的描述。 |
...
@@ -711,8 +680,7 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
...
@@ -711,8 +680,7 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
设备管理员应用的管理员类型。
设备管理员应用的管理员类型。
**系统能力:**
**系统能力:**
SystemCapability.Customization.EnterpriseDeviceManager
以下各项对应系统能力均为SystemCapability.Customization.EnterpriseDeviceManager
| 名称 | 默认值 | 说明 |
| 名称 | 默认值 | 说明 |
| ----------------- | ---- | ----- |
| ----------------- | ---- | ----- |
...
...
zh-cn/application-dev/reference/apis/js-apis-i18n.md
浏览文件 @
0d1e9382
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md
浏览文件 @
0d1e9382
...
@@ -6,13 +6,13 @@ InputConsumer模块提供对按键事件的监听。
...
@@ -6,13 +6,13 @@ InputConsumer模块提供对按键事件的监听。
>
>
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
>
> - 本模块接口
均为系统接口,三方应用不支持调用
。
> - 本模块接口
为系统接口
。
## 导入模块
## 导入模块
```
```
js
import
inputConsumer
from
'
@ohos.multimodalInput.inputConsumer
'
;
import
inputConsumer
from
'
@ohos.multimodalInput.inputConsumer
'
;
```
```
...
@@ -23,21 +23,19 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v
...
@@ -23,21 +23,19 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v
开始监听组合按键事件, 当满足条件的组合按键输入事件发生时,将keyOptions回调到入参callback表示的回调函数上。
开始监听组合按键事件, 当满足条件的组合按键输入事件发生时,将keyOptions回调到入参callback表示的回调函数上。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| --------
| -------- | -------- |
-------- |
| --------
-- | -------------------------- | ---- | --------------------------------
-------- |
| type | string | 是 | 监听输入事件类型,只支持“key”。 |
| type | string | 是 | 监听输入事件类型,只支持“key”。 |
| keyOptions |
[
keyOptions
](
#keyoptions
)
| 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 |
| keyOptions |
[
keyOptions
](
#keyoptions
)
| 是 | 组合键选项,用来指定组合键输入时应该符合的条件。 |
| callback | Callback
<
KeyOptions
>
| 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 |
| callback | Callback
<
KeyOptions
>
| 是 | 回调函数。当满足条件的按键输入产生时,回调到此函数,以传入的KeyOptions为入参。 |
**示例:**
**示例:**
```
```
js
let
keyOptions
=
{
preKeys
:
[],
finalKey
:
3
,
isFinalKeyDown
:
true
,
finalKeyDownDuration
:
0
}
let
keyOptions
=
{
preKeys
:
[],
finalKey
:
3
,
isFinalKeyDown
:
true
,
finalKeyDownDuration
:
0
}
let
callback
=
function
(
keyOptions
)
{
let
callback
=
function
(
keyOptions
)
{
console
.
info
(
"
preKeys:
"
+
keyOptions
.
preKeys
,
"
finalKey:
"
+
keyOptions
.
finalKey
,
console
.
info
(
"
preKeys:
"
+
keyOptions
.
preKeys
,
"
finalKey:
"
+
keyOptions
.
finalKey
,
...
@@ -53,21 +51,19 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>):
...
@@ -53,21 +51,19 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>):
停止监听组合按键事件。
停止监听组合按键事件。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| --------
| -------- | -------- |
-------- |
| --------
-- | -------------------------- | ---- | -----------------------
-------- |
| type | string | 是 | 监听输入事件类型,只支持“key”。 |
| type | string | 是 | 监听输入事件类型,只支持“key”。 |
| keyOptions |
[
keyOptions
](
#keyoptions
)
| 是 | 开始监听时传入的keyOptions。 |
| keyOptions |
[
keyOptions
](
#keyoptions
)
| 是 | 开始监听时传入的keyOptions。 |
| callback | Callback
<
KeyOptions
>
| 是 | 开始监听时与KeyOption一同传入的回调函数
。 |
| callback | Callback
<
KeyOptions
>
| 是 | 开始监听时与KeyOption一同传入的回调函数
。 |
**示例:**
**示例:**
```
```
js
let
keyOptions
=
{
preKeys
:
[],
finalKey
:
3
,
isFinalKeyDown
:
true
,
finalKeyDownDuration
:
0
}
let
keyOptions
=
{
preKeys
:
[],
finalKey
:
3
,
isFinalKeyDown
:
true
,
finalKeyDownDuration
:
0
}
let
callback
=
function
(
keyOptions
)
{
let
callback
=
function
(
keyOptions
)
{
console
.
info
(
"
preKeys:
"
+
keyOptions
.
preKeys
,
"
finalKey:
"
+
keyOptions
.
finalKey
,
console
.
info
(
"
preKeys:
"
+
keyOptions
.
preKeys
,
"
finalKey:
"
+
keyOptions
.
finalKey
,
...
@@ -81,12 +77,10 @@ inputConsumer.off('key', keyOptions, callback);
...
@@ -81,12 +77,10 @@ inputConsumer.off('key', keyOptions, callback);
组合键输入事件发生时,组合键满足的选项。
组合键输入事件发生时,组合键满足的选项。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
**系统能力:**
SystemCapability.MultimodalInput.Input.InputConsumer
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| --------
| -------- | -------- |
-------- |
| --------
------------ | ------- | ---- | ----------------
-------- |
| preKeys | Array | 是 | 组合键前置按键集合,可为空,前置按键无顺序要求。 |
| preKeys | Array | 是 | 组合键前置按键集合,可为空,前置按键无顺序要求。 |
| finalKey | Number | 是 | 组合键最后按键,不能为空。 |
| finalKey | Number | 是 | 组合键最后按键,不能为空。 |
| isFinalKeyDown | boolean | 是 | 组合键最后按键是按下还是抬起,默认是按下。 |
| isFinalKeyDown | boolean | 是 | 组合键最后按键是按下还是抬起,默认是按下。 |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
浏览文件 @
0d1e9382
...
@@ -284,7 +284,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -284,7 +284,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
输入设备的描述信息。
输入设备的描述信息。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| -------- | --------------------------- | --------------------------------- |
| -------- | --------------------------- | --------------------------------- |
...
@@ -295,7 +295,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -295,7 +295,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
输入设备的描述信息。
输入设备的描述信息。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| -------------------- | -------------------------------------- | ---------------------------------------- |
| -------------------- | -------------------------------------- | ---------------------------------------- |
...
@@ -314,7 +314,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -314,7 +314,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
输入设备的轴类型。
输入设备的轴类型。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| ----------- | ------ | --------------- |
| ----------- | ------ | --------------- |
...
@@ -332,7 +332,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -332,7 +332,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
输入设备的轴信息。
输入设备的轴信息。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
: SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| ----------------------- | ------------------------- | -------- |
| ----------------------- | ------------------------- | -------- |
...
@@ -348,7 +348,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -348,7 +348,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
定义这个轴的输入源类型。比如鼠标设备可上报x轴事件,则x轴的源就是鼠标。
定义这个轴的输入源类型。比如鼠标设备可上报x轴事件,则x轴的源就是鼠标。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| ----------- | ------ | ----------- |
| ----------- | ------ | ----------- |
...
@@ -363,7 +363,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -363,7 +363,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
定义监听设备热插拔事件。
定义监听设备热插拔事件。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 说明 |
| 名称 | 参数类型 | 说明 |
| ------ | ------ | --------- |
| ------ | ------ | --------- |
...
@@ -374,7 +374,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
...
@@ -374,7 +374,7 @@ inputDevice.getKeyboardType(1).then((ret)=>{
定义键盘输入设备的类型。
定义键盘输入设备的类型。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputDevice
**系统能力**
:SystemCapability.MultimodalInput.Input.InputDevice
| 名称 | 参数类型 | 值 | 说明 |
| 名称 | 参数类型 | 值 | 说明 |
| ------------------- | ------ | ---- | --------- |
| ------------------- | ------ | ---- | --------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputevent.md
浏览文件 @
0d1e9382
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
InputEvent模块描述了设备上报的基本事件。
InputEvent模块描述了设备上报的基本事件。
>

**说明:**
> **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
...
@@ -13,10 +13,10 @@ import InputEvent from '@ohos.multimodalInput.inputEvent';
...
@@ -13,10 +13,10 @@ import InputEvent from '@ohos.multimodalInput.inputEvent';
## InputEvent
## InputEvent
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
-- | ------ | ---- | ---- | ------
-------- |
| id | number | 是 | 否 | 由服务端生成全局唯一事件id |
| id | number | 是 | 否 | 由服务端生成全局唯一事件id |
| deviceId | number | 是 | 否 | 上报输入事件的设备id |
| deviceId | number | 是 | 否 | 上报输入事件的设备id |
| actionTime | number | 是 | 否 | 输入事件的上报时间 |
| actionTime | number | 是 | 否 | 输入事件的上报时间 |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md
浏览文件 @
0d1e9382
...
@@ -6,7 +6,7 @@ InputEventClient模块提供了注入按键能力。
...
@@ -6,7 +6,7 @@ InputEventClient模块提供了注入按键能力。
>
>
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
>
> - 本模块接口
均为系统接口,三方应用不支持调用
。
> - 本模块接口
为系统接口
。
## 导入模块
## 导入模块
...
@@ -23,8 +23,6 @@ injectEvent({KeyEvent: KeyEvent}): void
...
@@ -23,8 +23,6 @@ injectEvent({KeyEvent: KeyEvent}): void
注入按键,KeyEvent为注入按键的描述信息。
注入按键,KeyEvent为注入按键的描述信息。
此接口为系统接口。
**系统能力:**
SystemCapability.MultimodalInput.Input.InputSimulator
**系统能力:**
SystemCapability.MultimodalInput.Input.InputSimulator
**参数:**
**参数:**
...
@@ -48,11 +46,9 @@ let res = inputEventClient.injectEvent({KeyEvent: keyEvent});
...
@@ -48,11 +46,9 @@ let res = inputEventClient.injectEvent({KeyEvent: keyEvent});
## KeyEvent
## KeyEvent
注入按键的描述信息
注入按键的描述信息。
此接口为系统接口。
**系统能力:**
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.InputSimulator
**系统能力:**
SystemCapability.MultimodalInput.Input.InputSimulator
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| --------------- | ------- | ---- | --------- |
| --------------- | ------- | ---- | --------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md
浏览文件 @
0d1e9382
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
InputMonitor模块提供了监听全局触摸事件的功能。
InputMonitor模块提供了监听全局触摸事件的功能。
>

**说明:**
> **说明:**
> - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
>
> - 本模块接口均为系统接口
,三方应用不支持调用
。
> - 本模块接口均为系统接口。
## 导入模块
## 导入模块
...
@@ -16,26 +16,19 @@ import inputMonitor from '@ohos.multimodalInput.inputMonitor';
...
@@ -16,26 +16,19 @@ import inputMonitor from '@ohos.multimodalInput.inputMonitor';
```
```
## 权限
ohos.permission.INPUT_MONITORING
## inputMonitor.on
## inputMonitor.on
on(type: "touch", receiver: TouchEventReceiver): void
on(type: "touch", receiver: TouchEventReceiver): void
开始监听全局触屏事件。
开始监听全局触屏事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------
- | ---- | ------------
------------------- |
| -------- | ----------------------------------------
| ---- |
------------------- |
| type | string | 是 | 监听输入事件类型,取值“touch”。 |
| type | string | 是 | 监听输入事件类型,取值“touch”。 |
| receiver |
[
TouchEventReceiver
](
#toucheventreceiver
)
| 是 | 触摸输入事件回调函数。 |
| receiver |
[
TouchEventReceiver
](
#toucheventreceiver
)
| 是 | 触摸输入事件回调函数。 |
...
@@ -53,8 +46,6 @@ on(type: "mouse", receiver: Callback<MouseEvent>): void
...
@@ -53,8 +46,6 @@ on(type: "mouse", receiver: Callback<MouseEvent>): void
开始监听全局鼠标事件。
开始监听全局鼠标事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
...
@@ -62,7 +53,7 @@ on(type: "mouse", receiver: Callback<MouseEvent>): void
...
@@ -62,7 +53,7 @@ on(type: "mouse", receiver: Callback<MouseEvent>): void
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------------- | ---- | -------------------
------------
|
| -------- | -------------------------- | ---- | ------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback
<
MouseEvent
>
| 是 | 鼠标输入事件回调函数。 |
| receiver | Callback
<
MouseEvent
>
| 是 | 鼠标输入事件回调函数。 |
...
@@ -82,15 +73,13 @@ off(type: "touch", receiver?: TouchEventReceiver): void
...
@@ -82,15 +73,13 @@ off(type: "touch", receiver?: TouchEventReceiver): void
停止监听全局触屏事件。
停止监听全局触屏事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------
- | ---- | ------------
------------------- |
| -------- | ----------------------------------------
| ---- |
------------------- |
| type | string | 是 | 监听输入事件类型,取值“touch”。 |
| type | string | 是 | 监听输入事件类型,取值“touch”。 |
| receiver |
[
TouchEventReceiver
](
#toucheventreceiver
)
| 否 | 触摸输入事件回调函数。 |
| receiver |
[
TouchEventReceiver
](
#toucheventreceiver
)
| 否 | 触摸输入事件回调函数。 |
...
@@ -104,8 +93,6 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
...
@@ -104,8 +93,6 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
停止监听全局鼠标事件。
停止监听全局鼠标事件。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
...
@@ -113,7 +100,7 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
...
@@ -113,7 +100,7 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
**参数:**
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------------- | ---- | -------------------
------------
|
| -------- | -------------------------- | ---- | ------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback
<
MouseEvent
>
| 否 | 鼠标输入事件回调函数。 |
| receiver | Callback
<
MouseEvent
>
| 否 | 鼠标输入事件回调函数。 |
...
@@ -129,7 +116,7 @@ inputMonitor.off("mouse");
...
@@ -129,7 +116,7 @@ inputMonitor.off("mouse");
触摸输入事件的回调函数。如果返回true,则触摸输入被监听器消耗,系统将执行关闭动作。
触摸输入事件的回调函数。如果返回true,则触摸输入被监听器消耗,系统将执行关闭动作。
此接口为系统接口。
**需要权限:**
ohos.permission.INPUT_MONITORING
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
**系统能力:**
SystemCapability.MultimodalInput.Input.InputMonitor
...
@@ -140,7 +127,7 @@ inputMonitor.off("mouse");
...
@@ -140,7 +127,7 @@ inputMonitor.off("mouse");
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| ------- | -------------------------------------- |
| ------- | --------------------------------------
--
|
| Boolean | 返回true表示触摸输入事件被监听器消费,false表示触摸输入事件未被监听器消费。 |
| Boolean | 返回true表示触摸输入事件被监听器消费,false表示触摸输入事件未被监听器消费。 |
**示例:**
**示例:**
...
...
zh-cn/application-dev/reference/apis/js-apis-intl.md
浏览文件 @
0d1e9382
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。
本模块提供提供基础的应用国际化能力,包括时间日期格式化、数字格式化、排序等,相关接口在ECMA 402标准中定义。
[
I18N模块
](
js-apis-i18n.md
)
提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。
[
I18N模块
](
js-apis-i18n.md
)
提供其他非ECMA 402定义的国际化接口,与本模块共同使用可提供完整地国际化支持能力。
>

**说明:**
> **说明:**
> - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
>
> - Intl模块包含国际化能力基础接口(在ECMA 402中定义),包括时间日期格式化、数字格式化、排序等,国际化增强能力请参考[I18N模块](js-apis-i18n.md)。
> - Intl模块包含国际化能力基础接口(在ECMA 402中定义),包括时间日期格式化、数字格式化、排序等,国际化增强能力请参考[I18N模块](js-apis-i18n.md)。
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
## 导入模块
## 导入模块
```
```
js
import
Intl
from
'
@ohos.intl
'
;
import
Intl
from
'
@ohos.intl
'
;
```
```
...
@@ -46,7 +46,7 @@ constructor()
...
@@ -46,7 +46,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
locale
=
new
Intl
.
Locale
();
var
locale
=
new
Intl
.
Locale
();
```
```
...
@@ -66,7 +66,7 @@ constructor(locale: string, options?: LocaleOptions)
...
@@ -66,7 +66,7 @@ constructor(locale: string, options?: LocaleOptions)
| options | LocaleOptions | 否 | 用于创建区域对象的选项。 |
| options | LocaleOptions | 否 | 用于创建区域对象的选项。 |
**示例:**
**示例:**
```
```
js
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
```
```
...
@@ -85,7 +85,7 @@ toString(): string
...
@@ -85,7 +85,7 @@ toString(): string
| string | 字符串形式的区域信息。 |
| string | 字符串形式的区域信息。 |
**示例:**
**示例:**
```
```
js
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
locale
.
toString
();
locale
.
toString
();
```
```
...
@@ -105,7 +105,7 @@ maximize(): Locale
...
@@ -105,7 +105,7 @@ maximize(): Locale
|
[
Locale
](
#locale
)
| 最大化后的区域对象。 |
|
[
Locale
](
#locale
)
| 最大化后的区域对象。 |
**示例:**
**示例:**
```
```
js
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
locale
.
maximize
();
locale
.
maximize
();
```
```
...
@@ -125,7 +125,7 @@ minimize(): Locale
...
@@ -125,7 +125,7 @@ minimize(): Locale
|
[
Locale
](
#locale
)
| 最小化后的区域对象。 |
|
[
Locale
](
#locale
)
| 最小化后的区域对象。 |
**示例:**
**示例:**
```
```
js
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
var
locale
=
new
Intl
.
Locale
(
"
zh-CN
"
);
locale
.
minimize
();
locale
.
minimize
();
```
```
...
@@ -135,7 +135,7 @@ minimize(): Locale
...
@@ -135,7 +135,7 @@ minimize(): Locale
表示区域初始化选项。
表示区域初始化选项。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| --------------- | ------- | ---- | ---- | ---------------------------------------- |
| --------------- | ------- | ---- | ---- | ---------------------------------------- |
...
@@ -159,7 +159,7 @@ constructor()
...
@@ -159,7 +159,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
datefmt
=
new
Intl
.
DateTimeFormat
();
var
datefmt
=
new
Intl
.
DateTimeFormat
();
```
```
...
@@ -179,13 +179,13 @@ constructor(locale: string | Array<string>, options?: DateTimeOptions)
...
@@ -179,13 +179,13 @@ constructor(locale: string | Array<string>, options?: DateTimeOptions)
| options |
[
DateTimeOptions
](
#datetimeoptions
)
| 否 | 用于创建时间日期格式化的选项。 |
| options |
[
DateTimeOptions
](
#datetimeoptions
)
| 否 | 用于创建时间日期格式化的选项。 |
**示例:**
**示例:**
```
```
js
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
zh-CN
"
,
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
});
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
zh-CN
"
,
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
});
```
```
**示例:**
**示例:**
```
```
js
var
datefmt
=
new
Intl
.
DateTimeFormat
([
"
ban
"
,
"
zh
"
],
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
});
var
datefmt
=
new
Intl
.
DateTimeFormat
([
"
ban
"
,
"
zh
"
],
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
});
```
```
...
@@ -209,7 +209,7 @@ format(date: Date): string
...
@@ -209,7 +209,7 @@ format(date: Date): string
| string | 格式化后的时间日期字符串 |
| string | 格式化后的时间日期字符串 |
**示例:**
**示例:**
```
```
js
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
datefmt
.
format
(
date
);
datefmt
.
format
(
date
);
...
@@ -236,7 +236,7 @@ formatRange(startDate: Date, endDate: Date): string
...
@@ -236,7 +236,7 @@ formatRange(startDate: Date, endDate: Date): string
| string | 格式化后的时间日期段字符串。 |
| string | 格式化后的时间日期段字符串。 |
**示例:**
**示例:**
```
```
js
var
startDate
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
startDate
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
endDate
=
new
Date
(
2021
,
11
,
18
,
3
,
24
,
0
);
var
endDate
=
new
Date
(
2021
,
11
,
18
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
...
@@ -258,7 +258,7 @@ resolvedOptions(): DateTimeOptions
...
@@ -258,7 +258,7 @@ resolvedOptions(): DateTimeOptions
|
[
DateTimeOptions
](
#datetimeoptions
)
| DateTimeFormat
对象的格式化选项。 |
|
[
DateTimeOptions
](
#datetimeoptions
)
| DateTimeFormat
对象的格式化选项。 |
**示例:**
**示例:**
```
```
js
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
datefmt
.
resolvedOptions
();
datefmt
.
resolvedOptions
();
```
```
...
@@ -268,7 +268,7 @@ resolvedOptions(): DateTimeOptions
...
@@ -268,7 +268,7 @@ resolvedOptions(): DateTimeOptions
表示时间日期格式化选项。
表示时间日期格式化选项。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| --------------- | ------- | ---- | ---- | ---------------------------------------- |
| --------------- | ------- | ---- | ---- | ---------------------------------------- |
...
@@ -305,7 +305,7 @@ constructor()
...
@@ -305,7 +305,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
numfmt
=
new
Intl
.
NumberFormat
();
var
numfmt
=
new
Intl
.
NumberFormat
();
```
```
...
@@ -325,7 +325,7 @@ constructor(locale: string | Array<string>, options?: NumberOptions)
...
@@ -325,7 +325,7 @@ constructor(locale: string | Array<string>, options?: NumberOptions)
| options |
[
NumberOptions
](
#numberoptions
)
| 否 | 用于创建数字格式化的选项。 |
| options |
[
NumberOptions
](
#numberoptions
)
| 否 | 用于创建数字格式化的选项。 |
**示例:**
**示例:**
```
```
js
var
numfmt
=
new
Intl
.
NumberFormat
(
"
en-GB
"
,
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
var
numfmt
=
new
Intl
.
NumberFormat
(
"
en-GB
"
,
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
```
```
...
@@ -350,7 +350,7 @@ format(number: number): string;
...
@@ -350,7 +350,7 @@ format(number: number): string;
**示例:**
**示例:**
```
```
js
var
numfmt
=
new
Intl
.
NumberFormat
([
"
en-GB
"
,
"
zh
"
],
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
var
numfmt
=
new
Intl
.
NumberFormat
([
"
en-GB
"
,
"
zh
"
],
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
numfmt
.
format
(
1223
);
numfmt
.
format
(
1223
);
```
```
...
@@ -371,7 +371,7 @@ resolvedOptions(): NumberOptions
...
@@ -371,7 +371,7 @@ resolvedOptions(): NumberOptions
**示例:**
**示例:**
```
```
js
var
numfmt
=
new
Intl
.
NumberFormat
([
"
en-GB
"
,
"
zh
"
],
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
var
numfmt
=
new
Intl
.
NumberFormat
([
"
en-GB
"
,
"
zh
"
],
{
style
:
'
decimal
'
,
notation
:
"
scientific
"
});
numfmt
.
resolvedOptions
();
numfmt
.
resolvedOptions
();
```
```
...
@@ -418,7 +418,7 @@ constructor()
...
@@ -418,7 +418,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
collator
=
new
Intl
.
Collator
();
var
collator
=
new
Intl
.
Collator
();
```
```
...
@@ -439,7 +439,7 @@ constructor(locale: string | Array<string>, options?: CollatorOptions)
...
@@ -439,7 +439,7 @@ constructor(locale: string | Array<string>, options?: CollatorOptions)
| options |
[
CollatorOptions
](
#collatoroptions
)
| 否 | 用于创建排序对象的选项。 |
| options |
[
CollatorOptions
](
#collatoroptions
)
| 否 | 用于创建排序对象的选项。 |
**示例:**
**示例:**
```
```
js
var
collator
=
new
Intl
.
Collator
(
"
zh-CN
"
,
{
localeMatcher
:
"
lookup
"
,
usage
:
"
sort
"
});
var
collator
=
new
Intl
.
Collator
(
"
zh-CN
"
,
{
localeMatcher
:
"
lookup
"
,
usage
:
"
sort
"
});
```
```
...
@@ -464,7 +464,7 @@ compare(first: string, second: string): number
...
@@ -464,7 +464,7 @@ compare(first: string, second: string): number
| number | 比较结果。当number为负数,表示first排序在second之前;当number为0,表示first与second排序相同;当number为正数,表示first排序在second之后。 |
| number | 比较结果。当number为负数,表示first排序在second之前;当number为0,表示first与second排序相同;当number为正数,表示first排序在second之后。 |
**示例:**
**示例:**
```
```
js
var
collator
=
new
Intl
.
Collator
(
"
zh-Hans
"
);
var
collator
=
new
Intl
.
Collator
(
"
zh-Hans
"
);
collator
.
compare
(
"
first
"
,
"
second
"
);
collator
.
compare
(
"
first
"
,
"
second
"
);
```
```
...
@@ -484,17 +484,17 @@ resolvedOptions(): CollatorOptions
...
@@ -484,17 +484,17 @@ resolvedOptions(): CollatorOptions
|
[
CollatorOptions
](
#collatoroptions
)
| 返回的Collator对象的属性。 |
|
[
CollatorOptions
](
#collatoroptions
)
| 返回的Collator对象的属性。 |
**示例:**
**示例:**
```
```
js
var
collator
=
new
Intl
.
Collator
(
"
zh-Hans
"
);
var
collator
=
new
Intl
.
Collator
(
"
zh-Hans
"
);
var
options
=
collator
.
resolvedOptions
();
var
options
=
collator
.
resolvedOptions
();
```
```
## CollatorOptions<sup>8+</sup>
<a name=collatoroptions></a>
## CollatorOptions<sup>8+</sup>
表示Collator可设置的属性。
表示Collator可设置的属性。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ----------------- | ------- | ---- | ---- | ---------------------------------------- |
| ----------------- | ------- | ---- | ---- | ---------------------------------------- |
...
@@ -519,7 +519,7 @@ constructor()
...
@@ -519,7 +519,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
pluralRules
=
new
Intl
.
PluralRules
();
var
pluralRules
=
new
Intl
.
PluralRules
();
```
```
...
@@ -539,7 +539,7 @@ constructor(locale: string | Array<string>, options?: PluralRulesOptions)
...
@@ -539,7 +539,7 @@ constructor(locale: string | Array<string>, options?: PluralRulesOptions)
| options |
[
PluralRulesOptions
](
#pluralrulesoptions
)
| 否 | 用于创建单复数对象的选项。 |
| options |
[
PluralRulesOptions
](
#pluralrulesoptions
)
| 否 | 用于创建单复数对象的选项。 |
**示例:**
**示例:**
```
```
js
var
pluralRules
=
new
Intl
.
PluraRules
(
"
zh-CN
"
,
{
"
localeMatcher
"
:
"
lookup
"
,
"
type
"
:
"
cardinal
"
});
var
pluralRules
=
new
Intl
.
PluraRules
(
"
zh-CN
"
,
{
"
localeMatcher
"
:
"
lookup
"
,
"
type
"
:
"
cardinal
"
});
```
```
...
@@ -563,17 +563,17 @@ select(n: number): string
...
@@ -563,17 +563,17 @@ select(n: number): string
| string | 单复数类别,取值包括:"zero","one","two",
"few",
"many",
"others"。 |
| string | 单复数类别,取值包括:"zero","one","two",
"few",
"many",
"others"。 |
**示例:**
**示例:**
```
```
js
var
pluralRules
=
new
Intl
.
PluralRules
(
"
zh-Hans
"
);
var
pluralRules
=
new
Intl
.
PluralRules
(
"
zh-Hans
"
);
pluralRules
.
select
(
1
);
pluralRules
.
select
(
1
);
```
```
## PluralRulesOptions<sup>8+</sup>
<a name=pluralrulesoptions></a>
## PluralRulesOptions<sup>8+</sup>
表示PluralRules对象可设置的属性。
表示PluralRules对象可设置的属性。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ------------------------ | ------ | ---- | ---- | ---------------------------------------- |
| ------------------------ | ------ | ---- | ---- | ---------------------------------------- |
...
@@ -598,7 +598,7 @@ constructor()
...
@@ -598,7 +598,7 @@ constructor()
**系统能力**
:SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
**示例:**
**示例:**
```
```
js
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
();
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
();
```
```
...
@@ -618,7 +618,7 @@ constructor(locale: string | Array<string>, options?: RelativeTimeFormatIn
...
@@ -618,7 +618,7 @@ constructor(locale: string | Array<string>, options?: RelativeTimeFormatIn
| options |
[
RelativeTimeFormatInputOptions
](
#relativetimeformatinputoptions
)
| 否 | 用于创建相对时间格式化对象的选项。 |
| options |
[
RelativeTimeFormatInputOptions
](
#relativetimeformatinputoptions
)
| 否 | 用于创建相对时间格式化对象的选项。 |
**示例:**
**示例:**
```
```
js
var
relativeTimeFormat
=
new
Intl
.
RelativeTimeFormat
(
"
zh-CN
"
,
{
"
localeMatcher
"
:
"
lookup
"
,
"
numeric
"
:
"
always
"
,
"
style
"
:
"
long
"
});
var
relativeTimeFormat
=
new
Intl
.
RelativeTimeFormat
(
"
zh-CN
"
,
{
"
localeMatcher
"
:
"
lookup
"
,
"
numeric
"
:
"
always
"
,
"
style
"
:
"
long
"
});
```
```
...
@@ -643,7 +643,7 @@ format(value: number, unit: string): string
...
@@ -643,7 +643,7 @@ format(value: number, unit: string): string
| string | 格式化后的相对时间。 |
| string | 格式化后的相对时间。 |
**示例:**
**示例:**
```
```
js
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
zh-CN
"
);
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
zh-CN
"
);
relativetimefmt
.
format
(
3
,
"
quarter
"
)
relativetimefmt
.
format
(
3
,
"
quarter
"
)
```
```
...
@@ -669,7 +669,7 @@ formatToParts(value: number, unit: string): Array<object>
...
@@ -669,7 +669,7 @@ formatToParts(value: number, unit: string): Array<object>
| Array
<
object
>
| 返回可用于自定义区域设置格式的相对时间格式的对象数组。 |
| Array
<
object
>
| 返回可用于自定义区域设置格式的相对时间格式的对象数组。 |
**示例:**
**示例:**
```
```
js
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
en
"
,
{
"
numeric
"
:
"
auto
"
});
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
en
"
,
{
"
numeric
"
:
"
auto
"
});
var
parts
=
relativetimefmt
.
format
(
10
,
"
seconds
"
);
var
parts
=
relativetimefmt
.
format
(
10
,
"
seconds
"
);
```
```
...
@@ -689,17 +689,17 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions
...
@@ -689,17 +689,17 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions
|
[
RelativeTimeFormatResolvedOptions
](
#relativetimeformatresolvedoptions
)
| RelativeTimeFormat
对象的格式化选项。 |
|
[
RelativeTimeFormatResolvedOptions
](
#relativetimeformatresolvedoptions
)
| RelativeTimeFormat
对象的格式化选项。 |
**示例:**
**示例:**
```
```
js
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
en-GB
"
);
var
relativetimefmt
=
new
Intl
.
RelativeTimeFormat
(
"
en-GB
"
);
relativetimefmt
.
resolvedOptions
();
relativetimefmt
.
resolvedOptions
();
```
```
## RelativeTimeFormatInputOptions<sup>8+</sup>
<a name=relativetimeformatinputoptions></a>
## RelativeTimeFormatInputOptions<sup>8+</sup>
表示RelativeTimeFormat对象可设置的属性。
表示RelativeTimeFormat对象可设置的属性。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ------------- | ------ | ---- | ---- | ---------------------------------------- |
| ------------- | ------ | ---- | ---- | ---------------------------------------- |
...
@@ -708,11 +708,11 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions
...
@@ -708,11 +708,11 @@ resolvedOptions(): RelativeTimeFormatResolvedOptions
| style | string | 是 | 是 | 国际化消息的长度,取值包括:"long",
"short",
"narrow"。 |
| style | string | 是 | 是 | 国际化消息的长度,取值包括:"long",
"short",
"narrow"。 |
## RelativeTimeFormatResolvedOptions<sup>8+</sup>
<a name=relativetimeformatresolvedoptions></a>
## RelativeTimeFormatResolvedOptions<sup>8+</sup>
表示RelativeTimeFormat对象可设置的属性。
表示RelativeTimeFormat对象可设置的属性。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.Global.I18n
**系统能力**
:SystemCapability.Global.I18n
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| --------------- | ------ | ---- | ---- | ---------------------------------------- |
| --------------- | ------ | ---- | ---- | ---------------------------------------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-keycode.md
浏览文件 @
0d1e9382
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
KeyCode模块提供了按键类设备的键值。
KeyCode模块提供了按键类设备的键值。
>

**说明:**
> **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
...
@@ -13,10 +13,10 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
...
@@ -13,10 +13,10 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
## KeyCode
## KeyCode
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
------------------------ | ------ | ---- | ---- | -------------------
-------- |
| KEYCODE_FN | number | 是 | 否 | 功能(Fn)键 |
| KEYCODE_FN | number | 是 | 否 | 功能(Fn)键 |
| KEYCODE_UNKNOWN | number | 是 | 否 | 未知按键 |
| KEYCODE_UNKNOWN | number | 是 | 否 | 未知按键 |
| KEYCODE_HOME | number | 是 | 否 | 按键Home |
| KEYCODE_HOME | number | 是 | 否 | 按键Home |
...
@@ -88,7 +88,7 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
...
@@ -88,7 +88,7 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
| KEYCODE_SPACE | number | 是 | 否 | 空格键 |
| KEYCODE_SPACE | number | 是 | 否 | 空格键 |
| KEYCODE_SYM | number | 是 | 否 | 符号修改器按键 |
| KEYCODE_SYM | number | 是 | 否 | 符号修改器按键 |
| KEYCODE_EXPLORER | number | 是 | 否 | 浏览器功能键,此键用于启动浏览器应用程序。 |
| KEYCODE_EXPLORER | number | 是 | 否 | 浏览器功能键,此键用于启动浏览器应用程序。 |
| KEYCODE_ENVELOPE
| number | 是 | 否 | 电子邮件功能键,此键用于启动电子邮件应用程序。
|
| KEYCODE_ENVELOPE
| number | 是 | 否 | 电子邮件功能键,此键用于启动电子邮件应用程序。
|
| KEYCODE_ENTER | number | 是 | 否 | 回车键 |
| KEYCODE_ENTER | number | 是 | 否 | 回车键 |
| KEYCODE_DEL | number | 是 | 否 | 退格键 |
| KEYCODE_DEL | number | 是 | 否 | 退格键 |
| KEYCODE_GRAVE | number | 是 | 否 | 按键'
`
' |
| KEYCODE_GRAVE | number | 是 | 否 | 按键'
`
' |
...
@@ -329,11 +329,11 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
...
@@ -329,11 +329,11 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode'
| KEYCODE_SPORT | number | 是 | 否 | 运动按键 |
| KEYCODE_SPORT | number | 是 | 否 | 运动按键 |
| KEYCODE_SHOP | number | 是 | 否 | 商城键 |
| KEYCODE_SHOP | number | 是 | 否 | 商城键 |
| KEYCODE_ALTERASE | number | 是 | 否 | 交替键 |
| KEYCODE_ALTERASE | number | 是 | 否 | 交替键 |
| KEYCODE_SWITCHVIDEOMODE
| number | 是 | 否 | 在可用视频之间循环输出(监视器/LCD/TV输出/等)
|
| KEYCODE_SWITCHVIDEOMODE
| number | 是 | 否 | 在可用视频之间循环输出(监视器/LCD/TV输出/等)
|
| KEYCODE_BATTERY | number | 是 | 否 | 电池按键 |
| KEYCODE_BATTERY | number | 是 | 否 | 电池按键 |
| KEYCODE_BLUETOOTH | number | 是 | 否 | 蓝牙按键 |
| KEYCODE_BLUETOOTH | number | 是 | 否 | 蓝牙按键 |
| KEYCODE_WLAN | number | 是 | 否 | 无线局域网 |
| KEYCODE_WLAN | number | 是 | 否 | 无线局域网 |
| KEYCODE_UWB
| number | 是 | 否 | 超宽带(UWB)
|
| KEYCODE_UWB
| number | 是 | 否 | 超宽带(UWB)
|
| KEYCODE_WWAN_WIMAX | number | 是 | 否 | WWAN WiMAX按键 |
| KEYCODE_WWAN_WIMAX | number | 是 | 否 | WWAN WiMAX按键 |
| KEYCODE_RFKILL | number | 是 | 否 | 控制所有收音机的键 |
| KEYCODE_RFKILL | number | 是 | 否 | 控制所有收音机的键 |
| KEYCODE_CHANNEL | number | 是 | 否 | 向上频道键 |
| KEYCODE_CHANNEL | number | 是 | 否 | 向上频道键 |
...
...
zh-cn/application-dev/reference/apis/js-apis-keyevent.md
浏览文件 @
0d1e9382
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
KeyEvent模块提供了设备可以上报的按键事件。
KeyEvent模块提供了设备可以上报的按键事件。
>  **说明:**
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
...
@@ -13,30 +14,30 @@ import {Action,Key,KeyEvent} from '@ohos.multimodalInput.keyEvent';
...
@@ -13,30 +14,30 @@ import {Action,Key,KeyEvent} from '@ohos.multimodalInput.keyEvent';
## Action
## Action
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| ------
-- | -------- | -------- | -------- | ----
---- |
| ------
| ------ | ---- | ---- |
---- |
| CANCEL | number | 是 | 否 | 取消 |
| CANCEL | number | 是 | 否 | 取消 |
| DOWN | number | 是 | 否 | 按下按钮 |
| DOWN | number | 是 | 否 | 按下按钮 |
| UP | number | 是 | 否 | 抬起按钮 |
| UP | number | 是 | 否 | 抬起按钮 |
## Key
## Key
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- | --
------ |
| --------
--- | ------- | ---- | ---- |
------ |
| code | KeyCode | 是 | 否 | 按键码 |
| code | KeyCode | 是 | 否 | 按键码 |
| pressedTime | number | 是 | 否 | 按下时间 |
| pressedTime | number | 是 | 否 | 按下时间 |
| deviceId | number | 是 | 否 | 按键所属设备 |
| deviceId | number | 是 | 否 | 按键所属设备 |
## KeyEvent
## KeyEvent
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
--- | ------- | ---- | ---- | ------------
-------- |
| action | Action | 是 | 否 | 按键动作 |
| action | Action | 是 | 否 | 按键动作 |
| key | Key | 是 | 否 | 当前发生变化的按键 |
| key | Key | 是 | 否 | 当前发生变化的按键 |
| unicodeChar | number | 是 | 否 | 按键对应的uniCode字符 |
| unicodeChar | number | 是 | 否 | 按键对应的uniCode字符 |
...
...
zh-cn/application-dev/reference/apis/js-apis-mediaquery.md
浏览文件 @
0d1e9382
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
提供根据不同媒体类型定义不同的样式。
提供根据不同媒体类型定义不同的样式。
> **说明:**
> **说明:**
>
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
...
@@ -118,7 +119,7 @@ off(type: 'change', callback?: Callback<MediaQueryResult>): void
...
@@ -118,7 +119,7 @@ off(type: 'change', callback?: Callback<MediaQueryResult>): void
### 示例
### 示例
```
j
s
```
t
s
import
mediaquery
from
'
@ohos.mediaquery
'
import
mediaquery
from
'
@ohos.mediaquery
'
let
portraitFunc
=
null
let
portraitFunc
=
null
...
...
zh-cn/application-dev/reference/apis/js-apis-mouseevent.md
浏览文件 @
0d1e9382
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
设备上报的鼠标事件。
设备上报的鼠标事件。
>

**说明:**
> **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
...
@@ -13,10 +13,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
...
@@ -13,10 +13,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
## Action
## Action
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
--- | ------ | ---- | ---- | --
-------- |
| CANCEL | number | 是 | 否 | 取消 |
| CANCEL | number | 是 | 否 | 取消 |
| MOVE | number | 是 | 否 | 鼠标移动 |
| MOVE | number | 是 | 否 | 鼠标移动 |
| BUTTON_DOWN | number | 是 | 否 | 鼠标按钮按下 |
| BUTTON_DOWN | number | 是 | 否 | 鼠标按钮按下 |
...
@@ -28,10 +28,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
...
@@ -28,10 +28,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
## Button
## Button
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| -------
- | -------- | -------- | -------- | ---
----- |
| -------
| ------ | ---- | ---- |
----- |
| LEFT | number | 是 | 否 | 鼠标左键 |
| LEFT | number | 是 | 否 | 鼠标左键 |
| MIDDLE | number | 是 | 否 | 鼠标中键 |
| MIDDLE | number | 是 | 否 | 鼠标中键 |
| RIGHT | number | 是 | 否 | 鼠标右键 |
| RIGHT | number | 是 | 否 | 鼠标右键 |
...
@@ -43,10 +43,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
...
@@ -43,10 +43,10 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
## Axis
## Axis
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- | ---
----- |
| --------
--------- | ------ | ---- | ---- |
----- |
| SCROLL_VERTICAL | number | 是 | 否 | 垂直滚动轴 |
| SCROLL_VERTICAL | number | 是 | 否 | 垂直滚动轴 |
| SCROLL_HORIZONTAL | number | 是 | 否 | 水平滚动轴 |
| SCROLL_HORIZONTAL | number | 是 | 否 | 水平滚动轴 |
| PINCH | number | 是 | 否 | 捏合轴 |
| PINCH | number | 是 | 否 | 捏合轴 |
...
@@ -54,20 +54,20 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
...
@@ -54,20 +54,20 @@ import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mou
## AxisValue
## AxisValue
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| -----
--- | -------- | -------- | -------- | ----
---- |
| -----
| ------ | ---- | ---- |
---- |
| axis | Axis | 是 | 否 | 轴类型 |
| axis | Axis | 是 | 否 | 轴类型 |
| value | number | 是 | 否 | 轴的值 |
| value | number | 是 | 否 | 轴的值 |
## MouseEvent
## MouseEvent
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
------ | ----------- | ---- | ---- | --------------------------------
-------- |
| action | Action | 是 | 否 | 鼠标事件动作 |
| action | Action | 是 | 否 | 鼠标事件动作 |
| screenX | number | 是 | 否 | 鼠标光标在屏幕中的x坐标 |
| screenX | number | 是 | 否 | 鼠标光标在屏幕中的x坐标 |
| screenY | number | 是 | 否 | 鼠标光标在屏幕中的y坐标 |
| screenY | number | 是 | 否 | 鼠标光标在屏幕中的y坐标 |
...
...
zh-cn/application-dev/reference/apis/js-apis-prompt.md
浏览文件 @
0d1e9382
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
## 导入模块
## 导入模块
```
```
js
import
prompt
from
'
@ohos.prompt
'
import
prompt
from
'
@ohos.prompt
'
```
```
...
@@ -26,15 +26,11 @@ showToast(options: ShowToastOptions): void
...
@@ -26,15 +26,11 @@ showToast(options: ShowToastOptions): void
| options |
[
ShowToastOptions
](
#showtoastoptions
)
| 是 | 文本弹窗选项。 |
| options |
[
ShowToastOptions
](
#showtoastoptions
)
| 是 | 文本弹窗选项。 |
**示例:**
**示例:**
```
```
js
export default {
prompt
.
showToast
({
showToast() {
prompt.showToast({
message
:
'
Message Info
'
,
message
:
'
Message Info
'
,
duration
:
2000
,
duration
:
2000
,
});
});
}
}
```
```
## ShowToastOptions
## ShowToastOptions
...
@@ -43,10 +39,10 @@ showToast(options: ShowToastOptions): void
...
@@ -43,10 +39,10 @@ showToast(options: ShowToastOptions): void
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | --------------
|
---- | ---------------------------------------- |
| -------- | --------------
-------------------------- | --
---- | ---------------------------------------- |
| message | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 显示的文本信息。 |
| message | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 显示的文本信息。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms,若小于1500ms则取默认值。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms,若小于1500ms则取默认值。 |
| bottom | string
| number | 否 | 设置弹窗边框距离屏幕底部的位置。
|
| bottom | string
| number | 否
|
## prompt.showDialog
## prompt.showDialog
...
@@ -69,10 +65,8 @@ showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>
...
@@ -69,10 +65,8 @@ showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>
**示例:**
**示例:**
```
```
js
export default {
prompt
.
showDialog
({
showDialog() {
prompt.showDialog({
title
:
'
Title Info
'
,
title
:
'
Title Info
'
,
message
:
'
Message Info
'
,
message
:
'
Message Info
'
,
buttons
:
[
buttons
:
[
...
@@ -85,15 +79,13 @@ showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>
...
@@ -85,15 +79,13 @@ showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>
color
:
'
#000000
'
,
color
:
'
#000000
'
,
}
}
],
],
})
})
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
info
(
'
showDialog success, click button:
'
+
data
.
index
);
console
.
info
(
'
showDialog success, click button:
'
+
data
.
index
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
info
(
'
showDialog error:
'
+
err
);
console
.
info
(
'
showDialog error:
'
+
err
);
})
})
}
}
```
```
## prompt.showDialog
## prompt.showDialog
...
@@ -112,17 +104,8 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
...
@@ -112,17 +104,8 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
| callback | AsyncCallback
<
[ShowDialogSuccessResponse](#showdialogsuccessresponse)
>
| 是 | 对话框响应结果回调。 |
| callback | AsyncCallback
<
[ShowDialogSuccessResponse](#showdialogsuccessresponse)
>
| 是 | 对话框响应结果回调。 |
**示例:**
**示例:**
```
```
js
export default {
prompt
.
showDialog
({
callback(err, data) {
if(err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
},
showDialog() {
prompt.showDialog({
title
:
'
showDialog Title Info
'
,
title
:
'
showDialog Title Info
'
,
message
:
'
Message Info
'
,
message
:
'
Message Info
'
,
buttons
:
[
buttons
:
[
...
@@ -135,9 +118,13 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
...
@@ -135,9 +118,13 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
color
:
'
#000000
'
,
color
:
'
#000000
'
,
}
}
]
]
}, this.callback);
},
(
err
,
data
)
=>
{
}
if
(
err
)
{
console
.
info
(
'
showDialog err:
'
+
err
);
return
;
}
}
console
.
info
(
'
showDialog success callback, click button:
'
+
data
.
index
);
});
```
```
## ShowDialogOptions
## ShowDialogOptions
...
@@ -147,7 +134,7 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
...
@@ -147,7 +134,7 @@ showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSucc
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---------------------------------------- |
| ------- | ------
----------------------------------
| ---- | ---------------------------------------- |
| title | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 标题文本。 |
| title | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 标题文本。 |
| message | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 内容文本。 |
| message | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 内容文本。 |
| buttons | Array | 否 | 对话框中按钮的数组,结构为:{text:'button',
color:
'
\#
666666'},支持1-3个按钮。其中第一个为positiveButton;第二个为negativeButton;第三个为neutralButton。 |
| buttons | Array | 否 | 对话框中按钮的数组,结构为:{text:'button',
color:
'
\#
666666'},支持1-3个按钮。其中第一个为positiveButton;第二个为negativeButton;第三个为neutralButton。 |
...
@@ -179,17 +166,8 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenu
...
@@ -179,17 +166,8 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenu
**示例:**
**示例:**
```
```
js
export default {
prompt
.
showActionMenu
({
callback(err, data) {
if(err) {
console.info('showActionMenu err: ' + err);
return;
}
console.info('showActionMenu success callback, click button: ' + data.index);
},
showActionMenu() {
prompt.showActionMenu({
title
:
'
Title Info
'
,
title
:
'
Title Info
'
,
buttons
:
[
buttons
:
[
{
{
...
@@ -201,9 +179,13 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenu
...
@@ -201,9 +179,13 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenu
color
:
'
#000000
'
,
color
:
'
#000000
'
,
},
},
]
]
}, this.callback)
},
(
err
,
data
)
=>
{
}
if
(
err
)
{
console
.
info
(
'
showActionMenu err:
'
+
err
);
return
;
}
}
console
.
info
(
'
showActionMenu success callback, click button:
'
+
data
.
index
);
})
```
```
## prompt.showActionMenu
## prompt.showActionMenu
...
@@ -225,10 +207,8 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
...
@@ -225,10 +207,8 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
| Promise
<
[ActionMenuSuccessResponse](#actionmenusuccessresponse)
>
| 菜单响应结果。 |
| Promise
<
[ActionMenuSuccessResponse](#actionmenusuccessresponse)
>
| 菜单响应结果。 |
**示例:**
**示例:**
```
```
js
export default {
prompt
.
showActionMenu
({
showActionMenu() {
prompt.showActionMenu({
title
:
'
showActionMenu Title Info
'
,
title
:
'
showActionMenu Title Info
'
,
buttons
:
[
buttons
:
[
{
{
...
@@ -240,24 +220,22 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
...
@@ -240,24 +220,22 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
color
:
'
#000000
'
,
color
:
'
#000000
'
,
},
},
]
]
})
})
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
info
(
'
showActionMenu success, click button:
'
+
data
.
index
);
console
.
info
(
'
showActionMenu success, click button:
'
+
data
.
index
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
info
(
'
showActionMenu error:
'
+
err
);
console
.
info
(
'
showActionMenu error:
'
+
err
);
})
})
}
}
```
```
## ActionMenuOptions
## ActionMenuOptions
操作菜单的选项。
操作菜单的选项。
**系统能力:**
以下各项对应的系统能力均为
SystemCapability.ArkUI.ArkUI.Full。
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---------------------------------------- |
| ------- | ------
----------------------------------
| ---- | ---------------------------------------- |
| title | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 标题文本。 |
| title | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 否 | 标题文本。 |
| buttons | Array
<
[Button](#button)
>
| 是 | 菜单中菜单项按钮的数组,结构为:{text:'button',
color:
'
\#
666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 |
| buttons | Array
<
[Button](#button)
>
| 是 | 菜单中菜单项按钮的数组,结构为:{text:'button',
color:
'
\#
666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 |
...
@@ -265,7 +243,7 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
...
@@ -265,7 +243,7 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
操作菜单的响应结果。
操作菜单的响应结果。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ------------------------ |
| ----- | ------ | ---- | ------------------------ |
...
@@ -275,10 +253,10 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
...
@@ -275,10 +253,10 @@ showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse
菜单中的菜单项按钮。
菜单中的菜单项按钮。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**系统能力:**
SystemCapability.ArkUI.ArkUI.Full
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| ----- | ------
| ---- | -----------------
------- |
| ----- | ------
---------------------------------- | ---- |
------- |
| text | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 按钮文本内容。 |
| text | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 按钮文本内容。 |
| color | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 按钮文本颜色。 |
| color | string
\|
[
Resource
](
../../ui/ts-types.md#resource类型
)
<sup>
9+
</sup>
| 是 | 按钮文本颜色。 |
zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
浏览文件 @
0d1e9382
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-touchevent.md
浏览文件 @
0d1e9382
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
设备上报的触屏事件。
设备上报的触屏事件。
>  **说明:**
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
...
@@ -13,10 +14,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
...
@@ -13,10 +14,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
## Action
## Action
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| ------
-- | -------- | -------- | -------- | ----
---- |
| ------
| ------ | ---- | ---- |
---- |
| CANCEL | number | 是 | 否 | 触摸取消 |
| CANCEL | number | 是 | 否 | 触摸取消 |
| DOWN | number | 是 | 否 | 触摸按下 |
| DOWN | number | 是 | 否 | 触摸按下 |
| MOVE | number | 是 | 否 | 触摸移动 |
| MOVE | number | 是 | 否 | 触摸移动 |
...
@@ -24,10 +25,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
...
@@ -24,10 +25,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
## ToolType
## ToolType
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| -------- | ------
-- | -------- | -------- | ----
---- |
| -------- | ------
| ---- | ---- |
---- |
| FINGER | number | 是 | 否 | 手指 |
| FINGER | number | 是 | 否 | 手指 |
| PEN | number | 是 | 否 | 笔 |
| PEN | number | 是 | 否 | 笔 |
| RUBBER | number | 是 | 否 | 橡皮擦 |
| RUBBER | number | 是 | 否 | 橡皮擦 |
...
@@ -39,20 +40,20 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
...
@@ -39,20 +40,20 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
## SourceType
## SourceType
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- | ----
---- |
| --------
---- | ------ | ---- | ---- |
---- |
| TOUCH_SCREEN | number | 是 | 否 | 触摸屏 |
| TOUCH_SCREEN | number | 是 | 否 | 触摸屏 |
| PEN | number | 是 | 否 | 手写笔 |
| PEN | number | 是 | 否 | 手写笔 |
| TOUCH_PAD | number | 是 | 否 | 触摸板 |
| TOUCH_PAD | number | 是 | 否 | 触摸板 |
## Touch
## Touch
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
--- | ------ | ---- | ---- | ---------------------------
-------- |
| id | number | 是 | 否 | 指针标识 |
| id | number | 是 | 否 | 指针标识 |
| pressedTime | number | 是 | 否 | 按下时的时间戳 |
| pressedTime | number | 是 | 否 | 按下时的时间戳 |
| screenX | number | 是 | 否 | 触摸位置所属的屏幕x坐标 |
| screenX | number | 是 | 否 | 触摸位置所属的屏幕x坐标 |
...
@@ -74,10 +75,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
...
@@ -74,10 +75,10 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
## TouchEvent
## TouchEvent
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.MultimodalInput.Input.Core
**系统能力**
:SystemCapability.MultimodalInput.Input.Core
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| --------
| -------- | -------- | -------- |
-------- |
| --------
-- | ---------- | ---- | ---- | -
-------- |
| action | Action | 是 | 否 | 触摸动作 |
| action | Action | 是 | 否 | 触摸动作 |
| touch | Touch | 是 | 否 | 当前触摸点 |
| touch | Touch | 是 | 否 | 当前触摸点 |
| touches | Touch[] | 是 | 否 | 所有触摸点 |
| touches | Touch[] | 是 | 否 | 所有触摸点 |
...
...
zh-cn/application-dev/reference/apis/js-apis-update.md
浏览文件 @
0d1e9382
...
@@ -41,7 +41,7 @@ getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater
...
@@ -41,7 +41,7 @@ getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater
**示例:**
**示例:**
```
```
ts
try
{
try
{
var
upgradeInfo
=
{
var
upgradeInfo
=
{
upgradeApp
:
"
com.ohos.ota.updateclient
"
,
upgradeApp
:
"
com.ohos.ota.updateclient
"
,
...
@@ -73,7 +73,7 @@ getRestorer(): Restorer
...
@@ -73,7 +73,7 @@ getRestorer(): Restorer
**示例:**
**示例:**
```
```
ts
try
{
try
{
let
restorer
=
update
.
getRestorer
();
let
restorer
=
update
.
getRestorer
();
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -97,7 +97,7 @@ getLocalUpdater(): LocalUpdater
...
@@ -97,7 +97,7 @@ getLocalUpdater(): LocalUpdater
**示例:**
**示例:**
```
```
ts
try
{
try
{
let
localUpdater
=
update
.
getLocalUpdater
();
let
localUpdater
=
update
.
getLocalUpdater
();
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -125,7 +125,7 @@ checkNewVersion(callback: AsyncCallback\<CheckResult>): void
...
@@ -125,7 +125,7 @@ checkNewVersion(callback: AsyncCallback\<CheckResult>): void
**示例:**
**示例:**
```
```
ts
updater
.
checkNewVersion
((
err
,
result
)
=>
{
updater
.
checkNewVersion
((
err
,
result
)
=>
{
console
.
log
(
`checkNewVersion isExistNewVersion
${
result
?.
isExistNewVersion
}
`
);
console
.
log
(
`checkNewVersion isExistNewVersion
${
result
?.
isExistNewVersion
}
`
);
});
});
...
@@ -149,7 +149,7 @@ checkNewVersion(): Promise\<CheckResult>
...
@@ -149,7 +149,7 @@ checkNewVersion(): Promise\<CheckResult>
**示例:**
**示例:**
```
```
ts
updater
.
checkNewVersion
().
then
(
result
=>
{
updater
.
checkNewVersion
().
then
(
result
=>
{
console
.
log
(
`checkNewVersion isExistNewVersion:
${
result
.
isExistNewVersion
}
`
);
console
.
log
(
`checkNewVersion isExistNewVersion:
${
result
.
isExistNewVersion
}
`
);
// 版本摘要信息
// 版本摘要信息
...
@@ -177,7 +177,7 @@ getNewVersionInfo(callback: AsyncCallback\<NewVersionInfo>): void
...
@@ -177,7 +177,7 @@ getNewVersionInfo(callback: AsyncCallback\<NewVersionInfo>): void
**示例:**
**示例:**
```
```
ts
updater
.
getNewVersionInfo
((
err
,
info
)
=>
{
updater
.
getNewVersionInfo
((
err
,
info
)
=>
{
console
.
log
(
`info displayVersion =
${
info
?.
versionComponents
[
0
].
displayVersion
}
`
);
console
.
log
(
`info displayVersion =
${
info
?.
versionComponents
[
0
].
displayVersion
}
`
);
console
.
log
(
`info innerVersion =
${
info
?.
versionComponents
[
0
].
innerVersion
}
`
);
console
.
log
(
`info innerVersion =
${
info
?.
versionComponents
[
0
].
innerVersion
}
`
);
...
@@ -202,7 +202,7 @@ getNewVersionInfo(): Promise\<NewVersionInfo>
...
@@ -202,7 +202,7 @@ getNewVersionInfo(): Promise\<NewVersionInfo>
**示例:**
**示例:**
```
```
ts
updater
.
getNewVersionInfo
().
then
(
info
=>
{
updater
.
getNewVersionInfo
().
then
(
info
=>
{
console
.
log
(
`info displayVersion =
${
info
.
versionComponents
[
0
].
displayVersion
}
`
);
console
.
log
(
`info displayVersion =
${
info
.
versionComponents
[
0
].
displayVersion
}
`
);
console
.
log
(
`info innerVersion =
${
info
.
versionComponents
[
0
].
innerVersion
}
`
);
console
.
log
(
`info innerVersion =
${
info
.
versionComponents
[
0
].
innerVersion
}
`
);
...
@@ -231,7 +231,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
...
@@ -231,7 +231,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -274,7 +274,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
...
@@ -274,7 +274,7 @@ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOption
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -311,7 +311,7 @@ getCurrentVersionInfo(callback: AsyncCallback\<CurrentVersionInfo>): void
...
@@ -311,7 +311,7 @@ getCurrentVersionInfo(callback: AsyncCallback\<CurrentVersionInfo>): void
**示例:**
**示例:**
```
```
ts
updater
.
getCurrentVersionInfo
((
err
,
info
)
=>
{
updater
.
getCurrentVersionInfo
((
err
,
info
)
=>
{
console
.
log
(
`info osVersion =
${
info
?.
osVersion
}
`
);
console
.
log
(
`info osVersion =
${
info
?.
osVersion
}
`
);
console
.
log
(
`info deviceName =
${
info
?.
deviceName
}
`
);
console
.
log
(
`info deviceName =
${
info
?.
deviceName
}
`
);
...
@@ -337,7 +337,7 @@ getCurrentVersionInfo(): Promise\<CurrentVersionInfo>
...
@@ -337,7 +337,7 @@ getCurrentVersionInfo(): Promise\<CurrentVersionInfo>
**示例:**
**示例:**
```
```
ts
updater
.
getCurrentVersionInfo
().
then
(
info
=>
{
updater
.
getCurrentVersionInfo
().
then
(
info
=>
{
console
.
log
(
`info osVersion =
${
info
.
osVersion
}
`
);
console
.
log
(
`info osVersion =
${
info
.
osVersion
}
`
);
console
.
log
(
`info deviceName =
${
info
.
deviceName
}
`
);
console
.
log
(
`info deviceName =
${
info
.
deviceName
}
`
);
...
@@ -366,7 +366,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: A
...
@@ -366,7 +366,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: A
**示例:**
**示例:**
```
```
ts
// 描述文件选项
// 描述文件选项
var
descriptionOptions
=
{
var
descriptionOptions
=
{
format
:
DescriptionFormat
.
STANDARD
,
// 标准格式
format
:
DescriptionFormat
.
STANDARD
,
// 标准格式
...
@@ -403,7 +403,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions): Promise\<A
...
@@ -403,7 +403,7 @@ getCurrentVersionDescription(descriptionOptions: DescriptionOptions): Promise\<A
**示例:**
**示例:**
```
```
ts
// 描述文件选项
// 描述文件选项
var
descriptionOptions
=
{
var
descriptionOptions
=
{
format
:
DescriptionFormat
.
STANDARD
,
// 标准格式
format
:
DescriptionFormat
.
STANDARD
,
// 标准格式
...
@@ -435,7 +435,7 @@ getTaskInfo(callback: AsyncCallback\<TaskInfo>): void
...
@@ -435,7 +435,7 @@ getTaskInfo(callback: AsyncCallback\<TaskInfo>): void
**示例:**
**示例:**
```
```
ts
updater
.
getTaskInfo
((
err
,
info
)
=>
{
updater
.
getTaskInfo
((
err
,
info
)
=>
{
console
.
log
(
`getTaskInfo isexistTask=
${
info
?.
existTask
}
`
);
console
.
log
(
`getTaskInfo isexistTask=
${
info
?.
existTask
}
`
);
});
});
...
@@ -459,7 +459,7 @@ getTaskInfo(): Promise\<TaskInfo>
...
@@ -459,7 +459,7 @@ getTaskInfo(): Promise\<TaskInfo>
**示例:**
**示例:**
```
```
ts
updater
.
getTaskInfo
().
then
(
info
=>
{
updater
.
getTaskInfo
().
then
(
info
=>
{
console
.
log
(
`getTaskInfo isexistTask=
${
info
.
existTask
}
`
);
console
.
log
(
`getTaskInfo isexistTask=
${
info
.
existTask
}
`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -487,7 +487,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions,
...
@@ -487,7 +487,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions,
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -528,7 +528,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions)
...
@@ -528,7 +528,7 @@ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions)
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -566,7 +566,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
...
@@ -566,7 +566,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -606,7 +606,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
...
@@ -606,7 +606,7 @@ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: Resu
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -643,7 +643,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
...
@@ -643,7 +643,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -683,7 +683,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
...
@@ -683,7 +683,7 @@ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseD
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -720,7 +720,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, ca
...
@@ -720,7 +720,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, ca
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -760,7 +760,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions): P
...
@@ -760,7 +760,7 @@ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions): P
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -797,7 +797,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, cal
...
@@ -797,7 +797,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, cal
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -837,7 +837,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Pr
...
@@ -837,7 +837,7 @@ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions): Pr
**示例:**
**示例:**
```
```
ts
// 版本摘要信息
// 版本摘要信息
var
versionDigestInfo
=
{
var
versionDigestInfo
=
{
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
versionDigest
:
"
versionDigest
"
// 检测结果中的版本摘要信息
...
@@ -872,7 +872,7 @@ getUpgradePolicy(callback: AsyncCallback\<UpgradePolicy>): void
...
@@ -872,7 +872,7 @@ getUpgradePolicy(callback: AsyncCallback\<UpgradePolicy>): void
**示例:**
**示例:**
```
```
ts
updater
.
getUpgradePolicy
((
err
,
policy
)
=>
{
updater
.
getUpgradePolicy
((
err
,
policy
)
=>
{
console
.
log
(
`policy downloadStrategy =
${
policy
?.
downloadStrategy
}
`
);
console
.
log
(
`policy downloadStrategy =
${
policy
?.
downloadStrategy
}
`
);
console
.
log
(
`policy autoUpgradeStrategy =
${
policy
?.
autoUpgradeStrategy
}
`
);
console
.
log
(
`policy autoUpgradeStrategy =
${
policy
?.
autoUpgradeStrategy
}
`
);
...
@@ -897,7 +897,7 @@ getUpgradePolicy(): Promise\<UpgradePolicy>
...
@@ -897,7 +897,7 @@ getUpgradePolicy(): Promise\<UpgradePolicy>
**示例:**
**示例:**
```
```
ts
updater
.
getUpgradePolicy
().
then
(
policy
=>
{
updater
.
getUpgradePolicy
().
then
(
policy
=>
{
console
.
log
(
`policy downloadStrategy =
${
policy
.
downloadStrategy
}
`
);
console
.
log
(
`policy downloadStrategy =
${
policy
.
downloadStrategy
}
`
);
console
.
log
(
`policy autoUpgradeStrategy =
${
policy
.
autoUpgradeStrategy
}
`
);
console
.
log
(
`policy autoUpgradeStrategy =
${
policy
.
autoUpgradeStrategy
}
`
);
...
@@ -925,7 +925,7 @@ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\<void>): void
...
@@ -925,7 +925,7 @@ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\<void>): void
**示例:**
**示例:**
```
```
ts
let
policy
=
{
let
policy
=
{
downloadStrategy
:
false
,
downloadStrategy
:
false
,
autoUpgradeStrategy
:
false
,
autoUpgradeStrategy
:
false
,
...
@@ -960,7 +960,7 @@ setUpgradePolicy(policy: UpgradePolicy): Promise\<void>
...
@@ -960,7 +960,7 @@ setUpgradePolicy(policy: UpgradePolicy): Promise\<void>
**示例:**
**示例:**
```
```
ts
let
policy
=
{
let
policy
=
{
downloadStrategy
:
false
,
downloadStrategy
:
false
,
autoUpgradeStrategy
:
false
,
autoUpgradeStrategy
:
false
,
...
@@ -991,7 +991,7 @@ terminateUpgrade(callback: AsyncCallback\<void>): void
...
@@ -991,7 +991,7 @@ terminateUpgrade(callback: AsyncCallback\<void>): void
**示例:**
**示例:**
```
```
ts
updater
.
terminateUpgrade
((
err
)
=>
{
updater
.
terminateUpgrade
((
err
)
=>
{
console
.
log
(
`terminateUpgrade error
${
JSON
.
stringify
(
err
)}
`
);
console
.
log
(
`terminateUpgrade error
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -1015,7 +1015,7 @@ terminateUpgrade(): Promise\<void>
...
@@ -1015,7 +1015,7 @@ terminateUpgrade(): Promise\<void>
**示例:**
**示例:**
```
```
ts
updater
.
terminateUpgrade
().
then
(()
=>
{
updater
.
terminateUpgrade
().
then
(()
=>
{
console
.
log
(
`terminateUpgrade success`
);
console
.
log
(
`terminateUpgrade success`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -1040,7 +1040,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
...
@@ -1040,7 +1040,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
**示例:**
**示例:**
```
```
ts
var
eventClassifyInfo
=
{
var
eventClassifyInfo
=
{
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
extraInfo
:
""
extraInfo
:
""
...
@@ -1067,7 +1067,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
...
@@ -1067,7 +1067,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
**示例:**
**示例:**
```
```
ts
var
eventClassifyInfo
=
{
var
eventClassifyInfo
=
{
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
extraInfo
:
""
extraInfo
:
""
...
@@ -1098,7 +1098,7 @@ factoryReset(callback: AsyncCallback\<void>): void
...
@@ -1098,7 +1098,7 @@ factoryReset(callback: AsyncCallback\<void>): void
**示例:**
**示例:**
```
```
ts
restorer
.
factoryReset
((
err
)
=>
{
restorer
.
factoryReset
((
err
)
=>
{
console
.
log
(
`factoryReset error
${
JSON
.
stringify
(
err
)}
`
);
console
.
log
(
`factoryReset error
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -1122,7 +1122,7 @@ factoryReset(): Promise\<void>
...
@@ -1122,7 +1122,7 @@ factoryReset(): Promise\<void>
**示例:**
**示例:**
```
```
ts
restorer
.
factoryReset
().
then
(()
=>
{
restorer
.
factoryReset
().
then
(()
=>
{
console
.
log
(
`factoryReset success`
);
console
.
log
(
`factoryReset success`
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -1152,7 +1152,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: Asyn
...
@@ -1152,7 +1152,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: Asyn
**示例:**
**示例:**
```
```
ts
var
upgradeFile
=
{
var
upgradeFile
=
{
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
filePath
:
"
path
"
// 本地升级包路径
filePath
:
"
path
"
// 本地升级包路径
...
@@ -1188,7 +1188,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise\<void
...
@@ -1188,7 +1188,7 @@ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string): Promise\<void
**示例:**
**示例:**
```
```
ts
var
upgradeFile
=
{
var
upgradeFile
=
{
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
filePath
:
"
path
"
// 本地升级包路径
filePath
:
"
path
"
// 本地升级包路径
...
@@ -1218,7 +1218,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>, callback: Asyn
...
@@ -1218,7 +1218,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>, callback: Asyn
**示例:**
**示例:**
```
```
ts
var
upgradeFiles
=
[{
var
upgradeFiles
=
[{
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
filePath
:
"
path
"
// 本地升级包路径
filePath
:
"
path
"
// 本地升级包路径
...
@@ -1247,7 +1247,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\<void
...
@@ -1247,7 +1247,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\<void
**示例:**
**示例:**
```
```
ts
var
upgradeFiles
=
[{
var
upgradeFiles
=
[{
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
fileType
:
update
.
ComponentType
.
OTA
,
// OTA包
filePath
:
"
path
"
// 本地升级包路径
filePath
:
"
path
"
// 本地升级包路径
...
@@ -1275,7 +1275,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
...
@@ -1275,7 +1275,7 @@ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): voi
**示例:**
**示例:**
```
```
ts
var
eventClassifyInfo
=
{
var
eventClassifyInfo
=
{
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
extraInfo
:
""
extraInfo
:
""
...
@@ -1304,7 +1304,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
...
@@ -1304,7 +1304,7 @@ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): v
**示例:**
**示例:**
```
```
ts
var
eventClassifyInfo
=
{
var
eventClassifyInfo
=
{
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
eventClassify
:
update
.
EventClassify
.
TASK
,
// 订阅升级更新事件
extraInfo
:
""
extraInfo
:
""
...
...
zh-cn/application-dev/reference/apis/js-apis-workScheduler.md
浏览文件 @
0d1e9382
...
@@ -4,13 +4,13 @@
...
@@ -4,13 +4,13 @@
开发者在开发应用时,通过调用延迟任务注册接口,注册对实时性要求不高的延迟任务,该任务默认由系统安排,在系统空闲时根据性能、功耗、热等情况进行调度执行。
开发者在开发应用时,通过调用延迟任务注册接口,注册对实时性要求不高的延迟任务,该任务默认由系统安排,在系统空闲时根据性能、功耗、热等情况进行调度执行。
>

**说明:**
> **说明:**
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
```
```
js
import
workScheduler
from
'
@ohos.workScheduler
'
import
workScheduler
from
'
@ohos.workScheduler
'
```
```
...
@@ -35,7 +35,7 @@ startWork(work: WorkInfo): boolean
...
@@ -35,7 +35,7 @@ startWork(work: WorkInfo): boolean
**示例**
:
**示例**
:
```
```
js
let
workInfo
=
{
let
workInfo
=
{
workId
:
1
,
workId
:
1
,
batteryLevel
:
50
,
batteryLevel
:
50
,
...
@@ -71,7 +71,7 @@ stopWork(work: WorkInfo, needCancel?: boolean): boolean
...
@@ -71,7 +71,7 @@ stopWork(work: WorkInfo, needCancel?: boolean): boolean
**示例**
:
**示例**
:
```
```
js
let
workInfo
=
{
let
workInfo
=
{
workId
:
1
,
workId
:
1
,
batteryLevel
:
50
,
batteryLevel
:
50
,
...
@@ -101,7 +101,7 @@ getWorkStatus(workId: number, callback : AsyncCallback\<WorkInfo>): void
...
@@ -101,7 +101,7 @@ getWorkStatus(workId: number, callback : AsyncCallback\<WorkInfo>): void
**示例**
:
**示例**
:
```
```
js
workScheduler
.
getWorkStatus
(
50
,
(
err
,
res
)
=>
{
workScheduler
.
getWorkStatus
(
50
,
(
err
,
res
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
'
workschedulerLog getWorkStatus failed, because:
'
+
err
.
code
);
console
.
info
(
'
workschedulerLog getWorkStatus failed, because:
'
+
err
.
code
);
...
@@ -134,7 +134,7 @@ getWorkStatus(workId: number): Promise\<WorkInfo>
...
@@ -134,7 +134,7 @@ getWorkStatus(workId: number): Promise\<WorkInfo>
**示例**
:
**示例**
:
```
```
js
workScheduler
.
getWorkStatus
(
50
).
then
((
res
)
=>
{
workScheduler
.
getWorkStatus
(
50
).
then
((
res
)
=>
{
for
(
let
item
in
res
)
{
for
(
let
item
in
res
)
{
console
.
info
(
'
workschedulerLog getWorkStatus success,
'
+
item
+
'
is:
'
+
res
[
item
]);
console
.
info
(
'
workschedulerLog getWorkStatus success,
'
+
item
+
'
is:
'
+
res
[
item
]);
...
@@ -165,7 +165,7 @@ obtainAllWorks(callback : AsyncCallback\<void>): Array\<WorkInfo>
...
@@ -165,7 +165,7 @@ obtainAllWorks(callback : AsyncCallback\<void>): Array\<WorkInfo>
**示例**
:
**示例**
:
```
```
js
workScheduler
.
obtainAllWorks
((
err
,
res
)
=>
{
workScheduler
.
obtainAllWorks
((
err
,
res
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
'
workschedulerLog obtainAllWorks failed, because:
'
+
err
.
code
);
console
.
info
(
'
workschedulerLog obtainAllWorks failed, because:
'
+
err
.
code
);
...
@@ -190,7 +190,7 @@ obtainAllWorks(): Promise<Array\<WorkInfo>>
...
@@ -190,7 +190,7 @@ obtainAllWorks(): Promise<Array\<WorkInfo>>
**示例**
:
**示例**
:
```
```
js
workScheduler
.
obtainAllWorks
().
then
((
res
)
=>
{
workScheduler
.
obtainAllWorks
().
then
((
res
)
=>
{
console
.
info
(
'
workschedulerLog obtainAllWorks success, data is:
'
+
JSON
.
stringify
(
res
));
console
.
info
(
'
workschedulerLog obtainAllWorks success, data is:
'
+
JSON
.
stringify
(
res
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -207,7 +207,7 @@ stopAndClearWorks(): boolean
...
@@ -207,7 +207,7 @@ stopAndClearWorks(): boolean
**示例**
:
**示例**
:
```
```
js
let
res
=
workScheduler
.
stopAndClearWorks
();
let
res
=
workScheduler
.
stopAndClearWorks
();
console
.
info
(
"
workschedulerLog res:
"
+
res
);
console
.
info
(
"
workschedulerLog res:
"
+
res
);
```
```
...
@@ -234,7 +234,7 @@ isLastWorkTimeOut(workId: number, callback : AsyncCallback\<void>): boolean
...
@@ -234,7 +234,7 @@ isLastWorkTimeOut(workId: number, callback : AsyncCallback\<void>): boolean
**示例**
:
**示例**
:
```
```
js
workScheduler
.
isLastWorkTimeOut
(
500
,
(
err
,
res
)
=>
{
workScheduler
.
isLastWorkTimeOut
(
500
,
(
err
,
res
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
'
workschedulerLog isLastWorkTimeOut failed, because:
'
+
err
.
code
);
console
.
info
(
'
workschedulerLog isLastWorkTimeOut failed, because:
'
+
err
.
code
);
...
@@ -265,7 +265,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -265,7 +265,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
**示例**
:
**示例**
:
```
```
js
workScheduler
.
isLastWorkTimeOut
(
500
)
workScheduler
.
isLastWorkTimeOut
(
500
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
info
(
'
workschedulerLog isLastWorkTimeOut success, data is:
'
+
res
);
console
.
info
(
'
workschedulerLog isLastWorkTimeOut success, data is:
'
+
res
);
...
@@ -278,10 +278,10 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -278,10 +278,10 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
## WorkInfo
## WorkInfo
提供工作的具体信息。
提供工作的具体信息。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.WorkScheduler
**系统能力**
:SystemCapability.ResourceSchedule.WorkScheduler
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --------------- | --------------------------------- | ---- | ----------------
----------------
|
| --------------- | --------------------------------- | ---- | ---------------- |
| workId | number | 是 | 当前工作的ID |
| workId | number | 是 | 当前工作的ID |
| bundleName | string | 是 | 延迟任务包名 |
| bundleName | string | 是 | 延迟任务包名 |
| abilityName | string | 是 | 延迟任务回调通知的组件名(必填) |
| abilityName | string | 是 | 延迟任务回调通知的组件名(必填) |
...
@@ -301,7 +301,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -301,7 +301,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
## NetworkType
## NetworkType
触发工作的网络类型。
触发工作的网络类型。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.WorkScheduler
**系统能力**
:SystemCapability.ResourceSchedule.WorkScheduler
| 名称 | 默认值 | 说明 |
| 名称 | 默认值 | 说明 |
| ---------------------- | ---- | ----------------------- |
| ---------------------- | ---- | ----------------------- |
...
@@ -315,7 +315,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -315,7 +315,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
## ChargingType
## ChargingType
触发工作的充电类型。
触发工作的充电类型。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.WorkScheduler
**系统能力**
:SystemCapability.ResourceSchedule.WorkScheduler
| 名称 | 默认值 | 说明 |
| 名称 | 默认值 | 说明 |
| ------------------------- | ---- | -------------------- |
| ------------------------- | ---- | -------------------- |
...
@@ -327,7 +327,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -327,7 +327,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
## BatteryStatus
## BatteryStatus
触发工作的电池状态。
触发工作的电池状态。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.WorkScheduler
**系统能力**
:SystemCapability.ResourceSchedule.WorkScheduler
| 名称 | 默认值 | 说明 |
| 名称 | 默认值 | 说明 |
| -------------------------- | ---- | -------------------------- |
| -------------------------- | ---- | -------------------------- |
...
@@ -338,10 +338,10 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
...
@@ -338,10 +338,10 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
## StorageRequest
## StorageRequest
触发工作的存储状态。
触发工作的存储状态。
**系统能力**
:
以下各项对应的系统能力均为
SystemCapability.ResourceSchedule.WorkScheduler
**系统能力**
:SystemCapability.ResourceSchedule.WorkScheduler
|名称 |默认值 |说明|
| 名称 | 默认值 | 说明 |
| -------- | -------- | -------- |
| ------------------------- | ---- | ------------------------------ |
|STORAGE_LEVEL_LOW |0 |表示这个触发条件是存储空间不足。
| STORAGE_LEVEL_LOW | 0 | 表示这个触发条件是存储空间不足。 |
|STORAGE_LEVEL_OKAY |1 |表示这个触发条件是从存储空间不足恢复到正常。
| STORAGE_LEVEL_OKAY | 1 | 表示这个触发条件是从存储空间不足恢复到正常。 |
|STORAGE_LEVEL_LOW_OR_OKAY |2 |表示这个触发条件是从存储空间不足恢复到正常或者存储空间不足。
| STORAGE_LEVEL_LOW_OR_OKAY | 2 | 表示这个触发条件是从存储空间不足恢复到正常或者存储空间不足。 |
\ No newline at end of file
\ No newline at end of file
zh-cn/application-dev/ui/Readme-CN.md
浏览文件 @
0d1e9382
# UI开发
# UI开发
-
[
方舟开发框架(ArkUI)概述
](
arkui-overview.md
)
-
[
方舟开发框架(ArkUI)概述
](
arkui-overview.md
)
-
基于TS扩展的声明式开发范式
-
[
概述
](
ui-ts-overview.md
)
-
框架说明
-
文件组织
-
[
目录结构
](
ts-framework-directory.md
)
-
[
应用代码文件访问规则
](
ts-framework-file-access-rules.md
)
-
[
js标签配置
](
ts-framework-js-tag.md
)
-
资源管理
-
[
资源文件的分类
](
ui-ts-basic-resource-file-categories.md
)
-
[
资源访问
](
ts-resource-access.md
)
-
[
像素单位
](
ts-pixel-units.md
)
-
[
类型定义
](
ts-types.md
)
-
声明式语法
-
[
描述规范使用说明
](
ts-syntax-intro.md
)
-
通用UI描述规范
-
[
基本概念
](
ts-general-ui-concepts.md
)
-
声明式UI描述规范
-
[
无构造参数配置
](
ts-parameterless-configuration.md
)
-
[
必选参数构造配置
](
ts-configuration-with-mandatory-parameters.md
)
-
[
属性配置
](
ts-attribution-configuration.md
)
-
[
事件配置
](
ts-event-configuration.md
)
-
[
子组件配置
](
ts-child-component-configuration.md
)
-
组件化
-
[
@Component
](
ts-component-based-component.md
)
-
[
@Entry
](
ts-component-based-entry.md
)
-
[
@Preview
](
ts-component-based-preview.md
)
-
[
@Builder
](
ts-component-based-builder.md
)
-
[
@Extend
](
ts-component-based-extend.md
)
-
[
@CustomDialog
](
ts-component-based-customdialog.md
)
-
[
@Styles
](
ts-component-based-styles.md
)
-
UI状态管理
-
[
基本概念
](
ts-ui-state-mgmt-concepts.md
)
-
管理组件拥有的状态
-
[
@State
](
ts-component-states-state.md
)
-
[
@Prop
](
ts-component-states-prop.md
)
-
[
@Link
](
ts-component-states-link.md
)
-
管理应用程序的状态
-
[
应用程序的数据存储
](
ts-application-states-appstorage.md
)
-
[
Ability数据存储
](
ui-ts-local-storage.md
)
-
[
持久化数据管理
](
ts-application-states-apis-persistentstorage.md
)
-
[
环境变量
](
ts-application-states-apis-environment.md
)
-
其他类目的状态管理
-
[
Observed和ObjectLink数据管理
](
ts-other-states-observed-objectlink.md
)
-
[
@Consume和@Provide数据管理
](
ts-other-states-consume-provide.md
)
-
[
@Watch
](
ts-other-states-watch.md
)
-
渲染控制语法
-
[
条件渲染
](
ts-rending-control-syntax-if-else.md
)
-
[
循环渲染
](
ts-rending-control-syntax-foreach.md
)
-
[
数据懒加载
](
ts-rending-control-syntax-lazyforeach.md
)
-
深入理解组件化
-
[
build函数
](
ts-function-build.md
)
-
[
自定义组件初始化
](
ts-custom-component-initialization.md
)
-
[
自定义组件生命周期回调函数
](
ts-custom-component-lifecycle-callbacks.md
)
-
[
组件创建和重新初始化示例
](
ts-component-creation-re-initialization.md
)
-
[
语法糖
](
ts-syntactic-sugar.md
)
-
常见组件开发指导
-
[
Button开发指导
](
ui-ts-basic-components-button.md
)
-
[
Web开发指导
](
ui-ts-components-web.md
)
-
常见布局开发指导
-
[
弹性布局
](
ui-ts-layout-flex.md
)
-
[
栅格布局
](
ui-ts-layout-grid-container.md
)
-
[
媒体查询
](
ui-ts-layout-mediaquery.md
)
-
体验声明式UI
-
[
创建声明式UI工程
](
ui-ts-creating-project.md
)
-
[
初识Component
](
ui-ts-components.md
)
-
[
创建简单视图
](
ui-ts-creating-simple-page.md
)
-
页面布局与连接
-
[
构建食物数据模型
](
ui-ts-building-data-model.md
)
-
[
构建食物列表List布局
](
ui-ts-building-category-list-layout.md
)
-
[
构建食物分类Grid布局
](
ui-ts-building-category-grid-layout.md
)
-
[
页面跳转与数据传递
](
ui-ts-page-redirection-data-transmission.md
)
-
基于JS扩展的类Web开发范式
-
基于JS扩展的类Web开发范式
-
[
概述
](
ui-js-overview.md
)
-
[
概述
](
ui-js-overview.md
)
-
框架说明
-
框架说明
...
@@ -73,74 +145,3 @@
...
@@ -73,74 +145,3 @@
-
[
动画动效
](
ui-js-animate-dynamic-effects.md
)
-
[
动画动效
](
ui-js-animate-dynamic-effects.md
)
-
[
动画帧
](
ui-js-animate-frame.md
)
-
[
动画帧
](
ui-js-animate-frame.md
)
-
[
自定义组件
](
ui-js-custom-components.md
)
-
[
自定义组件
](
ui-js-custom-components.md
)
\ No newline at end of file
-
基于TS扩展的声明式开发范式
-
[
概述
](
ui-ts-overview.md
)
-
框架说明
-
文件组织
-
[
目录结构
](
ts-framework-directory.md
)
-
[
应用代码文件访问规则
](
ts-framework-file-access-rules.md
)
-
[
js标签配置
](
ts-framework-js-tag.md
)
-
资源管理
-
[
资源文件的分类
](
ui-ts-basic-resource-file-categories.md
)
-
[
资源访问
](
ts-resource-access.md
)
-
[
像素单位
](
ts-pixel-units.md
)
-
[
类型定义
](
ts-types.md
)
-
声明式语法
-
[
描述规范使用说明
](
ts-syntax-intro.md
)
-
通用UI描述规范
-
[
基本概念
](
ts-general-ui-concepts.md
)
-
声明式UI描述规范
-
[
无构造参数配置
](
ts-parameterless-configuration.md
)
-
[
必选参数构造配置
](
ts-configuration-with-mandatory-parameters.md
)
-
[
属性配置
](
ts-attribution-configuration.md
)
-
[
事件配置
](
ts-event-configuration.md
)
-
[
子组件配置
](
ts-child-component-configuration.md
)
-
组件化
-
[
@Component
](
ts-component-based-component.md
)
-
[
@Entry
](
ts-component-based-entry.md
)
-
[
@Preview
](
ts-component-based-preview.md
)
-
[
@Builder
](
ts-component-based-builder.md
)
-
[
@Extend
](
ts-component-based-extend.md
)
-
[
@CustomDialog
](
ts-component-based-customdialog.md
)
-
[
@Styles
](
ts-component-based-styles.md
)
-
UI状态管理
-
[
基本概念
](
ts-ui-state-mgmt-concepts.md
)
-
管理组件拥有的状态
-
[
@State
](
ts-component-states-state.md
)
-
[
@Prop
](
ts-component-states-prop.md
)
-
[
@Link
](
ts-component-states-link.md
)
-
管理应用程序的状态
-
[
应用程序的数据存储
](
ts-application-states-appstorage.md
)
-
[
Ability数据存储
](
ui-ts-local-storage.md
)
-
[
持久化数据管理
](
ts-application-states-apis-persistentstorage.md
)
-
[
环境变量
](
ts-application-states-apis-environment.md
)
-
其他类目的状态管理
-
[
Observed和ObjectLink数据管理
](
ts-other-states-observed-objectlink.md
)
-
[
@Consume和@Provide数据管理
](
ts-other-states-consume-provide.md
)
-
[
@Watch
](
ts-other-states-watch.md
)
-
渲染控制语法
-
[
条件渲染
](
ts-rending-control-syntax-if-else.md
)
-
[
循环渲染
](
ts-rending-control-syntax-foreach.md
)
-
[
数据懒加载
](
ts-rending-control-syntax-lazyforeach.md
)
-
深入理解组件化
-
[
build函数
](
ts-function-build.md
)
-
[
自定义组件初始化
](
ts-custom-component-initialization.md
)
-
[
自定义组件生命周期回调函数
](
ts-custom-component-lifecycle-callbacks.md
)
-
[
组件创建和重新初始化示例
](
ts-component-creation-re-initialization.md
)
-
[
语法糖
](
ts-syntactic-sugar.md
)
-
常见组件开发指导
-
[
Button开发指导
](
ui-ts-basic-components-button.md
)
-
[
Web开发指导
](
ui-ts-components-web.md
)
-
常见布局开发指导
-
[
弹性布局
](
ui-ts-layout-flex.md
)
-
[
栅格布局
](
ui-ts-layout-grid-container.md
)
-
[
媒体查询
](
ui-ts-layout-mediaquery.md
)
-
体验声明式UI
-
[
创建声明式UI工程
](
ui-ts-creating-project.md
)
-
[
初识Component
](
ui-ts-components.md
)
-
[
创建简单视图
](
ui-ts-creating-simple-page.md
)
-
页面布局与连接
-
[
构建食物数据模型
](
ui-ts-building-data-model.md
)
-
[
构建食物列表List布局
](
ui-ts-building-category-list-layout.md
)
-
[
构建食物分类Grid布局
](
ui-ts-building-category-grid-layout.md
)
-
[
页面跳转与数据传递
](
ui-ts-page-redirection-data-transmission.md
)
zh-cn/application-dev/website.md
浏览文件 @
0d1e9382
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录