Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7c354f0f
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看板
未验证
提交
7c354f0f
编写于
9月 06, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 06, 2023
浏览文件
操作
浏览文件
下载
差异文件
!24166 示例代码整改,输入法、上传下载部分
Merge pull request !24166 from guojin31/master
上级
321308f6
e67918ce
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
360 addition
and
378 deletion
+360
-378
zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-context.md
...v/reference/apis/js-apis-inputmethod-extension-context.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
+36
-36
zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
...plication-dev/reference/apis/js-apis-inputmethodengine.md
+60
-60
zh-cn/application-dev/reference/apis/js-apis-request.md
zh-cn/application-dev/reference/apis/js-apis-request.md
+262
-280
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-inputmethod-extension-context.md
浏览文件 @
7c354f0f
...
@@ -43,7 +43,7 @@ destroy(callback: AsyncCallback\<void>): void
...
@@ -43,7 +43,7 @@ destroy(callback: AsyncCallback\<void>): void
**示例:**
**示例:**
```
ts
```
ts
this
.
context
.
destroy
((
err
:
Error
)
=>
{
this
.
context
.
destroy
((
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
'
Failed to destroy context.
'
);
console
.
log
(
'
Failed to destroy context.
'
);
return
;
return
;
...
@@ -71,7 +71,7 @@ destroy(): Promise\<void>;
...
@@ -71,7 +71,7 @@ destroy(): Promise\<void>;
```
ts
```
ts
this
.
context
.
destroy
().
then
(()
=>
{
this
.
context
.
destroy
().
then
(()
=>
{
console
.
log
(
'
Succeed in destroying context.
'
);
console
.
log
(
'
Succeed in destroying context.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
log
(
'
Failed to destroy context.
'
);
console
.
log
(
'
Failed to destroy context.
'
);
});
});
```
```
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
浏览文件 @
7c354f0f
...
@@ -128,7 +128,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolea
...
@@ -128,7 +128,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback<boolea
```
ts
```
ts
let
currentIme
=
inputMethod
.
getCurrentInputMethod
();
let
currentIme
=
inputMethod
.
getCurrentInputMethod
();
try
{
try
{
inputMethod
.
switchInputMethod
(
currentIme
,
(
err
:
Error
,
result
:
boolean
)
=>
{
inputMethod
.
switchInputMethod
(
currentIme
,
(
err
:
Business
Error
,
result
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to switchInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -184,7 +184,7 @@ try {
...
@@ -184,7 +184,7 @@ try {
}
else
{
}
else
{
console
.
error
(
'
Failed to switchInputMethod.
'
);
console
.
error
(
'
Failed to switchInputMethod.
'
);
}
}
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to switchInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -257,7 +257,7 @@ try {
...
@@ -257,7 +257,7 @@ try {
icon
:
""
,
icon
:
""
,
iconId
:
0
,
iconId
:
0
,
extra
:
extra
extra
:
extra
},
(
err
:
Error
,
result
:
boolean
)
=>
{
},
(
err
:
Business
Error
,
result
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to switchCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -329,7 +329,7 @@ try {
...
@@ -329,7 +329,7 @@ try {
}
else
{
}
else
{
console
.
error
(
'
Failed to switchCurrentInputMethodSubtype.
'
);
console
.
error
(
'
Failed to switchCurrentInputMethodSubtype.
'
);
}
}
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to switchCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -390,7 +390,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
...
@@ -390,7 +390,7 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
let
currentIme
=
inputMethod
.
getCurrentInputMethod
();
let
currentIme
=
inputMethod
.
getCurrentInputMethod
();
let
imSubType
=
inputMethod
.
getCurrentInputMethodSubtype
();
let
imSubType
=
inputMethod
.
getCurrentInputMethodSubtype
();
try
{
try
{
inputMethod
.
switchCurrentInputMethodAndSubtype
(
currentIme
,
imSubType
,
(
err
:
Error
,
result
:
boolean
)
=>
{
inputMethod
.
switchCurrentInputMethodAndSubtype
(
currentIme
,
imSubType
,
(
err
:
Business
Error
,
result
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to switchCurrentInputMethodAndSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchCurrentInputMethodAndSubtype:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -450,7 +450,7 @@ try {
...
@@ -450,7 +450,7 @@ try {
}
else
{
}
else
{
console
.
error
(
'
Failed to switchCurrentInputMethodAndSubtype.
'
);
console
.
error
(
'
Failed to switchCurrentInputMethodAndSubtype.
'
);
}
}
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to switchCurrentInputMethodAndSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to switchCurrentInputMethodAndSubtype:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -704,7 +704,7 @@ try {
...
@@ -704,7 +704,7 @@ try {
enterKeyType
:
1
enterKeyType
:
1
}
}
};
};
inputMethodController
.
attach
(
true
,
textConfig
,
(
err
:
Error
)
=>
{
inputMethodController
.
attach
(
true
,
textConfig
,
(
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to attach:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to attach:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -762,7 +762,7 @@ try {
...
@@ -762,7 +762,7 @@ try {
};
};
inputMethodController
.
attach
(
true
,
textConfig
).
then
(()
=>
{
inputMethodController
.
attach
(
true
,
textConfig
).
then
(()
=>
{
console
.
log
(
'
Succeeded in attaching inputMethod.
'
);
console
.
log
(
'
Succeeded in attaching inputMethod.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to attach:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to attach:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -801,7 +801,7 @@ showTextInput(callback: AsyncCallback<void>): void
...
@@ -801,7 +801,7 @@ showTextInput(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
showTextInput
((
err
:
Error
)
=>
{
inputMethodController
.
showTextInput
((
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to showTextInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to showTextInput:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -843,7 +843,7 @@ showTextInput(): Promise<void>
...
@@ -843,7 +843,7 @@ showTextInput(): Promise<void>
```
ts
```
ts
inputMethodController
.
showTextInput
().
then
(()
=>
{
inputMethodController
.
showTextInput
().
then
(()
=>
{
console
.
log
(
'
Succeeded in showing text input.
'
);
console
.
log
(
'
Succeeded in showing text input.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to showTextInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to showTextInput:
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -881,7 +881,7 @@ hideTextInput(callback: AsyncCallback<void>): void
...
@@ -881,7 +881,7 @@ hideTextInput(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
hideTextInput
((
err
:
Error
)
=>
{
inputMethodController
.
hideTextInput
((
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to hideTextInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to hideTextInput:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -925,7 +925,7 @@ hideTextInput(): Promise<void>
...
@@ -925,7 +925,7 @@ hideTextInput(): Promise<void>
```
ts
```
ts
inputMethodController
.
hideTextInput
().
then
(()
=>
{
inputMethodController
.
hideTextInput
().
then
(()
=>
{
console
.
log
(
'
Succeeded in hiding inputMethod.
'
);
console
.
log
(
'
Succeeded in hiding inputMethod.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to hideTextInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to hideTextInput:
${
JSON
.
stringify
(
err
)}
`
);
})
})
```
```
...
@@ -956,7 +956,7 @@ detach(callback: AsyncCallback<void>): void
...
@@ -956,7 +956,7 @@ detach(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
detach
((
err
:
Error
)
=>
{
inputMethodController
.
detach
((
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to detach:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to detach:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -993,7 +993,7 @@ detach(): Promise<void>
...
@@ -993,7 +993,7 @@ detach(): Promise<void>
```
ts
```
ts
inputMethodController
.
detach
().
then
(()
=>
{
inputMethodController
.
detach
().
then
(()
=>
{
console
.
log
(
'
Succeeded in detaching inputMethod.
'
);
console
.
log
(
'
Succeeded in detaching inputMethod.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to detach:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to detach:
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -1032,7 +1032,7 @@ setCallingWindow(windowId: number, callback: AsyncCallback<void>): void
...
@@ -1032,7 +1032,7 @@ setCallingWindow(windowId: number, callback: AsyncCallback<void>): void
```
ts
```
ts
try
{
try
{
let
windowId
:
number
=
2000
;
let
windowId
:
number
=
2000
;
inputMethodController
.
setCallingWindow
(
windowId
,
(
err
:
Error
)
=>
{
inputMethodController
.
setCallingWindow
(
windowId
,
(
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to setCallingWindow:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to setCallingWindow:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1085,7 +1085,7 @@ try {
...
@@ -1085,7 +1085,7 @@ try {
let
windowId
:
number
=
2000
;
let
windowId
:
number
=
2000
;
inputMethodController
.
setCallingWindow
(
windowId
).
then
(()
=>
{
inputMethodController
.
setCallingWindow
(
windowId
).
then
(()
=>
{
console
.
log
(
'
Succeeded in setting callingWindow.
'
);
console
.
log
(
'
Succeeded in setting callingWindow.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to setCallingWindow:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to setCallingWindow:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -1123,7 +1123,7 @@ updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback<void>): void
...
@@ -1123,7 +1123,7 @@ updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback<void>): void
```
ts
```
ts
try
{
try
{
let
cursorInfo
:
inputMethod
.
CursorInfo
=
{
left
:
0
,
top
:
0
,
width
:
600
,
height
:
800
};
let
cursorInfo
:
inputMethod
.
CursorInfo
=
{
left
:
0
,
top
:
0
,
width
:
600
,
height
:
800
};
inputMethodController
.
updateCursor
(
cursorInfo
,
(
err
:
Error
)
=>
{
inputMethodController
.
updateCursor
(
cursorInfo
,
(
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to updateCursor:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to updateCursor:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1172,7 +1172,7 @@ try {
...
@@ -1172,7 +1172,7 @@ try {
let
cursorInfo
:
inputMethod
.
CursorInfo
=
{
left
:
0
,
top
:
0
,
width
:
600
,
height
:
800
};
let
cursorInfo
:
inputMethod
.
CursorInfo
=
{
left
:
0
,
top
:
0
,
width
:
600
,
height
:
800
};
inputMethodController
.
updateCursor
(
cursorInfo
).
then
(()
=>
{
inputMethodController
.
updateCursor
(
cursorInfo
).
then
(()
=>
{
console
.
log
(
'
Succeeded in updating cursorInfo.
'
);
console
.
log
(
'
Succeeded in updating cursorInfo.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to updateCursor:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to updateCursor:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -1211,7 +1211,7 @@ changeSelection(text: string, start: number, end: number, callback: AsyncCallbac
...
@@ -1211,7 +1211,7 @@ changeSelection(text: string, start: number, end: number, callback: AsyncCallbac
```
ts
```
ts
try
{
try
{
inputMethodController
.
changeSelection
(
'
text
'
,
0
,
5
,
(
err
:
Error
)
=>
{
inputMethodController
.
changeSelection
(
'
text
'
,
0
,
5
,
(
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to changeSelection:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to changeSelection:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1261,7 +1261,7 @@ changeSelection(text: string, start: number, end: number): Promise<void>
...
@@ -1261,7 +1261,7 @@ changeSelection(text: string, start: number, end: number): Promise<void>
try
{
try
{
inputMethodController
.
changeSelection
(
'
test
'
,
0
,
5
).
then
(()
=>
{
inputMethodController
.
changeSelection
(
'
test
'
,
0
,
5
).
then
(()
=>
{
console
.
log
(
'
Succeeded in changing selection.
'
);
console
.
log
(
'
Succeeded in changing selection.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to changeSelection:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to changeSelection:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -1299,7 +1299,7 @@ updateAttribute(attribute: InputAttribute, callback: AsyncCallback<void>):
...
@@ -1299,7 +1299,7 @@ updateAttribute(attribute: InputAttribute, callback: AsyncCallback<void>):
```
ts
```
ts
try
{
try
{
let
inputAttribute
:
inputMethod
.
InputAttribute
=
{
textInputType
:
0
,
enterKeyType
:
1
};
let
inputAttribute
:
inputMethod
.
InputAttribute
=
{
textInputType
:
0
,
enterKeyType
:
1
};
inputMethodController
.
updateAttribute
(
inputAttribute
,
(
err
:
Error
)
=>
{
inputMethodController
.
updateAttribute
(
inputAttribute
,
(
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to updateAttribute:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to updateAttribute:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1348,7 +1348,7 @@ try {
...
@@ -1348,7 +1348,7 @@ try {
let
inputAttribute
:
inputMethod
.
InputAttribute
=
{
textInputType
:
0
,
enterKeyType
:
1
};
let
inputAttribute
:
inputMethod
.
InputAttribute
=
{
textInputType
:
0
,
enterKeyType
:
1
};
inputMethodController
.
updateAttribute
(
inputAttribute
).
then
(()
=>
{
inputMethodController
.
updateAttribute
(
inputAttribute
).
then
(()
=>
{
console
.
log
(
'
Succeeded in updating attribute.
'
);
console
.
log
(
'
Succeeded in updating attribute.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to updateAttribute:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to updateAttribute:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -1387,7 +1387,7 @@ stopInputSession(callback: AsyncCallback<boolean>): void
...
@@ -1387,7 +1387,7 @@ stopInputSession(callback: AsyncCallback<boolean>): void
```
ts
```
ts
try
{
try
{
inputMethodController
.
stopInputSession
((
err
:
Error
,
result
:
boolean
)
=>
{
inputMethodController
.
stopInputSession
((
err
:
Business
Error
,
result
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to stopInputSession:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to stopInputSession:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1440,7 +1440,7 @@ try {
...
@@ -1440,7 +1440,7 @@ try {
}
else
{
}
else
{
console
.
error
(
'
Failed to stopInputSession.
'
);
console
.
error
(
'
Failed to stopInputSession.
'
);
}
}
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to stopInputSession:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to stopInputSession:
${
JSON
.
stringify
(
err
)}
`
);
})
})
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -1480,7 +1480,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): void
...
@@ -1480,7 +1480,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
showSoftKeyboard
((
err
:
Error
)
=>
{
inputMethodController
.
showSoftKeyboard
((
err
:
Business
Error
)
=>
{
if
(
!
err
)
{
if
(
!
err
)
{
console
.
log
(
'
Succeeded in showing softKeyboard.
'
);
console
.
log
(
'
Succeeded in showing softKeyboard.
'
);
}
else
{
}
else
{
...
@@ -1523,7 +1523,7 @@ showSoftKeyboard(): Promise<void>
...
@@ -1523,7 +1523,7 @@ showSoftKeyboard(): Promise<void>
```
ts
```
ts
inputMethodController
.
showSoftKeyboard
().
then
(()
=>
{
inputMethodController
.
showSoftKeyboard
().
then
(()
=>
{
console
.
log
(
'
Succeeded in showing softKeyboard.
'
);
console
.
log
(
'
Succeeded in showing softKeyboard.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to show softKeyboard:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to show softKeyboard:
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -1560,7 +1560,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void
...
@@ -1560,7 +1560,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
hideSoftKeyboard
((
err
:
Error
)
=>
{
inputMethodController
.
hideSoftKeyboard
((
err
:
Business
Error
)
=>
{
if
(
!
err
)
{
if
(
!
err
)
{
console
.
log
(
'
Succeeded in hiding softKeyboard.
'
);
console
.
log
(
'
Succeeded in hiding softKeyboard.
'
);
}
else
{
}
else
{
...
@@ -1603,7 +1603,7 @@ hideSoftKeyboard(): Promise<void>
...
@@ -1603,7 +1603,7 @@ hideSoftKeyboard(): Promise<void>
```
ts
```
ts
inputMethodController
.
hideSoftKeyboard
().
then
(()
=>
{
inputMethodController
.
hideSoftKeyboard
().
then
(()
=>
{
console
.
log
(
'
Succeeded in hiding softKeyboard.
'
);
console
.
log
(
'
Succeeded in hiding softKeyboard.
'
);
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to hide softKeyboard:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to hide softKeyboard:
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -1631,7 +1631,7 @@ stopInput(callback: AsyncCallback<boolean>): void
...
@@ -1631,7 +1631,7 @@ stopInput(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodController
.
stopInput
((
err
:
Error
,
result
:
boolean
)
=>
{
inputMethodController
.
stopInput
((
err
:
Business
Error
,
result
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to stopInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to stopInput:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -1673,7 +1673,7 @@ inputMethodController.stopInput().then((result: boolean) => {
...
@@ -1673,7 +1673,7 @@ inputMethodController.stopInput().then((result: boolean) => {
}
else
{
}
else
{
console
.
error
(
'
Failed to stopInput.
'
);
console
.
error
(
'
Failed to stopInput.
'
);
}
}
}).
catch
((
err
:
Error
)
=>
{
}).
catch
((
err
:
Business
Error
)
=>
{
console
.
error
(
`Failed to stopInput:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to stopInput:
${
JSON
.
stringify
(
err
)}
`
);
})
})
```
```
...
@@ -2577,7 +2577,7 @@ let inputMethodProperty: inputMethod.InputMethodProperty = {
...
@@ -2577,7 +2577,7 @@ let inputMethodProperty: inputMethod.InputMethodProperty = {
id
:
'
propertyId
'
,
id
:
'
propertyId
'
,
}
}
try
{
try
{
inputMethodSetting
.
listInputMethodSubtype
(
inputMethodProperty
,
(
err
:
Error
,
data
:
Array
<
InputMethodSubtype
>
)
=>
{
inputMethodSetting
.
listInputMethodSubtype
(
inputMethodProperty
,
(
err
:
Business
Error
,
data
:
Array
<
InputMethodSubtype
>
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to listInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to listInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -2665,7 +2665,7 @@ listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSub
...
@@ -2665,7 +2665,7 @@ listCurrentInputMethodSubtype(callback: AsyncCallback<Array<InputMethodSub
```
ts
```
ts
try
{
try
{
inputMethodSetting
.
listCurrentInputMethodSubtype
((
err
:
Error
,
data
:
Array
<
InputMethodSubtype
>
)
=>
{
inputMethodSetting
.
listCurrentInputMethodSubtype
((
err
:
Business
Error
,
data
:
Array
<
InputMethodSubtype
>
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to listCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to listCurrentInputMethodSubtype:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -2748,7 +2748,7 @@ getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethod
...
@@ -2748,7 +2748,7 @@ getInputMethods(enable: boolean, callback: AsyncCallback<Array<InputMethod
```
ts
```
ts
try
{
try
{
inputMethodSetting
.
getInputMethods
(
true
,
(
err
:
Error
,
data
:
Array
<
inputMethod
.
InputMethodProperty
>
)
=>
{
inputMethodSetting
.
getInputMethods
(
true
,
(
err
:
Business
Error
,
data
:
Array
<
inputMethod
.
InputMethodProperty
>
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to getInputMethods:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to getInputMethods:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -2835,7 +2835,7 @@ showOptionalInputMethods(callback: AsyncCallback<boolean>): void
...
@@ -2835,7 +2835,7 @@ showOptionalInputMethods(callback: AsyncCallback<boolean>): void
```
ts
```
ts
try
{
try
{
inputMethodSetting
.
showOptionalInputMethods
((
err
:
Error
,
data
:
boolean
)
=>
{
inputMethodSetting
.
showOptionalInputMethods
((
err
:
Business
Error
,
data
:
boolean
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to showOptionalInputMethods:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to showOptionalInputMethods:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -2900,7 +2900,7 @@ listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>)
...
@@ -2900,7 +2900,7 @@ listInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>)
**示例:**
**示例:**
```
ts
```
ts
inputMethodSetting
.
listInputMethod
((
err
:
Error
,
data
:
Array
<
inputMethod
.
InputMethodProperty
>
)
=>
{
inputMethodSetting
.
listInputMethod
((
err
:
Business
Error
,
data
:
Array
<
inputMethod
.
InputMethodProperty
>
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to listInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to listInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
@@ -2958,7 +2958,7 @@ displayOptionalInputMethod(callback: AsyncCallback<void>): void
...
@@ -2958,7 +2958,7 @@ displayOptionalInputMethod(callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
inputMethodSetting
.
displayOptionalInputMethod
((
err
:
Error
)
=>
{
inputMethodSetting
.
displayOptionalInputMethod
((
err
:
Business
Error
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to displayOptionalInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`Failed to displayOptionalInputMethod:
${
JSON
.
stringify
(
err
)}
`
);
return
;
return
;
...
...
zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md
浏览文件 @
7c354f0f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-request.md
浏览文件 @
7c354f0f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录