// 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 $models from "./models.js";

export function GetID(): $CancellablePromise<string> {
    return $Call.ByID(1539451205);
}

export function GetLocalIPInSameSubnet(receiverIP: string): $CancellablePromise<[string, boolean]> {
    return $Call.ByID(3089425954, receiverIP);
}

export function GetPeerByID(id: string): $CancellablePromise<[$models.Peer | null, boolean]> {
    return $Call.ByID(1962377788, id).then(($result: any) => {
        $result[0] = $$createType1($result[0]);
        return $result;
    });
}

export function GetPeerByIP(ip: string): $CancellablePromise<[$models.Peer | null, boolean]> {
    return $Call.ByID(1626825408, ip).then(($result: any) => {
        $result[0] = $$createType1($result[0]);
        return $result;
    });
}

export function GetPeers(): $CancellablePromise<$models.Peer[]> {
    return $Call.ByID(3041084029).then(($result: any) => {
        return $$createType2($result);
    });
}

export function GetSelf(): $CancellablePromise<$models.Peer> {
    return $Call.ByID(3599633538).then(($result: any) => {
        return $$createType0($result);
    });
}

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

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