Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
29f81f08
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看板
未验证
提交
29f81f08
编写于
9月 06, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 06, 2023
浏览文件
操作
浏览文件
下载
差异文件
!24167 ArkTS适配
Merge pull request !24167 from duyufan/dyf0907
上级
c7fa17e2
e6a36f6c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
1 deletion
+10
-1
zh-cn/application-dev/reference/apis/js-apis-devicestatus-cooperate.md
...tion-dev/reference/apis/js-apis-devicestatus-cooperate.md
+10
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-devicestatus-cooperate.md
浏览文件 @
29f81f08
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
```
ts
```
ts
import
cooperate
from
'
@ohos.cooperate
'
import
cooperate
from
'
@ohos.cooperate
'
import
BusinessError
from
'
@ohos.base
'
```
```
## cooperate.prepare
## cooperate.prepare
...
@@ -32,6 +31,7 @@ prepare(callback: AsyncCallback<void>): void;
...
@@ -32,6 +31,7 @@ prepare(callback: AsyncCallback<void>): void;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
prepare
((
error
:
BusinessError
)
=>
{
cooperate
.
prepare
((
error
:
BusinessError
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -64,6 +64,7 @@ prepare(): Promise<void>
...
@@ -64,6 +64,7 @@ prepare(): Promise<void>
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
prepare
().
then
(()
=>
{
cooperate
.
prepare
().
then
(()
=>
{
console
.
log
(
`Keyboard mouse crossing prepare success.`
);
console
.
log
(
`Keyboard mouse crossing prepare success.`
);
...
@@ -91,6 +92,7 @@ unprepare(callback: AsyncCallback<void>): void;
...
@@ -91,6 +92,7 @@ unprepare(callback: AsyncCallback<void>): void;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
unprepare
((
error
:
BusinessError
)
=>
{
cooperate
.
unprepare
((
error
:
BusinessError
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -119,6 +121,7 @@ unprepare(): Promise<void>;
...
@@ -119,6 +121,7 @@ unprepare(): Promise<void>;
| Promise
<
void
>
| 无返回结果的Promise对象。 |
| Promise
<
void
>
| 无返回结果的Promise对象。 |
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
unprepare
().
then
(()
=>
{
cooperate
.
unprepare
().
then
(()
=>
{
console
.
log
(
`Keyboard mouse crossing unprepare success.`
);
console
.
log
(
`Keyboard mouse crossing unprepare success.`
);
...
@@ -158,6 +161,7 @@ activate(targetNetworkId: string, inputDeviceId: number, callback: AsyncCallback
...
@@ -158,6 +161,7 @@ activate(targetNetworkId: string, inputDeviceId: number, callback: AsyncCallback
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
let
targetNetworkId
=
"
networkId
"
;
let
targetNetworkId
=
"
networkId
"
;
let
inputDeviceId
=
0
;
let
inputDeviceId
=
0
;
try
{
try
{
...
@@ -207,6 +211,7 @@ activate(targetNetworkId: string, inputDeviceId: number): Promise<void>;
...
@@ -207,6 +211,7 @@ activate(targetNetworkId: string, inputDeviceId: number): Promise<void>;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
let
targetNetworkId
=
"
networkId
"
;
let
targetNetworkId
=
"
networkId
"
;
let
inputDeviceId
=
0
;
let
inputDeviceId
=
0
;
try
{
try
{
...
@@ -240,6 +245,7 @@ deactivate(isUnchained: boolean, callback: AsyncCallback<void>): void;
...
@@ -240,6 +245,7 @@ deactivate(isUnchained: boolean, callback: AsyncCallback<void>): void;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
deactivate
(
false
,
(
error
:
BusinessError
)
=>
{
cooperate
.
deactivate
(
false
,
(
error
:
BusinessError
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -280,6 +286,7 @@ deactivate(isUnchained: boolean): Promise<void>;
...
@@ -280,6 +286,7 @@ deactivate(isUnchained: boolean): Promise<void>;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
try
{
try
{
cooperate
.
deactivate
(
false
).
then
(()
=>
{
cooperate
.
deactivate
(
false
).
then
(()
=>
{
console
.
log
(
`Stop Keyboard mouse crossing success.`
);
console
.
log
(
`Stop Keyboard mouse crossing success.`
);
...
@@ -309,6 +316,7 @@ getCrossingSwitchState(networkId: string, callback: AsyncCallback<boolean>
...
@@ -309,6 +316,7 @@ getCrossingSwitchState(networkId: string, callback: AsyncCallback<boolean>
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
let
deviceDescriptor
=
"
networkId
"
;
let
deviceDescriptor
=
"
networkId
"
;
try
{
try
{
cooperate
.
getCrossingSwitchState
(
deviceDescriptor
,
(
error
:
BusinessError
,
data
:
boolean
)
=>
{
cooperate
.
getCrossingSwitchState
(
deviceDescriptor
,
(
error
:
BusinessError
,
data
:
boolean
)
=>
{
...
@@ -350,6 +358,7 @@ getCrossingSwitchState(networkId: string): Promise<boolean>;
...
@@ -350,6 +358,7 @@ getCrossingSwitchState(networkId: string): Promise<boolean>;
**示例**
:
**示例**
:
```
ts
```
ts
import
BusinessError
from
'
@ohos.base
'
;
let
deviceDescriptor
=
"
networkId
"
;
let
deviceDescriptor
=
"
networkId
"
;
try
{
try
{
cooperate
.
getCrossingSwitchState
(
deviceDescriptor
).
then
((
data
:
boolean
)
=>
{
cooperate
.
getCrossingSwitchState
(
deviceDescriptor
).
then
((
data
:
boolean
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录