Constructors
constructor
- new Text(text?: string | string[] | Value[]): Text
-
Parameters
-
Optional
text: string | string[] | Value[]
Properties
spans
spans: undefined | any[]
str
str: undefined | string
Accessors
length
- get length(): number
-
Returns number
Methods
[iterator]
- [iterator](): {
next(): {
done: boolean;
value: any;
} | {
done: boolean;
value?: undefined;
};
}
-
Returns {
next(): {
done: boolean;
value: any;
} | {
done: boolean;
value?: undefined;
};
}
-
next:function
- next(): {
done: boolean;
value: any;
} | {
done: boolean;
value?: undefined;
}
-
Returns {
done: boolean;
value: any;
} | {
done: boolean;
value?: undefined;
}
deleteAt
- deleteAt(index: number, numDelete?: number): void
-
Parameters
-
index: number
-
numDelete: number = 1
Returns void
every
- every(test: ((v: Value) => boolean)): boolean
-
Parameters
-
test: ((v: Value) => boolean)
-
- (v: Value): boolean
-
Returns boolean
Returns boolean
filter
- filter(test: ((v: Value) => boolean)): Text
-
Parameters
-
test: ((v: Value) => boolean)
-
- (v: Value): boolean
-
Returns boolean
find
- find(test: ((v: Value) => boolean)): undefined | Value
-
Parameters
-
test: ((v: Value) => boolean)
-
- (v: Value): boolean
-
Returns boolean
Returns undefined | Value
findIndex
- findIndex(test: ((v: Value) => boolean)): undefined | number
-
Parameters
-
test: ((v: Value) => boolean)
-
- (v: Value): boolean
-
Returns boolean
Returns undefined | number
forEach
- forEach(f: ((v: Value) => undefined)): void
-
Parameters
-
f: ((v: Value) => undefined)
-
- (v: Value): undefined
-
Returns undefined
Returns void
get
- get(index: number): any
-
Returns any
includes
- includes(elem: Value): boolean
-
Returns boolean
indexOf
- indexOf(elem: Value): number
-
Returns number
insertAt
- insertAt(index: number, ...values: Value[]): void
-
Parameters
-
index: number
-
Rest
...values: Value[]
Returns void
join
- join(sep?: string): string
-
Returns string
lastIndexOf
- lastIndexOf(searchElement: Value, fromIndex?: number): void
-
Parameters
-
searchElement: Value
-
Optional
fromIndex: number
Returns void
map
- map<T>(callback: ((e: Value) => T)): void
-
Parameters
-
callback: ((e: Value) => T)
Returns void
reduce
- reduce(f: ((previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]) => Value)): 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
reduceRight
- reduceRight(f: ((previousValue: Value, currentValue: Value, currentIndex: number, array: Value[]) => Value)): 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
set
- set(index: number, value: Value): void
-
Parameters
-
index: number
-
value: Value
Returns void
slice
- slice(start?: number, end?: number): Text
-
Parameters
-
Optional
start: number
-
Optional
end: number
some
- some(test: ((arg: Value) => boolean)): boolean
-
Parameters
-
test: ((arg: Value) => boolean)
-
- (arg: Value): boolean
-
Returns boolean
Returns boolean
toJSON
- toJSON(): string
-
Returns string
toLocaleString
- toLocaleString(): void
-
Returns void
toSpans
- toSpans(): Value[]
-
Returns Value[]
toString
- toString(): string
-
Returns string
Iterates over the text elements character by character, including any inline objects.