import { Text } from "https://deno.land/x/automerge@2.2.0/index.ts";
Methods
deleteAt(index: number, numDelete?)
Deletes numDelete
list items starting at position index
.
if numDelete
is not given, one item is deleted.
every(test: (v: Value) => boolean): boolean
find(test: (v: Value) => boolean): Value | undefined
findIndex(test: (v: Value) => boolean): number | undefined
forEach(f: (v: Value) => undefined)
get(index: number): any
includes(elem: Value): boolean
indexOf(elem: Value)
insertAt(index: number, ...values: Array<Value | object>)
Inserts new list items values
starting at position index
.
join(sep?: string): string
lastIndexOf(searchElement: Value, fromIndex?: number)
map<T>(callback: (e: Value | object) => T)
reduce(f: () => Value)
previousValue: Value,
currentValue: Value,
currentIndex: number,
array: Value[],
reduceRight(f: () => Value)
previousValue: Value,
currentValue: Value,
currentIndex: number,
array: Value[],
slice(start?: number, end?: number)
some(test: (arg: Value) => boolean): boolean
toJSON(): string
Returns the content of the Text object as a simple string, so that the JSON serialization of an Automerge document represents text nicely.
toSpans(): Array<Value | object>
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']
toString(): string
Returns the content of the Text object as a simple string, ignoring any non-character elements.