未验证 提交 53bfbf5d 编写于 作者: O openharmony_ci 提交者: Gitee

!11582 【仅文档格式规范问题修改】API文档接口一致性规范整改

Merge pull request !11582 from maoziduanl/master
......@@ -39,6 +39,7 @@ getResourceManager(callback: AsyncCallback<ResourceManager>): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------------------- |
| callback | AsyncCallback<[ResourceManager](#resourcemanager)> | 是 | callback方式返回ResourceManager对象 |
......@@ -72,6 +73,7 @@ getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManage
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------- | ---- | ----------------------------- |
| bundleName | string | 是 | 指定应用的Bundle名称 |
......@@ -126,6 +128,7 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---- | ------------- |
| bundleName | string | 是 | 指定应用的Bundle名称 |
......@@ -149,7 +152,7 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
**系统能力**:SystemCapability.Global.ResourceManager
| 名称 | 默认值 | 说明 |
| 名称 | 值 | 说明 |
| -------------------- | ---- | ---- |
| DIRECTION_VERTICAL | 0 | 竖屏 |
| DIRECTION_HORIZONTAL | 1 | 横屏 |
......@@ -161,7 +164,7 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
**系统能力**:SystemCapability.Global.ResourceManager
| 名称 | 默认值 | 说明 |
| 名称 | 值 | 说明 |
| -------------------- | ---- | ---- |
| DEVICE_TYPE_PHONE | 0x00 | 手机 |
| DEVICE_TYPE_TABLET | 0x01 | 平板 |
......@@ -177,7 +180,7 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
**系统能力**:SystemCapability.Global.ResourceManager
| 名称 | 默认值 | 说明 |
| 名称 | 值 | 说明 |
| -------------- | ---- | ---------- |
| SCREEN_SDPI | 120 | 小规模的屏幕密度 |
| SCREEN_MDPI | 160 | 中规模的屏幕密度 |
......@@ -193,8 +196,9 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| --------- | ----------------------- | ---- | ---- | -------- |
| direction | [Direction](#direction) | 是 | 否 | 当前设备屏幕方向 |
| locale | string | 是 | 否 | 当前系统语言 |
......@@ -216,8 +220,9 @@ resourceManager.getResourceManager((error, mgr) => {
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------- | ------------------------------- | ---- | ---- | -------- |
| screenDensity | [ScreenDensity](#screendensity) | 是 | 否 | 当前设备屏幕密度 |
| deviceType | [DeviceType](#devicetype) | 是 | 否 | 当前设备类型 |
......@@ -239,11 +244,13 @@ resourceManager.getResourceManager((error, mgr) => {
**系统能力:** SystemCapability.Global.ResourceManager
| 名称 | 类型 | 说明 |
| ------ | ------ | ------------------ |
| fd | number | rawfile的descriptor |
| offset | number | rawfile的起始偏移量 |
| length | number | rawfile的文件长度 |
**参数:**
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------ | ------ | ---- | ---- | ------------------ |
| fd | number | 是 | 否 | rawfile的descriptor |
| offset | number | 是 | 否 | rawfile的起始偏移量 |
| length | number | 是 | 否 | rawfile的文件长度 |
## Resource<sup>9+</sup>
......@@ -251,11 +258,13 @@ resourceManager.getResourceManager((error, mgr) => {
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Global.ResourceManager
| 名称 | 类型 | 说明 |
| ---------- | ------ | ----------- |
| bundleName | string | 应用的bundle名称 |
| moduleName | string | 应用的module名称 |
| id | number | 资源的id值 |
**参数:**
| 名称 | 类型 | 可读 | 可写 |说明 |
| ---------- | ------ | ----- | ---- | ---------------|
| bundleName | string | 是 | 否 | 应用的bundle名称 |
| moduleName | string | 是 | 否 | 应用的module名称 |
| id | number | 是 | 否 | 资源的id值 |
## ResourceManager
......@@ -277,6 +286,7 @@ getStringValue(resId: number, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | --------------- |
| resId | number | 是 | 资源ID值 |
......@@ -288,9 +298,9 @@ getStringValue(resId: number, callback: AsyncCallback&lt;string&gt;): void
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the module resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例Stage:**
```ts
......@@ -317,6 +327,7 @@ getStringValue(resId: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -328,11 +339,13 @@ getStringValue(resId: number): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -357,6 +370,7 @@ getStringValue(resource: Resource, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | --------------- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -364,11 +378,13 @@ getStringValue(resource: Resource, callback: AsyncCallback&lt;string&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -377,7 +393,7 @@ getStringValue(resource: Resource, callback: AsyncCallback&lt;string&gt;): void
moduleName: "entry",
id: $r('app.string.test').id
};
tyr {
try {
this.context.resourceManager.getStringValue(resource, (error, value) => {
if (error != null) {
console.log("error is " + error);
......@@ -400,23 +416,26 @@ getStringValue(resource: Resource): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| --------------------- | ---------------- |
| Promise&lt;string&gt; | resource对象对应的字符串 |
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -446,6 +465,7 @@ getStringArrayValue(resId: number, callback: AsyncCallback&lt;Array&lt;string&gt
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------- |
| resId | number | 是 | 资源ID值 |
......@@ -453,11 +473,13 @@ getStringArrayValue(resId: number, callback: AsyncCallback&lt;Array&lt;string&gt
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -484,6 +506,7 @@ getStringArrayValue(resId: number): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -495,11 +518,13 @@ getStringArrayValue(resId: number): Promise&lt;Array&lt;string&gt;&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -523,6 +548,7 @@ getStringArrayValue(resource: Resource, callback: AsyncCallback&lt;Array&lt;stri
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -530,11 +556,13 @@ getStringArrayValue(resource: Resource, callback: AsyncCallback&lt;Array&lt;stri
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -565,6 +593,7 @@ getStringArrayValue(resource: Resource): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -576,11 +605,13 @@ getStringArrayValue(resource: Resource): Promise&lt;Array&lt;string&gt;&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -601,7 +632,7 @@ getStringArrayValue(resource: Resource): Promise&lt;Array&lt;string&gt;&gt;
```
### getMediaContent
### getMediaContent<sup>9+</sup>
getMediaContent(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
......@@ -610,6 +641,7 @@ getMediaContent(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ------------------ |
| resId | number | 是 | 资源ID值 |
......@@ -617,10 +649,12 @@ getMediaContent(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
......@@ -638,7 +672,7 @@ getMediaContent(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
```
### getMediaContent
### getMediaContent<sup>9+</sup>
getMediaContent(resId: number): Promise&lt;Uint8Array&gt;
......@@ -647,6 +681,7 @@ getMediaContent(resId: number): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -658,15 +693,17 @@ getMediaContent(resId: number): Promise&lt;Uint8Array&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
try {
mgr.getMediaContent($r('app.media.test').id).then(value => {
this.context.resourceManager.getMediaContent($r('app.media.test').id).then(value => {
let media = value;
}).catch(error => {
console.log("getMediaContent promise error is " + error);
......@@ -685,6 +722,7 @@ getMediaContent(resource: Resource, callback: AsyncCallback&lt;Uint8Array&gt;):
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ------------------ |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -692,10 +730,12 @@ getMediaContent(resource: Resource, callback: AsyncCallback&lt;Uint8Array&gt;):
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
......@@ -726,6 +766,7 @@ getMediaContent(resource: Resource): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -737,10 +778,12 @@ getMediaContent(resource: Resource): Promise&lt;Uint8Array&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
......@@ -761,7 +804,7 @@ getMediaContent(resource: Resource): Promise&lt;Uint8Array&gt;
```
### getMediaContentBase64
### getMediaContentBase64<sup>9+</sup>
getMediaContentBase64(resId: number, callback: AsyncCallback&lt;string&gt;): void
......@@ -770,6 +813,7 @@ getMediaContentBase64(resId: number, callback: AsyncCallback&lt;string&gt;): voi
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------ |
| resId | number | 是 | 资源ID值 |
......@@ -777,15 +821,17 @@ getMediaContentBase64(resId: number, callback: AsyncCallback&lt;string&gt;): voi
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
try {
mgr.getMediaContentBase64($r('app.media.test').id, (error, value) => {
this.context.resourceManager.getMediaContentBase64($r('app.media.test').id, (error, value) => {
if (error != null) {
console.log("error is " + error);
} else {
......@@ -798,7 +844,7 @@ getMediaContentBase64(resId: number, callback: AsyncCallback&lt;string&gt;): voi
```
### getMediaContentBase64
### getMediaContentBase64<sup>9+</sup>
getMediaContentBase64(resId: number): Promise&lt;string&gt;
......@@ -807,6 +853,7 @@ getMediaContentBase64(resId: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -818,15 +865,17 @@ getMediaContentBase64(resId: number): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
try {
mgr.getMediaContentBase64($r('app.media.test').id).then(value => {
this.context.resourceManager.getMediaContentBase64($r('app.media.test').id).then(value => {
let media = value;
}).catch(error => {
console.log("getMediaContentBase64 promise error is " + error);
......@@ -844,7 +893,8 @@ getMediaContentBase64(resource: Resource, callback: AsyncCallback&lt;string&gt;)
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------ |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -852,10 +902,12 @@ getMediaContentBase64(resource: Resource, callback: AsyncCallback&lt;string&gt;)
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
......@@ -886,6 +938,7 @@ getMediaContentBase64(resource: Resource): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -897,10 +950,12 @@ getMediaContentBase64(resource: Resource): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
**示例:**
```ts
......@@ -930,6 +985,7 @@ getConfiguration(callback: AsyncCallback&lt;Configuration&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ------------------------- |
| callback | AsyncCallback&lt;[Configuration](#configuration)&gt; | 是 | 异步回调,用于返回设备的Configuration |
......@@ -984,6 +1040,7 @@ getDeviceCapability(callback: AsyncCallback&lt;DeviceCapability&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;[DeviceCapability](#devicecapability)&gt; | 是 | 异步回调,用于返回设备的DeviceCapability |
......@@ -1029,7 +1086,7 @@ getDeviceCapability(): Promise&lt;DeviceCapability&gt;
```
### getPluralStringValue
### getPluralStringValue<sup>9+</sup>
getPluralStringValue(resId: number, num: number, callback: AsyncCallback&lt;string&gt;): void
......@@ -1038,6 +1095,7 @@ getPluralStringValue(resId: number, num: number, callback: AsyncCallback&lt;stri
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------- |
| resId | number | 是 | 资源ID值 |
......@@ -1046,11 +1104,13 @@ getPluralStringValue(resId: number, num: number, callback: AsyncCallback&lt;stri
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1068,7 +1128,7 @@ getPluralStringValue(resId: number, num: number, callback: AsyncCallback&lt;stri
```
### getPluralStringValue
### getPluralStringValue<sup>9+</sup>
getPluralStringValue(resId: number, num: number): Promise&lt;string&gt;
......@@ -1077,6 +1137,7 @@ getPluralStringValue(resId: number, num: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -1089,11 +1150,13 @@ getPluralStringValue(resId: number, num: number): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1117,6 +1180,7 @@ getPluralStringValue(resource: Resource, num: number, callback: AsyncCallback&lt
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------ |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -1125,11 +1189,13 @@ getPluralStringValue(resource: Resource, num: number, callback: AsyncCallback&lt
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1161,6 +1227,7 @@ getPluralString(resource: Resource, num: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -1173,11 +1240,13 @@ getPluralString(resource: Resource, num: number): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1207,6 +1276,7 @@ getRawFileContent(path: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ----------------------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1214,9 +1284,11 @@ getRawFileContent(path: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
| 9001005 | If the resource not found by path. |
**示例:**
```ts
......@@ -1243,6 +1315,7 @@ getRawFileContent(path: string): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1254,9 +1327,11 @@ getRawFileContent(path: string): Promise&lt;Uint8Array&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
| 9001005 | If the resource not found by path. |
**示例:**
```ts
......@@ -1281,6 +1356,7 @@ getRawFd(path: string, callback: AsyncCallback&lt;RawFileDescriptor&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | -------------------------------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1288,9 +1364,11 @@ getRawFd(path: string, callback: AsyncCallback&lt;RawFileDescriptor&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
| 9001005 | If the resource not found by path. |
**示例:**
```ts
......@@ -1303,9 +1381,8 @@ getRawFd(path: string, callback: AsyncCallback&lt;RawFileDescriptor&gt;): void
let offset = value.offset;
let length = value.length;
}
});
} catch(error => {
console.log("getRawFd callback error is " + error);
}).catch(error => {
console.log("getRawFd callback error is " + error);
});
```
......@@ -1318,6 +1395,7 @@ getRawFd(path: string): Promise&lt;RawFileDescriptor&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1329,9 +1407,11 @@ getRawFd(path: string): Promise&lt;RawFileDescriptor&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
| 9001005 | If the resource not found by path. |
**示例:**
```ts
......@@ -1357,6 +1437,7 @@ closeRawFileDescriptor(path: string, callback: AsyncCallback&lt;void&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1382,6 +1463,7 @@ closeRawFileDescriptor(path: string): Promise&lt;void&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1412,6 +1494,7 @@ closeRawFd(path: string, callback: AsyncCallback&lt;void&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1419,6 +1502,8 @@ closeRawFd(path: string, callback: AsyncCallback&lt;void&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
......@@ -1426,7 +1511,7 @@ closeRawFd(path: string, callback: AsyncCallback&lt;void&gt;): void
**示例:**
```ts
try {
mgr.closeRawFd("test.xml", (error, value) => {
this.context.resourceManager.closeRawFd("test.xml", (error, value) => {
if (error != null) {
console.log("error is " + error);
}
......@@ -1446,6 +1531,7 @@ closeRawFd(path: string): Promise&lt;void&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -1457,14 +1543,16 @@ closeRawFd(path: string): Promise&lt;void&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001005 | The resource not found by path. |
| 9001005 | If the resource not found by path. |
**示例:**
```ts
try {
mgr.closeRawFd("test.xml").then(value => {
this.context.resourceManager.closeRawFd("test.xml").then(value => {
let result = value;
}).catch(error => {
console.log("closeRawFd promise error is " + error);
......@@ -1498,6 +1586,7 @@ getStringByName(resName: string, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | --------------- |
| resName | string | 是 | 资源名称 |
......@@ -1505,11 +1594,13 @@ getStringByName(resName: string, callback: AsyncCallback&lt;string&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1536,6 +1627,7 @@ getStringByName(resName: string): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1547,11 +1639,13 @@ getStringByName(resName: string): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1575,6 +1669,7 @@ getStringArrayByName(resName: string, callback: AsyncCallback&lt;Array&lt;string
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------- |
| resName | string | 是 | 资源名称 |
......@@ -1582,11 +1677,13 @@ getStringArrayByName(resName: string, callback: AsyncCallback&lt;Array&lt;string
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1612,6 +1709,7 @@ getStringArrayByName(resName: string): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1623,11 +1721,13 @@ getStringArrayByName(resName: string): Promise&lt;Array&lt;string&gt;&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1651,6 +1751,7 @@ getMediaByName(resName: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ------------------ |
| resName | string | 是 | 资源名称 |
......@@ -1658,11 +1759,13 @@ getMediaByName(resName: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1688,6 +1791,7 @@ getMediaByName(resName: string): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1699,11 +1803,13 @@ getMediaByName(resName: string): Promise&lt;Uint8Array&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1727,6 +1833,7 @@ getMediaBase64ByName(resName: string, callback: AsyncCallback&lt;string&gt;): vo
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------ |
| resName | string | 是 | 资源名称 |
......@@ -1734,11 +1841,13 @@ getMediaBase64ByName(resName: string, callback: AsyncCallback&lt;string&gt;): vo
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1764,6 +1873,7 @@ getMediaBase64ByName(resName: string): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1775,11 +1885,13 @@ getMediaBase64ByName(resName: string): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1803,6 +1915,7 @@ getPluralStringByName(resName: string, num: number, callback: AsyncCallback&lt;s
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ----------------------------- |
| resName | string | 是 | 资源名称 |
......@@ -1811,11 +1924,13 @@ getPluralStringByName(resName: string, num: number, callback: AsyncCallback&lt;s
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1842,6 +1957,7 @@ getPluralStringByName(resName: string, num: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1854,11 +1970,13 @@ getPluralStringByName(resName: string, num: number): Promise&lt;string&gt;
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1882,6 +2000,7 @@ getStringSync(resId: number): string
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -1891,6 +2010,16 @@ getStringSync(resId: number): string
| ------ | ----------- |
| string | 资源ID值对应的字符串 |
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
try {
......@@ -1909,6 +2038,7 @@ getStringSync(resource: Resource): string
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -1920,11 +2050,13 @@ getStringSync(resource: Resource): string
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1949,6 +2081,7 @@ getStringByNameSync(resName: string): string
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -1960,11 +2093,13 @@ getStringByNameSync(resName: string): string
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -1984,6 +2119,7 @@ getBoolean(resId: number): boolean
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -1995,11 +2131,13 @@ getBoolean(resId: number): boolean
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2018,6 +2156,7 @@ getBoolean(resource: Resource): boolean
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -2029,11 +2168,13 @@ getBoolean(resource: Resource): boolean
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2058,6 +2199,7 @@ getBooleanByName(resName: string): boolean
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -2069,11 +2211,13 @@ getBooleanByName(resName: string): boolean
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2093,6 +2237,7 @@ getNumber(resId: number): number
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2104,11 +2249,13 @@ getNumber(resId: number): number
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2134,6 +2281,7 @@ getNumber(resource: Resource): number
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ---- |
| resource | [Resource](#resource9) | 是 | 资源信息 |
......@@ -2145,11 +2293,13 @@ getNumber(resource: Resource): number
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001001 | The resId invalid. |
| 9001002 | The resource not found by resId. |
| 9001006 | The resource re-ref too much. |
| 9001001 | If the resId invalid. |
| 9001002 | If the resource not found by resId. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2174,6 +2324,7 @@ getNumberByName(resName: string): number
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | ---- |
| resName | string | 是 | 资源名称 |
......@@ -2185,11 +2336,13 @@ getNumberByName(resName: string): number
以下错误码的详细介绍请参见[资源管理错误码](../errorcodes/errorcode-resource-manager.md)
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------- |
| 9001003 | The resName invalid. |
| 9001004 | The resource not found by resName. |
| 9001006 | The resource re-ref too much. |
| 9001003 | If the resName invalid. |
| 9001004 | If the resource not found by resName. |
| 9001006 | If the resource re-ref too much. |
**示例:**
```ts
......@@ -2218,6 +2371,7 @@ getString(resId: number, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | --------------- |
| resId | number | 是 | 资源ID值 |
......@@ -2248,6 +2402,7 @@ getString(resId: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2280,6 +2435,7 @@ getStringArray(resId: number, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------- |
| resId | number | 是 | 资源ID值 |
......@@ -2310,6 +2466,7 @@ getStringArray(resId: number): Promise&lt;Array&lt;string&gt;&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2342,6 +2499,7 @@ getMedia(resId: number, callback: AsyncCallback&lt;Uint8Array&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ------------------ |
| resId | number | 是 | 资源ID值 |
......@@ -2372,6 +2530,7 @@ getMedia(resId: number): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2404,6 +2563,7 @@ getMediaBase64(resId: number, callback: AsyncCallback&lt;string&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------ |
| resId | number | 是 | 资源ID值 |
......@@ -2434,6 +2594,7 @@ getMediaBase64(resId: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2466,6 +2627,7 @@ getPluralString(resId: number, num: number): Promise&lt;string&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ---- | ----- |
| resId | number | 是 | 资源ID值 |
......@@ -2499,6 +2661,7 @@ getPluralString(resId: number, num: number, callback: AsyncCallback&lt;string&gt
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------- |
| resId | number | 是 | 资源ID值 |
......@@ -2530,6 +2693,7 @@ getRawFile(path: string, callback: AsyncCallback&lt;Uint8Array&gt;): void
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------- | ---- | ----------------------- |
| path | string | 是 | rawfile文件路径 |
......@@ -2560,6 +2724,7 @@ getRawFile(path: string): Promise&lt;Uint8Array&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......@@ -2592,6 +2757,7 @@ getRawFileDescriptor(path: string, callback: AsyncCallback&lt;RawFileDescriptor&
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | -------------------------------- |
| path | string | 是 | rawfile文件路径 |
......@@ -2623,6 +2789,7 @@ getRawFileDescriptor(path: string): Promise&lt;RawFileDescriptor&gt;
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----------- |
| path | string | 是 | rawfile文件路径 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册