function progressStatus(finished) {
    return __awaiter(this, void 0, void 0, function* () {
        yield wait(100);
        const loading = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
        // using 10 to make the progress bar length 10 charactes, multiplying by 5 below to arrive to 100
        for (const i of loading) {
            const dots = '.'.repeat(i);
            const left = 10 - i;
            const empty = ' '.repeat(left);
            const percentage = i * 10;
            // need to use `process.stdout.write` becuase console.log prints a newline character
            // \r clear the current line and then print the other characters making it looks like it refresh
            process.stdout.write(`\rGenerating your icons - process will take a few seconds [${dots}${empty}] ${percentage}%`);
            // wait periodically to simulate a realistic loading animation
            yield wait(50);
            // a step implemented to remove a glitch in the loading animation
            if (i === 1) {
                process.stdout.write('\r\x1b[K');
            }
            // if the generation process is complete clear the console line with the escape character
            if (finished) {
                process.stdout.write('\r\x1b[K');
                break;
            }
        }
    });
}
/**
 * Description: Displays a progression bar with the status of the generation process
 * @param finished - boolean denoting whether or not the process is completed
 */
Displays a progression bar with the status of the generation process
@param finished - boolean denoting whether or not the process is completed
Displays a progression bar with the status of the generation process @param finished - boolean denoting whether or not the process is completed
function progressStatus(finished) {
    return __awaiter(this, void 0, void 0, function* () {
        yield wait(100);
        const loading = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
        for (const i of loading) {
            const dots = '.'.repeat(i);
            const left = 10 - i;
            const empty = ' '.repeat(left);
            const percentage = i * 10;
            process.stdout.write(`\rGenerating your icons - process will take a few seconds [${dots}${empty}] ${percentage}%`);
            yield wait(50);
            if (i === 1) {
                process.stdout.write('\r\x1b[K');
            }
            if (finished) {
                process.stdout.write('\r\x1b[K');
                break;
            }
        }
    });
}
function progressStatus ( finished ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { yield wait ( 100 ) ; const loading = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ; for ( const i of loading ) { const dots = '.' . repeat ( i ) ; const left = 10 - i ; const empty = ' ' . repeat ( left ) ; const percentage = i * 10 ; process . stdout . write ( ` \r ${ dots } ${ empty } ${ percentage } ` ) ; yield wait ( 50 ) ; if ( i === 1 ) { process . stdout . write ( '\r\x1b[K' ) ; } if ( finished ) { process . stdout . write ( '\r\x1b[K' ) ; break ; } } } ) ; }
Description: Displays a progression bar with the status of the generation process
 @param finished - boolean denoting whether or not the process is completed
Description : Displays a progression bar with the status of the generation process @param finished - boolean denoting whether or not the process is completed
// using 10 to make the progress bar length 10 charactes, multiplying by 5 below to arrive to 100 // need to use `process.stdout.write` becuase console.log prints a newline character // \r clear the current line and then print the other characters making it looks like it refresh // wait periodically to simulate a realistic loading animation // a step implemented to remove a glitch in the loading animation // if the generation process is complete clear the console line with the escape character