// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
import "../_dnt.polyfills.js";
import { Func } from "../types.js";
import { runtimes } from "../wit.js";
import { Runtime } from "./mod.js";
export class GrpcRuntime extends Runtime {
    constructor(protoFile, endpoint) {
        const id = runtimes.registerGrpcRuntime({
            protoFile,
            endpoint,
        });
        super(id);
    }
    call(method) {
        const funcData = runtimes.callGrpcMethod(this._id, { method: method });
        return Func.fromTypeFunc(funcData);
    }
}
