// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.8.0.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

Future<String> genHash({required String str}) =>
    RustLib.instance.api.crateApiCacheFileCacheGenHash(str: str);

/// 缓存文件
/// uri: 文件路径或 URL
/// filename: 文件名，如果为 None，则使用哈希值
/// custom_cache_root: 自定义存储路径，如果为 None，则使用document_folder
Future<String> cacheFileFromUri(
        {required String documentFolder,
        required String uri,
        required String cacheFolder,
        String? filename,
        String? customCacheRoot}) =>
    RustLib.instance.api.crateApiCacheFileCacheCacheFileFromUri(
        documentFolder: documentFolder,
        uri: uri,
        cacheFolder: cacheFolder,
        filename: filename,
        customCacheRoot: customCacheRoot);

/// 从内容缓存文件
/// content: 文件内容
/// filename: 文件名
/// custom_cache_root: 自定义存储路径，如果为 None，则使用根路径
Future<String> cacheFileFromContent(
        {required String documentFolder,
        required String content,
        required String cacheFolder,
        required String filename,
        String? customCacheRoot}) =>
    RustLib.instance.api.crateApiCacheFileCacheCacheFileFromContent(
        documentFolder: documentFolder,
        content: content,
        cacheFolder: cacheFolder,
        filename: filename,
        customCacheRoot: customCacheRoot);

String? getCacheFileFromUri(
        {required String documentFolder,
        required String uri,
        required String cacheFolder,
        String? filename,
        String? customCacheRoot}) =>
    RustLib.instance.api.crateApiCacheFileCacheGetCacheFileFromUri(
        documentFolder: documentFolder,
        uri: uri,
        cacheFolder: cacheFolder,
        filename: filename,
        customCacheRoot: customCacheRoot);

Future<void> deleteCacheFileWithUri(
        {required String documentFolder,
        required String uri,
        required String cacheFolder,
        String? filename,
        String? customCacheRoot}) =>
    RustLib.instance.api.crateApiCacheFileCacheDeleteCacheFileWithUri(
        documentFolder: documentFolder,
        uri: uri,
        cacheFolder: cacheFolder,
        filename: filename,
        customCacheRoot: customCacheRoot);
