diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index f6657872849b9ac673a517826c86c8f52f1e3a44..e59ca05109612a5b20e4ebe049fc89339c56ac7b 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -23,6 +23,10 @@ import { Resource as _Resource } from './global/resource'; import { AsyncCallback as _AsyncCallback } from './@ohos.base'; import { DrawableDescriptor } from './@ohos.arkui.drawableDescriptor'; +/*** if arkts 1.2 */ +import { Resource as _Resource } from './global/resource'; +/*** endif */ + /** * Provides resource related APIs. * @@ -45,7 +49,8 @@ import { DrawableDescriptor } from './@ohos.arkui.drawableDescriptor'; * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace resourceManager { /** @@ -831,7 +836,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export function getSystemResourceManager(): ResourceManager; @@ -857,7 +863,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export interface ResourceManager { /** @@ -924,7 +931,8 @@ declare namespace resourceManager { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringValue(resource: Resource, callback: _AsyncCallback): void; @@ -968,7 +976,8 @@ declare namespace resourceManager { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringValue(resource: Resource): Promise; @@ -2339,7 +2348,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringSync(resId: number): string; @@ -2416,7 +2426,8 @@ declare namespace resourceManager { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringSync(resource: Resource): string; @@ -2692,7 +2703,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getNumber(resId: number): number; @@ -2736,7 +2748,8 @@ declare namespace resourceManager { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getNumber(resource: Resource): number; @@ -2842,7 +2855,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringValue(resId: number, callback: _AsyncCallback): void; @@ -2883,7 +2897,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getStringValue(resId: number): Promise; @@ -3093,6 +3108,27 @@ declare namespace resourceManager { */ getIntPluralStringValueSync(resId: number, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the ID string corresponding to + * the specified number. + * + * @param { number } resId - Indicates the resource ID. + * @param { number } num - An integer used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 9001001 - Invalid resource ID. + * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getIntPluralStringValueSync(resId: number, num: number, ...args: (string | number)[]): string; + /** * Obtains the singular-plural character string represented by the resource object string corresponding to the * specified number. @@ -3114,6 +3150,28 @@ declare namespace resourceManager { */ getIntPluralStringValueSync(resource: Resource, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the resource object string corresponding to the + * specified number. + * + * @param { Resource } resource - Indicates the resource object. + * @param { number } num - An integer used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 9001001 - Invalid resource ID. + * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. + * @syscap SystemCapability.Global.ResourceManager + * @stagemodelonly + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getIntPluralStringValueSync(resource: Resource, num: number, ...args: (string | number)[]): string; + /** * Obtains the singular-plural character string represented by the name string corresponding to * the specified number. @@ -3134,6 +3192,27 @@ declare namespace resourceManager { */ getIntPluralStringByNameSync(resName: string, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the name string corresponding to + * the specified number. + * + * @param { string } resName - Indicates the resource name. + * @param { number } num - An integer used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the name string + * corresponding to the specified number. + * @throws { BusinessError } 9001003 - Invalid resource name. + * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getIntPluralStringByNameSync(resName: string, num: number, ...args: (string | number)[]): string; + /** * Obtains the singular-plural character string represented by the ID string corresponding to * the specified number. @@ -3154,6 +3233,27 @@ declare namespace resourceManager { */ getDoublePluralStringValueSync(resId: number, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the ID string corresponding to + * the specified number. + * + * @param { number } resId - Indicates the resource ID. + * @param { number } num - A double parameter used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 9001001 - Invalid resource ID. + * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getDoublePluralStringValueSync(resId: number, num: number, ...args: (string | number)[]): string; + /** * Obtains the singular-plural character string represented by the resource object string corresponding to the * specified number. @@ -3175,6 +3275,28 @@ declare namespace resourceManager { */ getDoublePluralStringValueSync(resource: Resource, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the resource object string corresponding to the + * specified number. + * + * @param { Resource } resource - Indicates the resource object. + * @param { number } num - A double parameter used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 9001001 - Invalid resource ID. + * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. + * @syscap SystemCapability.Global.ResourceManager + * @stagemodelonly + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getDoublePluralStringValueSync(resource: Resource, num: number, ...args: (string | number)[]): string; + /** * Obtains the singular-plural character string represented by the name string corresponding to * the specified number. @@ -3195,6 +3317,27 @@ declare namespace resourceManager { */ getDoublePluralStringByNameSync(resName: string, num: number, ...args: Array): string; + /** + * Obtains the singular-plural character string represented by the name string corresponding to + * the specified number. + * + * @param { string } resName - Indicates the resource name. + * @param { number } num - A double parameter used to get the correct string for the current plural rules. + * @param { (string | number)[] } args - Indicates the formatting string resource parameters. + * @returns { string } The singular-plural character string represented by the name string + * corresponding to the specified number. + * @throws { BusinessError } 9001003 - Invalid resource name. + * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. + * @throws { BusinessError } 9001006 - The resource is referenced cyclically. + * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + getDoublePluralStringByNameSync(resName: string, num: number, ...args: (string | number)[]): string; + /** * Obtains the content of the media file corresponding to a specified resource ID in callback mode. * @@ -3505,7 +3648,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getRawFileContent(path: string, callback: _AsyncCallback): void; @@ -3540,7 +3684,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getRawFileContent(path: string): Promise; @@ -4081,7 +4226,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getColorSync(resId: number) : number; @@ -4111,7 +4257,8 @@ declare namespace resourceManager { * @stagemodelonly * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getColorSync(resource: Resource) : number; @@ -4277,7 +4424,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ getRawFileContentSync(path: string): Uint8Array; @@ -4855,7 +5003,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export type Resource = _Resource; }