From e5d1bff7941006fa96b932b1521e9589d75e1ab4 Mon Sep 17 00:00:00 2001 From: zhrenqiang Date: Thu, 18 Apr 2024 10:05:38 +0800 Subject: [PATCH 1/3] add getOriginalSize Signed-off-by: zhrenqiang Change-Id: I92d7ecb59d6c9d1aa838e69d327e9e4f1a607711 --- api/@ohos.zlib.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index e2b739dcd..3b629ba6d 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -571,6 +571,21 @@ declare namespace zlib { */ function decompressFile(inFile: string, outFile: string, options?: Options): Promise; + /** + * Get the original size of the compressed zip file. + * + * @param { string } inFile - Indicates the path of the compressed file. + * @returns { Promise } Returns the original size of the compressed file. + * @throws { BusinessError } 401 - The parameter check failed, has no parameter or parameter not string. + * @throws { BusinessError } 900001 - The input source file is invalid. + * @throws { BusinessError } 900003 - The input source file is not ZIP format or damaged. + * @syscap SystemCapability.BundleManager.Zlib + * @crossplatform + * @atomicservice + * @since 12 + */ + function getOriginalSize(inFile: string): Promise + /** * Asynchronous creation of verification objects. * -- Gitee From 333cba8494b3c6e65c0d1b8cab104bfb919646cd Mon Sep 17 00:00:00 2001 From: zhrenqiang Date: Wed, 24 Apr 2024 20:27:46 +0800 Subject: [PATCH 2/3] update Signed-off-by: zhrenqiang Change-Id: Ibbe98e62576386ef749132c2da5e800b4b8675d7 --- api/@ohos.zlib.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index 3b629ba6d..8d074056c 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -572,11 +572,11 @@ declare namespace zlib { function decompressFile(inFile: string, outFile: string, options?: Options): Promise; /** - * Get the original size of the compressed zip file. + * Get the original size of the compressed zip file, the size is the meta data stored in zip file. * * @param { string } inFile - Indicates the path of the compressed file. * @returns { Promise } Returns the original size of the compressed file. - * @throws { BusinessError } 401 - The parameter check failed, has no parameter or parameter not string. + * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 900001 - The input source file is invalid. * @throws { BusinessError } 900003 - The input source file is not ZIP format or damaged. * @syscap SystemCapability.BundleManager.Zlib -- Gitee From bd0182464eb6711261bdcd2933dd7bffe6f0270a Mon Sep 17 00:00:00 2001 From: zhrenqiang Date: Fri, 26 Apr 2024 10:59:44 +0800 Subject: [PATCH 3/3] inFile -> compressedFile Signed-off-by: zhrenqiang Change-Id: I9e2c08017cb502b5d071d747750bb3a8364de63c --- api/@ohos.zlib.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index 8d074056c..9ea064461 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -574,7 +574,7 @@ declare namespace zlib { /** * Get the original size of the compressed zip file, the size is the meta data stored in zip file. * - * @param { string } inFile - Indicates the path of the compressed file. + * @param { string } compressedFile - Indicates the path of the compressed file. * @returns { Promise } Returns the original size of the compressed file. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. * @throws { BusinessError } 900001 - The input source file is invalid. @@ -584,7 +584,7 @@ declare namespace zlib { * @atomicservice * @since 12 */ - function getOriginalSize(inFile: string): Promise + function getOriginalSize(compressedFile: string): Promise /** * Asynchronous creation of verification objects. -- Gitee