"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhatsIndex = void 0;
const fsPromises = require("fs/promises");
const fs = require('fs');
const WhatsQueueIndex_1 = __importDefault(require("./WhatsQueueIndex"));
// Delete a directory and its children 
const WhatsIndex = (whatsapps) => {
    let index = 0;
    if (WhatsQueueIndex_1.default.getIndex() >= whatsapps.length) {
        WhatsQueueIndex_1.default.setIndex(0);
    }
    index = +WhatsQueueIndex_1.default.getIndex();
    WhatsQueueIndex_1.default.setIndex(+WhatsQueueIndex_1.default.getIndex() + 1);
    console.log('WhatsQueue Index: ', index);
    return index;
};
exports.WhatsIndex = WhatsIndex;
