// Copyright (C) 2025 Huawei Device Co., Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! ANI crate for the ETS cache download API.
//!
//! This is the crate root for the `@ohos.request.cacheDownload` ANI module,
//! aggregating the bridge, cache_download, and callback submodules and
//! registering the ETS-facing constructor entry points.

mod bridge;
mod cache_download;
pub(crate) mod callback;
ani_rs::ani_constructor! {
    namespace "@ohos.request.cacheDownload.cacheDownload"
    [
        "download" : cache_download::download,
        "cancel" : cache_download::cancel,
        "setMemoryCacheSize" : cache_download::set_memory_cache_size,
        "setFileCacheSize" : cache_download::set_file_cache_size,
        "getDownloadInfo" : cache_download::get_download_info,
        "setDownloadInfoListSize" : cache_download::set_download_info_list_size,
        "clearMemoryCache" : cache_download::clear_memory_cache,
        "clearFileCache" : cache_download::clear_file_cache,
        "onDownloadSuccess" : cache_download::on_download_success,
        "offDownloadSuccess" : cache_download::off_download_success,
        "onDownloadError" : cache_download::on_download_error,
        "offDownloadError" : cache_download::off_download_error,
        "setGlobalRetryOptions" : cache_download::set_global_retry_options,
        "setGlobalTimeoutOptions" : cache_download::set_global_timeout_options,
    ]
}