// Hatchway CLI - Built with Rollup
import ora from 'ora';

/**
 * Spinner utility for showing progress
 */
class Spinner {
    constructor() {
        this.spinner = null;
    }
    start(text) {
        this.spinner = ora(text).start();
    }
    succeed(text) {
        if (this.spinner) {
            this.spinner.succeed(text);
            this.spinner = null;
        }
    }
    fail(text) {
        if (this.spinner) {
            this.spinner.fail(text);
            this.spinner = null;
        }
    }
    warn(text) {
        if (this.spinner) {
            this.spinner.warn(text);
            this.spinner = null;
        }
    }
    info(text) {
        if (this.spinner) {
            this.spinner.info(text);
            this.spinner = null;
        }
    }
    text(text) {
        if (this.spinner) {
            this.spinner.text = text;
        }
    }
    stop() {
        if (this.spinner) {
            this.spinner.stop();
            this.spinner = null;
        }
    }
}
const spinner = new Spinner();

export { spinner as s };
//# sourceMappingURL=spinner-DTH0QZQw.js.map
