From 604a5f1bb9e7821683fdbc8691524f5aaa32917f Mon Sep 17 00:00:00 2001 From: VictoriaGuo Date: Thu, 20 Jan 2022 19:35:04 +0800 Subject: [PATCH] add getResourceManager StageModeOnly interface Signed-off-by: VictoriaGuo --- api/@ohos.resourceManager.d.ts | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 3c9f54b613..45e561c9c8 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -13,6 +13,8 @@ * limitations under the License. */ +import { Context } from './app/context'; + /** * Provides resource related APIs. * @@ -194,6 +196,7 @@ export interface AsyncCallback { * * @param callback Indicates the callback containing the ResourceManager object. * @since 6 + * @FAModelOnly */ export function getResourceManager(callback: AsyncCallback); @@ -203,6 +206,7 @@ export function getResourceManager(callback: AsyncCallback); * @param bundleName Indicates the bundle name of the specified application. * @param callback Indicates the callback containing the ResourceManager object. * @since 6 + * @FAModelOnly */ export function getResourceManager(bundleName: string, callback: AsyncCallback); @@ -211,6 +215,7 @@ export function getResourceManager(bundleName: string, callback: AsyncCallback; @@ -220,9 +225,52 @@ export function getResourceManager(): Promise; * @param bundleName Indicates the bundle name of the specified application. * @return Returns that the ResourceManager object is returned in Promise mode. * @since 6 + * @FAModelOnly */ export function getResourceManager(bundleName: string): Promise; +/** + * Obtains the ResourceManager object of the current application. + * + * @param ctx The Context object. + * @param callback Indicates the callback containing the ResourceManager object. + * @since 9 preview + * @StageModelOnly + */ +export function getResourceManager(ctx: Context, callback: AsyncCallback); + +/** + * Obtains the ResourceManager object of the specified application. + * + * @param ctx The Context object. + * @param bundleName Indicates the bundle name of the specified application. + * @param callback Indicates the callback containing the ResourceManager object. + * @since 9 preview + * @StageModelOnly + */ +export function getResourceManager(ctx: Context, bundleName: string, callback: AsyncCallback); + +/** + * Obtains the ResourceManager object of the current application. + * + * @param ctx The Context object. + * @return Returns that the ResourceManager object is returned in Promise mode. + * @since 9 preview + * @StageModelOnly + */ +export function getResourceManager(ctx: Context): Promise; + +/** + * Obtains the ResourceManager object of the specified application. + * + * @param ctx The Context object. + * @param bundleName Indicates the bundle name of the specified application. + * @return Returns that the ResourceManager object is returned in Promise mode. + * @since 9 preview + * @StageModelOnly + */ +export function getResourceManager(ctx: Context, bundleName: string): Promise; + /** * Provides the capability of accessing application resources. * -- Gitee