import { Lorem } from '@pawel-up/data-mock/Lorem.js';
import { Types } from '@pawel-up/data-mock/Types.js';
export class Variables {
    types;
    lorem;
    constructor(init = {}) {
        this.types = new Types(init.seed);
        this.lorem = new Lorem(init);
    }
    /**
     * Generates a random variable
     */
    variable(init = {}) {
        let isDefault;
        if (init.defaultEnv) {
            isDefault = true;
        }
        else if (init.randomEnv) {
            isDefault = false;
        }
        else {
            isDefault = this.types.boolean();
        }
        const result = /** @type ARCVariable */ {
            enabled: this.types.boolean({ likelihood: 85 }),
            value: this.lorem.sentence({ words: 2 }),
            name: this.lorem.word(),
            _id: this.types.uuid(),
            environment: '',
        };
        if (isDefault) {
            result.environment = 'default';
        }
        else {
            result.environment = this.lorem.sentence({ words: 2 });
        }
        return result;
    }
    /**
     * Generates a number of variables.
     * @param size The number of variables to generate.
     */
    listVariables(size = 25, init = {}) {
        const result = [];
        for (let i = 0; i < size; i++) {
            result.push(this.variable(init));
        }
        return result;
    }
}
//# sourceMappingURL=Variables.js.map