Polyman Documentation - v2.2.2
    Preparing search index...

    Class Formatter

    Formatter class for creating styled terminal output with Codeforces theme. Uses chalk library for coloring with custom hex colors (#1E88E5 blue, #FF6B6B red).

    Formatter

    import { fmt } from './formatter';

    fmt.section('📁 CREATE TEMPLATE');
    fmt.step(1, 'Creating directory');
    fmt.success('Directory created!');
    fmt.stepComplete('Done');
    Index

    Constructors

    Methods

    • Prints a success message in green.

      Parameters

      • message: string

        The message to display

      Returns void

      fmt.success('Template created successfully!');
      
    • Prints an error message in red.

      Parameters

      • message: string

        The error message to display

      Returns void

      fmt.error('Failed to compile validator');
      
    • Prints a warning message in yellow.

      Parameters

      • message: string

        The warning message to display

      Returns void

      fmt.warning('testlib.h already exists');
      
    • Prints an informational message in white.

      Parameters

      • message: string

        The info message to display

      Returns void

      fmt.info(`Target: ${generatorName}`);
      
    • Prints a dimmed/gray log message. Used for less important information.

      Parameters

      • message: string

        The message to display

      Returns void

      fmt.log('Additional details...');
      
    • Returns a green checkmark icon (✓). Use explicitly in messages for better indentation control.

      Returns string

      Styled checkmark

      fmt.success(`${fmt.checkmark()} Test passed`);
      
    • Returns a red cross icon (✖). Use explicitly in messages for better indentation control.

      Returns string

      Styled cross

      fmt.error(`${fmt.cross()} Test failed`);
      
    • Returns a yellow warning icon (⚠). Use explicitly in messages for better indentation control.

      Returns string

      Styled warning icon

      fmt.warning(`${fmt.warningIcon()} Memory limit not supported on Windows`);
      
    • Returns a blue info icon (ℹ). Use explicitly in messages for better indentation control.

      Returns string

      Styled info icon

      fmt.info(`${fmt.infoIcon()} Found 5 generators`);
      
    • Prints a section header with blue double-line border. Used to separate major sections in command output.

      Parameters

      • title: string

        The section title

      Returns void

      fmt.section('📁 CREATE NEW PROBLEM TEMPLATE');
      
    • Prints a numbered step header with a top corner bracket.

      Parameters

      • stepNumber: number

        The step number

      • title: string

        The step description

      Returns void

      fmt.step(1, 'Creating Directory Structure');
      
    • Prints a step completion message with a bottom corner bracket and checkmark.

      Parameters

      • Optionalmessage: string

        Optional completion message (defaults to 'Complete')

      Returns void

      fmt.stepComplete('Directory created');
      
    • Returns highlighted text in Codeforces blue color.

      Parameters

      • text: string

        Text to highlight

      Returns string

      Styled text

      fmt.info(`Target: ${fmt.highlight('all')}`);
      
    • Returns dimmed/grayed text.

      Parameters

      • text: string

        Text to dim

      Returns string

      Styled text

      fmt.info(`${fmt.dim('(optional)')}`);
      
    • Returns bold text.

      Parameters

      • text: string

        Text to make bold

      Returns string

      Styled text

      console.log(fmt.bold('Important:'));
      
    • Returns text in Codeforces red accent color (#FF6B6B).

      Parameters

      • text: string

        Text to style

      Returns string

      Styled text

      fmt.log(`Error: ${fmt.accent('Failed')}`);
      
    • Returns text in Codeforces primary blue color (#1E88E5).

      Parameters

      • text: string

        Text to style

      Returns string

      Styled text

      fmt.info(`Main solution: ${fmt.primary(mainSolution.name)}`);
      
    • Prints a success box with green border and celebration emoji. Used for final success messages.

      Parameters

      • message: string

        Success message to display

      Returns void

      fmt.successBox('TEMPLATE CREATED SUCCESSFULLY!');
      
    • Prints an error box with red border and cross emoji. Used for final error messages.

      Parameters

      • message: string

        Error message to display

      Returns void

      fmt.errorBox('VALIDATION FAILED!');