> ## Documentation Index
> Fetch the complete documentation index at: https://mint-tsdocs.saulo.engineer/llms.txt
> Use this file to discover all available pages before exploring further.

# IndentedWriter class

> A utility for writing indented text.

export const RefLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('RefLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-reflink broken-link" title="Invalid RefLink target" data-component="tsdocs-reflink">Invalid Link</span>;
  }
  const linkText = children || target;
  const path = typeof window !== 'undefined' && window.getRefPath ? window.getRefPath(target) : `./${target.split('.').filter(s => s.length > 0).join('/')}`;
  const isValid = typeof window !== 'undefined' && window.VALID_REFS && window.VALID_REFS.has(target);
  const className = !isValid ? 'tsdocs-reflink broken-link' : 'tsdocs-reflink';
  const title = !isValid ? `Broken API reference: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-reflink">
      {linkText}
    </a>;
};

export const PageLink = ({target, children}) => {
  if (!target || typeof target !== 'string') {
    console.error('PageLink: Invalid target prop. Expected non-empty string.');
    return <span className="tsdocs-pagelink broken-link" title="Invalid PageLink target" data-component="tsdocs-pagelink">Invalid Link</span>;
  }
  const linkText = children || target;
  let path = target;
  if (!path.startsWith('/')) {
    path = `/${target}`;
  }
  const isValid = typeof window !== 'undefined' && window.VALID_PAGES && window.VALID_PAGES.has(target);
  const className = !isValid ? 'tsdocs-pagelink broken-link' : 'tsdocs-pagelink';
  const title = !isValid ? `Broken page link: ${target}` : undefined;
  return <a href={path} className={className} title={title} data-component="tsdocs-pagelink">
      {linkText}
    </a>;
};

# IndentedWriter

## Summary

A utility for writing indented text.

## Signature

```typescript theme={null}
export declare class IndentedWriter 
```

## Constructors

### constructor

Constructs a new instance of the class

## Properties

### defaultIndentPrefix

**Type**:`defaultIndentPrefix: string;`
**Default**: \`\`

The text characters used to create one level of indentation. Two spaces by default.

## Methods

### decreaseIndent

Decreases the indentation, reverting the effect of the corresponding call to IndentedWriter.increaseIndent().

### ensureNewLine

Adds a newline if the file pointer is not already at the start of the line (or start of the stream).

### ensureSkippedLine

Adds up to two newlines to ensure that there is a blank line above the current line.

### getText

Retrieves the output that was built so far.

### increaseIndent

Increases the indentation. Normally the indentation is two spaces, however an arbitrary prefix can optional be specified. (For example, the prefix could be "// " to indent and comment simultaneously.) Each call to IndentedWriter.increaseIndent() must be followed by a corresponding call to IndentedWriter.decreaseIndent().

### indentScope

A shorthand for ensuring that increaseIndent()/decreaseIndent() occur in pairs.

### peekLastCharacter

Returns the last character that was written, or an empty string if no characters have been written yet.

### peekSecondLastCharacter

Returns the second to last character that was written, or an empty string if less than one characters have been written yet.

### toString

### write

Writes some text to the internal string buffer, applying indentation according to the current indentation level. If the string contains multiple newlines, each line will be indented separately.

### writeLine

A shorthand for writing an optional message, followed by a newline. Indentation is applied following the semantics of IndentedWriter.write().

### writeTentative

Writes and messages if and only if writes anything.If writes "CONTENT", this method will write "CONTENT". If writes nothing, this method will write nothing.

## Events

*No events defined.*

## Remarks

Note that the indentation is inserted at the last possible opportunity. For example, this code...  ...would produce this output:
