/**
 * @license
 * Copyright 2022-2026 Greg Lauckhart <greg@lauckhart.com>
 * SPDX-License-Identifier: Apache-2.0
 */
import { Producer } from "./producer.js";
import { Color, EightBitColor, RgbColor } from "./sgr.js";
import { Style } from "./style.js";
/**
 * Convenience API for building ANSI text.
 *
 * Allows you to create ANSI escape sequences using e.g. `ansi.bright.yellow.bg.blue.blink`.
 */
export interface TextBuilder extends Style {
    (...text: Producer.Sequence): TextBuilder;
    readonly state: TextBuilder.State;
    readonly bg: TextBuilder;
    readonly not: TextBuilder;
    readonly reset: TextBuilder;
    readonly bold: TextBuilder;
    readonly dim: TextBuilder;
    readonly bright: TextBuilder;
    readonly italic: TextBuilder;
    readonly underline: TextBuilder;
    readonly doubleUnderline: TextBuilder;
    readonly blink: TextBuilder;
    readonly fastBlink: TextBuilder;
    readonly invert: TextBuilder;
    readonly conceal: TextBuilder;
    readonly strike: TextBuilder;
    readonly black: TextBuilder;
    readonly red: TextBuilder;
    readonly green: TextBuilder;
    readonly yellow: TextBuilder;
    readonly blue: TextBuilder;
    readonly magenta: TextBuilder;
    readonly cyan: TextBuilder;
    readonly white: TextBuilder;
    color(color: Color | EightBitColor | RgbColor): TextBuilder;
    factory: TextBuilder.Factory;
}
export declare function TextBuilder(definition?: Style.InputDefinition | Style, derivesFrom?: Style, state?: TextBuilder.State): TextBuilder;
export declare namespace TextBuilder {
    var prototype: any;
}
export declare namespace TextBuilder {
    interface State {
        /**
         * If next build affects a color it will modify bg rather than fg.
         */
        readonly bg?: boolean;
        /**
         * If next build affects 8-bit color the color will render as bright.
         */
        readonly bright?: boolean;
        /**
         * If next build modifies ANSI styling its meaning is inverted.
         */
        readonly not?: boolean;
        /**
         * Serialization will include style reversion as the final token.
         *
         * Set after invoking builder as function, cleared when modifying style.  This means that ansi.red("foo") is
         * terminated but ansi.red("foo").green will render as a red "foo" and leave text styled green.
         */
        readonly revert?: boolean;
        /**
         * The serialization sequence.  Populated by invoking builder as function.
         */
        readonly sequence?: Producer.Sequence;
    }
    type Factory = (definition?: Style.Definition | Style, derivesFrom?: Style, state?: TextBuilder.State) => TextBuilder;
}
/**
 * Initial builder.
 */
export declare const ansi: TextBuilder;
//# sourceMappingURL=text-builder.d.ts.map