Hierarchy

  • Text

Constructors

  • Parameters

    • Optional text: string | string[] | Value[]

    Returns Text

Properties

elems: any[]
spans: undefined | any[]
str: undefined | string

Accessors

Methods

  • Iterates over the text elements character by character, including any inline objects.

    Returns {
        next(): {
            done: boolean;
            value: any;
        } | {
            done: boolean;
            value?: undefined;
        };
    }

    • next:function
      • Returns {
            done: boolean;
            value: any;
        } | {
            done: boolean;
            value?: undefined;
        }

  • Deletes numDelete list items starting at position index. if numDelete is not given, one item is deleted.

    Parameters

    • index: number
    • numDelete: number = 1

    Returns void

  • Parameters

    • test: ((v: Value) => boolean)
        • (v: Value): boolean
        • Parameters

          • v: Value

          Returns boolean

    Returns boolean

  • Parameters

    • test: ((v: Value) => boolean)
        • (v: Value): boolean
        • Parameters

          • v: Value

          Returns boolean

    Returns Text

  • Parameters

    • test: ((v: Value) => boolean)
        • (v: Value): boolean
        • Parameters

          • v: Value

          Returns boolean

    Returns undefined | Value

  • Parameters

    • test: ((v: Value) => boolean)
        • (v: Value): boolean
        • Parameters

          • v: Value

          Returns boolean

    Returns undefined | number

  • Parameters

    • f: ((v: Value) => undefined)
        • (v: Value): undefined
        • Parameters

          • v: Value

          Returns undefined

    Returns void

  • Parameters

    • index: number

    Returns any

  • Parameters

    • elem: Value

    Returns boolean

  • Parameters

    • elem: Value

    Returns number

  • Inserts new list items values starting at position index.

    Parameters

    • index: number
    • Rest ...values: Value[]

    Returns void

  • Parameters

    • Optional sep: string

    Returns string

  • Parameters

    • searchElement: Value
    • Optional fromIndex: number

    Returns void

  • Type Parameters

    • T

    Parameters

    • callback: ((e: Value) => T)
        • (e: Value): T
        • Parameters

          • e: Value

          Returns T

    Returns void

  • Parameters

    • f: ((previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]) => Value)
        • (previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]): Value
        • Parameters

          • previousValue: Value
          • currentValue: Value
          • currentIndex: number
          • array: Value[]

          Returns Value

    Returns void

  • Parameters

    • f: ((previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]) => Value)
        • (previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]): Value
        • Parameters

          • previousValue: Value
          • currentValue: Value
          • currentIndex: number
          • array: Value[]

          Returns Value

    Returns void

  • Updates the list item at position index to a new value value.

    Parameters

    • index: number
    • value: Value

    Returns void

  • Parameters

    • Optional start: number
    • Optional end: number

    Returns Text

  • Parameters

    • test: ((arg: Value) => boolean)
        • (arg: Value): boolean
        • Parameters

          • arg: Value

          Returns boolean

    Returns boolean

  • Returns the content of the Text object as a simple string, so that the JSON serialization of an Automerge document represents text nicely.

    Returns string

  • Returns the content of the Text object as a sequence of strings, interleaved with non-character elements.

    For example, the value ['a', 'b', {x: 3}, 'c', 'd'] has spans: => ['ab', {x: 3}, 'cd']

    Returns Value[]

  • Returns the content of the Text object as a simple string, ignoring any non-character elements.

    Returns string

Generated using TypeDoc