Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7174988c
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
提交
7174988c
编写于
12月 27, 2022
作者:
S
shawn_he
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update doc
Signed-off-by:
N
shawn_he
<
shawn.he@huawei.com
>
上级
4535003d
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
513 addition
and
16 deletion
+513
-16
en/application-dev/internationalization/intl-guidelines.md
en/application-dev/internationalization/intl-guidelines.md
+2
-2
en/application-dev/napi/Readme-EN.md
en/application-dev/napi/Readme-EN.md
+1
-0
en/application-dev/napi/figures/neural_network_runtime.png
en/application-dev/napi/figures/neural_network_runtime.png
+0
-0
en/application-dev/napi/neural-network-runtime-guidelines.md
en/application-dev/napi/neural-network-runtime-guidelines.md
+491
-0
en/application-dev/reference/apis/js-apis-cooperate.md
en/application-dev/reference/apis/js-apis-cooperate.md
+11
-6
en/application-dev/reference/apis/js-apis-inputdevice.md
en/application-dev/reference/apis/js-apis-inputdevice.md
+5
-5
en/application-dev/reference/apis/js-apis-update.md
en/application-dev/reference/apis/js-apis-update.md
+3
-3
未找到文件。
en/application-dev/internationalization/intl-guidelines.md
浏览文件 @
7174988c
...
@@ -45,7 +45,7 @@ Use [Locale](../reference/apis/js-apis-intl.md#locale) APIs to maximize or minim
...
@@ -45,7 +45,7 @@ Use [Locale](../reference/apis/js-apis-intl.md#locale) APIs to maximize or minim
```
js
```
js
var
locale
=
"
zh-CN
"
;
var
locale
=
"
zh-CN
"
;
var
options
=
{
caseFirst
:
false
,
calendar
:
"
chinese
"
,
collation
:
"
pinyin
"
};
var
options
=
{
caseFirst
:
"
false
"
,
calendar
:
"
chinese
"
,
collation
:
"
pinyin
"
};
var
localeObj
=
new
intl
.
Locale
(
locale
,
options
);
var
localeObj
=
new
intl
.
Locale
(
locale
,
options
);
```
```
...
@@ -347,4 +347,4 @@ The following sample is provided to help you better understand how to develop in
...
@@ -347,4 +347,4 @@ The following sample is provided to help you better understand how to develop in
-
[
`International`: Internationalization (JS) (API8)
](
https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International
)
-
[
`International`: Internationalization (JS) (API8)
](
https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International
)
-
[
`International`: Internationalization (
e
TS) (API8) (Full SDK)
](
https://gitee.com/openharmony/applications_app_samples/tree/master/common/International
)
-
[
`International`: Internationalization (
Ark
TS) (API8) (Full SDK)
](
https://gitee.com/openharmony/applications_app_samples/tree/master/common/International
)
en/application-dev/napi/Readme-EN.md
浏览文件 @
7174988c
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
-
[
Raw File Development
](
rawfile-guidelines.md
)
-
[
Raw File Development
](
rawfile-guidelines.md
)
-
[
Native Window Development
](
native-window-guidelines.md
)
-
[
Native Window Development
](
native-window-guidelines.md
)
-
[
Using MindSpore Lite for Model Inference
](
mindspore-lite-guidelines.md
)
-
[
Using MindSpore Lite for Model Inference
](
mindspore-lite-guidelines.md
)
-
[
Connecting the Neural Network Runtime to an AI Inference Framework
](
neural-network-runtime-guidelines.md
)
en/application-dev/napi/figures/neural_network_runtime.png
0 → 100644
浏览文件 @
7174988c
50.6 KB
en/application-dev/napi/neural-network-runtime-guidelines.md
0 → 100644
浏览文件 @
7174988c
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-cooperate.md
浏览文件 @
7174988c
...
@@ -112,6 +112,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
...
@@ -112,6 +112,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
**Example**
**Example**
```
js
```
js
let
sinkDeviceDescriptor
=
"
descriptor
"
;
let
srcInputDeviceId
=
0
;
try
{
try
{
inputDeviceCooperate
.
start
(
sinkDeviceDescriptor
,
srcInputDeviceId
,
(
error
)
=>
{
inputDeviceCooperate
.
start
(
sinkDeviceDescriptor
,
srcInputDeviceId
,
(
error
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -160,6 +162,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
...
@@ -160,6 +162,8 @@ For details about the error codes, see [Screen Hopping Error Codes](../errorcode
**Example**
**Example**
```
js
```
js
let
sinkDeviceDescriptor
=
"
descriptor
"
;
let
srcInputDeviceId
=
0
;
try
{
try
{
inputDeviceCooperate
.
start
(
sinkDeviceDescriptor
,
srcInputDeviceId
).
then
(()
=>
{
inputDeviceCooperate
.
start
(
sinkDeviceDescriptor
,
srcInputDeviceId
).
then
(()
=>
{
console
.
log
(
`Start Keyboard mouse crossing success.`
);
console
.
log
(
`Start Keyboard mouse crossing success.`
);
...
@@ -249,6 +253,7 @@ Checks whether screen hopping is enabled. This API uses an asynchronous callback
...
@@ -249,6 +253,7 @@ Checks whether screen hopping is enabled. This API uses an asynchronous callback
**Example**
**Example**
```
js
```
js
let
deviceDescriptor
=
"
descriptor
"
;
try
{
try
{
inputDeviceCooperate
.
getState
(
deviceDescriptor
,
(
error
,
data
)
=>
{
inputDeviceCooperate
.
getState
(
deviceDescriptor
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -324,7 +329,7 @@ try {
...
@@ -324,7 +329,7 @@ try {
inputDeviceCooperate
.
on
(
'
cooperation
'
,
(
data
)
=>
{
inputDeviceCooperate
.
on
(
'
cooperation
'
,
(
data
)
=>
{
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
data
)}
`
);
});
});
}
catch
(
err
)
{
}
catch
(
err
or
)
{
console
.
log
(
`Register failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
console
.
log
(
`Register failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
}
}
```
```
...
@@ -350,25 +355,25 @@ Disables listening for screen hopping events.
...
@@ -350,25 +355,25 @@ Disables listening for screen hopping events.
```
js
```
js
// Unregister a single callback.
// Unregister a single callback.
callback
:
function
(
event
)
{
function
callback
(
event
)
{
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
event
)}
`
);
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
event
)}
`
);
return
false
;
return
false
;
}
}
try
{
try
{
inputDeviceCooperate
.
on
(
'
cooperation
'
,
this
.
callback
);
inputDeviceCooperate
.
on
(
'
cooperation
'
,
callback
);
inputDeviceCooperate
.
off
(
"
cooperation
"
,
this
.
callback
);
inputDeviceCooperate
.
off
(
"
cooperation
"
,
callback
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
`Execute failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
console
.
log
(
`Execute failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
}
}
```
```
```
js
```
js
// Unregister all callbacks.
// Unregister all callbacks.
callback
:
function
(
event
)
{
function
callback
(
event
)
{
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
event
)}
`
);
console
.
log
(
`Keyboard mouse crossing event:
${
JSON
.
stringify
(
event
)}
`
);
return
false
;
return
false
;
}
}
try
{
try
{
inputDeviceCooperate
.
on
(
'
cooperation
'
,
this
.
callback
);
inputDeviceCooperate
.
on
(
'
cooperation
'
,
callback
);
inputDeviceCooperate
.
off
(
"
cooperation
"
);
inputDeviceCooperate
.
off
(
"
cooperation
"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
`Execute failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
console
.
log
(
`Execute failed, error:
${
JSON
.
stringify
(
error
,
[
`code`
,
`message`
])}
`
);
...
...
en/application-dev/reference/apis/js-apis-inputdevice.md
浏览文件 @
7174988c
...
@@ -197,12 +197,12 @@ Disables listening for hot swap events of an input device.
...
@@ -197,12 +197,12 @@ Disables listening for hot swap events of an input device.
**Example**
**Example**
```
js
```
js
function
callback
(
data
)
{
callback
:
function
(
data
)
{
console
.
log
(
"
type:
"
+
data
.
type
+
"
, deviceId:
"
+
data
.
deviceId
);
console
.
log
(
"
type:
"
+
data
.
type
+
"
, deviceId:
"
+
data
.
deviceId
);
}
}
try
{
try
{
inputDevice
.
on
(
"
change
"
,
callback
);
inputDevice
.
on
(
"
change
"
,
this
.
callback
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
"
oninputdevcie
"
+
error
.
code
+
"
"
+
error
.
message
)
console
.
info
(
"
oninputdevcie
"
+
error
.
code
+
"
"
+
error
.
message
)
}
}
...
@@ -212,7 +212,7 @@ inputDevice.on("change", listener);
...
@@ -212,7 +212,7 @@ inputDevice.on("change", listener);
// Disable this listener.
// Disable this listener.
try
{
try
{
inputDevice
.
off
(
"
change
"
,
callback
);
inputDevice
.
off
(
"
change
"
,
this
.
callback
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
"
offinputdevcie
"
+
error
.
code
+
"
"
+
error
.
message
)
console
.
info
(
"
offinputdevcie
"
+
error
.
code
+
"
"
+
error
.
message
)
}
}
...
@@ -333,7 +333,7 @@ inputDevice.getDevice(1).then((inputDevice)=>{
...
@@ -333,7 +333,7 @@ inputDevice.getDevice(1).then((inputDevice)=>{
## inputDevice.supportKeys<sup>9+</sup>
## inputDevice.supportKeys<sup>9+</sup>
supportKeys(deviceId: number, keys: Array
<
KeyCode
>
, callback:
Callback
<
Array
<
boolean
>>
): void
supportKeys(deviceId: number, keys: Array
<
KeyCode
>
, callback:
AsyncCallback
<
Array
<
boolean
>>
): void
Obtains the key codes supported by the input device. This API uses an asynchronous callback to return the result.
Obtains the key codes supported by the input device. This API uses an asynchronous callback to return the result.
...
@@ -345,7 +345,7 @@ Obtains the key codes supported by the input device. This API uses an asynchrono
...
@@ -345,7 +345,7 @@ Obtains the key codes supported by the input device. This API uses an asynchrono
| -------- | ------------------------------------ | ---- | --------------------------------- |
| -------- | ------------------------------------ | ---- | --------------------------------- |
| deviceId | number | Yes | Unique ID of the input device. If the same physical device is repeatedly inserted and removed, its ID changes.|
| deviceId | number | Yes | Unique ID of the input device. If the same physical device is repeatedly inserted and removed, its ID changes.|
| keys | Array
<
KeyCode
>
| Yes | Key codes to be queried. A maximum of five key codes can be specified. |
| keys | Array
<
KeyCode
>
| Yes | Key codes to be queried. A maximum of five key codes can be specified. |
| callback | Callback
<
Array
<
boolean
>>
| Yes | Callback used to return the result. |
| callback |
Async
Callback
<
Array
<
boolean
>>
| Yes | Callback used to return the result. |
**Example**
**Example**
...
...
en/application-dev/reference/apis/js-apis-update.md
浏览文件 @
7174988c
...
@@ -102,7 +102,7 @@ try {
...
@@ -102,7 +102,7 @@ try {
let
localUpdater
=
update
.
getLocalUpdater
();
let
localUpdater
=
update
.
getLocalUpdater
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`Fail to get localUpdater error:
${
error
}
`
);
console
.
error
(
`Fail to get localUpdater error:
${
error
}
`
);
}
}
;
```
```
## Updater
## Updater
...
@@ -844,7 +844,7 @@ const versionDigestInfo = {
...
@@ -844,7 +844,7 @@ const versionDigestInfo = {
};
};
// Options for clearing errors
// Options for clearing errors
lconste
t
clearOptions
=
{
cons
t
clearOptions
=
{
status
:
update
.
UpgradeStatus
.
UPGRADE_FAIL
,
status
:
update
.
UpgradeStatus
.
UPGRADE_FAIL
,
};
};
updater
.
clearError
(
versionDigestInfo
,
clearOptions
).
then
(()
=>
{
updater
.
clearError
(
versionDigestInfo
,
clearOptions
).
then
(()
=>
{
...
@@ -1248,7 +1248,7 @@ Installs the update package. This API uses a promise to return the result.
...
@@ -1248,7 +1248,7 @@ Installs the update package. This API uses a promise to return the result.
**Example**
**Example**
```
ts
```
ts
localUpdater
upgradeFiles
=
[{
const
upgradeFiles
=
[{
fileType
:
update
.
ComponentType
.
OTA
,
// OTA package
fileType
:
update
.
ComponentType
.
OTA
,
// OTA package
filePath
:
"
path
"
// Path of the local update package
filePath
:
"
path
"
// Path of the local update package
}];
}];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录