/** * The properties that can be set on Style objects */ export type StyleProps = { /** may be either a hex string, or a named color */ background?: string; bold?: boolean; /** may be either a hex string, or a named color */ color?: string; dim?: boolean; inverse?: boolean; italic?: boolean; overline?: boolean; strike?: boolean; underline?: boolean; /** hyperlink target, must be a valid url or `''` */ href?: string; }; /** * An immutable representation of an ANSI style. Used by Terminal and Block * to represent the styles in use for text to be printed. * If a Style object is created with the same properties as a * formerly seen Style object, the same object will be returned. * * For example: * * ```js * const a = new Style({ bold: true }) * const b = new Style({ bold: true }) * assert.equal(a, b) // passes * ``` * * This optimization cuts down considerably on object creation, * because a Style is created for each styled character written to * the Terminal buffer. It also means that Style objects can be * compared directly with `===` to test for equivalence. */ export declare class Style { #private; constructor(styles: StyleProps | string); /** * True if this style is a full reset of all properties. */ get isReset(): boolean; /** corresponding ANSI code sequence for this style */ get ansi(): string; /** Convert a set of properties to an ANSI style code */ static propertiesAnsi(styles: StyleProps): string; /** * If the input string is a sequence of *only* ANSI style and * OSC href codes, returns the array of codes and their parameters. * Otherwise, returns false. */ static validStyleCodes(s: string): null | [string, string][]; /** a Style object that resets all properties */ static get RESET(): Style; /** Convert an ANSI style code to a set of properties */ static ansiProperties(code: string): StyleProps; /** * Return a new Style with this one plus the updated properties. * * If a string is provided, must be a valid set of style and OSC hyperlink * ANSI code, though unrecognized parameters within that code will be ignored * rather than throwing an error. */ update(properties: StyleProps | string): Style; /** * Wrap the input string in the appropriate HTML for this style */ wrap(s: string): string; /** * Return just the CSS for the styles. Href is not relevant. */ toString(): string; } //# sourceMappingURL=style.d.ts.map