"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Spinner = void 0;
class Spinner {
    interval;
    frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
    current = 0;
    start(message = "Loading") {
        this.interval = setInterval(() => {
            process.stdout.write(`\r${this.frames[this.current]} ${message}...`);
            this.current = (this.current + 1) % this.frames.length;
        }, 100);
    }
    stop() {
        if (this.interval) {
            clearInterval(this.interval);
            this.interval = undefined;
            process.stdout.write("\r");
        }
    }
}
exports.Spinner = Spinner;
//# sourceMappingURL=spinner.js.map