@cowwoc/requirements
Version:
A fluent API for enforcing design contracts with automatic message generation.
46 lines (45 loc) • 1.63 kB
text/typescript
import { TerminalEncoding } from "../internal.mjs";
/**
* The terminal associated with the process.
*/
declare class Terminal {
private supportedTypes;
private encoding;
/**
* @returns the encodings supported by the terminal
*/
getSupportedTypes(): Set<TerminalEncoding>;
/**
* Indicates the type of encoding that the terminal should use.
* <p>
* This feature can be used to force the use of colors even when their support is not detected.
*
* @param encoding - the type of encoding that the terminal should use
* @param force - true if the encoding should be forced regardless of what the system supports
* @throws TypeError if `encoding` is not a `TerminalEncoding`.
* If `force` is not a `boolean`.
* @see Terminal.useBestEncoding
*/
private setEncodingImpl;
/**
* Indicates the type of encoding that the terminal should use.
* <p>
* This feature can be used to force the use of colors even when their support is not detected.
*
* @param encoding - the type of encoding that the terminal should use
* @throws TypeError if `encoding` is not a `TerminalEncoding`
* @see Terminal.useBestEncoding
*/
setEncoding(encoding: TerminalEncoding): void;
/**
* Indicates that validators should output the best encoding supported by the terminal.
*
* @see Terminal.setEncoding
*/
useBestEncoding(): void;
/**
* @returns the encoding that the terminal should use (defaults to the best available encoding)
*/
getEncoding(): TerminalEncoding;
}
export { Terminal };