From a4f14352a6c0eb8fa64dc58009c213fb9bc1f244 Mon Sep 17 00:00:00 2001 From: sunjie Date: Fri, 8 Aug 2025 10:03:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E8=AE=BE=E8=AE=A1=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sunjie --- api/@ohos.resourceManager.d.ts | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 6958b844ba..e4d142bf85 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -866,11 +866,27 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @deprecated since 20 + * @useinstead ohos.resourceManager.getSystemResourceManager */ export function getSystemResourceManager(): ResourceManager; + /** + * Obtains a global shared system ResourceManager object that provides access to only system resource, in which the + * resConfig is current system resConfig(contains resLocale, screenDensityDpi, direction, etc). + * + * @returns { ResourceManager } The System ResourceManager object is returned. + * @throws { BusinessError } 9001009 - Failed to access the system resource. + * which is not mapped to application sandbox, This error code will be thrown. + * @syscap SystemCapability.Global.ResourceManager + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + export function getSysResourceManager(): ResourceManager; + /** * Provides the capability of accessing application resources. * @@ -2551,6 +2567,8 @@ declare namespace resourceManager { * @crossplatform * @atomicservice * @since 11 + * @deprecated since 20 + * @useinstead ohos.resourceManager.getStringSync */ getStringSync(resource: Resource, ...args: Array): string; @@ -2807,7 +2825,7 @@ declare namespace resourceManager { * * @param { number } resId - Indicates the resource ID. * @returns { number } The number resource corresponding to the resource ID. - * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types. * @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. @@ -2926,7 +2944,7 @@ declare namespace resourceManager { * * @param { string } resName - Indicates the resource name. * @returns { number } The number resource corresponding to the resource name. - * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types. * @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. @@ -3325,6 +3343,8 @@ declare namespace resourceManager { * @crossplatform * @atomicservice * @since 18 + * @deprecated since 20 + * @useinstead ohos.resourceManager.getIntPluralStringValueSync */ getIntPluralStringValueSync(resource: Resource, num: number, ...args: Array): string; @@ -3428,6 +3448,8 @@ declare namespace resourceManager { * @crossplatform * @atomicservice * @since 18 + * @deprecated since 20 + * @useinstead ohos.resourceManager.getDoublePluralStringValueSync */ getDoublePluralStringValueSync(resource: Resource, num: number, ...args: Array): string; @@ -4786,7 +4808,7 @@ declare namespace resourceManager { * @param { number } num - Indicates the number. * @returns { string } The singular-plural character string represented by the ID string * corresponding to the specified number. - * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. + * @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types. * @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. -- Gitee From 62dd01d3fa0c1a53af1d469af3bb93889c260a0c Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 8 Aug 2025 03:52:43 +0000 Subject: [PATCH 2/2] update api/@ohos.resourceManager.d.ts. Signed-off-by: sj --- api/@ohos.resourceManager.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index e4d142bf85..1bf0868c87 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -866,9 +866,8 @@ declare namespace resourceManager { * @syscap SystemCapability.Global.ResourceManager * @crossplatform * @atomicservice - * @since 11 - * @deprecated since 20 - * @useinstead ohos.resourceManager.getSystemResourceManager + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ export function getSystemResourceManager(): ResourceManager; -- Gitee