diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 25fa1314f27d8f4c1d9c07b59b3dbc1800b7162a..b4f2afb22a0ad1165a791f9c389f0479d3d7cd4c 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -235,6 +235,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @param callback Indicates the asynchronous callback used to return the obtained character string. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getStringValue */ getString(resId: number, callback: AsyncCallback): void; @@ -244,6 +246,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @return Returns the character string corresponding to the resource ID. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getStringValue */ getString(resId: number): Promise; @@ -252,18 +256,26 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getString(resource: Resource, callback: AsyncCallback): void; + getStringValue(resource: Resource, callback: AsyncCallback): void; /** * Obtains string resources associated with a specified resource object in Promise mode. * * @param resource Indicates the resource object. * @return Returns the character string corresponding to the resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getString(resource: Resource): Promise; + getStringValue(resource: Resource): Promise; /** * Obtains the array of character strings corresponding to a specified resource ID in callback mode. @@ -271,6 +283,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getStringArrayValue */ getStringArray(resId: number, callback: AsyncCallback>): void; @@ -280,6 +294,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @return Returns the array of character strings corresponding to the specified resource ID. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getStringArrayValue */ getStringArray(resId: number): Promise>; @@ -288,18 +304,26 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringArray(resource: Resource, callback: AsyncCallback>): void; + getStringArrayValue(resource: Resource, callback: AsyncCallback>): void; /** * Obtains the array of character strings corresponding to a specified resource object in Promise mode. * * @param resource Indicates the resource object. * @return Returns the array of character strings corresponding to the specified resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringArray(resource: Resource): Promise>; + getStringArrayValue(resource: Resource): Promise>; /** * Obtains the content of the media file corresponding to a specified resource ID in callback mode. @@ -307,6 +331,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @param callback Indicates the asynchronous callback used to return the obtained media file content. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getMediaContent */ getMedia(resId: number, callback: AsyncCallback): void; @@ -316,6 +342,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @return Returns the content of the media file corresponding to the specified resource ID. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getMediaContent */ getMedia(resId: number): Promise; @@ -324,18 +352,24 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMedia(resource: Resource, callback: AsyncCallback): void; + getMediaContent(resource: Resource, callback: AsyncCallback): void; /** * Obtains the content of the media file corresponding to a specified resource object in Promise mode. * * @param resource Indicates the resource object. * @return Returns the content of the media file corresponding to the specified resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMedia(resource: Resource): Promise; + getMediaContent(resource: Resource): Promise; /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. @@ -344,6 +378,8 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getMediaContentBase64 */ getMediaBase64(resId: number, callback: AsyncCallback): void; @@ -353,6 +389,8 @@ export interface ResourceManager { * @param resId Indicates the resource ID. * @return Returns the Base64 code of the image resource corresponding to the specified resource ID. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getMediaContentBase64 */ getMediaBase64(resId: number): Promise; @@ -362,18 +400,24 @@ export interface ResourceManager { * @param resource Indicates the resource object. * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMediaBase64(resource: Resource, callback: AsyncCallback): void; + getMediaContentBase64(resource: Resource, callback: AsyncCallback): void; /** * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. * * @param resource Indicates the resource object. * @return Returns the Base64 code of the image resource corresponding to the specified resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMediaBase64(resource: Resource): Promise; + getMediaContentBase64(resource: Resource): Promise; /** * Obtains the device capability in callback mode. @@ -417,6 +461,8 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the singular-plural character * string represented by the ID string corresponding to the specified number. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getPluralStringValue */ getPluralString(resId: number, num: number, callback: AsyncCallback): void; @@ -429,6 +475,8 @@ export interface ResourceManager { * @return Returns the singular-plural character string represented by the ID string * corresponding to the specified number. * @since 6 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getPluralStringValue */ getPluralString(resId: number, num: number): Promise; @@ -440,9 +488,13 @@ export interface ResourceManager { * @param num Indicates the number. * @param callback Indicates the asynchronous callback used to return the singular-plural character * string represented by the resource object string corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getPluralString(resource: Resource, num: number, callback: AsyncCallback): void; + getPluralStringValue(resource: Resource, num: number, callback: AsyncCallback): void; /** * Obtains the singular-plural character string represented by the resource object string corresponding to @@ -452,9 +504,13 @@ export interface ResourceManager { * @param num Indicates the number. * @return Returns the singular-plural character string represented by the resource object string * corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getPluralString(resource: Resource, num: number): Promise; + getPluralStringValue(resource: Resource, num: number): Promise; /** * Obtains the raw file resource corresponding to the specified resource path in callback mode. @@ -462,6 +518,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @param callback Indicates the asynchronous callback used to return the raw file resource. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getRawFileContent */ getRawFile(path: string, callback: AsyncCallback): void; @@ -471,6 +529,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @return Returns the raw file resource corresponding to the specified resource path. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getRawFileContent */ getRawFile(path: string): Promise; @@ -480,6 +540,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @param callback Indicates the asynchronous callback used to return the raw file resource descriptor. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getRawFd */ getRawFileDescriptor(path: string, callback: AsyncCallback): void; @@ -489,6 +551,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @return Returns the raw file resource descriptor corresponding to the specified resource path. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getRawFd */ getRawFileDescriptor(path: string): Promise; @@ -498,6 +562,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.closeRawFd */ closeRawFileDescriptor(path: string, callback: AsyncCallback): void; @@ -507,6 +573,8 @@ export interface ResourceManager { * @param path Indicates the resource relative path. * @return Returns result close raw file resource descriptor corresponding to the specified resource path. * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.closeRawFd */ closeRawFileDescriptor(path: string): Promise; @@ -515,6 +583,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringByName(resName: string, callback: AsyncCallback): void; @@ -524,6 +596,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the character string corresponding to the resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringByName(resName: string): Promise; @@ -533,6 +609,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringArrayByName(resName: string, callback: AsyncCallback>): void; @@ -542,6 +622,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the array of character strings corresponding to the specified resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringArrayByName(resName: string): Promise>; @@ -551,6 +635,9 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ getMediaByName(resName: string, callback: AsyncCallback): void; @@ -560,6 +647,9 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the content of the media file corresponding to the specified resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ getMediaByName(resName: string): Promise; @@ -570,6 +660,9 @@ export interface ResourceManager { * @param resName Indicates the resource name. * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ getMediaBase64ByName(resName: string, callback: AsyncCallback): void; @@ -579,6 +672,9 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the Base64 code of the image resource corresponding to the specified resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ getMediaBase64ByName(resName: string): Promise; @@ -591,6 +687,10 @@ export interface ResourceManager { * @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. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getPluralStringByName(resName: string, num: number, callback: AsyncCallback): void; @@ -603,6 +703,10 @@ export interface ResourceManager { * @param num Indicates the number. * @return Returns the singular-plural character string represented by the name string * corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getPluralStringByName(resName: string, num: number): Promise; @@ -612,6 +716,10 @@ export interface ResourceManager { * * @param resId Indicates the resource ID. * @return Returns the character string corresponding to the resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringSync(resId: number): string; @@ -621,6 +729,10 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @return Returns the character string corresponding to the resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringSync(resource: Resource): string; @@ -630,6 +742,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the character string corresponding to the resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getStringByNameSync(resName: string): string; @@ -639,6 +755,10 @@ export interface ResourceManager { * * @param resId Indicates the resource ID. * @return Returns the boolean resource corresponding to the resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getBoolean(resId: number): boolean; @@ -648,6 +768,10 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @return Returns the boolean resource corresponding to the resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getBoolean(resource: Resource): boolean; @@ -657,6 +781,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the boolean resource corresponding to the resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getBooleanByName(resName: string): boolean; @@ -666,6 +794,10 @@ export interface ResourceManager { * * @param resId Indicates the resource ID. * @return Returns the number resource corresponding to the resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getNumber(resId: number): number; @@ -675,6 +807,10 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @return Returns the number resource corresponding to the resource object. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the module resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getNumber(resource: Resource): number; @@ -684,6 +820,10 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @return Returns the number resource corresponding to the resource name. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001003 - If the resName invalid. + * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ getNumberByName(resName: string): number; @@ -694,6 +834,204 @@ export interface ResourceManager { * @since 7 */ release(); + + /** + * Obtains the character string corresponding to a specified resource ID in callback mode. + * + * @param resId Indicates the resource ID. + * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getStringValue(resId: number, callback: AsyncCallback): void; + + /** + * Obtains string resources associated with a specified resource ID in Promise mode. + * + * @param resId Indicates the resource ID. + * @return Returns the character string corresponding to the resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getStringValue(resId: number): Promise; + + /** + * Obtains the array of character strings corresponding to a specified resource ID in callback mode. + * + * @param resId Indicates the resource ID. + * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getStringArrayValue(resId: number, callback: AsyncCallback>): void; + + /** + * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. + * + * @param resId Indicates the resource ID. + * @return Returns the array of character strings corresponding to the specified resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getStringArrayValue(resId: number): Promise>; + + /** + * Obtains the singular-plural character string represented by the ID string corresponding to the + * specified number in callback mode. + * + * @param resId Indicates the resource ID. + * @param num Indicates the number. + * @param callback Indicates the asynchronous callback used to return the singular-plural character + * string represented by the ID string corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getPluralStringValue(resId: number, num: number, callback: AsyncCallback): void; + + /** + * Obtains the singular-plural character string represented by the ID string corresponding to + * the specified number in Promise mode. + * + * @param resId Indicates the resource ID. + * @param num Indicates the number. + * @return Returns the singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @since 9 + */ + getPluralStringValue(resId: number, num: number): Promise; + + /** + * Obtains the content of the media file corresponding to a specified resource ID in callback mode. + * + * @param resId Indicates the resource ID. + * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @since 9 + */ + getMediaContent(resId: number, callback: AsyncCallback): void; + + /** + * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. + * + * @param resId Indicates the resource ID. + * @return Returns the content of the media file corresponding to the specified resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @since 9 + */ + getMediaContent(resId: number): Promise; + + /** + * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. + * + * @param resId Indicates the resource ID. + * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image + * resource. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @since 9 + */ + getMediaContentBase64(resId: number, callback: AsyncCallback): void; + + /** + * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. + * + * @param resId Indicates the resource ID. + * @return Returns the Base64 code of the image resource corresponding to the specified resource ID. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @since 9 + */ + getMediaContentBase64(resId: number): Promise; + + /** + * Obtains the raw file resource corresponding to the specified resource path in callback mode. + * + * @param path Indicates the resource relative path. + * @param callback Indicates the asynchronous callback used to return the raw file resource. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + getRawFileContent(path: string, callback: AsyncCallback): void; + + /** + * Obtains the raw file resource corresponding to the specified resource path in Promise mode. + * + * @param path Indicates the resource relative path. + * @return Returns the raw file resource corresponding to the specified resource path. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + getRawFileContent(path: string): Promise; + + /** + * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. + * + * @param path Indicates the resource relative path. + * @param callback Indicates the asynchronous callback used to return the raw file resource descriptor. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + getRawFd(path: string, callback: AsyncCallback): void; + + /** + * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. + * + * @param path Indicates the resource relative path. + * @return Returns the raw file resource descriptor corresponding to the specified resource path. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + getRawFd(path: string): Promise; + + /** + * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. + * + * @param path Indicates the resource relative path. + * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + closeRawFd(path: string, callback: AsyncCallback): void; + + /** + * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. + * + * @param path Indicates the resource relative path. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001005 - If the resource not found by path. + * @since 9 + */ + closeRawFd(path: string): Promise; } /**