SendableResource

This module provides information about SendableResource resources, including the application bundle name, application module name, resource type, and so on. SendableResource implements the ISendable interface and supports cross-thread transfer, so that application resources can be accessed in multi-threaded 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 Package name of the application.
moduleName string No No Application module name.
id number No No

Resource ID, which can be one of the following:

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

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

params collections.Array<string | number> No Yes Resource parameters, including the resource name (string type), the replacement values of the formatting API (string or number provided in the order of the placeholders), and the quantifier of 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, which can be one of the following:

- 10001: color

- 10002: float

- 10003: string

- 10004: plural

- 10005: boolean

- 10006: intarray

- 10007: integer

- 10008: pattern

- 10009: strarray

- 20000: media

- 30000: rawfile

- 40000: symbol