UNPKG

@cowwoc/requirements

Version:

A fluent API for enforcing design contracts with automatic message generation.

34 lines (33 loc) 1.04 kB
/** * The encodings supported by the terminal. */ declare enum TerminalEncoding { /** * A terminal that does not support any colors. */ NONE = 0, /** * Node terminal supports a 16-color palette. */ NODE_16_COLORS = 1, /** * Node terminal supports a 256-color palette. */ NODE_256_COLORS = 2, /** * Node terminal supports a 24-bit color palette. */ NODE_16MILLION_COLORS = 3 } /** * Returns a comparator that sorts encodings based on the number of colors that they support, from the most * to the least number of colors. * * @param first - the first encoding * @param second - the second encoding * @returns a negative number if `first` supports more colors than `second`. * `0` if the encodings support the same number of colors. A positive number if * `first` supports fewer colors than `second`. */ declare const sortByDecreasingRank: (first: TerminalEncoding, second: TerminalEncoding) => number; export { TerminalEncoding, sortByDecreasingRank };