@tusss/ood
    Preparing search index...

    Class PrinterAbstract

    Abstract base class representing a component capable of producing a string representation of itself.

    Subclasses or implementations should override or define the toString method to generate the appropriate string formatting.

    Example demonstrating implementing a custom Printer class and defining a plain object conforming to Printer

    // 1. Implementing as a class
    class CustomPrinter extends Printer {
    override toString(): string {
    return "Hello from CustomPrinter";
    }
    }

    const printerObj = new CustomPrinter();
    console.log(printerObj.toString()); // "Hello from CustomPrinter"

    // 2. Conforming as a plain object
    const plainPrinter = {
    toString: () => "Hello from plain object",
    } satisfies Printer;

    console.log(plainPrinter.toString()); // "Hello from plain object"
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Generates a string representation of the printer or its target content.

      Returns string

      A string representation.