"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.$remoteRef = void 0;
const makeRemoteUnitAPI_1 = require("../makeRemoteUnitAPI");
function $remoteRef(ref) {
    let _ref = {};
    for (const name in ref) {
        const method = ref[name];
        const _method = (data) => {
            const { _ } = data;
            const $unit = method(data);
            if ($unit.__async) {
                return $unit;
            }
            const remoteApi = (0, makeRemoteUnitAPI_1.makeRemoteUnitAPI)($unit, _);
            return remoteApi;
        };
        _ref[name] = _method;
    }
    return _ref;
}
exports.$remoteRef = $remoteRef;
//# sourceMappingURL=$makeRemoteUnitAPI.js.map