"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncA = exports.AsyncARef = exports.AsyncAWatch = exports.AsyncACall = exports.AsyncAGet = void 0;
const err_1 = require("../../../util/err");
const AsyncAGet = (array) => ({
    $at: function ({ i }, callback) {
        (0, err_1.tryCatch)(() => array.at(i), callback);
    },
    $length: function ({}, callback) {
        (0, err_1.tryCatch)(() => array.length(), callback);
    },
    $indexOf: function ({ a }, callback) {
        (0, err_1.tryCatch)(() => array.indexOf(a), callback);
    },
});
exports.AsyncAGet = AsyncAGet;
const AsyncACall = (array) => ({
    $append: function ({ a }, callback) {
        (0, err_1.tryCatch)(() => array.append(a), callback);
    },
    $put: function ({ i, data }, callback) {
        (0, err_1.tryCatch)(() => array.put(data, i), callback);
    },
});
exports.AsyncACall = AsyncACall;
const AsyncAWatch = (array) => {
    return {};
};
exports.AsyncAWatch = AsyncAWatch;
const AsyncARef = (array) => ({});
exports.AsyncARef = AsyncARef;
const AsyncA = (array) => {
    return {
        ...(0, exports.AsyncAGet)(array),
        ...(0, exports.AsyncACall)(array),
        ...(0, exports.AsyncAWatch)(array),
        ...(0, exports.AsyncARef)(array),
    };
};
exports.AsyncA = AsyncA;
//# sourceMappingURL=AsyncA.js.map