161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"), 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit BasicServicesKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * @namespace zlib 2561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 2661847f8eSopenharmony_ci * @since 7 2761847f8eSopenharmony_ci */ 2861847f8eSopenharmony_ci/** 2961847f8eSopenharmony_ci * @namespace zlib 3061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 3161847f8eSopenharmony_ci * @atomicservice 3261847f8eSopenharmony_ci * @since 11 3361847f8eSopenharmony_ci */ 3461847f8eSopenharmony_ci/** 3561847f8eSopenharmony_ci * @namespace zlib 3661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 3761847f8eSopenharmony_ci * @crossplatform 3861847f8eSopenharmony_ci * @atomicservice 3961847f8eSopenharmony_ci * @since 12 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_cideclare namespace zlib { 4261847f8eSopenharmony_ci /** 4361847f8eSopenharmony_ci * ErrorCode 4461847f8eSopenharmony_ci * 4561847f8eSopenharmony_ci * @enum { number } 4661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 4761847f8eSopenharmony_ci * @since 7 4861847f8eSopenharmony_ci * @deprecated since 9 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci export enum ErrorCode { 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 5361847f8eSopenharmony_ci * @since 7 5461847f8eSopenharmony_ci * @deprecated since 9 5561847f8eSopenharmony_ci */ 5661847f8eSopenharmony_ci ERROR_CODE_OK = 0, 5761847f8eSopenharmony_ci /** 5861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 5961847f8eSopenharmony_ci * @since 7 6061847f8eSopenharmony_ci * @deprecated since 9 6161847f8eSopenharmony_ci */ 6261847f8eSopenharmony_ci ERROR_CODE_ERRNO = -1 6361847f8eSopenharmony_ci } 6461847f8eSopenharmony_ci 6561847f8eSopenharmony_ci /** 6661847f8eSopenharmony_ci * CompressLevel 6761847f8eSopenharmony_ci * 6861847f8eSopenharmony_ci * @enum { number } 6961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 7061847f8eSopenharmony_ci * @since 7 7161847f8eSopenharmony_ci */ 7261847f8eSopenharmony_ci /** 7361847f8eSopenharmony_ci * CompressLevel 7461847f8eSopenharmony_ci * 7561847f8eSopenharmony_ci * @enum { number } 7661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 7761847f8eSopenharmony_ci * @crossplatform 7861847f8eSopenharmony_ci * @atomicservice 7961847f8eSopenharmony_ci * @since 11 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci export enum CompressLevel { 8261847f8eSopenharmony_ci /** 8361847f8eSopenharmony_ci * Indicates the no compression mode. 8461847f8eSopenharmony_ci * 8561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 8661847f8eSopenharmony_ci * @since 7 8761847f8eSopenharmony_ci */ 8861847f8eSopenharmony_ci /** 8961847f8eSopenharmony_ci * Indicates the no compression mode. 9061847f8eSopenharmony_ci * 9161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 9261847f8eSopenharmony_ci * @crossplatform 9361847f8eSopenharmony_ci * @atomicservice 9461847f8eSopenharmony_ci * @since 11 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci COMPRESS_LEVEL_NO_COMPRESSION = 0, 9761847f8eSopenharmony_ci /** 9861847f8eSopenharmony_ci * Indicates the best speed mode. 9961847f8eSopenharmony_ci * 10061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 10161847f8eSopenharmony_ci * @since 7 10261847f8eSopenharmony_ci */ 10361847f8eSopenharmony_ci /** 10461847f8eSopenharmony_ci * Indicates the best speed mode. 10561847f8eSopenharmony_ci * 10661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 10761847f8eSopenharmony_ci * @crossplatform 10861847f8eSopenharmony_ci * @atomicservice 10961847f8eSopenharmony_ci * @since 11 11061847f8eSopenharmony_ci */ 11161847f8eSopenharmony_ci COMPRESS_LEVEL_BEST_SPEED = 1, 11261847f8eSopenharmony_ci /** 11361847f8eSopenharmony_ci * Indicates the best compression mode. 11461847f8eSopenharmony_ci * 11561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 11661847f8eSopenharmony_ci * @since 7 11761847f8eSopenharmony_ci */ 11861847f8eSopenharmony_ci /** 11961847f8eSopenharmony_ci * Indicates the best compression mode. 12061847f8eSopenharmony_ci * 12161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 12261847f8eSopenharmony_ci * @crossplatform 12361847f8eSopenharmony_ci * @atomicservice 12461847f8eSopenharmony_ci * @since 11 12561847f8eSopenharmony_ci */ 12661847f8eSopenharmony_ci COMPRESS_LEVEL_BEST_COMPRESSION = 9, 12761847f8eSopenharmony_ci /** 12861847f8eSopenharmony_ci * Indicates the default compression mode. 12961847f8eSopenharmony_ci * 13061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 13161847f8eSopenharmony_ci * @since 7 13261847f8eSopenharmony_ci */ 13361847f8eSopenharmony_ci /** 13461847f8eSopenharmony_ci * Indicates the default compression mode. 13561847f8eSopenharmony_ci * 13661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 13761847f8eSopenharmony_ci * @crossplatform 13861847f8eSopenharmony_ci * @atomicservice 13961847f8eSopenharmony_ci * @since 11 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci COMPRESS_LEVEL_DEFAULT_COMPRESSION = -1 14261847f8eSopenharmony_ci } 14361847f8eSopenharmony_ci 14461847f8eSopenharmony_ci /** 14561847f8eSopenharmony_ci * CompressStrategy 14661847f8eSopenharmony_ci * 14761847f8eSopenharmony_ci * @enum { number } 14861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 14961847f8eSopenharmony_ci * @since 7 15061847f8eSopenharmony_ci */ 15161847f8eSopenharmony_ci /** 15261847f8eSopenharmony_ci * CompressStrategy 15361847f8eSopenharmony_ci * 15461847f8eSopenharmony_ci * @enum { number } 15561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 15661847f8eSopenharmony_ci * @crossplatform 15761847f8eSopenharmony_ci * @atomicservice 15861847f8eSopenharmony_ci * @since 11 15961847f8eSopenharmony_ci */ 16061847f8eSopenharmony_ci export enum CompressStrategy { 16161847f8eSopenharmony_ci /** 16261847f8eSopenharmony_ci * Indicates the default strategy. 16361847f8eSopenharmony_ci * 16461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 16561847f8eSopenharmony_ci * @since 7 16661847f8eSopenharmony_ci */ 16761847f8eSopenharmony_ci /** 16861847f8eSopenharmony_ci * Indicates the default strategy. 16961847f8eSopenharmony_ci * 17061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 17161847f8eSopenharmony_ci * @crossplatform 17261847f8eSopenharmony_ci * @atomicservice 17361847f8eSopenharmony_ci * @since 11 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci COMPRESS_STRATEGY_DEFAULT_STRATEGY = 0, 17661847f8eSopenharmony_ci /** 17761847f8eSopenharmony_ci * Indicates the filtered strategy. 17861847f8eSopenharmony_ci * 17961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 18061847f8eSopenharmony_ci * @since 7 18161847f8eSopenharmony_ci */ 18261847f8eSopenharmony_ci /** 18361847f8eSopenharmony_ci * Indicates the filtered strategy. 18461847f8eSopenharmony_ci * 18561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 18661847f8eSopenharmony_ci * @crossplatform 18761847f8eSopenharmony_ci * @atomicservice 18861847f8eSopenharmony_ci * @since 11 18961847f8eSopenharmony_ci */ 19061847f8eSopenharmony_ci COMPRESS_STRATEGY_FILTERED = 1, 19161847f8eSopenharmony_ci /** 19261847f8eSopenharmony_ci * Indicates the huffman-only strategy. 19361847f8eSopenharmony_ci * 19461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 19561847f8eSopenharmony_ci * @since 7 19661847f8eSopenharmony_ci */ 19761847f8eSopenharmony_ci /** 19861847f8eSopenharmony_ci * Indicates the huffman-only strategy. 19961847f8eSopenharmony_ci * 20061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 20161847f8eSopenharmony_ci * @crossplatform 20261847f8eSopenharmony_ci * @atomicservice 20361847f8eSopenharmony_ci * @since 11 20461847f8eSopenharmony_ci */ 20561847f8eSopenharmony_ci COMPRESS_STRATEGY_HUFFMAN_ONLY = 2, 20661847f8eSopenharmony_ci /** 20761847f8eSopenharmony_ci * Indicates the RLE strategy. 20861847f8eSopenharmony_ci * 20961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 21061847f8eSopenharmony_ci * @since 7 21161847f8eSopenharmony_ci */ 21261847f8eSopenharmony_ci /** 21361847f8eSopenharmony_ci * Indicates the RLE strategy. 21461847f8eSopenharmony_ci * 21561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 21661847f8eSopenharmony_ci * @crossplatform 21761847f8eSopenharmony_ci * @atomicservice 21861847f8eSopenharmony_ci * @since 11 21961847f8eSopenharmony_ci */ 22061847f8eSopenharmony_ci COMPRESS_STRATEGY_RLE = 3, 22161847f8eSopenharmony_ci /** 22261847f8eSopenharmony_ci * Indicates the fixed strategy. 22361847f8eSopenharmony_ci * 22461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 22561847f8eSopenharmony_ci * @since 7 22661847f8eSopenharmony_ci */ 22761847f8eSopenharmony_ci /** 22861847f8eSopenharmony_ci * Indicates the fixed strategy. 22961847f8eSopenharmony_ci * 23061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 23161847f8eSopenharmony_ci * @crossplatform 23261847f8eSopenharmony_ci * @atomicservice 23361847f8eSopenharmony_ci * @since 11 23461847f8eSopenharmony_ci */ 23561847f8eSopenharmony_ci COMPRESS_STRATEGY_FIXED = 4 23661847f8eSopenharmony_ci } 23761847f8eSopenharmony_ci 23861847f8eSopenharmony_ci /** 23961847f8eSopenharmony_ci * MemLevel 24061847f8eSopenharmony_ci * 24161847f8eSopenharmony_ci * @enum { number } 24261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 24361847f8eSopenharmony_ci * @since 7 24461847f8eSopenharmony_ci */ 24561847f8eSopenharmony_ci /** 24661847f8eSopenharmony_ci * MemLevel 24761847f8eSopenharmony_ci * 24861847f8eSopenharmony_ci * @enum { number } 24961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 25061847f8eSopenharmony_ci * @crossplatform 25161847f8eSopenharmony_ci * @atomicservice 25261847f8eSopenharmony_ci * @since 11 25361847f8eSopenharmony_ci */ 25461847f8eSopenharmony_ci export enum MemLevel { 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Uses the least amount of memory. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 25961847f8eSopenharmony_ci * @since 7 26061847f8eSopenharmony_ci */ 26161847f8eSopenharmony_ci /** 26261847f8eSopenharmony_ci * Uses the least amount of memory. 26361847f8eSopenharmony_ci * 26461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 26561847f8eSopenharmony_ci * @crossplatform 26661847f8eSopenharmony_ci * @atomicservice 26761847f8eSopenharmony_ci * @since 11 26861847f8eSopenharmony_ci */ 26961847f8eSopenharmony_ci MEM_LEVEL_MIN = 1, 27061847f8eSopenharmony_ci /** 27161847f8eSopenharmony_ci * Uses the maximum amount of memory. 27261847f8eSopenharmony_ci * 27361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 27461847f8eSopenharmony_ci * @since 7 27561847f8eSopenharmony_ci */ 27661847f8eSopenharmony_ci /** 27761847f8eSopenharmony_ci * Uses the maximum amount of memory. 27861847f8eSopenharmony_ci * 27961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 28061847f8eSopenharmony_ci * @crossplatform 28161847f8eSopenharmony_ci * @atomicservice 28261847f8eSopenharmony_ci * @since 11 28361847f8eSopenharmony_ci */ 28461847f8eSopenharmony_ci MEM_LEVEL_MAX = 9, 28561847f8eSopenharmony_ci /** 28661847f8eSopenharmony_ci * Uses the default amount of memory. 28761847f8eSopenharmony_ci * 28861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 28961847f8eSopenharmony_ci * @since 7 29061847f8eSopenharmony_ci */ 29161847f8eSopenharmony_ci /** 29261847f8eSopenharmony_ci * Uses the default amount of memory. 29361847f8eSopenharmony_ci * 29461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 29561847f8eSopenharmony_ci * @crossplatform 29661847f8eSopenharmony_ci * @atomicservice 29761847f8eSopenharmony_ci * @since 11 29861847f8eSopenharmony_ci */ 29961847f8eSopenharmony_ci MEM_LEVEL_DEFAULT = 8 30061847f8eSopenharmony_ci } 30161847f8eSopenharmony_ci 30261847f8eSopenharmony_ci /** 30361847f8eSopenharmony_ci * CompressFlushMode 30461847f8eSopenharmony_ci * 30561847f8eSopenharmony_ci * @enum { number } 30661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 30761847f8eSopenharmony_ci * @atomicservice 30861847f8eSopenharmony_ci * @since 12 30961847f8eSopenharmony_ci */ 31061847f8eSopenharmony_ci export enum CompressFlushMode { 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Default value, indicating normal operation. 31361847f8eSopenharmony_ci * 31461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 31561847f8eSopenharmony_ci * @atomicservice 31661847f8eSopenharmony_ci * @since 12 31761847f8eSopenharmony_ci */ 31861847f8eSopenharmony_ci NO_FLUSH = 0, 31961847f8eSopenharmony_ci /** 32061847f8eSopenharmony_ci * Generate partial refresh points in compressed streams. 32161847f8eSopenharmony_ci * 32261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 32361847f8eSopenharmony_ci * @atomicservice 32461847f8eSopenharmony_ci * @since 12 32561847f8eSopenharmony_ci */ 32661847f8eSopenharmony_ci PARTIAL_FLUSH = 1, 32761847f8eSopenharmony_ci /** 32861847f8eSopenharmony_ci * Force output of all compressed data while maintaining the compressed stream state. 32961847f8eSopenharmony_ci * 33061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 33161847f8eSopenharmony_ci * @atomicservice 33261847f8eSopenharmony_ci * @since 12 33361847f8eSopenharmony_ci */ 33461847f8eSopenharmony_ci SYNC_FLUSH = 2, 33561847f8eSopenharmony_ci /** 33661847f8eSopenharmony_ci * the compression state is reset. 33761847f8eSopenharmony_ci * 33861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 33961847f8eSopenharmony_ci * @atomicservice 34061847f8eSopenharmony_ci * @since 12 34161847f8eSopenharmony_ci */ 34261847f8eSopenharmony_ci FULL_FLUSH = 3, 34361847f8eSopenharmony_ci /** 34461847f8eSopenharmony_ci * The compression or decompression process ends. 34561847f8eSopenharmony_ci * 34661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 34761847f8eSopenharmony_ci * @atomicservice 34861847f8eSopenharmony_ci * @since 12 34961847f8eSopenharmony_ci */ 35061847f8eSopenharmony_ci FINISH = 4, 35161847f8eSopenharmony_ci /** 35261847f8eSopenharmony_ci * Allow for finer grained control. 35361847f8eSopenharmony_ci * 35461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 35561847f8eSopenharmony_ci * @atomicservice 35661847f8eSopenharmony_ci * @since 12 35761847f8eSopenharmony_ci */ 35861847f8eSopenharmony_ci BLOCK = 5, 35961847f8eSopenharmony_ci /** 36061847f8eSopenharmony_ci * There are special purposes in implementation. 36161847f8eSopenharmony_ci * 36261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 36361847f8eSopenharmony_ci * @atomicservice 36461847f8eSopenharmony_ci * @since 12 36561847f8eSopenharmony_ci */ 36661847f8eSopenharmony_ci TREES = 6 36761847f8eSopenharmony_ci } 36861847f8eSopenharmony_ci 36961847f8eSopenharmony_ci /** 37061847f8eSopenharmony_ci * Return codes for the compression/decompression functions. 37161847f8eSopenharmony_ci * 37261847f8eSopenharmony_ci * @enum { number } 37361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 37461847f8eSopenharmony_ci * @atomicservice 37561847f8eSopenharmony_ci * @since 12 37661847f8eSopenharmony_ci */ 37761847f8eSopenharmony_ci export enum ReturnStatus { 37861847f8eSopenharmony_ci /** 37961847f8eSopenharmony_ci * Indicates success. 38061847f8eSopenharmony_ci * 38161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 38261847f8eSopenharmony_ci * @atomicservice 38361847f8eSopenharmony_ci * @since 12 38461847f8eSopenharmony_ci */ 38561847f8eSopenharmony_ci OK = 0, 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Indicates that the entire data has been processed. 38861847f8eSopenharmony_ci * 38961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 39061847f8eSopenharmony_ci * @atomicservice 39161847f8eSopenharmony_ci * @since 12 39261847f8eSopenharmony_ci */ 39361847f8eSopenharmony_ci STREAM_END = 1, 39461847f8eSopenharmony_ci /** 39561847f8eSopenharmony_ci * Indicates preset dictionary is required to continue decompression. 39661847f8eSopenharmony_ci * 39761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 39861847f8eSopenharmony_ci * @atomicservice 39961847f8eSopenharmony_ci * @since 12 40061847f8eSopenharmony_ci */ 40161847f8eSopenharmony_ci NEED_DICT = 2, 40261847f8eSopenharmony_ci } 40361847f8eSopenharmony_ci 40461847f8eSopenharmony_ci /** 40561847f8eSopenharmony_ci * The deflate compression method (the only one supported in this version). 40661847f8eSopenharmony_ci * 40761847f8eSopenharmony_ci * @enum { number } 40861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 40961847f8eSopenharmony_ci * @atomicservice 41061847f8eSopenharmony_ci * @since 12 41161847f8eSopenharmony_ci */ 41261847f8eSopenharmony_ci export enum CompressMethod { 41361847f8eSopenharmony_ci /** 41461847f8eSopenharmony_ci * Compression method. 41561847f8eSopenharmony_ci * 41661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 41761847f8eSopenharmony_ci * @atomicservice 41861847f8eSopenharmony_ci * @since 12 41961847f8eSopenharmony_ci */ 42061847f8eSopenharmony_ci DEFLATED = 8, 42161847f8eSopenharmony_ci } 42261847f8eSopenharmony_ci 42361847f8eSopenharmony_ci /** 42461847f8eSopenharmony_ci * Define the reference point for offset. 42561847f8eSopenharmony_ci * 42661847f8eSopenharmony_ci * @enum { number } 42761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 42861847f8eSopenharmony_ci * @atomicservice 42961847f8eSopenharmony_ci * @since 12 43061847f8eSopenharmony_ci */ 43161847f8eSopenharmony_ci export enum OffsetReferencePoint { 43261847f8eSopenharmony_ci /** 43361847f8eSopenharmony_ci * Seek from beginning of file. 43461847f8eSopenharmony_ci * 43561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 43661847f8eSopenharmony_ci * @atomicservice 43761847f8eSopenharmony_ci * @since 12 43861847f8eSopenharmony_ci */ 43961847f8eSopenharmony_ci SEEK_SET = 0, 44061847f8eSopenharmony_ci 44161847f8eSopenharmony_ci /** 44261847f8eSopenharmony_ci * Seek from current position. 44361847f8eSopenharmony_ci * 44461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 44561847f8eSopenharmony_ci * @atomicservice 44661847f8eSopenharmony_ci * @since 12 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci SEEK_CUR = 1, 44961847f8eSopenharmony_ci } 45061847f8eSopenharmony_ci 45161847f8eSopenharmony_ci /** 45261847f8eSopenharmony_ci * Defines compress or decompress options. 45361847f8eSopenharmony_ci * 45461847f8eSopenharmony_ci * @typedef Options 45561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 45661847f8eSopenharmony_ci * @since 7 45761847f8eSopenharmony_ci */ 45861847f8eSopenharmony_ci /** 45961847f8eSopenharmony_ci * Defines compress or decompress options. 46061847f8eSopenharmony_ci * 46161847f8eSopenharmony_ci * @typedef Options 46261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 46361847f8eSopenharmony_ci * @crossplatform 46461847f8eSopenharmony_ci * @atomicservice 46561847f8eSopenharmony_ci * @since 11 46661847f8eSopenharmony_ci */ 46761847f8eSopenharmony_ci interface Options { 46861847f8eSopenharmony_ci /** 46961847f8eSopenharmony_ci * Indicates the compress level. 47061847f8eSopenharmony_ci * 47161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 47261847f8eSopenharmony_ci * @since 7 47361847f8eSopenharmony_ci */ 47461847f8eSopenharmony_ci /** 47561847f8eSopenharmony_ci * Indicates the compress level. 47661847f8eSopenharmony_ci * 47761847f8eSopenharmony_ci * @type { ?CompressLevel } 47861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 47961847f8eSopenharmony_ci * @crossplatform 48061847f8eSopenharmony_ci * @atomicservice 48161847f8eSopenharmony_ci * @since 11 48261847f8eSopenharmony_ci */ 48361847f8eSopenharmony_ci level?: CompressLevel; 48461847f8eSopenharmony_ci /** 48561847f8eSopenharmony_ci * Indicates the memory level. 48661847f8eSopenharmony_ci * 48761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 48861847f8eSopenharmony_ci * @since 7 48961847f8eSopenharmony_ci */ 49061847f8eSopenharmony_ci /** 49161847f8eSopenharmony_ci * Indicates the memory level. 49261847f8eSopenharmony_ci * 49361847f8eSopenharmony_ci * @type { ?MemLevel } 49461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 49561847f8eSopenharmony_ci * @crossplatform 49661847f8eSopenharmony_ci * @atomicservice 49761847f8eSopenharmony_ci * @since 11 49861847f8eSopenharmony_ci */ 49961847f8eSopenharmony_ci memLevel?: MemLevel; 50061847f8eSopenharmony_ci /** 50161847f8eSopenharmony_ci * Indicates the compress strategy. 50261847f8eSopenharmony_ci * 50361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 50461847f8eSopenharmony_ci * @since 7 50561847f8eSopenharmony_ci */ 50661847f8eSopenharmony_ci /** 50761847f8eSopenharmony_ci * Indicates the compress strategy. 50861847f8eSopenharmony_ci * 50961847f8eSopenharmony_ci * @type { ?CompressStrategy } 51061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 51161847f8eSopenharmony_ci * @crossplatform 51261847f8eSopenharmony_ci * @atomicservice 51361847f8eSopenharmony_ci * @since 11 51461847f8eSopenharmony_ci */ 51561847f8eSopenharmony_ci strategy?: CompressStrategy; 51661847f8eSopenharmony_ci } 51761847f8eSopenharmony_ci 51861847f8eSopenharmony_ci /** 51961847f8eSopenharmony_ci * Process all the information required for compression and decompression. 52061847f8eSopenharmony_ci * 52161847f8eSopenharmony_ci * @typedef ZStream 52261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 52361847f8eSopenharmony_ci * @atomicservice 52461847f8eSopenharmony_ci * @since 12 52561847f8eSopenharmony_ci */ 52661847f8eSopenharmony_ci interface ZStream { 52761847f8eSopenharmony_ci /** 52861847f8eSopenharmony_ci * Next input byte. 52961847f8eSopenharmony_ci * 53061847f8eSopenharmony_ci * @type { ?ArrayBuffer } 53161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 53261847f8eSopenharmony_ci * @atomicservice 53361847f8eSopenharmony_ci * @since 12 53461847f8eSopenharmony_ci */ 53561847f8eSopenharmony_ci nextIn?: ArrayBuffer; 53661847f8eSopenharmony_ci 53761847f8eSopenharmony_ci /** 53861847f8eSopenharmony_ci * Number of bytes available at nextIn. 53961847f8eSopenharmony_ci * 54061847f8eSopenharmony_ci * @type { ?number } 54161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 54261847f8eSopenharmony_ci * @atomicservice 54361847f8eSopenharmony_ci * @since 12 54461847f8eSopenharmony_ci */ 54561847f8eSopenharmony_ci availableIn?: number; 54661847f8eSopenharmony_ci 54761847f8eSopenharmony_ci /** 54861847f8eSopenharmony_ci * Total number of input bytes read so far. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @type { ?number } 55161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 55261847f8eSopenharmony_ci * @atomicservice 55361847f8eSopenharmony_ci * @since 12 55461847f8eSopenharmony_ci */ 55561847f8eSopenharmony_ci totalIn?: number; 55661847f8eSopenharmony_ci 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * Next output byte will go here. 55961847f8eSopenharmony_ci * 56061847f8eSopenharmony_ci * @type { ?ArrayBuffer } 56161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 56261847f8eSopenharmony_ci * @atomicservice 56361847f8eSopenharmony_ci * @since 12 56461847f8eSopenharmony_ci */ 56561847f8eSopenharmony_ci nextOut?: ArrayBuffer; 56661847f8eSopenharmony_ci 56761847f8eSopenharmony_ci /** 56861847f8eSopenharmony_ci * Remaining free space at nextOut. 56961847f8eSopenharmony_ci * 57061847f8eSopenharmony_ci * @type { ?number } 57161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 57261847f8eSopenharmony_ci * @atomicservice 57361847f8eSopenharmony_ci * @since 12 57461847f8eSopenharmony_ci */ 57561847f8eSopenharmony_ci availableOut?: number; 57661847f8eSopenharmony_ci 57761847f8eSopenharmony_ci /** 57861847f8eSopenharmony_ci * Total number of bytes output so far. 57961847f8eSopenharmony_ci * 58061847f8eSopenharmony_ci * @type { ?number } 58161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 58261847f8eSopenharmony_ci * @atomicservice 58361847f8eSopenharmony_ci * @since 12 58461847f8eSopenharmony_ci */ 58561847f8eSopenharmony_ci totalOut?: number; 58661847f8eSopenharmony_ci 58761847f8eSopenharmony_ci /** 58861847f8eSopenharmony_ci * Best guess about the data type. 58961847f8eSopenharmony_ci * 59061847f8eSopenharmony_ci * @type { ?number } 59161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 59261847f8eSopenharmony_ci * @atomicservice 59361847f8eSopenharmony_ci * @since 12 59461847f8eSopenharmony_ci */ 59561847f8eSopenharmony_ci dataType?: number; 59661847f8eSopenharmony_ci 59761847f8eSopenharmony_ci /** 59861847f8eSopenharmony_ci * Adler-32 or CRC-32 value of the uncompressed data. 59961847f8eSopenharmony_ci * 60061847f8eSopenharmony_ci * @type { ?number } 60161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 60261847f8eSopenharmony_ci * @atomicservice 60361847f8eSopenharmony_ci * @since 12 60461847f8eSopenharmony_ci */ 60561847f8eSopenharmony_ci adler?: number; 60661847f8eSopenharmony_ci } 60761847f8eSopenharmony_ci 60861847f8eSopenharmony_ci /** 60961847f8eSopenharmony_ci * Gzip header information passed to and from zlib routines. 61061847f8eSopenharmony_ci * 61161847f8eSopenharmony_ci * @typedef GzHeader 61261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 61361847f8eSopenharmony_ci * @atomicservice 61461847f8eSopenharmony_ci * @since 12 61561847f8eSopenharmony_ci */ 61661847f8eSopenharmony_ci interface GzHeader { 61761847f8eSopenharmony_ci /** 61861847f8eSopenharmony_ci * True if compressed data believed to be text. 61961847f8eSopenharmony_ci * 62061847f8eSopenharmony_ci * @type { ?boolean } 62161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 62261847f8eSopenharmony_ci * @atomicservice 62361847f8eSopenharmony_ci * @since 12 62461847f8eSopenharmony_ci */ 62561847f8eSopenharmony_ci isText?: boolean; 62661847f8eSopenharmony_ci 62761847f8eSopenharmony_ci /** 62861847f8eSopenharmony_ci * Operating system. 62961847f8eSopenharmony_ci * 63061847f8eSopenharmony_ci * @type { ?number } 63161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 63261847f8eSopenharmony_ci * @atomicservice 63361847f8eSopenharmony_ci * @since 12 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci os?: number; 63661847f8eSopenharmony_ci 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Modification time. 63961847f8eSopenharmony_ci * 64061847f8eSopenharmony_ci * @type { ?number } 64161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 64261847f8eSopenharmony_ci * @atomicservice 64361847f8eSopenharmony_ci * @since 12 64461847f8eSopenharmony_ci */ 64561847f8eSopenharmony_ci time?: number; 64661847f8eSopenharmony_ci 64761847f8eSopenharmony_ci /** 64861847f8eSopenharmony_ci * Extra flags. 64961847f8eSopenharmony_ci * 65061847f8eSopenharmony_ci * @type { ?number } 65161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 65261847f8eSopenharmony_ci * @atomicservice 65361847f8eSopenharmony_ci * @since 12 65461847f8eSopenharmony_ci */ 65561847f8eSopenharmony_ci xflags?: number; 65661847f8eSopenharmony_ci 65761847f8eSopenharmony_ci /** 65861847f8eSopenharmony_ci * Extra field. 65961847f8eSopenharmony_ci * 66061847f8eSopenharmony_ci * @type { ?ArrayBuffer } 66161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 66261847f8eSopenharmony_ci * @atomicservice 66361847f8eSopenharmony_ci * @since 12 66461847f8eSopenharmony_ci */ 66561847f8eSopenharmony_ci extra?: ArrayBuffer; 66661847f8eSopenharmony_ci 66761847f8eSopenharmony_ci /** 66861847f8eSopenharmony_ci * Extra field length. 66961847f8eSopenharmony_ci * 67061847f8eSopenharmony_ci * @type { ?number } 67161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 67261847f8eSopenharmony_ci * @atomicservice 67361847f8eSopenharmony_ci * @since 12 67461847f8eSopenharmony_ci */ 67561847f8eSopenharmony_ci extraLen?: number; 67661847f8eSopenharmony_ci 67761847f8eSopenharmony_ci /** 67861847f8eSopenharmony_ci * Zero-terminated file name. 67961847f8eSopenharmony_ci * 68061847f8eSopenharmony_ci * @type { ?ArrayBuffer } 68161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 68261847f8eSopenharmony_ci * @atomicservice 68361847f8eSopenharmony_ci * @since 12 68461847f8eSopenharmony_ci */ 68561847f8eSopenharmony_ci name?: ArrayBuffer; 68661847f8eSopenharmony_ci 68761847f8eSopenharmony_ci /** 68861847f8eSopenharmony_ci * Zero-terminated comment. 68961847f8eSopenharmony_ci * 69061847f8eSopenharmony_ci * @type { ?ArrayBuffer } 69161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 69261847f8eSopenharmony_ci * @atomicservice 69361847f8eSopenharmony_ci * @since 12 69461847f8eSopenharmony_ci */ 69561847f8eSopenharmony_ci comment?: ArrayBuffer; 69661847f8eSopenharmony_ci 69761847f8eSopenharmony_ci /** 69861847f8eSopenharmony_ci * True if there was or will be a header crc 69961847f8eSopenharmony_ci * 70061847f8eSopenharmony_ci * @type { ?boolean } 70161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 70261847f8eSopenharmony_ci * @atomicservice 70361847f8eSopenharmony_ci * @since 12 70461847f8eSopenharmony_ci */ 70561847f8eSopenharmony_ci hcrc?: boolean; 70661847f8eSopenharmony_ci 70761847f8eSopenharmony_ci /** 70861847f8eSopenharmony_ci * True when done reading gzip header. 70961847f8eSopenharmony_ci * 71061847f8eSopenharmony_ci * @type { ?boolean } 71161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 71261847f8eSopenharmony_ci * @atomicservice 71361847f8eSopenharmony_ci * @since 12 71461847f8eSopenharmony_ci */ 71561847f8eSopenharmony_ci done?: boolean; 71661847f8eSopenharmony_ci } 71761847f8eSopenharmony_ci 71861847f8eSopenharmony_ci /** 71961847f8eSopenharmony_ci * Compression and decompression return value information. 72061847f8eSopenharmony_ci * 72161847f8eSopenharmony_ci * @typedef ZipOutputInfo 72261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 72361847f8eSopenharmony_ci * @atomicservice 72461847f8eSopenharmony_ci * @since 12 72561847f8eSopenharmony_ci */ 72661847f8eSopenharmony_ci interface ZipOutputInfo { 72761847f8eSopenharmony_ci /** 72861847f8eSopenharmony_ci * ReturnStatus the specific meaning is defined as enum. 72961847f8eSopenharmony_ci * 73061847f8eSopenharmony_ci * @type { ReturnStatus } 73161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 73261847f8eSopenharmony_ci * @atomicservice 73361847f8eSopenharmony_ci * @since 12 73461847f8eSopenharmony_ci */ 73561847f8eSopenharmony_ci status: ReturnStatus 73661847f8eSopenharmony_ci 73761847f8eSopenharmony_ci /** 73861847f8eSopenharmony_ci * Total sizeof the destination buffer. 73961847f8eSopenharmony_ci * 74061847f8eSopenharmony_ci * @type { number } 74161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 74261847f8eSopenharmony_ci * @atomicservice 74361847f8eSopenharmony_ci * @since 12 74461847f8eSopenharmony_ci */ 74561847f8eSopenharmony_ci destLen: number 74661847f8eSopenharmony_ci } 74761847f8eSopenharmony_ci 74861847f8eSopenharmony_ci /** 74961847f8eSopenharmony_ci * InflateGetDictionary and deflateGetDictionary return value information. 75061847f8eSopenharmony_ci * 75161847f8eSopenharmony_ci * @typedef DictionaryOutputInfo 75261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 75361847f8eSopenharmony_ci * @atomicservice 75461847f8eSopenharmony_ci * @since 12 75561847f8eSopenharmony_ci */ 75661847f8eSopenharmony_ci interface DictionaryOutputInfo { 75761847f8eSopenharmony_ci /** 75861847f8eSopenharmony_ci * ReturnStatus the specific meaning is defined as enum. 75961847f8eSopenharmony_ci * 76061847f8eSopenharmony_ci * @type { ReturnStatus } 76161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 76261847f8eSopenharmony_ci * @atomicservice 76361847f8eSopenharmony_ci * @since 12 76461847f8eSopenharmony_ci */ 76561847f8eSopenharmony_ci status: ReturnStatus 76661847f8eSopenharmony_ci 76761847f8eSopenharmony_ci /** 76861847f8eSopenharmony_ci * Return dictionary length. 76961847f8eSopenharmony_ci * 77061847f8eSopenharmony_ci * @type { number } 77161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 77261847f8eSopenharmony_ci * @atomicservice 77361847f8eSopenharmony_ci * @since 12 77461847f8eSopenharmony_ci */ 77561847f8eSopenharmony_ci dictionaryLength: number 77661847f8eSopenharmony_ci } 77761847f8eSopenharmony_ci 77861847f8eSopenharmony_ci /** 77961847f8eSopenharmony_ci * Uncompress2 return value information. 78061847f8eSopenharmony_ci * 78161847f8eSopenharmony_ci * @typedef DecompressionOutputInfo 78261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 78361847f8eSopenharmony_ci * @atomicservice 78461847f8eSopenharmony_ci * @since 12 78561847f8eSopenharmony_ci */ 78661847f8eSopenharmony_ci interface DecompressionOutputInfo { 78761847f8eSopenharmony_ci /** 78861847f8eSopenharmony_ci * ReturnStatus the specific meaning is defined as enum. 78961847f8eSopenharmony_ci * 79061847f8eSopenharmony_ci * @type { ReturnStatus } 79161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 79261847f8eSopenharmony_ci * @atomicservice 79361847f8eSopenharmony_ci * @since 12 79461847f8eSopenharmony_ci */ 79561847f8eSopenharmony_ci status: ReturnStatus 79661847f8eSopenharmony_ci 79761847f8eSopenharmony_ci /** 79861847f8eSopenharmony_ci * Total sizeof the destination buffer. 79961847f8eSopenharmony_ci * 80061847f8eSopenharmony_ci * @type { number } 80161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 80261847f8eSopenharmony_ci * @atomicservice 80361847f8eSopenharmony_ci * @since 12 80461847f8eSopenharmony_ci */ 80561847f8eSopenharmony_ci destLength: number 80661847f8eSopenharmony_ci 80761847f8eSopenharmony_ci /** 80861847f8eSopenharmony_ci * Total sizeof the sourceLen. 80961847f8eSopenharmony_ci * 81061847f8eSopenharmony_ci * @type { number } 81161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 81261847f8eSopenharmony_ci * @atomicservice 81361847f8eSopenharmony_ci * @since 12 81461847f8eSopenharmony_ci */ 81561847f8eSopenharmony_ci sourceLength: number 81661847f8eSopenharmony_ci } 81761847f8eSopenharmony_ci 81861847f8eSopenharmony_ci /** 81961847f8eSopenharmony_ci * DeflatePending return value information. 82061847f8eSopenharmony_ci * 82161847f8eSopenharmony_ci * @typedef DeflatePendingOutputInfo 82261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 82361847f8eSopenharmony_ci * @atomicservice 82461847f8eSopenharmony_ci * @since 12 82561847f8eSopenharmony_ci */ 82661847f8eSopenharmony_ci interface DeflatePendingOutputInfo { 82761847f8eSopenharmony_ci /** 82861847f8eSopenharmony_ci * ReturnStatus the specific meaning is defined as enum. 82961847f8eSopenharmony_ci * 83061847f8eSopenharmony_ci * @type { ReturnStatus } 83161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 83261847f8eSopenharmony_ci * @atomicservice 83361847f8eSopenharmony_ci * @since 12 83461847f8eSopenharmony_ci */ 83561847f8eSopenharmony_ci status: ReturnStatus 83661847f8eSopenharmony_ci 83761847f8eSopenharmony_ci /** 83861847f8eSopenharmony_ci * The number of bytes of output that have been generated. 83961847f8eSopenharmony_ci * 84061847f8eSopenharmony_ci * @type { number } 84161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 84261847f8eSopenharmony_ci * @atomicservice 84361847f8eSopenharmony_ci * @since 12 84461847f8eSopenharmony_ci */ 84561847f8eSopenharmony_ci pending: number 84661847f8eSopenharmony_ci 84761847f8eSopenharmony_ci /** 84861847f8eSopenharmony_ci * The number of bits of output that have been generated. 84961847f8eSopenharmony_ci * 85061847f8eSopenharmony_ci * @type { number } 85161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 85261847f8eSopenharmony_ci * @atomicservice 85361847f8eSopenharmony_ci * @since 12 85461847f8eSopenharmony_ci */ 85561847f8eSopenharmony_ci bits: number 85661847f8eSopenharmony_ci } 85761847f8eSopenharmony_ci 85861847f8eSopenharmony_ci /** 85961847f8eSopenharmony_ci * GzError return value information. 86061847f8eSopenharmony_ci * 86161847f8eSopenharmony_ci * @typedef GzErrorOutputInfo 86261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 86361847f8eSopenharmony_ci * @atomicservice 86461847f8eSopenharmony_ci * @since 12 86561847f8eSopenharmony_ci */ 86661847f8eSopenharmony_ci interface GzErrorOutputInfo { 86761847f8eSopenharmony_ci /** 86861847f8eSopenharmony_ci * Return Zlib status ReturnStatus the specific meaning is defined as enum. 86961847f8eSopenharmony_ci * 87061847f8eSopenharmony_ci * @type { ReturnStatus } 87161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 87261847f8eSopenharmony_ci * @atomicservice 87361847f8eSopenharmony_ci * @since 12 87461847f8eSopenharmony_ci */ 87561847f8eSopenharmony_ci status: ReturnStatus 87661847f8eSopenharmony_ci 87761847f8eSopenharmony_ci /** 87861847f8eSopenharmony_ci * The status message for the last status which occurred on file. 87961847f8eSopenharmony_ci * 88061847f8eSopenharmony_ci * @type { string } 88161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 88261847f8eSopenharmony_ci * @atomicservice 88361847f8eSopenharmony_ci * @since 12 88461847f8eSopenharmony_ci */ 88561847f8eSopenharmony_ci statusMsg: string 88661847f8eSopenharmony_ci } 88761847f8eSopenharmony_ci 88861847f8eSopenharmony_ci /** 88961847f8eSopenharmony_ci * A callback function for reading input data provided by a user. When the decompression process requires more input data, 89061847f8eSopenharmony_ci * zlib will call this function. This function should read data from the data source to the buffer. 89161847f8eSopenharmony_ci * 89261847f8eSopenharmony_ci * @typedef { function } 89361847f8eSopenharmony_ci * @param { object } inDesc - A universal user-defined data object. 89461847f8eSopenharmony_ci * The specific type and content depend on the actual application scenario, which can include configuration data, file handles, etc. 89561847f8eSopenharmony_ci * @returns { ArrayBuffer } Return the buffer successfully read by the data source through the input descriptor. 89661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 89761847f8eSopenharmony_ci * @atomicservice 89861847f8eSopenharmony_ci * @since 12 89961847f8eSopenharmony_ci */ 90061847f8eSopenharmony_ci type InflateBackInputCallback = (inDesc: object) => ArrayBuffer; 90161847f8eSopenharmony_ci 90261847f8eSopenharmony_ci /** 90361847f8eSopenharmony_ci * The output data provided by the user is written into the callback function. Whenever decompressed data is ready for output, 90461847f8eSopenharmony_ci * zlib calls this function to write the data from the buffer to the target location. 90561847f8eSopenharmony_ci * 90661847f8eSopenharmony_ci * @typedef { function } 90761847f8eSopenharmony_ci * @param { object } outDesc - Object passed to output function. Object dependency requirement implementation. 90861847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Used to store data to be written. 90961847f8eSopenharmony_ci * @param { number } length - Write the length of the output buffer. 91061847f8eSopenharmony_ci * @returns { number } Return the number of bytes output. 91161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 91261847f8eSopenharmony_ci * @atomicservice 91361847f8eSopenharmony_ci * @since 12 91461847f8eSopenharmony_ci */ 91561847f8eSopenharmony_ci type InflateBackOutputCallback = (outDesc: object, buf: ArrayBuffer, length: number) => number; 91661847f8eSopenharmony_ci 91761847f8eSopenharmony_ci /** 91861847f8eSopenharmony_ci * Compress the specified file. 91961847f8eSopenharmony_ci * 92061847f8eSopenharmony_ci * @param { string } inFile Indicates the path of the file to be compressed. 92161847f8eSopenharmony_ci * @param { string } outFile Indicates the path of the output compressed file. 92261847f8eSopenharmony_ci * @param { Options } options 92361847f8eSopenharmony_ci * @returns { Promise<void> } 92461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 92561847f8eSopenharmony_ci * @since 7 92661847f8eSopenharmony_ci * @deprecated since 9 92761847f8eSopenharmony_ci * @useinstead ohos.zlib#compressFile 92861847f8eSopenharmony_ci */ 92961847f8eSopenharmony_ci function zipFile(inFile: string, outFile: string, options: Options): Promise<void>; 93061847f8eSopenharmony_ci 93161847f8eSopenharmony_ci /** 93261847f8eSopenharmony_ci * Decompress the specified file. 93361847f8eSopenharmony_ci * 93461847f8eSopenharmony_ci * @param { string } inFile Indicates the path of the file to be decompressed. 93561847f8eSopenharmony_ci * @param { string } outFile Indicates the path of the decompressed file. 93661847f8eSopenharmony_ci * @param { Options } options 93761847f8eSopenharmony_ci * @returns { Promise<void> } 93861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 93961847f8eSopenharmony_ci * @since 7 94061847f8eSopenharmony_ci * @deprecated since 9 94161847f8eSopenharmony_ci * @useinstead ohos.zlib#decompressFile 94261847f8eSopenharmony_ci */ 94361847f8eSopenharmony_ci function unzipFile(inFile: string, outFile: string, options: Options): Promise<void>; 94461847f8eSopenharmony_ci 94561847f8eSopenharmony_ci /** 94661847f8eSopenharmony_ci * Compress the specified file. 94761847f8eSopenharmony_ci * 94861847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be compressed. 94961847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output compressed file. 95061847f8eSopenharmony_ci * @param { Options } options - Indicates the options of compressing file. 95161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of compressing file result. 95261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 95361847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 95461847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 95561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 95661847f8eSopenharmony_ci * @since 9 95761847f8eSopenharmony_ci */ 95861847f8eSopenharmony_ci /** 95961847f8eSopenharmony_ci * Compress the specified file. 96061847f8eSopenharmony_ci * 96161847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be compressed. 96261847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output compressed file. 96361847f8eSopenharmony_ci * @param { Options } options - Indicates the options of compressing file. 96461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of compressing file result. 96561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 96661847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 96761847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 96861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 96961847f8eSopenharmony_ci * @crossplatform 97061847f8eSopenharmony_ci * @atomicservice 97161847f8eSopenharmony_ci * @since 11 97261847f8eSopenharmony_ci */ 97361847f8eSopenharmony_ci function compressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback<void>): void; 97461847f8eSopenharmony_ci 97561847f8eSopenharmony_ci /** 97661847f8eSopenharmony_ci * Compress the specified file. 97761847f8eSopenharmony_ci * 97861847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be compressed. 97961847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output compressed file. 98061847f8eSopenharmony_ci * @param { Options } options - Indicates the options of compressing file. 98161847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of compressFile file. 98261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 98361847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 98461847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 98561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 98661847f8eSopenharmony_ci * @since 9 98761847f8eSopenharmony_ci */ 98861847f8eSopenharmony_ci /** 98961847f8eSopenharmony_ci * Compress the specified file. 99061847f8eSopenharmony_ci * 99161847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be compressed. 99261847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output compressed file. 99361847f8eSopenharmony_ci * @param { Options } options - Indicates the options of compressing file. 99461847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of compressFile file. 99561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 99661847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 99761847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 99861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 99961847f8eSopenharmony_ci * @crossplatform 100061847f8eSopenharmony_ci * @atomicservice 100161847f8eSopenharmony_ci * @since 11 100261847f8eSopenharmony_ci */ 100361847f8eSopenharmony_ci function compressFile(inFile: string, outFile: string, options: Options): Promise<void>; 100461847f8eSopenharmony_ci 100561847f8eSopenharmony_ci /** 100661847f8eSopenharmony_ci * Compress the specified multiple files. 100761847f8eSopenharmony_ci * 100861847f8eSopenharmony_ci * @param { Array<string> } inFiles - Indicates the files to be compressed. 100961847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output compressed file. 101061847f8eSopenharmony_ci * @param { Options } options - Indicates the options of compressing file. 101161847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of compressFile file. 101261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 101361847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 101461847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 101561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 101661847f8eSopenharmony_ci * @atomicservice 101761847f8eSopenharmony_ci * @since 12 101861847f8eSopenharmony_ci */ 101961847f8eSopenharmony_ci function compressFiles(inFiles: Array<string>, outFile: string, options: Options): Promise<void>; 102061847f8eSopenharmony_ci 102161847f8eSopenharmony_ci /** 102261847f8eSopenharmony_ci * Decompress the specified file. 102361847f8eSopenharmony_ci * 102461847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 102561847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressed file. 102661847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 102761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of decompressing file result. 102861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 102961847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 103061847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 103161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 103261847f8eSopenharmony_ci * @since 9 103361847f8eSopenharmony_ci */ 103461847f8eSopenharmony_ci /** 103561847f8eSopenharmony_ci * Decompress the specified file. 103661847f8eSopenharmony_ci * 103761847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 103861847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressed file. 103961847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 104061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of decompressing file result. 104161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 104261847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 104361847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 104461847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 104561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 104661847f8eSopenharmony_ci * @since 10 104761847f8eSopenharmony_ci */ 104861847f8eSopenharmony_ci /** 104961847f8eSopenharmony_ci * Decompress the specified file. 105061847f8eSopenharmony_ci * 105161847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 105261847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressed file. 105361847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 105461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of decompressing file result. 105561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 105661847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 105761847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 105861847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 105961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 106061847f8eSopenharmony_ci * @crossplatform 106161847f8eSopenharmony_ci * @atomicservice 106261847f8eSopenharmony_ci * @since 11 106361847f8eSopenharmony_ci */ 106461847f8eSopenharmony_ci function decompressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback<void>): void; 106561847f8eSopenharmony_ci 106661847f8eSopenharmony_ci /** 106761847f8eSopenharmony_ci * Decompress the specified file. 106861847f8eSopenharmony_ci * 106961847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 107061847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressed file. 107161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of decompressing file result. 107261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 107361847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 107461847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 107561847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 107661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 107761847f8eSopenharmony_ci * @since 10 107861847f8eSopenharmony_ci */ 107961847f8eSopenharmony_ci /** 108061847f8eSopenharmony_ci * Decompress the specified file. 108161847f8eSopenharmony_ci * 108261847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 108361847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressed file. 108461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The callback of decompressing file result. 108561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 108661847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 108761847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 108861847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 108961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 109061847f8eSopenharmony_ci * @crossplatform 109161847f8eSopenharmony_ci * @atomicservice 109261847f8eSopenharmony_ci * @since 11 109361847f8eSopenharmony_ci */ 109461847f8eSopenharmony_ci function decompressFile(inFile: string, outFile: string, callback: AsyncCallback<void>): void; 109561847f8eSopenharmony_ci 109661847f8eSopenharmony_ci /** 109761847f8eSopenharmony_ci * Decompress the specified file. 109861847f8eSopenharmony_ci * 109961847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 110061847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressing file. 110161847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 110261847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of decompressing file. 110361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 110461847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 110561847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 110661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 110761847f8eSopenharmony_ci * @since 9 110861847f8eSopenharmony_ci */ 110961847f8eSopenharmony_ci /** 111061847f8eSopenharmony_ci * Decompress the specified file. 111161847f8eSopenharmony_ci * 111261847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 111361847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressing file. 111461847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 111561847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of decompressing file. 111661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 111761847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 111861847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 111961847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 112061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 112161847f8eSopenharmony_ci * @since 10 112261847f8eSopenharmony_ci */ 112361847f8eSopenharmony_ci /** 112461847f8eSopenharmony_ci * Decompress the specified file. 112561847f8eSopenharmony_ci * 112661847f8eSopenharmony_ci * @param { string } inFile - Indicates the path of the file to be decompressed. 112761847f8eSopenharmony_ci * @param { string } outFile - Indicates the path of the output decompressing file. 112861847f8eSopenharmony_ci * @param { Options } options - Indicates the options of decompressing file. 112961847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result of decompressing file. 113061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 113161847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 113261847f8eSopenharmony_ci * @throws { BusinessError } 900002 - The input destination file is invalid. 113361847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 113461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 113561847f8eSopenharmony_ci * @crossplatform 113661847f8eSopenharmony_ci * @atomicservice 113761847f8eSopenharmony_ci * @since 11 113861847f8eSopenharmony_ci */ 113961847f8eSopenharmony_ci function decompressFile(inFile: string, outFile: string, options?: Options): Promise<void>; 114061847f8eSopenharmony_ci 114161847f8eSopenharmony_ci /** 114261847f8eSopenharmony_ci * Get the original size of the compressed zip file, the size is the meta data stored in zip file. 114361847f8eSopenharmony_ci * 114461847f8eSopenharmony_ci * @param { string } compressedFile - Indicates the path of the compressed file. 114561847f8eSopenharmony_ci * @returns { Promise<number> } Returns the original size of the compressed file. 114661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. 114761847f8eSopenharmony_ci * @throws { BusinessError } 900001 - The input source file is invalid. 114861847f8eSopenharmony_ci * @throws { BusinessError } 900003 - The input source file is not in ZIP format or is damaged. 114961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 115061847f8eSopenharmony_ci * @crossplatform 115161847f8eSopenharmony_ci * @atomicservice 115261847f8eSopenharmony_ci * @since 12 115361847f8eSopenharmony_ci */ 115461847f8eSopenharmony_ci function getOriginalSize(compressedFile: string): Promise<number>; 115561847f8eSopenharmony_ci 115661847f8eSopenharmony_ci /** 115761847f8eSopenharmony_ci * Asynchronous creation of verification objects. 115861847f8eSopenharmony_ci * 115961847f8eSopenharmony_ci * @returns { Promise<Checksum> } Returns verification objects. 116061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 116161847f8eSopenharmony_ci * @atomicservice 116261847f8eSopenharmony_ci * @since 12 116361847f8eSopenharmony_ci */ 116461847f8eSopenharmony_ci function createChecksum(): Promise<Checksum>; 116561847f8eSopenharmony_ci 116661847f8eSopenharmony_ci /** 116761847f8eSopenharmony_ci * Synchronize creation of verification objects. 116861847f8eSopenharmony_ci * 116961847f8eSopenharmony_ci * @returns { Checksum } Returns verification objects. 117061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 117161847f8eSopenharmony_ci * @atomicservice 117261847f8eSopenharmony_ci * @since 12 117361847f8eSopenharmony_ci */ 117461847f8eSopenharmony_ci function createChecksumSync(): Checksum; 117561847f8eSopenharmony_ci 117661847f8eSopenharmony_ci /** 117761847f8eSopenharmony_ci * Asynchronous creation of zip objects. 117861847f8eSopenharmony_ci * 117961847f8eSopenharmony_ci * @returns { Promise<Zip> } Returns zip objects. 118061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 118161847f8eSopenharmony_ci * @atomicservice 118261847f8eSopenharmony_ci * @since 12 118361847f8eSopenharmony_ci */ 118461847f8eSopenharmony_ci function createZip(): Promise<Zip>; 118561847f8eSopenharmony_ci 118661847f8eSopenharmony_ci /** 118761847f8eSopenharmony_ci * Synchronize creation of zip objects. 118861847f8eSopenharmony_ci * 118961847f8eSopenharmony_ci * @returns { Zip } Returns zip objects. 119061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 119161847f8eSopenharmony_ci * @atomicservice 119261847f8eSopenharmony_ci * @since 12 119361847f8eSopenharmony_ci */ 119461847f8eSopenharmony_ci function createZipSync(): Zip; 119561847f8eSopenharmony_ci 119661847f8eSopenharmony_ci /** 119761847f8eSopenharmony_ci * Synchronize creation of gzip objects. 119861847f8eSopenharmony_ci * 119961847f8eSopenharmony_ci * @returns { Promise<GZip> } Returns zip objects. 120061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 120161847f8eSopenharmony_ci * @atomicservice 120261847f8eSopenharmony_ci * @since 12 120361847f8eSopenharmony_ci */ 120461847f8eSopenharmony_ci function createGZip(): Promise<GZip>; 120561847f8eSopenharmony_ci 120661847f8eSopenharmony_ci /** 120761847f8eSopenharmony_ci * Synchronize creation of gzip objects. 120861847f8eSopenharmony_ci * 120961847f8eSopenharmony_ci * @returns { GZip } Returns zip objects. 121061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 121161847f8eSopenharmony_ci * @atomicservice 121261847f8eSopenharmony_ci * @since 12 121361847f8eSopenharmony_ci */ 121461847f8eSopenharmony_ci function createGZipSync(): GZip; 121561847f8eSopenharmony_ci 121661847f8eSopenharmony_ci /** 121761847f8eSopenharmony_ci * Calculate Adler-32 and CRC-32 checksum. 121861847f8eSopenharmony_ci * 121961847f8eSopenharmony_ci * @typedef Checksum 122061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 122161847f8eSopenharmony_ci * @atomicservice 122261847f8eSopenharmony_ci * @since 12 122361847f8eSopenharmony_ci */ 122461847f8eSopenharmony_ci interface Checksum { 122561847f8eSopenharmony_ci /** 122661847f8eSopenharmony_ci * Update a running Adler-32 checksum with the bytes buf. 122761847f8eSopenharmony_ci * 122861847f8eSopenharmony_ci * @param { number } adler - Initial value of Adler32 checksum. 122961847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Calculate checksum data buffer. 123061847f8eSopenharmony_ci * @returns { Promise<number> } Return the updated checksum. 123161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 123261847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 123361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 123461847f8eSopenharmony_ci * @atomicservice 123561847f8eSopenharmony_ci * @since 12 123661847f8eSopenharmony_ci */ 123761847f8eSopenharmony_ci adler32(adler: number, buf: ArrayBuffer): Promise<number>; 123861847f8eSopenharmony_ci 123961847f8eSopenharmony_ci /** 124061847f8eSopenharmony_ci * Combine two Adler-32 checksum into one. 124161847f8eSopenharmony_ci * 124261847f8eSopenharmony_ci * @param { number } adler1 - The first Adler32 checksum. 124361847f8eSopenharmony_ci * @param { number } adler2 - The second Adler32 checksum. 124461847f8eSopenharmony_ci * @param { number } len2 - The length of the data block associated with the second Adler32 checksum. 124561847f8eSopenharmony_ci * @returns { Promise<number> } Returns the Adler-32 checksum. 124661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 124761847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 124861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 124961847f8eSopenharmony_ci * @atomicservice 125061847f8eSopenharmony_ci * @since 12 125161847f8eSopenharmony_ci */ 125261847f8eSopenharmony_ci adler32Combine(adler1: number, adler2: number, len2: number): Promise<number>; 125361847f8eSopenharmony_ci 125461847f8eSopenharmony_ci /** 125561847f8eSopenharmony_ci * Update a running CRC-32 with the bytes buf. 125661847f8eSopenharmony_ci * 125761847f8eSopenharmony_ci * @param { number } crc - Initial value of CRC-32 checksum. 125861847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Calculate checksum data buffer. 125961847f8eSopenharmony_ci * @returns { Promise<number> } Return the updated CRC-32. 126061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 126161847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 126261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 126361847f8eSopenharmony_ci * @atomicservice 126461847f8eSopenharmony_ci * @since 12 126561847f8eSopenharmony_ci */ 126661847f8eSopenharmony_ci crc32(crc: number, buf: ArrayBuffer): Promise<number>; 126761847f8eSopenharmony_ci 126861847f8eSopenharmony_ci /** 126961847f8eSopenharmony_ci * Combine two CRC-32 check values into one. 127061847f8eSopenharmony_ci * 127161847f8eSopenharmony_ci * @param { number } crc1 - The first CRC-32 checksum. 127261847f8eSopenharmony_ci * @param { number } crc2 - The second CRC-32 checksum. 127361847f8eSopenharmony_ci * @param { number } len2 - The length of the data block associated with the second CRC-32 checksum. 127461847f8eSopenharmony_ci * @returns { Promise<number> } Returns the CRC-32 check value. 127561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 127661847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 127761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 127861847f8eSopenharmony_ci * @atomicservice 127961847f8eSopenharmony_ci * @since 12 128061847f8eSopenharmony_ci */ 128161847f8eSopenharmony_ci crc32Combine(crc1: number, crc2: number, len2: number): Promise<number>; 128261847f8eSopenharmony_ci 128361847f8eSopenharmony_ci /** 128461847f8eSopenharmony_ci * Update a running CRC-64 with the bytes buf. 128561847f8eSopenharmony_ci * 128661847f8eSopenharmony_ci * @param { number } crc - Initial value of CRC-64 checksum. 128761847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Calculate checksum data buffer. 128861847f8eSopenharmony_ci * @returns { Promise<number> } Return the updated CRC-64. 128961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 129061847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 129161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 129261847f8eSopenharmony_ci * @atomicservice 129361847f8eSopenharmony_ci * @since 12 129461847f8eSopenharmony_ci */ 129561847f8eSopenharmony_ci crc64(crc: number, buf: ArrayBuffer): Promise<number>; 129661847f8eSopenharmony_ci 129761847f8eSopenharmony_ci /** 129861847f8eSopenharmony_ci * Get CRC-32 table. 129961847f8eSopenharmony_ci * 130061847f8eSopenharmony_ci * @returns { Promise<Array<number>> } Return a array to the CRC-32 table. 130161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 130261847f8eSopenharmony_ci * @atomicservice 130361847f8eSopenharmony_ci * @since 12 130461847f8eSopenharmony_ci */ 130561847f8eSopenharmony_ci getCrcTable(): Promise<Array<number>>; 130661847f8eSopenharmony_ci 130761847f8eSopenharmony_ci /** 130861847f8eSopenharmony_ci * Get CRC-64 table. 130961847f8eSopenharmony_ci * 131061847f8eSopenharmony_ci * @returns { Promise<Array<number>> } Return a array to the CRC-64 table. 131161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 131261847f8eSopenharmony_ci * @atomicservice 131361847f8eSopenharmony_ci * @since 12 131461847f8eSopenharmony_ci */ 131561847f8eSopenharmony_ci getCrc64Table(): Promise<Array<number>>; 131661847f8eSopenharmony_ci } 131761847f8eSopenharmony_ci 131861847f8eSopenharmony_ci /** 131961847f8eSopenharmony_ci * Deflate and inflate interface. 132061847f8eSopenharmony_ci * 132161847f8eSopenharmony_ci * @typedef Zip 132261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 132361847f8eSopenharmony_ci * @atomicservice 132461847f8eSopenharmony_ci * @since 12 132561847f8eSopenharmony_ci */ 132661847f8eSopenharmony_ci interface Zip { 132761847f8eSopenharmony_ci /** 132861847f8eSopenharmony_ci * Get ZStream. 132961847f8eSopenharmony_ci * 133061847f8eSopenharmony_ci * @returns { Promise<ZStream> } Return the required ZStream for compression or decompression. 133161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 133261847f8eSopenharmony_ci * @atomicservice 133361847f8eSopenharmony_ci * @since 12 133461847f8eSopenharmony_ci */ 133561847f8eSopenharmony_ci getZStream(): Promise<ZStream>; 133661847f8eSopenharmony_ci 133761847f8eSopenharmony_ci /** 133861847f8eSopenharmony_ci * Get the version information of the current linked zlib library. 133961847f8eSopenharmony_ci * 134061847f8eSopenharmony_ci * @returns { Promise<string> } Returns a specific version number string constant containing the zlib library. 134161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 134261847f8eSopenharmony_ci * @atomicservice 134361847f8eSopenharmony_ci * @since 12 134461847f8eSopenharmony_ci */ 134561847f8eSopenharmony_ci zlibVersion(): Promise<string>; 134661847f8eSopenharmony_ci 134761847f8eSopenharmony_ci /** 134861847f8eSopenharmony_ci * Return flags indicating compile-time options. 134961847f8eSopenharmony_ci * 135061847f8eSopenharmony_ci * @returns { Promise<number> } Return flags indicating compile-time options. 135161847f8eSopenharmony_ci * Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 135261847f8eSopenharmony_ci * 1.0: size of uInt. 135361847f8eSopenharmony_ci * 3.2: size of uLong. 135461847f8eSopenharmony_ci * 5.4: size of voidpf (pointer). 135561847f8eSopenharmony_ci * 7.6: size of z_off_t. 135661847f8eSopenharmony_ci * Compiler, assembler, and debug options: 135761847f8eSopenharmony_ci * 8: ZLIB_DEBUG. 135861847f8eSopenharmony_ci * 9: ASMV or ASMINF -- use ASM code. 135961847f8eSopenharmony_ci * 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention. 136061847f8eSopenharmony_ci * 11: 0 (reserved). 136161847f8eSopenharmony_ci * One-time table building (smaller code, but not thread-safe if true): 136261847f8eSopenharmony_ci * 12: BUILDFIXED -- build static block decoding tables when needed. 136361847f8eSopenharmony_ci * 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed. 136461847f8eSopenharmony_ci * 14,15: 0 (reserved). 136561847f8eSopenharmony_ci * Library content (indicates missing functionality): 136661847f8eSopenharmony_ci * 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed). 136761847f8eSopenharmony_ci * 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code). 136861847f8eSopenharmony_ci * 18-19: 0 (reserved). 136961847f8eSopenharmony_ci * Operation variations (changes in library functionality): 137061847f8eSopenharmony_ci * 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate. 137161847f8eSopenharmony_ci * 21: FASTEST -- deflate algorithm with only one, lowest compression level. 137261847f8eSopenharmony_ci * 22,23: 0 (reserved). 137361847f8eSopenharmony_ci * The sprintf variant used by gzprintf (zero is best): 137461847f8eSopenharmony_ci * 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format. 137561847f8eSopenharmony_ci * 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure. 137661847f8eSopenharmony_ci * 26: 0 = returns value, 1 = void -- 1 means inferred string length returned. 137761847f8eSopenharmony_ci * Remainder: 137861847f8eSopenharmony_ci * 27-31: 0 (reserved). 137961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 138061847f8eSopenharmony_ci * @atomicservice 138161847f8eSopenharmony_ci * @since 12 138261847f8eSopenharmony_ci */ 138361847f8eSopenharmony_ci zlibCompileFlags(): Promise<number>; 138461847f8eSopenharmony_ci 138561847f8eSopenharmony_ci /** 138661847f8eSopenharmony_ci * Compresses the source buffer into the destination buffer. 138761847f8eSopenharmony_ci * 138861847f8eSopenharmony_ci * @param { ArrayBuffer } dest - Destination buffer. 138961847f8eSopenharmony_ci * @param { ArrayBuffer } source - Source data buffer. 139061847f8eSopenharmony_ci * @param { number } sourceLen - Source data length. 139161847f8eSopenharmony_ci * @returns { Promise<ZipOutputInfo> } Return ReturnStatus and total sizeof the destination buffer. 139261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 139361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 139461847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 139561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 139661847f8eSopenharmony_ci * @atomicservice 139761847f8eSopenharmony_ci * @since 12 139861847f8eSopenharmony_ci */ 139961847f8eSopenharmony_ci compress(dest: ArrayBuffer, source: ArrayBuffer, sourceLen?: number): Promise<ZipOutputInfo>; 140061847f8eSopenharmony_ci 140161847f8eSopenharmony_ci /** 140261847f8eSopenharmony_ci * Compresses the source buffer into the destination buffer. 140361847f8eSopenharmony_ci * 140461847f8eSopenharmony_ci * @param { ArrayBuffer } dest - Destination buffer. 140561847f8eSopenharmony_ci * @param { ArrayBuffer } source - Source data buffer. 140661847f8eSopenharmony_ci * @param { CompressLevel } level - Compression level. 140761847f8eSopenharmony_ci * @param { number } sourceLen - Source data length. 140861847f8eSopenharmony_ci * @returns { Promise<ZipOutputInfo> } Return ReturnStatus and total sizeof the destination buffer. 140961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 141061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 141161847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 141261847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 141361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 141461847f8eSopenharmony_ci * @atomicservice 141561847f8eSopenharmony_ci * @since 12 141661847f8eSopenharmony_ci */ 141761847f8eSopenharmony_ci compress2(dest: ArrayBuffer, source: ArrayBuffer, level: CompressLevel, sourceLen?: number,): Promise<ZipOutputInfo>; 141861847f8eSopenharmony_ci 141961847f8eSopenharmony_ci /** 142061847f8eSopenharmony_ci * Calculate the upper limit of the return compression size. 142161847f8eSopenharmony_ci * 142261847f8eSopenharmony_ci * @param { number } sourceLen - The length of the source data. 142361847f8eSopenharmony_ci * @returns { Promise<number> } Returns an upper bound on the compressed size after. 142461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 142561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 142661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 142761847f8eSopenharmony_ci * @atomicservice 142861847f8eSopenharmony_ci * @since 12 142961847f8eSopenharmony_ci */ 143061847f8eSopenharmony_ci compressBound(sourceLen: number): Promise<number>; 143161847f8eSopenharmony_ci 143261847f8eSopenharmony_ci /** 143361847f8eSopenharmony_ci * Decompress the compressed data into its original uncompressed form. 143461847f8eSopenharmony_ci * 143561847f8eSopenharmony_ci * @param { ArrayBuffer } dest - Destination buffer. 143661847f8eSopenharmony_ci * @param { ArrayBuffer } source - Source data buffer. 143761847f8eSopenharmony_ci * @param { number } sourceLen - Source data length. 143861847f8eSopenharmony_ci * @returns { Promise<ZipOutputInfo> } Return ReturnStatus and total sizeof the destination buffer. 143961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 144061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 144161847f8eSopenharmony_ci * @throws { BusinessError } 17800005 - Data error. 144261847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 144361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 144461847f8eSopenharmony_ci * @atomicservice 144561847f8eSopenharmony_ci * @since 12 144661847f8eSopenharmony_ci */ 144761847f8eSopenharmony_ci uncompress(dest:ArrayBuffer, source: ArrayBuffer, sourceLen?: number): Promise<ZipOutputInfo>; 144861847f8eSopenharmony_ci 144961847f8eSopenharmony_ci /** 145061847f8eSopenharmony_ci * Decompress the compressed data into its original uncompressed form. 145161847f8eSopenharmony_ci * 145261847f8eSopenharmony_ci * @param { ArrayBuffer } dest - Destination buffer. 145361847f8eSopenharmony_ci * @param { ArrayBuffer } source - Source data buffer. 145461847f8eSopenharmony_ci * @param { number } sourceLen - Source data length. 145561847f8eSopenharmony_ci * @returns { Promise<DecompressionOutputInfo> } Return ReturnStatus and total sizeof the destination buffer and total sizeof the sourceLen. 145661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 145761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 145861847f8eSopenharmony_ci * @throws { BusinessError } 17800005 - Data error. 145961847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 146061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 146161847f8eSopenharmony_ci * @atomicservice 146261847f8eSopenharmony_ci * @since 12 146361847f8eSopenharmony_ci */ 146461847f8eSopenharmony_ci uncompress2(dest: ArrayBuffer, source: ArrayBuffer, sourceLen?: number): Promise<DecompressionOutputInfo>; 146561847f8eSopenharmony_ci 146661847f8eSopenharmony_ci /** 146761847f8eSopenharmony_ci * Verify the checksum inside the structure of compressed stream z_stream. 146861847f8eSopenharmony_ci * 146961847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 147061847f8eSopenharmony_ci * @param { number } check - Expected checksum. 147161847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 147261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 147361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 147461847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 147561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 147661847f8eSopenharmony_ci * @atomicservice 147761847f8eSopenharmony_ci * @since 12 147861847f8eSopenharmony_ci */ 147961847f8eSopenharmony_ci inflateValidate(strm: ZStream, check: number): Promise<ReturnStatus>; 148061847f8eSopenharmony_ci 148161847f8eSopenharmony_ci /** 148261847f8eSopenharmony_ci * Find a synchronization point for the current decompressed stream. 148361847f8eSopenharmony_ci * 148461847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 148561847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 148661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 148761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 148861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 148961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 149061847f8eSopenharmony_ci * @atomicservice 149161847f8eSopenharmony_ci * @since 12 149261847f8eSopenharmony_ci */ 149361847f8eSopenharmony_ci inflateSyncPoint(strm: ZStream): Promise<ReturnStatus>; 149461847f8eSopenharmony_ci 149561847f8eSopenharmony_ci /** 149661847f8eSopenharmony_ci * Skips invalid compressed data until a possible full flush point can be found. 149761847f8eSopenharmony_ci * 149861847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 149961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 150061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 150161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 150261847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 150361847f8eSopenharmony_ci * @throws { BusinessError } 17800005 - Data error. 150461847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 150561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 150661847f8eSopenharmony_ci * @atomicservice 150761847f8eSopenharmony_ci * @since 12 150861847f8eSopenharmony_ci */ 150961847f8eSopenharmony_ci inflateSync(strm: ZStream): Promise<ReturnStatus>; 151061847f8eSopenharmony_ci 151161847f8eSopenharmony_ci /** 151261847f8eSopenharmony_ci * Initializes the decompression dictionary from the given uncompressed byte sequence. 151361847f8eSopenharmony_ci * 151461847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 151561847f8eSopenharmony_ci * @param { ArrayBuffer } dictionary - Dictionary data. 151661847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 151761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 151861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 151961847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 152061847f8eSopenharmony_ci * @throws { BusinessError } 17800005 - Data error. 152161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 152261847f8eSopenharmony_ci * @atomicservice 152361847f8eSopenharmony_ci * @since 12 152461847f8eSopenharmony_ci */ 152561847f8eSopenharmony_ci inflateSetDictionary(strm: ZStream, dictionary: ArrayBuffer): Promise<ReturnStatus>; 152661847f8eSopenharmony_ci 152761847f8eSopenharmony_ci /** 152861847f8eSopenharmony_ci * Reset the state of the decompressed stream to retain the allocated Huffman decoding tree and preset dictionary. 152961847f8eSopenharmony_ci * 153061847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 153161847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 153261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 153361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 153461847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 153561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 153661847f8eSopenharmony_ci * @atomicservice 153761847f8eSopenharmony_ci * @since 12 153861847f8eSopenharmony_ci */ 153961847f8eSopenharmony_ci inflateResetKeep(strm: ZStream): Promise<ReturnStatus>; 154061847f8eSopenharmony_ci 154161847f8eSopenharmony_ci /** 154261847f8eSopenharmony_ci * This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. 154361847f8eSopenharmony_ci * 154461847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 154561847f8eSopenharmony_ci * @param { number } windowBits - Parameter is interpreted the same as it is for inflateInit2. 154661847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 154761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 154861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 154961847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 155061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 155161847f8eSopenharmony_ci * @atomicservice 155261847f8eSopenharmony_ci * @since 12 155361847f8eSopenharmony_ci */ 155461847f8eSopenharmony_ci inflateReset2(strm: ZStream, windowBits: number): Promise<ReturnStatus>; 155561847f8eSopenharmony_ci 155661847f8eSopenharmony_ci /** 155761847f8eSopenharmony_ci * This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. 155861847f8eSopenharmony_ci * 155961847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 156061847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 156161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 156261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 156361847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 156461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 156561847f8eSopenharmony_ci * @atomicservice 156661847f8eSopenharmony_ci * @since 12 156761847f8eSopenharmony_ci */ 156861847f8eSopenharmony_ci inflateReset(strm: ZStream): Promise<ReturnStatus>; 156961847f8eSopenharmony_ci 157061847f8eSopenharmony_ci /** 157161847f8eSopenharmony_ci * This function inserts bits in the inflate input stream. 157261847f8eSopenharmony_ci * 157361847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 157461847f8eSopenharmony_ci * @param { number } bits - The provided bits. 157561847f8eSopenharmony_ci * @param { number } value - The provided value. 157661847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 157761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 157861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 157961847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 158061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 158161847f8eSopenharmony_ci * @atomicservice 158261847f8eSopenharmony_ci * @since 12 158361847f8eSopenharmony_ci */ 158461847f8eSopenharmony_ci inflatePrime(strm: ZStream, bits: number, value: number): Promise<ReturnStatus>; 158561847f8eSopenharmony_ci 158661847f8eSopenharmony_ci /** 158761847f8eSopenharmony_ci * Is used to mark locations in the input data for random access. 158861847f8eSopenharmony_ci * 158961847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 159061847f8eSopenharmony_ci * @returns { Promise<number> } Return the internal marker position of the current decompressed stream. 159161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 159261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 159361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 159461847f8eSopenharmony_ci * @atomicservice 159561847f8eSopenharmony_ci * @since 12 159661847f8eSopenharmony_ci */ 159761847f8eSopenharmony_ci inflateMark(strm: ZStream): Promise<number>; 159861847f8eSopenharmony_ci 159961847f8eSopenharmony_ci /** 160061847f8eSopenharmony_ci * Initializes the internal stream state for decompression. 160161847f8eSopenharmony_ci * 160261847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 160361847f8eSopenharmony_ci * @param { number } windowBits - Is the base two logarithm of the maximum window size. 160461847f8eSopenharmony_ci * It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. 160561847f8eSopenharmony_ci * windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, 160661847f8eSopenharmony_ci * or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, 160761847f8eSopenharmony_ci * inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. 160861847f8eSopenharmony_ci * WindowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. 160961847f8eSopenharmony_ci * WindowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. 161061847f8eSopenharmony_ci * inflate() will then process raw deflate data, not looking for a zlib or gzip header, 161161847f8eSopenharmony_ci * not generating a check value, and not looking for any check values for comparison at the end of the stream. 161261847f8eSopenharmony_ci * This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. 161361847f8eSopenharmony_ci * If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an Adler-32 or 161461847f8eSopenharmony_ci * a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, 161561847f8eSopenharmony_ci * the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits.WindowBits 161661847f8eSopenharmony_ci * can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, 161761847f8eSopenharmony_ci * or add 16 to decode only the gzip format. If a gzip stream is being decoded, strm->adler is a CRC-32 instead of an Adler-32. 161861847f8eSopenharmony_ci * Unlike the gunzip utility and gzread(), inflate() will *not* automatically decode concatenated gzip members. Inflate() will return 161961847f8eSopenharmony_ci * Z_STREAM_END at the end of the gzip member. The state would need to be reset to continue decoding a subsequent gzip member. 162061847f8eSopenharmony_ci * This *must* be done if there is more data after a gzip member, in order for the decompression to be compliant with the gzip standard. 162161847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 162261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 162361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 162461847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 162561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 162661847f8eSopenharmony_ci * @atomicservice 162761847f8eSopenharmony_ci * @since 12 162861847f8eSopenharmony_ci */ 162961847f8eSopenharmony_ci inflateInit2(strm: ZStream, windowBits: number): Promise<ReturnStatus>; 163061847f8eSopenharmony_ci 163161847f8eSopenharmony_ci /** 163261847f8eSopenharmony_ci * Initializes the internal stream state for decompression. 163361847f8eSopenharmony_ci * 163461847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 163561847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 163661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 163761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 163861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 163961847f8eSopenharmony_ci * @atomicservice 164061847f8eSopenharmony_ci * @since 12 164161847f8eSopenharmony_ci */ 164261847f8eSopenharmony_ci inflateInit(strm: ZStream): Promise<ReturnStatus>; 164361847f8eSopenharmony_ci 164461847f8eSopenharmony_ci /** 164561847f8eSopenharmony_ci * Requests that gzip header information be stored in the provided gz_header structure. 164661847f8eSopenharmony_ci * 164761847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 164861847f8eSopenharmony_ci * @param { GzHeader } header - Receive gzip header information extracted from compressed data stream. 164961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 165061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 165161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 165261847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 165361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 165461847f8eSopenharmony_ci * @atomicservice 165561847f8eSopenharmony_ci * @since 12 165661847f8eSopenharmony_ci */ 165761847f8eSopenharmony_ci inflateGetHeader(strm: ZStream, header: GzHeader): Promise<ReturnStatus>; 165861847f8eSopenharmony_ci 165961847f8eSopenharmony_ci /** 166061847f8eSopenharmony_ci * Obtain the current dictionary content of the decompressed stream. 166161847f8eSopenharmony_ci * 166261847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 166361847f8eSopenharmony_ci * @param { ArrayBuffer } dictionary - The sliding dictionary being maintained by inflate. 166461847f8eSopenharmony_ci * @returns { Promise<DictionaryOutputInfo> } Return ReturnStatus and dictionary length. 166561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 166661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 166761847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 166861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 166961847f8eSopenharmony_ci * @atomicservice 167061847f8eSopenharmony_ci * @since 12 167161847f8eSopenharmony_ci */ 167261847f8eSopenharmony_ci inflateGetDictionary(strm: ZStream, dictionary: ArrayBuffer): Promise<DictionaryOutputInfo>; 167361847f8eSopenharmony_ci 167461847f8eSopenharmony_ci /** 167561847f8eSopenharmony_ci * All dynamically allocated data structures for this stream are freed. 167661847f8eSopenharmony_ci * 167761847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 167861847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 167961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 168061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 168161847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 168261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 168361847f8eSopenharmony_ci * @atomicservice 168461847f8eSopenharmony_ci * @since 12 168561847f8eSopenharmony_ci */ 168661847f8eSopenharmony_ci inflateEnd(strm: ZStream): Promise<ReturnStatus>; 168761847f8eSopenharmony_ci 168861847f8eSopenharmony_ci /** 168961847f8eSopenharmony_ci * Sets the destination stream as a complete copy of the source stream. 169061847f8eSopenharmony_ci * 169161847f8eSopenharmony_ci * @param { Zip } source - The status information of the current decompression process. 169261847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 169361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 169461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 169561847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 169661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 169761847f8eSopenharmony_ci * @atomicservice 169861847f8eSopenharmony_ci * @since 12 169961847f8eSopenharmony_ci */ 170061847f8eSopenharmony_ci inflateCopy(source: Zip): Promise<ReturnStatus>; 170161847f8eSopenharmony_ci 170261847f8eSopenharmony_ci /** 170361847f8eSopenharmony_ci * Obtain the number of Huffman encoding trees that have been used in the current decompression stream during the inflate process. 170461847f8eSopenharmony_ci * 170561847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 170661847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of used Huffman encoding trees. 170761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 170861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 170961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 171061847f8eSopenharmony_ci * @atomicservice 171161847f8eSopenharmony_ci * @since 12 171261847f8eSopenharmony_ci */ 171361847f8eSopenharmony_ci inflateCodesUsed(strm: ZStream): Promise<number>; 171461847f8eSopenharmony_ci 171561847f8eSopenharmony_ci /** 171661847f8eSopenharmony_ci * Initialize the internal stream state for decompression using inflateBack() calls. 171761847f8eSopenharmony_ci * 171861847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 171961847f8eSopenharmony_ci * @param { number } windowBits - Parameter is interpreted the same as it is for inflateInit2. The value range is between 8~15. 172061847f8eSopenharmony_ci * @param { ArrayBuffer } window - The preset sliding window buffer. 172161847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 172261847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 172361847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 172461847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 172561847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 172661847f8eSopenharmony_ci * @atomicservice 172761847f8eSopenharmony_ci * @since 12 172861847f8eSopenharmony_ci */ 172961847f8eSopenharmony_ci inflateBackInit(strm: ZStream, windowBits: number, window: ArrayBuffer): Promise<ReturnStatus>; 173061847f8eSopenharmony_ci 173161847f8eSopenharmony_ci /** 173261847f8eSopenharmony_ci * All memory allocated by inflateBackInit() is freed. 173361847f8eSopenharmony_ci * 173461847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 173561847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 173661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 173761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 173861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 173961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 174061847f8eSopenharmony_ci * @atomicservice 174161847f8eSopenharmony_ci * @since 12 174261847f8eSopenharmony_ci */ 174361847f8eSopenharmony_ci inflateBackEnd(strm: ZStream): Promise<ReturnStatus>; 174461847f8eSopenharmony_ci 174561847f8eSopenharmony_ci /** 174661847f8eSopenharmony_ci * Does a raw inflate with a single call using a call-back interface for input and output. 174761847f8eSopenharmony_ci * 174861847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 174961847f8eSopenharmony_ci * @param { InflateBackInputCallback } backIn - A function that decompresses data from the end to read the raw compressed data from the input source. 175061847f8eSopenharmony_ci * @param { object } inDesc - Universal object. 175161847f8eSopenharmony_ci * @param { InflateBackOutputCallback } backOut - Write the decompressed data to the target output. 175261847f8eSopenharmony_ci * @param { object } outDesc - Universal object. 175361847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 175461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 175561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 175661847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 175761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 175861847f8eSopenharmony_ci * @atomicservice 175961847f8eSopenharmony_ci * @since 12 176061847f8eSopenharmony_ci */ 176161847f8eSopenharmony_ci inflateBack(strm: ZStream, backIn: InflateBackInputCallback, inDesc: object, backOut: InflateBackOutputCallback, outDesc: object): Promise<ReturnStatus>; 176261847f8eSopenharmony_ci 176361847f8eSopenharmony_ci /** 176461847f8eSopenharmony_ci * Decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. 176561847f8eSopenharmony_ci * 176661847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 176761847f8eSopenharmony_ci * @param { CompressFlushMode } flush - The behavior pattern of compression operation. 176861847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 176961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 177061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 177161847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 177261847f8eSopenharmony_ci * @throws { BusinessError } 17800005 - Data error. 177361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 177461847f8eSopenharmony_ci * @atomicservice 177561847f8eSopenharmony_ci * @since 12 177661847f8eSopenharmony_ci */ 177761847f8eSopenharmony_ci inflate(strm: ZStream, flush: CompressFlushMode): Promise<ReturnStatus>; 177861847f8eSopenharmony_ci 177961847f8eSopenharmony_ci /** 178061847f8eSopenharmony_ci * Initializes the internal stream state for compression. 178161847f8eSopenharmony_ci * 178261847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 178361847f8eSopenharmony_ci * @param { CompressLevel } level - Compression level. 178461847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 178561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 178661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 178761847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 178861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 178961847f8eSopenharmony_ci * @atomicservice 179061847f8eSopenharmony_ci * @since 12 179161847f8eSopenharmony_ci */ 179261847f8eSopenharmony_ci deflateInit(strm: ZStream, level: CompressLevel): Promise<ReturnStatus>; 179361847f8eSopenharmony_ci 179461847f8eSopenharmony_ci /** 179561847f8eSopenharmony_ci * Initializes the internal stream state for compression. 179661847f8eSopenharmony_ci * 179761847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 179861847f8eSopenharmony_ci * @param { CompressLevel } level - Compression level. 179961847f8eSopenharmony_ci * @param { CompressMethod } method - The compression method. 180061847f8eSopenharmony_ci * @param { number } windowBits - Parameter is interpreted the same as it is for inflateInit2. 180161847f8eSopenharmony_ci * @param { MemLevel } memLevel - The memory usage level. 180261847f8eSopenharmony_ci * @param { CompressStrategy } strategy - The compression strategy. 180361847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 180461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 180561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 180661847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 180761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 180861847f8eSopenharmony_ci * @atomicservice 180961847f8eSopenharmony_ci * @since 12 181061847f8eSopenharmony_ci */ 181161847f8eSopenharmony_ci deflateInit2(strm: ZStream, level: CompressLevel, method: CompressMethod, windowBits: number, 181261847f8eSopenharmony_ci memLevel: MemLevel, strategy: CompressStrategy): Promise<ReturnStatus>; 181361847f8eSopenharmony_ci 181461847f8eSopenharmony_ci /** 181561847f8eSopenharmony_ci * Compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. 181661847f8eSopenharmony_ci * 181761847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 181861847f8eSopenharmony_ci * @param { CompressFlushMode } flush - The behavior pattern of compression operation. 181961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 182061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 182161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 182261847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 182361847f8eSopenharmony_ci * @throws { BusinessError } 17800007 - Buffer error. 182461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 182561847f8eSopenharmony_ci * @atomicservice 182661847f8eSopenharmony_ci * @since 12 182761847f8eSopenharmony_ci */ 182861847f8eSopenharmony_ci deflate(strm: ZStream, flush: CompressFlushMode): Promise<ReturnStatus>; 182961847f8eSopenharmony_ci 183061847f8eSopenharmony_ci /** 183161847f8eSopenharmony_ci * All dynamically allocated data structures for this stream are freed. 183261847f8eSopenharmony_ci * 183361847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 183461847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 183561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 183661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 183761847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 183861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 183961847f8eSopenharmony_ci * @atomicservice 184061847f8eSopenharmony_ci * @since 12 184161847f8eSopenharmony_ci */ 184261847f8eSopenharmony_ci deflateEnd(strm: ZStream): Promise<ReturnStatus>; 184361847f8eSopenharmony_ci 184461847f8eSopenharmony_ci /** 184561847f8eSopenharmony_ci * Calculate an upper bound on the compressed size. 184661847f8eSopenharmony_ci * 184761847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 184861847f8eSopenharmony_ci * @param { number } sourceLength - The length of uncompressed data. 184961847f8eSopenharmony_ci * @returns { Promise<number> } Return an upper bound on the compressed size. 185061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 185161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 185261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 185361847f8eSopenharmony_ci * @atomicservice 185461847f8eSopenharmony_ci * @since 12 185561847f8eSopenharmony_ci */ 185661847f8eSopenharmony_ci deflateBound(strm: ZStream, sourceLength: number): Promise<number>; 185761847f8eSopenharmony_ci 185861847f8eSopenharmony_ci /** 185961847f8eSopenharmony_ci * Provides gzip header information for when a gzip stream is requested by deflateInit2(). 186061847f8eSopenharmony_ci * 186161847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 186261847f8eSopenharmony_ci * @param { GzHeader } head - Object a to gz_headerp that already has gzip header information. 186361847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 186461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 186561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 186661847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 186761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 186861847f8eSopenharmony_ci * @atomicservice 186961847f8eSopenharmony_ci * @since 12 187061847f8eSopenharmony_ci */ 187161847f8eSopenharmony_ci deflateSetHeader(strm: ZStream, head: GzHeader): Promise<ReturnStatus>; 187261847f8eSopenharmony_ci 187361847f8eSopenharmony_ci /** 187461847f8eSopenharmony_ci * Sets the destination stream as a complete copy of the source stream. 187561847f8eSopenharmony_ci * 187661847f8eSopenharmony_ci * @param { Zip } source - Object to source z_stream structure. 187761847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 187861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 187961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 188061847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 188161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 188261847f8eSopenharmony_ci * @atomicservice 188361847f8eSopenharmony_ci * @since 12 188461847f8eSopenharmony_ci */ 188561847f8eSopenharmony_ci deflateCopy(source: Zip): Promise<ReturnStatus>; 188661847f8eSopenharmony_ci 188761847f8eSopenharmony_ci /** 188861847f8eSopenharmony_ci * Initializes the compression dictionary from the given byte sequence without producing any compressed output. 188961847f8eSopenharmony_ci * 189061847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 189161847f8eSopenharmony_ci * @param { ArrayBuffer } dictionary - Object a to gz_headerp that already has gzip header information. 189261847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 189361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 189461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 189561847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 189661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 189761847f8eSopenharmony_ci * @atomicservice 189861847f8eSopenharmony_ci * @since 12 189961847f8eSopenharmony_ci */ 190061847f8eSopenharmony_ci deflateSetDictionary(strm: ZStream, dictionary: ArrayBuffer): Promise<ReturnStatus>; 190161847f8eSopenharmony_ci 190261847f8eSopenharmony_ci /** 190361847f8eSopenharmony_ci * Returns the sliding dictionary being maintained by deflate. 190461847f8eSopenharmony_ci * 190561847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 190661847f8eSopenharmony_ci * @param { ArrayBuffer } dictionary - The sliding dictionary being maintained by deflate. 190761847f8eSopenharmony_ci * @returns { Promise<DictionaryOutputInfo> } Return ReturnStatus and dictionary length 190861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 190961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 191061847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 191161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 191261847f8eSopenharmony_ci * @atomicservice 191361847f8eSopenharmony_ci * @since 12 191461847f8eSopenharmony_ci */ 191561847f8eSopenharmony_ci deflateGetDictionary(strm: ZStream, dictionary: ArrayBuffer): Promise<DictionaryOutputInfo>; 191661847f8eSopenharmony_ci 191761847f8eSopenharmony_ci /** 191861847f8eSopenharmony_ci * Fine tune deflate's internal compression parameters. 191961847f8eSopenharmony_ci * 192061847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 192161847f8eSopenharmony_ci * @param { number } goodLength - Good matching length threshold. 192261847f8eSopenharmony_ci * @param { number } maxLazy - Maximum lazy matching times. 192361847f8eSopenharmony_ci * @param { number } niceLength - Good Lazy Length Threshold. 192461847f8eSopenharmony_ci * @param { number } maxChain - Maximum chain length. 192561847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 192661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 192761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 192861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 192961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 193061847f8eSopenharmony_ci * @atomicservice 193161847f8eSopenharmony_ci * @since 12 193261847f8eSopenharmony_ci */ 193361847f8eSopenharmony_ci deflateTune(strm: ZStream, goodLength: number, maxLazy: number, niceLength: number, maxChain: number): Promise<ReturnStatus>; 193461847f8eSopenharmony_ci 193561847f8eSopenharmony_ci /** 193661847f8eSopenharmony_ci * This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. 193761847f8eSopenharmony_ci * 193861847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 193961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 194061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 194161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 194261847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 194361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 194461847f8eSopenharmony_ci * @atomicservice 194561847f8eSopenharmony_ci * @since 12 194661847f8eSopenharmony_ci */ 194761847f8eSopenharmony_ci deflateReset(strm: ZStream): Promise<ReturnStatus>; 194861847f8eSopenharmony_ci 194961847f8eSopenharmony_ci /** 195061847f8eSopenharmony_ci * Reset the initialized deflate compressed stream, but retain its set compression parameters and dictionary. 195161847f8eSopenharmony_ci * 195261847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 195361847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 195461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 195561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 195661847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 195761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 195861847f8eSopenharmony_ci * @atomicservice 195961847f8eSopenharmony_ci * @since 12 196061847f8eSopenharmony_ci */ 196161847f8eSopenharmony_ci deflateResetKeep(strm: ZStream): Promise<ReturnStatus>; 196261847f8eSopenharmony_ci 196361847f8eSopenharmony_ci /** 196461847f8eSopenharmony_ci * Returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. 196561847f8eSopenharmony_ci * 196661847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 196761847f8eSopenharmony_ci * @returns { Promise<DeflatePendingOutputInfo> } Return ReturnStatus along with the number of bytes and bits generated. 196861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 196961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 197061847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 197161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 197261847f8eSopenharmony_ci * @atomicservice 197361847f8eSopenharmony_ci * @since 12 197461847f8eSopenharmony_ci */ 197561847f8eSopenharmony_ci deflatePending(strm: ZStream): Promise<DeflatePendingOutputInfo>; 197661847f8eSopenharmony_ci 197761847f8eSopenharmony_ci /** 197861847f8eSopenharmony_ci * Dynamically update the compression level and compression strategy. 197961847f8eSopenharmony_ci * 198061847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 198161847f8eSopenharmony_ci * @param { CompressLevel } level - New compression level. 198261847f8eSopenharmony_ci * @param { CompressStrategy } strategy - New compression strategy. 198361847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 198461847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 198561847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 198661847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 198761847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 198861847f8eSopenharmony_ci * @atomicservice 198961847f8eSopenharmony_ci * @since 12 199061847f8eSopenharmony_ci */ 199161847f8eSopenharmony_ci deflateParams(strm: ZStream, level: CompressLevel, strategy: CompressStrategy): Promise<ReturnStatus>; 199261847f8eSopenharmony_ci 199361847f8eSopenharmony_ci /** 199461847f8eSopenharmony_ci * Inserts bits in the deflate output stream. 199561847f8eSopenharmony_ci * 199661847f8eSopenharmony_ci * @param { ZStream } strm - Object to structure z_stream. 199761847f8eSopenharmony_ci * @param { number } bits - The number of bits to be inserted. The value range is between 0~16. 199861847f8eSopenharmony_ci * @param { number } value - The bit value corresponding to the number of bits. 199961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 200061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 200161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 200261847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 200361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 200461847f8eSopenharmony_ci * @atomicservice 200561847f8eSopenharmony_ci * @since 12 200661847f8eSopenharmony_ci */ 200761847f8eSopenharmony_ci deflatePrime(strm: ZStream, bits: number, value: number): Promise<ReturnStatus>; 200861847f8eSopenharmony_ci } 200961847f8eSopenharmony_ci 201061847f8eSopenharmony_ci /** 201161847f8eSopenharmony_ci * Gzip related interfaces. 201261847f8eSopenharmony_ci * 201361847f8eSopenharmony_ci * @typedef GZip 201461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 201561847f8eSopenharmony_ci * @atomicservice 201661847f8eSopenharmony_ci * @since 12 201761847f8eSopenharmony_ci */ 201861847f8eSopenharmony_ci interface GZip { 201961847f8eSopenharmony_ci 202061847f8eSopenharmony_ci /** 202161847f8eSopenharmony_ci * Associate a gzFile with the file descriptor fd. 202261847f8eSopenharmony_ci * 202361847f8eSopenharmony_ci * @param { number } fd - The file descriptor. Usually this is obtained through system calls to 'open' or other methods. 202461847f8eSopenharmony_ci * @param { string } mode - Used to specify access mode. 202561847f8eSopenharmony_ci * @returns { Promise<void> } 202661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 202761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 202861847f8eSopenharmony_ci * @throws { BusinessError } 17800002 - No such file or access mode error. 202961847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 203061847f8eSopenharmony_ci * @atomicservice 203161847f8eSopenharmony_ci * @since 12 203261847f8eSopenharmony_ci */ 203361847f8eSopenharmony_ci gzdopen(fd: number, mode: string): Promise<void>; 203461847f8eSopenharmony_ci 203561847f8eSopenharmony_ci /** 203661847f8eSopenharmony_ci * Set the internal buffer size used by this library's functions for file to size. 203761847f8eSopenharmony_ci * 203861847f8eSopenharmony_ci * @param { number } size - The internal buffer size to be set. 203961847f8eSopenharmony_ci * @returns { Promise<number> } Returns 0 on success. 204061847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 204161847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 204261847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 204361847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 204461847f8eSopenharmony_ci * @atomicservice 204561847f8eSopenharmony_ci * @since 12 204661847f8eSopenharmony_ci */ 204761847f8eSopenharmony_ci gzbuffer(size: number): Promise<number>; 204861847f8eSopenharmony_ci 204961847f8eSopenharmony_ci /** 205061847f8eSopenharmony_ci * Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing. 205161847f8eSopenharmony_ci * 205261847f8eSopenharmony_ci * @param { string } path - The file path to be opened. 205361847f8eSopenharmony_ci * @param { string } mode - Specify the file opening method. 205461847f8eSopenharmony_ci * @returns { Promise<void> } 205561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 205661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 205761847f8eSopenharmony_ci * @throws { BusinessError } 17800002 - No such file or access mode error. 205861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 205961847f8eSopenharmony_ci * @atomicservice 206061847f8eSopenharmony_ci * @since 12 206161847f8eSopenharmony_ci */ 206261847f8eSopenharmony_ci gzopen(path: string, mode: string): Promise<void>; 206361847f8eSopenharmony_ci 206461847f8eSopenharmony_ci /** 206561847f8eSopenharmony_ci * Check if the reading position of the gzip compressed file has reached the end of the file. 206661847f8eSopenharmony_ci * 206761847f8eSopenharmony_ci * @returns { Promise<number> } Return 1 (true) if the end-of-file indicator for file has been set while reading. 206861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 206961847f8eSopenharmony_ci * @atomicservice 207061847f8eSopenharmony_ci * @since 12 207161847f8eSopenharmony_ci */ 207261847f8eSopenharmony_ci gzeof(): Promise<number>; 207361847f8eSopenharmony_ci 207461847f8eSopenharmony_ci /** 207561847f8eSopenharmony_ci * Check if the specified gzip file handle file directly accesses the original uncompressed data. 207661847f8eSopenharmony_ci * 207761847f8eSopenharmony_ci * @returns { Promise<number> } returns 1 (true) if transparent writing was requested. 207861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 207961847f8eSopenharmony_ci * @atomicservice 208061847f8eSopenharmony_ci * @since 12 208161847f8eSopenharmony_ci */ 208261847f8eSopenharmony_ci gzdirect(): Promise<number>; 208361847f8eSopenharmony_ci 208461847f8eSopenharmony_ci /** 208561847f8eSopenharmony_ci * Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. 208661847f8eSopenharmony_ci * 208761847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 208861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 208961847f8eSopenharmony_ci * @throws { BusinessError } 17800006 - Memory allocation failed. 209061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 209161847f8eSopenharmony_ci * @atomicservice 209261847f8eSopenharmony_ci * @since 12 209361847f8eSopenharmony_ci */ 209461847f8eSopenharmony_ci gzclose(): Promise<ReturnStatus>; 209561847f8eSopenharmony_ci 209661847f8eSopenharmony_ci /** 209761847f8eSopenharmony_ci * Clear the error and end-of-file flags for file. 209861847f8eSopenharmony_ci * 209961847f8eSopenharmony_ci * @returns { Promise<void> } 210061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 210161847f8eSopenharmony_ci * @atomicservice 210261847f8eSopenharmony_ci * @since 12 210361847f8eSopenharmony_ci */ 210461847f8eSopenharmony_ci gzclearerr(): Promise<void>; 210561847f8eSopenharmony_ci 210661847f8eSopenharmony_ci /** 210761847f8eSopenharmony_ci * The error message for the last error which occurred on file. 210861847f8eSopenharmony_ci * 210961847f8eSopenharmony_ci * @returns { Promise<GzErrorOutputInfo> } Return the status message for the last status which occurred on file and ReturnStatus. 211061847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 211161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 211261847f8eSopenharmony_ci * @atomicservice 211361847f8eSopenharmony_ci * @since 12 211461847f8eSopenharmony_ci */ 211561847f8eSopenharmony_ci gzerror(): Promise<GzErrorOutputInfo>; 211661847f8eSopenharmony_ci 211761847f8eSopenharmony_ci /** 211861847f8eSopenharmony_ci * Read and decompress one byte from file. 211961847f8eSopenharmony_ci * 212061847f8eSopenharmony_ci * @returns { Promise<number> } Return the ASCII code of a character. 212161847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 212261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 212361847f8eSopenharmony_ci * @atomicservice 212461847f8eSopenharmony_ci * @since 12 212561847f8eSopenharmony_ci */ 212661847f8eSopenharmony_ci gzgetc(): Promise<number>; 212761847f8eSopenharmony_ci 212861847f8eSopenharmony_ci /** 212961847f8eSopenharmony_ci * Flush all pending output to file. 213061847f8eSopenharmony_ci * 213161847f8eSopenharmony_ci * @param { CompressFlushMode } flush - Control the behavior of refresh operations. 213261847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 213361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 213461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 213561847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 213661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 213761847f8eSopenharmony_ci * @atomicservice 213861847f8eSopenharmony_ci * @since 12 213961847f8eSopenharmony_ci */ 214061847f8eSopenharmony_ci gzflush(flush: CompressFlushMode): Promise<ReturnStatus>; 214161847f8eSopenharmony_ci 214261847f8eSopenharmony_ci /** 214361847f8eSopenharmony_ci * Compress and write nitems items of size size from buf to file. 214461847f8eSopenharmony_ci * 214561847f8eSopenharmony_ci * @param { ArrayBuffer } buf - The buffer to write data to. 214661847f8eSopenharmony_ci * @param { number } size - The number of bytes in a single data block. 214761847f8eSopenharmony_ci * @param { number } nitems - Number of data blocks to be written. 214861847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of full items written of size size. 214961847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 215061847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 215161847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 215261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 215361847f8eSopenharmony_ci * @atomicservice 215461847f8eSopenharmony_ci * @since 12 215561847f8eSopenharmony_ci */ 215661847f8eSopenharmony_ci gzfwrite(buf: ArrayBuffer, size: number, nitems: number): Promise<number>; 215761847f8eSopenharmony_ci 215861847f8eSopenharmony_ci /** 215961847f8eSopenharmony_ci * Read and decompress data from gzip compressed files. 216061847f8eSopenharmony_ci * 216161847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Target buffer for storing read results. 216261847f8eSopenharmony_ci * @param { number } size - The number of bytes in a single data block. 216361847f8eSopenharmony_ci * @param { number } nitems - Number of data blocks to be read. 216461847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of full items read of size size. 216561847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 216661847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 216761847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 216861847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 216961847f8eSopenharmony_ci * @atomicservice 217061847f8eSopenharmony_ci * @since 12 217161847f8eSopenharmony_ci */ 217261847f8eSopenharmony_ci gzfread(buf: ArrayBuffer, size: number, nitems: number): Promise<number>; 217361847f8eSopenharmony_ci 217461847f8eSopenharmony_ci /** 217561847f8eSopenharmony_ci * Same as gzclose(), gzclosew() only for use when writing or appending. 217661847f8eSopenharmony_ci * 217761847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 217861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 217961847f8eSopenharmony_ci * @throws { BusinessError } 17800006 - Memory allocation failed. 218061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 218161847f8eSopenharmony_ci * @atomicservice 218261847f8eSopenharmony_ci * @since 12 218361847f8eSopenharmony_ci */ 218461847f8eSopenharmony_ci gzclosew(): Promise<ReturnStatus>; 218561847f8eSopenharmony_ci 218661847f8eSopenharmony_ci /** 218761847f8eSopenharmony_ci * Same as gzclose(), gzcloser() is only for use when reading. 218861847f8eSopenharmony_ci * 218961847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 219061847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 219161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 219261847f8eSopenharmony_ci * @atomicservice 219361847f8eSopenharmony_ci * @since 12 219461847f8eSopenharmony_ci */ 219561847f8eSopenharmony_ci gzcloser(): Promise<ReturnStatus>; 219661847f8eSopenharmony_ci 219761847f8eSopenharmony_ci /** 219861847f8eSopenharmony_ci * Compress and write the len uncompressed bytes at buf to file. 219961847f8eSopenharmony_ci * 220061847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Object to the data buffer to be written. 220161847f8eSopenharmony_ci * @param { number } len - The len uncompressed bytes. 220261847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of uncompressed bytes written. 220361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 220461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 220561847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 220661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 220761847f8eSopenharmony_ci * @atomicservice 220861847f8eSopenharmony_ci * @since 12 220961847f8eSopenharmony_ci */ 221061847f8eSopenharmony_ci gzwrite(buf: ArrayBuffer, len: number): Promise<number>; 221161847f8eSopenharmony_ci 221261847f8eSopenharmony_ci /** 221361847f8eSopenharmony_ci * Push c back onto the stream for file to be read as the first character on the next read. 221461847f8eSopenharmony_ci * 221561847f8eSopenharmony_ci * @param { number } c - To fall back to the character before the input stream. 221661847f8eSopenharmony_ci * @returns { Promise<number> } Return the character pushed. 221761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 221861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 221961847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 222061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 222161847f8eSopenharmony_ci * @atomicservice 222261847f8eSopenharmony_ci * @since 12 222361847f8eSopenharmony_ci */ 222461847f8eSopenharmony_ci gzungetc(c: number): Promise<number>; 222561847f8eSopenharmony_ci 222661847f8eSopenharmony_ci /** 222761847f8eSopenharmony_ci * Return the starting position for the next gzread or gzwrite on file. 222861847f8eSopenharmony_ci * 222961847f8eSopenharmony_ci * @returns { Promise<number> } Return the starting position for the next gzread or gzwrite on file. 223061847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 223161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 223261847f8eSopenharmony_ci * @atomicservice 223361847f8eSopenharmony_ci * @since 12 223461847f8eSopenharmony_ci */ 223561847f8eSopenharmony_ci gztell(): Promise<number>; 223661847f8eSopenharmony_ci 223761847f8eSopenharmony_ci /** 223861847f8eSopenharmony_ci * Dynamically update the compression level and strategy for file. 223961847f8eSopenharmony_ci * 224061847f8eSopenharmony_ci * @param { CompressLevel } level - Compression level. 224161847f8eSopenharmony_ci * @param { CompressStrategy } strategy - Compression strategy. 224261847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 224361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 224461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 224561847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 224661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 224761847f8eSopenharmony_ci * @atomicservice 224861847f8eSopenharmony_ci * @since 12 224961847f8eSopenharmony_ci */ 225061847f8eSopenharmony_ci gzsetparams(level: CompressLevel, strategy: CompressStrategy): Promise<ReturnStatus>; 225161847f8eSopenharmony_ci 225261847f8eSopenharmony_ci /** 225361847f8eSopenharmony_ci * Set the starting position to offset relative to whence for the next gzread or gzwrite on file. 225461847f8eSopenharmony_ci * 225561847f8eSopenharmony_ci * @param { number } offset - Specify the new offset to move to. 225661847f8eSopenharmony_ci * @param { OffsetReferencePoint } whence - Define the reference point for offset. 225761847f8eSopenharmony_ci * @returns { Promise<number> } Return the resulting offset location as measured in bytes from the beginning of the uncompressed stream. 225861847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 225961847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 226061847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 226161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 226261847f8eSopenharmony_ci * @atomicservice 226361847f8eSopenharmony_ci * @since 12 226461847f8eSopenharmony_ci */ 226561847f8eSopenharmony_ci gzseek(offset: number, whence: OffsetReferencePoint): Promise<number>; 226661847f8eSopenharmony_ci 226761847f8eSopenharmony_ci /** 226861847f8eSopenharmony_ci * Rewind file. This function is supported only for reading. 226961847f8eSopenharmony_ci * 227061847f8eSopenharmony_ci * @returns { Promise<ReturnStatus> } Return ReturnStatus the specific meaning is defined as enum. 227161847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 227261847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 227361847f8eSopenharmony_ci * @atomicservice 227461847f8eSopenharmony_ci * @since 12 227561847f8eSopenharmony_ci */ 227661847f8eSopenharmony_ci gzrewind(): Promise<ReturnStatus>; 227761847f8eSopenharmony_ci 227861847f8eSopenharmony_ci /** 227961847f8eSopenharmony_ci * Read and decompress up to len uncompressed bytes from file into buf. 228061847f8eSopenharmony_ci * 228161847f8eSopenharmony_ci * @param { ArrayBuffer } buf - User provided buffer address. 228261847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of uncompressed bytes actually read, less than len for end of file. 228361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 228461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 228561847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 228661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 228761847f8eSopenharmony_ci * @atomicservice 228861847f8eSopenharmony_ci * @since 12 228961847f8eSopenharmony_ci */ 229061847f8eSopenharmony_ci gzread(buf: ArrayBuffer): Promise<number>; 229161847f8eSopenharmony_ci 229261847f8eSopenharmony_ci /** 229361847f8eSopenharmony_ci * Compress and write the given null-terminated string s to file, excluding the terminating null character. 229461847f8eSopenharmony_ci * 229561847f8eSopenharmony_ci * @param { string } str - Format descriptors and plain text. 229661847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of characters written. 229761847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 229861847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 229961847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 230061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 230161847f8eSopenharmony_ci * @atomicservice 230261847f8eSopenharmony_ci * @since 12 230361847f8eSopenharmony_ci */ 230461847f8eSopenharmony_ci gzputs(str: string): Promise<number>; 230561847f8eSopenharmony_ci 230661847f8eSopenharmony_ci /** 230761847f8eSopenharmony_ci * Compress and write c, converted to an unsigned char, into file. 230861847f8eSopenharmony_ci * 230961847f8eSopenharmony_ci * @param { number } char - Write ASCII values for characters. 231061847f8eSopenharmony_ci * @returns { Promise<number> } Return the value that was written. 231161847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 231261847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 231361847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 231461847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 231561847f8eSopenharmony_ci * @atomicservice 231661847f8eSopenharmony_ci * @since 12 231761847f8eSopenharmony_ci */ 231861847f8eSopenharmony_ci gzputc(char: number): Promise<number>; 231961847f8eSopenharmony_ci 232061847f8eSopenharmony_ci /** 232161847f8eSopenharmony_ci * Convert, format, compress, and write the arguments to file under control of the string format, as in fprintf. 232261847f8eSopenharmony_ci * 232361847f8eSopenharmony_ci * @param { string } format - Format descriptors and plain text. 232461847f8eSopenharmony_ci * @param { Array<string | number> } args - Variable argument lists. 232561847f8eSopenharmony_ci * @returns { Promise<number> } Return the number of uncompressed bytes actually written. 232661847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 232761847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 232861847f8eSopenharmony_ci * @throws { BusinessError } 17800004 - ZStream error. 232961847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 233061847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 233161847f8eSopenharmony_ci * @atomicservice 233261847f8eSopenharmony_ci * @since 12 233361847f8eSopenharmony_ci */ 233461847f8eSopenharmony_ci gzprintf(format: string, ...args: Array<string | number>): Promise<number>; 233561847f8eSopenharmony_ci 233661847f8eSopenharmony_ci /** 233761847f8eSopenharmony_ci * Return the current compressed (actual) read or write offset of file. 233861847f8eSopenharmony_ci * 233961847f8eSopenharmony_ci * @returns { Promise<number> } Return the current compressed (actual) read or write offset of file. 234061847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 234161847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 234261847f8eSopenharmony_ci * @atomicservice 234361847f8eSopenharmony_ci * @since 12 234461847f8eSopenharmony_ci */ 234561847f8eSopenharmony_ci gzoffset(): Promise<number>; 234661847f8eSopenharmony_ci 234761847f8eSopenharmony_ci /** 234861847f8eSopenharmony_ci * Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, 234961847f8eSopenharmony_ci * or an end-of-file condition is encountered. 235061847f8eSopenharmony_ci * 235161847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Store the read row data. 235261847f8eSopenharmony_ci * @returns { Promise<string> } Return buf which is a null-terminated string. 235361847f8eSopenharmony_ci * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; 235461847f8eSopenharmony_ci * 2. Incorrect parameter types; 3. Parameter verification failed. 235561847f8eSopenharmony_ci * @throws { BusinessError } 17800009 - Internal structure error. 235661847f8eSopenharmony_ci * @syscap SystemCapability.BundleManager.Zlib 235761847f8eSopenharmony_ci * @atomicservice 235861847f8eSopenharmony_ci * @since 12 235961847f8eSopenharmony_ci */ 236061847f8eSopenharmony_ci gzgets(buf: ArrayBuffer): Promise<string>; 236161847f8eSopenharmony_ci } 236261847f8eSopenharmony_ci} 236361847f8eSopenharmony_ciexport default zlib; 2364