// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as discovery$0 from "../discovery/models.js";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

export function CancelTransfer(transferID: string): $CancellablePromise<void> {
    return $Call.ByID(900002248, transferID);
}

/**
 * CleanTransferList 清理完成的 transfer
 */
export function CleanFinishedTransferList(): $CancellablePromise<void> {
    return $Call.ByID(1852624467);
}

export function DeleteTransfer(transferID: string): $CancellablePromise<void> {
    return $Call.ByID(4158310409, transferID);
}

export function GetPort(): $CancellablePromise<number> {
    return $Call.ByID(4195335736);
}

export function GetTransfer(transferID: string): $CancellablePromise<[$models.Transfer | null, boolean]> {
    return $Call.ByID(1198637268, transferID).then(($result: any) => {
        $result[0] = $$createType1($result[0]);
        return $result;
    });
}

export function GetTransferList(): $CancellablePromise<($models.Transfer | null)[]> {
    return $Call.ByID(584162076).then(($result: any) => {
        return $$createType2($result);
    });
}

export function LoadHistory(): $CancellablePromise<void> {
    return $Call.ByID(2987999795);
}

export function NotifyTransferListUpdate(): $CancellablePromise<void> {
    return $Call.ByID(1220032142);
}

/**
 * ResolvePendingRequest 外部调用，解决待处理的传输请求
 * 返回 true 表示成功处理，false 表示未找到该 ID 的请求
 */
export function ResolvePendingRequest(id: string, accept: boolean, savePath: string): $CancellablePromise<boolean> {
    return $Call.ByID(207902967, id, accept, savePath);
}

export function SaveHistory(): $CancellablePromise<void> {
    return $Call.ByID(713135400);
}

export function SendFile(target: discovery$0.Peer | null, targetIP: string, filePath: string): $CancellablePromise<void> {
    return $Call.ByID(2954589433, target, targetIP, filePath);
}

export function SendFiles(target: discovery$0.Peer | null, targetIP: string, filePaths: string[]): $CancellablePromise<void> {
    return $Call.ByID(3308811582, target, targetIP, filePaths);
}

export function SendFolder(target: discovery$0.Peer | null, targetIP: string, folderPath: string): $CancellablePromise<void> {
    return $Call.ByID(3258308403, target, targetIP, folderPath);
}

export function SendText(target: discovery$0.Peer | null, targetIP: string, text: string): $CancellablePromise<void> {
    return $Call.ByID(1497421440, target, targetIP, text);
}

export function Start(): $CancellablePromise<void> {
    return $Call.ByID(3611800535);
}

export function StoreTransferToList(transfer: $models.Transfer | null): $CancellablePromise<void> {
    return $Call.ByID(3225941780, transfer);
}

export function StoreTransfersToList(transfers: ($models.Transfer | null)[]): $CancellablePromise<void> {
    return $Call.ByID(658746199, transfers);
}

// Private type creation functions
const $$createType0 = $models.Transfer.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);
