Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
02bb224f
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看板
未验证
提交
02bb224f
编写于
9月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!9252 Fix docunment error of ability
Merge pull request !9252 from yuyaozhi/master
上级
31d78074
1daca4b2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
85 addition
and
33 deletion
+85
-33
zh-cn/application-dev/reference/apis/js-apis-Context.md
zh-cn/application-dev/reference/apis/js-apis-Context.md
+47
-0
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
...application-dev/reference/apis/js-apis-ability-context.md
+0
-2
zh-cn/application-dev/reference/apis/js-apis-application-Want.md
...pplication-dev/reference/apis/js-apis-application-Want.md
+3
-2
zh-cn/application-dev/reference/apis/js-apis-application-ability.md
...ication-dev/reference/apis/js-apis-application-ability.md
+1
-2
zh-cn/application-dev/reference/apis/js-apis-application-abilitystage.md
...on-dev/reference/apis/js-apis-application-abilitystage.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
+31
-16
zh-cn/application-dev/reference/apis/js-apis-errorManager.md
zh-cn/application-dev/reference/apis/js-apis-errorManager.md
+1
-9
zh-cn/application-dev/reference/apis/js-apis-formInfo.md
zh-cn/application-dev/reference/apis/js-apis-formInfo.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-Context.md
浏览文件 @
02bb224f
...
...
@@ -381,6 +381,53 @@ context.getDisplayOrientation().then((data) => {
});
```
## Context.getExternalCacheDir
getExternalCacheDir(callback: AsyncCallback
\<
string>): void
获取应用程序的外部缓存目录(callback形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| -------- | ---------------------- | ---- | ------------------ |
| callback | AsyncCallback
\<
string> | 是 | 返回应用程序的缓存目录的绝对路径。 |
**示例:**
```
js
import
featureAbility
from
'
@ohos.ability.featureAbility
'
var
context
=
featureAbility
.
getContext
();
context
.
getExternalCacheDir
()
```
## Context.getExternalCacheDir
getExternalCacheDir(): Promise
\<
string>;
获取应用程序的外部缓存目录(Promise形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ---------------- | ---------------- |
| Promise
\<
string> | 返回应用程序的缓存目录的绝对路径。 |
**示例:**
```
js
import
featureAbility
from
'
@ohos.ability.featureAbility
'
var
context
=
featureAbility
.
getContext
();
context
.
getExternalCacheDir
().
then
((
data
)
=>
{
console
.
info
(
"
=======================>getExternalCacheDirCallback====================>
"
);
console
.
info
(
"
====>data====>
"
+
JSON
.
stringify
(
data
));
});
```
## Context.setDisplayOrientation<sup>7+</sup>
setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback
\<
void>): void
...
...
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
浏览文件 @
02bb224f
...
...
@@ -892,8 +892,6 @@ startAbilityByCall(want: Want): Promise<Caller>;
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-application-Want.md
浏览文件 @
02bb224f
...
...
@@ -49,6 +49,7 @@ import Want from '@ohos.application.Want';
-
传递FD数据,FD表示文件描述符(FileDescriptor)
```
js
import
fileio
from
'
@ohos.fileio
'
;
var
fd
;
try
{
fd
=
fileio
.
openSync
(
"
/data/storage/el2/base/haps/pic.png
"
);
...
...
@@ -59,9 +60,9 @@ import Want from '@ohos.application.Want';
"
deviceId
"
:
""
,
// deviceId为空表示本设备
"
bundleName
"
:
"
com.extreme.test
"
,
"
abilityName
"
:
"
MainAbility
"
,
"
moduleName
"
:
"
entry
"
// moduleName非必选
"
moduleName
"
:
"
entry
"
,
// moduleName非必选
"
parameters
"
:
{
"
keyFd
"
:{
"
type
"
:
"
FD
"
,
"
value
"
:
fd
}
"
keyFd
"
:{
"
type
"
:
"
FD
"
,
"
value
"
:
fd
}
}
};
this
.
context
.
startAbility
(
want
,
(
error
)
=>
{
...
...
zh-cn/application-dev/reference/apis/js-apis-application-ability.md
浏览文件 @
02bb224f
...
...
@@ -643,9 +643,8 @@ off(method: string): void;
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| (msg: string) | function | 是 | 否 | 调用者注册的侦听器函数接口的原型。 |
## CalleeCallBack
## CalleeCallBack
(indata: rpc.MessageParcel): rpc.Sequenceable;
...
...
zh-cn/application-dev/reference/apis/js-apis-application-abilitystage.md
浏览文件 @
02bb224f
...
...
@@ -96,7 +96,7 @@ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
当系统已决定调整内存时调用。例如,当该功能在后台运行时,没有足够的内存来运行尽可能多的后台进程时可以使用。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**系统能力**
:SystemCapability.Ability.AbilityRuntime.
Ability
Core
**参数:**
...
...
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
浏览文件 @
02bb224f
...
...
@@ -185,14 +185,12 @@ getProcessRunningInfos(): Promise\<Array\<ProcessRunningInfo>>;
## appManager.getProcessRunningInfos<sup>(deprecated)</sup>
> **说明:**
>
> 从 API Version 9 开始废弃,建议使用[appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9-1)替代。
getProcessRunningInfos(callback: AsyncCallback
\<
Array
\<
ProcessRunningInfo>>): void;
获取有关运行进程的信息。
> 从 API Version 9 开始废弃,建议使用[appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9-1)替代。
**需要权限**
:ohos.permission.GET_RUNNING_INFO
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
...
...
@@ -706,9 +704,14 @@ onForegroundApplicationChanged(appStateData: AppStateData): void;
**示例:**
```
js
import
ApplicationStateObserver
from
'
@ohos.application.ApplicationStateObserver
'
const
foregroundApplicationInfo
=
ApplicationStateObserver
.
onForegroundApplicationChanged
();
console
.
log
(
'
-------- foregroundApplicationInfo: ---------
'
,
foregroundApplicationInfo
);
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
console
.
log
(
'
-------- observerCode: ---------
'
,
observerCode
);
```
## ApplicationStateObserver.onAbilityStateChanged<sup>8+</sup>
...
...
@@ -730,9 +733,13 @@ onAbilityStateChanged(abilityStateData: AbilityStateData): void;
**示例:**
```
js
import
ApplicationStateObserver
from
'
@ohos.application.ApplicationStateObserver
'
const
abilityStateChangedInfo
=
ApplicationStateObserver
.
onAbilityStateChanged
();
console
.
log
(
'
-------- abilityStateChangedInfo: ---------
'
,
abilityStateChangedInfo
);
var
applicationStateObserver
=
{
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
console
.
log
(
'
-------- observerCode: ---------
'
,
observerCode
);
```
## ApplicationStateObserver.onProcessCreated<sup>8+</sup>
...
...
@@ -754,9 +761,13 @@ onProcessCreated(processData: ProcessData): void;
**示例:**
```
js
import
ApplicationStateObserver
from
'
@ohos.application.ApplicationStateObserver
'
const
processCreatedInfo
=
ApplicationStateObserver
.
onProcessCreated
();
console
.
log
(
'
-------- processCreatedInfo: ---------
'
,
processCreatedInfo
);
var
applicationStateObserver
=
{
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
console
.
log
(
'
-------- observerCode: ---------
'
,
observerCode
);
```
## ApplicationStateObserver.onProcessDied<sup>8+</sup>
...
...
@@ -778,9 +789,13 @@ onProcessDied(processData: ProcessData): void;
**示例:**
```
js
import
ApplicationStateObserver
from
'
@ohos.application.ApplicationStateObserver
'
const
processDiedInfo
=
ApplicationStateObserver
.
onProcessDied
();
console
.
log
(
'
-------- processDiedInfo: ---------
'
,
processDiedInfo
);
var
applicationStateObserver
=
{
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
console
.
log
(
'
-------- observerCode: ---------
'
,
observerCode
);
```
## AppStateData
...
...
zh-cn/application-dev/reference/apis/js-apis-errorManager.md
浏览文件 @
02bb224f
...
...
@@ -33,8 +33,7 @@ var observer = {
console
.
log
(
'
onUnhandledException, errorMsg:
'
,
errorMsg
)
}
}
const
registerErrorObserverNumber
=
errorManager
.
registerErrorObserver
(
observer
)
console
.
info
(
registerErrorObserverNumber
)
errorManager
.
registerErrorObserver
(
observer
)
```
## ErrorManager.unregisterErrorObserver
...
...
@@ -123,11 +122,4 @@ var observer = {
}
}
errorManager
.
registerErrorObserver
(
observer
)
.
then
((
data
)
=>
{
console
.
log
(
'
----------- registerErrorObserver success ----------
'
,
data
);
})
.
catch
((
err
)
=>
{
console
.
log
(
'
----------- registerErrorObserver fail ----------
'
,
err
);
})
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-formInfo.md
浏览文件 @
02bb224f
...
...
@@ -105,7 +105,7 @@ import formInfo from '@ohos.application.formInfo';
| TEMPORARY_KEY | "ohos.extra.param.key.form_temporary" | 临时卡片。 |
| ABILITY_NAME_KEY
<sup>
9+
</sup>
| "ohos.extra.param.key.ability_name" | ability名称 |
| DEVICE_ID_KEY
<sup>
9+
</sup>
| "ohos.extra.param.key.device_id" | 设备标识。
<br/>
此接口为系统接口。 |
| BUNDLE_NAME_KEY
<sup>
9+
</sup>
| "ohos.extra.param.key.bundle_name" | 指示指定要获取的捆绑包名称的键。
<br/>
此接口为系统接口。
|
| BUNDLE_NAME_KEY
<sup>
9+
</sup>
| "ohos.extra.param.key.bundle_name" | 指示指定要获取的捆绑包名称的键。|
## FormDimension
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录