"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncWorkerS = exports.AsyncWorkerS_R = exports.AsyncWorkerS_W = exports.AsyncWorkerS_C = exports.AsyncWorkerGraph = exports.AsyncWorkerMS = exports.AsyncWorkerMS_R = exports.AsyncWorkerMS_W = exports.AsyncWorkerMS_C = exports.AsyncWorkerJ = exports.AsyncWorkerJ_R = exports.AsyncWorkerJ_W = exports.AsyncWorkerJ_C = exports.AsyncWorkerV = exports.AsyncWorkerV_R = exports.AsyncWorkerV_W = exports.AsyncWorkerV_C = exports.AsyncWorkerG = exports.AsyncWorkerG_R = exports.AsyncWorkerG_W = exports.AsyncWorkerG_C = exports.AsyncWorkerC = exports.AsyncWorkerC_R = exports.AsyncWorkerC_W = exports.AsyncWorkerC_C = exports.AsyncWorkerU = exports.AsyncWorkerU_R = exports.AsyncWorkerU_W = exports.AsyncWorkerU_C = exports.AsyncWorkerEE = exports.AsyncWorkerEE_R = exports.AsyncWorkerEE_W = exports.AsyncWorkerEE_C = exports.makeAsyncWorkerR = exports.makeAsyncWorkerW = exports.makeAsyncWorkerC = exports.AsyncWorker = void 0;
const _C_1 = require("./types/interface/async/$C");
const _EE_1 = require("./types/interface/async/$EE");
const _G_1 = require("./types/interface/async/$G");
const _J_1 = require("./types/interface/async/$J");
const _MS_1 = require("./types/interface/async/$MS");
const _S_1 = require("./types/interface/async/$S");
const _U_1 = require("./types/interface/async/$U");
const _V_1 = require("./types/interface/async/$V");
const AsyncWrap_1 = require("./types/interface/async/AsyncWrap");
function AsyncWorker(client, _) {
    return (0, AsyncWrap_1.AsyncWrap)(client, _, {
        G: AsyncWorkerG,
        C: AsyncWorkerC,
        V: AsyncWorkerV,
        J: AsyncWorkerJ,
        U: AsyncWorkerU,
        MS: AsyncWorkerMS,
        EE: AsyncWorkerEE,
        S: AsyncWorkerS,
    });
}
exports.AsyncWorker = AsyncWorker;
function makeAsyncWorkerC(client, METHOD_CALL) {
    const _$_C = {};
    for (const name of METHOD_CALL) {
        const $name = `$${name}`;
        _$_C[$name] = (data, callback) => {
            return client.call($name, data, callback);
        };
    }
    return _$_C;
}
exports.makeAsyncWorkerC = makeAsyncWorkerC;
function makeAsyncWorkerW(client, METHOD_WATCH) {
    const _$_W = {};
    for (const name of METHOD_WATCH) {
        const $name = `$${name}`;
        _$_W[$name] = (data, callback) => {
            const unlisten = client.watch($name, data, callback);
            return unlisten;
        };
    }
    return _$_W;
}
exports.makeAsyncWorkerW = makeAsyncWorkerW;
function makeAsyncWorkerR(client, METHOD_REF) {
    const _$_R = {};
    for (const name of METHOD_REF) {
        const $name = `$${name}`;
        _$_R[$name] = (data) => {
            const { _ } = data;
            const ref_client = client.ref($name, data);
            const $ref = AsyncWorker(ref_client, _);
            return $ref;
        };
    }
    return _$_R;
}
exports.makeAsyncWorkerR = makeAsyncWorkerR;
function AsyncWorkerEE_C(client) {
    return makeAsyncWorkerC(client, _EE_1.EE_METHOD_CALL);
}
exports.AsyncWorkerEE_C = AsyncWorkerEE_C;
function AsyncWorkerEE_W(client) {
    return makeAsyncWorkerW(client, _EE_1.EE_METHOD_WATCH);
}
exports.AsyncWorkerEE_W = AsyncWorkerEE_W;
function AsyncWorkerEE_R(client) {
    return makeAsyncWorkerR(client, _EE_1.EE_METHOD_REF);
}
exports.AsyncWorkerEE_R = AsyncWorkerEE_R;
function AsyncWorkerEE(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerEE_C(client)), AsyncWorkerEE_W(client)), AsyncWorkerEE_R(client));
}
exports.AsyncWorkerEE = AsyncWorkerEE;
function AsyncWorkerU_C(client) {
    return makeAsyncWorkerC(client, _U_1.U_METHOD_CALL);
}
exports.AsyncWorkerU_C = AsyncWorkerU_C;
function AsyncWorkerU_W(client) {
    return makeAsyncWorkerW(client, _U_1.U_METHOD_WATCH);
}
exports.AsyncWorkerU_W = AsyncWorkerU_W;
function AsyncWorkerU_R(client) {
    return makeAsyncWorkerR(client, _U_1.U_METHOD_REF);
}
exports.AsyncWorkerU_R = AsyncWorkerU_R;
function AsyncWorkerU(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerU_C(client)), AsyncWorkerU_W(client)), AsyncWorkerU_R(client));
}
exports.AsyncWorkerU = AsyncWorkerU;
function AsyncWorkerC_C(client) {
    return makeAsyncWorkerC(client, _C_1.C_METHOD_CALL);
}
exports.AsyncWorkerC_C = AsyncWorkerC_C;
function AsyncWorkerC_W(client) {
    return makeAsyncWorkerW(client, _C_1.C_METHOD_WATCH);
}
exports.AsyncWorkerC_W = AsyncWorkerC_W;
function AsyncWorkerC_R(client) {
    return makeAsyncWorkerR(client, _C_1.C_METHOD_REF);
}
exports.AsyncWorkerC_R = AsyncWorkerC_R;
function AsyncWorkerC(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerC_C(client)), AsyncWorkerC_W(client)), AsyncWorkerC_R(client));
}
exports.AsyncWorkerC = AsyncWorkerC;
function AsyncWorkerG_C(client) {
    return makeAsyncWorkerC(client, _G_1.G_METHOD_CALL);
}
exports.AsyncWorkerG_C = AsyncWorkerG_C;
function AsyncWorkerG_W(client) {
    return makeAsyncWorkerW(client, _G_1.G_METHOD_WATCH);
}
exports.AsyncWorkerG_W = AsyncWorkerG_W;
function AsyncWorkerG_R(client) {
    return makeAsyncWorkerR(client, _G_1.G_METHOD_REF);
}
exports.AsyncWorkerG_R = AsyncWorkerG_R;
function AsyncWorkerG(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerG_C(client)), AsyncWorkerG_W(client)), AsyncWorkerG_R(client));
}
exports.AsyncWorkerG = AsyncWorkerG;
function AsyncWorkerV_C(client) {
    return makeAsyncWorkerC(client, _V_1.V_METHOD_CALL);
}
exports.AsyncWorkerV_C = AsyncWorkerV_C;
function AsyncWorkerV_W(client) {
    return makeAsyncWorkerW(client, _V_1.V_METHOD_WATCH);
}
exports.AsyncWorkerV_W = AsyncWorkerV_W;
function AsyncWorkerV_R(client) {
    return makeAsyncWorkerR(client, _V_1.V_METHOD_REF);
}
exports.AsyncWorkerV_R = AsyncWorkerV_R;
function AsyncWorkerV(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerV_C(client)), AsyncWorkerV_W(client)), AsyncWorkerV_R(client));
}
exports.AsyncWorkerV = AsyncWorkerV;
function AsyncWorkerJ_C(client) {
    return makeAsyncWorkerC(client, _J_1.J_METHOD_CALL);
}
exports.AsyncWorkerJ_C = AsyncWorkerJ_C;
function AsyncWorkerJ_W(client) {
    return makeAsyncWorkerW(client, _J_1.J_METHOD_WATCH);
}
exports.AsyncWorkerJ_W = AsyncWorkerJ_W;
function AsyncWorkerJ_R(client) {
    return makeAsyncWorkerR(client, _J_1.J_METHOD_REF);
}
exports.AsyncWorkerJ_R = AsyncWorkerJ_R;
function AsyncWorkerJ(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerJ_C(client)), AsyncWorkerJ_W(client)), AsyncWorkerJ_R(client));
}
exports.AsyncWorkerJ = AsyncWorkerJ;
function AsyncWorkerMS_C(client) {
    return makeAsyncWorkerC(client, _MS_1.MS_METHOD_CALL);
}
exports.AsyncWorkerMS_C = AsyncWorkerMS_C;
function AsyncWorkerMS_W(client) {
    return makeAsyncWorkerW(client, _MS_1.MS_METHOD_WATCH);
}
exports.AsyncWorkerMS_W = AsyncWorkerMS_W;
function AsyncWorkerMS_R(client) {
    return makeAsyncWorkerR(client, _MS_1.MS_METHOD_REF);
}
exports.AsyncWorkerMS_R = AsyncWorkerMS_R;
function AsyncWorkerMS(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerMS_C(client)), AsyncWorkerMS_W(client)), AsyncWorkerMS_R(client));
}
exports.AsyncWorkerMS = AsyncWorkerMS;
function AsyncWorkerGraph(client) {
    return Object.assign(Object.assign(Object.assign(Object.assign({}, AsyncWorkerEE(client)), AsyncWorkerU(client)), AsyncWorkerC(client)), AsyncWorkerG(client));
}
exports.AsyncWorkerGraph = AsyncWorkerGraph;
function AsyncWorkerS_C(client) {
    return makeAsyncWorkerC(client, _S_1.S_METHOD_CALL);
}
exports.AsyncWorkerS_C = AsyncWorkerS_C;
function AsyncWorkerS_W(client) {
    return makeAsyncWorkerW(client, _S_1.S_METHOD_WATCH);
}
exports.AsyncWorkerS_W = AsyncWorkerS_W;
function AsyncWorkerS_R(client) {
    return makeAsyncWorkerR(client, _S_1.S_METHOD_REF);
}
exports.AsyncWorkerS_R = AsyncWorkerS_R;
function AsyncWorkerS(client) {
    return Object.assign(Object.assign(Object.assign({}, AsyncWorkerS_C(client)), AsyncWorkerS_W(client)), AsyncWorkerS_R(client));
}
exports.AsyncWorkerS = AsyncWorkerS;
//# sourceMappingURL=AsyncWorker.js.map