mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2025-02-18 16:10:25 +00:00
!1576 更新resourceManager资源接口
Merge pull request !1576 from maoziduanl/master
This commit is contained in:
commit
1f8b450522
157
api/@ohos.resourceManager.d.ts
vendored
157
api/@ohos.resourceManager.d.ts
vendored
@ -269,7 +269,7 @@ export interface ResourceManager {
|
||||
* @return Returns the array of character strings corresponding to the specified resource ID.
|
||||
* @since 6
|
||||
*/
|
||||
getStringArray(resId: number): Promise<Array<string>>;
|
||||
getStringArray(resId: number): Promise<Array<string>>;
|
||||
|
||||
/**
|
||||
* Obtains the content of the media file corresponding to a specified resource ID in callback mode.
|
||||
@ -297,7 +297,7 @@ export interface ResourceManager {
|
||||
* resource.
|
||||
* @since 6
|
||||
*/
|
||||
getMediaBase64(resId: number, callback: AsyncCallback<string>): void;
|
||||
getMediaBase64(resId: number, callback: AsyncCallback<string>): void;
|
||||
|
||||
/**
|
||||
* Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode.
|
||||
@ -417,7 +417,158 @@ export interface ResourceManager {
|
||||
* @return Returns result close raw file resource descriptor corresponding to the specified resource path.
|
||||
* @since 8
|
||||
*/
|
||||
closeRawFileDescriptor(path: string): Promise<void>;
|
||||
closeRawFileDescriptor(path: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Obtains the character string corresponding to a specified resource name in callback mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param callback Indicates the asynchronous callback used to return the obtained character string.
|
||||
* @since 9
|
||||
*/
|
||||
getStringByName(resName: string, callback: AsyncCallback<string>): void;
|
||||
|
||||
/**
|
||||
* Obtains string resources associated with a specified resource name in Promise mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the character string corresponding to the resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getStringByName(resName: string): Promise<string>;
|
||||
|
||||
/**
|
||||
* Obtains the array of character strings corresponding to a specified resource name in callback mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param callback Indicates the asynchronous callback used to return the obtained array of character strings.
|
||||
* @since 9
|
||||
*/
|
||||
getStringArrayByName(resName: string, callback: AsyncCallback<Array<string>>): void;
|
||||
|
||||
/**
|
||||
* Obtains the array of character strings corresponding to a specified resource name in Promise mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the array of character strings corresponding to the specified resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getStringArrayByName(resName: string): Promise<Array<string>>;
|
||||
|
||||
/**
|
||||
* Obtains the content of the media file corresponding to a specified resource name in callback mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param callback Indicates the asynchronous callback used to return the obtained media file content.
|
||||
* @since 9
|
||||
*/
|
||||
getMediaByName(resName: string, callback: AsyncCallback<Uint8Array>): void;
|
||||
|
||||
/**
|
||||
* Obtains the content of the media file corresponding to a specified resource name in Promise mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the content of the media file corresponding to the specified resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getMediaByName(resName: string): Promise<Uint8Array>;
|
||||
|
||||
/**
|
||||
* Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image
|
||||
* resource.
|
||||
* @since 9
|
||||
*/
|
||||
getMediaBase64ByName(resName: string, callback: AsyncCallback<string>): void;
|
||||
|
||||
/**
|
||||
* Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the Base64 code of the image resource corresponding to the specified resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getMediaBase64ByName(resName: string): Promise<string>;
|
||||
|
||||
/**
|
||||
* Obtains the singular-plural character string represented by the name string corresponding to the
|
||||
* specified number in callback mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param num Indicates the number.
|
||||
* @param callback Indicates the asynchronous callback used to return the singular-plural character
|
||||
* string represented by the name string corresponding to the specified number.
|
||||
* @since 9
|
||||
*/
|
||||
getPluralStringByName(resName: string, num: number, callback: AsyncCallback<string>): void;
|
||||
|
||||
/**
|
||||
* Obtains the singular-plural character string represented by the name string corresponding to
|
||||
* the specified number in Promise mode.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @param num Indicates the number.
|
||||
* @return Returns the singular-plural character string represented by the name string
|
||||
* corresponding to the specified number.
|
||||
* @since 9
|
||||
*/
|
||||
getPluralStringByName(resName: string, num: number): Promise<string>;
|
||||
|
||||
/**
|
||||
* Obtains string resources associated with a specified resource ID.
|
||||
*
|
||||
* @param resId Indicates the resource ID.
|
||||
* @return Returns the character string corresponding to the resource ID.
|
||||
* @since 9
|
||||
*/
|
||||
getStringSync(resId: number): string;
|
||||
|
||||
/**
|
||||
* Obtains string resources associated with a specified resource name.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the character string corresponding to the resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getStringByNameSync(resName: string): string;
|
||||
|
||||
/**
|
||||
* Obtains the boolean result with a specified resource ID.
|
||||
*
|
||||
* @param resId Indicates the resource ID.
|
||||
* @return Returns the boolean resource corresponding to the resource ID.
|
||||
* @since 9
|
||||
*/
|
||||
getBoolean(resId: number): boolean;
|
||||
|
||||
/**
|
||||
* Obtains the boolean result with a specified resource name.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the boolean resource corresponding to the resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getBooleanByName(resName: string): boolean;
|
||||
|
||||
/**
|
||||
* Obtains the number result with a specified resource ID.
|
||||
*
|
||||
* @param resId Indicates the resource ID.
|
||||
* @return Returns the number resource corresponding to the resource ID.
|
||||
* @since 9
|
||||
*/
|
||||
getNumber(resId: number): number;
|
||||
|
||||
/**
|
||||
* Obtains the number result with a specified resource name.
|
||||
*
|
||||
* @param resName Indicates the resource name.
|
||||
* @return Returns the number resource corresponding to the resource name.
|
||||
* @since 9
|
||||
*/
|
||||
getNumberByName(resName: string): number;
|
||||
|
||||
/**
|
||||
* Obtains release resourceManager.
|
||||
|
Loading…
x
Reference in New Issue
Block a user