Automerge Repo - v2.3.0-alpha.0
    Preparing search index...
    splice: <T>(
        doc: Automerge.Doc<T>,
        path: Automerge.Prop[],
        index: string | number,
        del: number,
        newText?: string,
    ) => void = Automerge.splice

    Type declaration

      • <T>(
            doc: Automerge.Doc<T>,
            path: Automerge.Prop[],
            index: string | number,
            del: number,
            newText?: string,
        ): void
      • Modify a string

        Type Parameters

        • T

          The type of the value contained in the document

        Parameters

        • doc: Automerge.Doc<T>

          The document to modify

        • path: Automerge.Prop[]

          The path to the string to modify

        • index: string | number

          The position (as a Cursor or index) to edit. If a cursor is used then the edit happens such that the cursor will now point to the end of the newText, so you can continue to reuse the same cursor for multiple calls to splice.

        • del: number

          The number of code units to delete, a positive number deletes N characters after the cursor, a negative number deletes N characters before the cursor.

        • OptionalnewText: string

          The string to insert (if any).

        Returns void