Class OutputBuffer<T>Abstract

Non-blocking token stream buffer.

Type Parameters

  • T = unknown

Hierarchy

Constructors

Properties

capacity: number
index: number
limit: number
remaining: number
settings: OutputSettings

The OutputSettings used to configure the behavior of output producers that write to this Output.

Methods

  • Returns a partial Output equivalent to this Output, if part is true; returns a final Output equivalent to this Output if part is false. The caller's reference to this Output should be replaced by the returned Output.

    Parameters

    • part: boolean

    Returns OutputBuffer<T>

  • Returns the implementation-defined result of writing the output.

    Returns T

  • Returns an implementation-defined branch of the token stream.

    Returns OutputBuffer<T>

    Throws

    Error if this Output writer cannot be cloned.

  • Writes the code points of the developer-readable [[Debug]] string of the given object. Assumes this is a Unicode Output writer with sufficient capacity.

    Parameters

    • object: unknown

    Returns Output<T>

    the continuation of the output.

    Throws

    [[OutputException]] if this Output exits the cont state before the full debug string has been written.

  • Writes the code points of the human-readable [[Display]] string of the given object. Assumes this is a Unicode Output writer with sufficient capacity.

    Parameters

    • object: unknown

    Returns Output<T>

    the continuation of the output.

    Throws

    [[OutputException]] if this Output exits the cont state before the full display string has been written.

  • Writes any internally buffered state to the underlying output stream.

    Returns OutputBuffer<T>

  • Parameters

    • index: number

    Returns number

  • Parameters

    • index: number

    Returns boolean

  • Returns true when the next [[write write(number)]] will succeed. i.e. this Output is in the cont state.

    Returns boolean

  • Returns true when no write will ever again succeed. i.e. this Output is in the done state.

    Returns boolean

  • Returns true when an immediate write will fail due to an error with the token stream. i.e. this Output is in the error state. When true, trap() will return the output error.

    Returns boolean

  • Returns true when an immediate write will fail, but writes may succeed at some point in the future, i.e. this Output is in the full state.

    Returns boolean

  • Returns true if this is a partial Output that will enter the full state when it is unable to write additional tokens.

    Returns boolean

  • Parameters

    • Rest ...tokens: number[]

    Returns void

  • Parameters

    • index: number
    • token: number

    Returns void

  • Parameters

    • Optional offset: number

    Returns OutputBuffer<T>

  • Returns the output error. Only guaranteed to return an error when in the error state.

    Returns Error

    Throws

    OutputException if this Output is not in the error state.

  • Parameters

    • index: number

    Returns OutputBuffer<T>

  • Parameters

    • limit: number

    Returns OutputBuffer<T>

  • Updates the settings associated with this Output.

    Parameters

    Returns Output<T>

    this

  • Writes a single token to the stream, if this Output is in the cont state.

    Parameters

    • token: number

    Returns OutputBuffer<T>

    this

    Throws

    [[OutputException]] if this Output is not in the cont state.

  • Writes the code points of the given string. Assumes this is a Unicode Output writer with sufficient capacity.

    Parameters

    • string: string

    Returns OutputBuffer<T>

    this

    Throws

    [[OutputException]] if this Output exits the cont state before the full string has been written.

  • Writes the code points of the given string, followed by the code points of the settings' [[OutputSettings.lineSeparator line separator]. Assumes this is a Unicode Output writer with sufficient capacity.

    Parameters

    • Optional string: string

    Returns OutputBuffer<T>

    this

    Throws

    [[OutputException]] if this Output exits the cont state before the full string and line separator has been written.

  • Returns an OutputBuffer in the done state.

    Returns OutputBuffer<never>

  • Returns an OutputBuffer in the error state that traps the given error.

    Parameters

    • error: Error

    Returns OutputBuffer<never>

  • Returns an OutputBuffer in the full state.

    Returns OutputBuffer<never>

Generated using TypeDoc