目录

SendableResource

This module provides information related to SendableResource resources, including the bundle name, module name, resource type, and so on. SendableResource implements the ISendable interface and supports cross-thread transfer, for accessing application resources in multi-thread scenarios.

The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Import a module.

import { resourceManager } from '@kit.LocalizationKit';

SendableResource

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Global.ResourceManager

Name Type Read-Only Optional Description
bundleName string No No Bundle name of the application.
moduleName string No No Application module name.
id number No No

Resource ID. The value ranges are as follows:

- Application resource range: [0x01000000, 0x06FFFFFF] and [0x08000000, 0xFFFFFFFF], indicating the resource ID of the application itself.

- System resource range: [0x07000000, 0x07FFFFFF], indicating the preset system resource ID.

params collections.Array<string | number> No Yes Resource parameters, including the resource name (string type), replacement values for the formatting API (string or number provided in placeholder order), and the quantifier for the plural API (number type, indicating the quantity). The replacement values of the formatting API are used for parameter substitution during string formatting, and the quantifier of the plural API is used to select the plural form in a multilingual environment.
type number No Yes

Resource type. The values are as follows:

- 10001: color

- 10002: float

- 10003: string

- 10004: plural

- 10005: boolean

- 10006: intarray

- 10007: integer

- 10008: pattern

- 10009: strarray

- 20000: media

- 30000: rawfile

- 40000: symbol