| 52 | } |
| 53 | |
| 54 | appendString(string: string, ...attributes: T[]): SpannedString<T> { |
| 55 | const startIndex = this._string.length; |
| 56 | const endIndex = startIndex + string.length; |
| 57 | |
| 58 | this._string += string; |
| 59 | this._spanMarkers = this._spanMarkers.concat(new Array(string.length)); |
| 60 | |
| 61 | for (const attribute of attributes) { |
| 62 | this.addSpan(startIndex, endIndex, attribute); |
| 63 | } |
| 64 | |
| 65 | return this; |
| 66 | } |
| 67 | |
| 68 | appendSpannedString(other: SpannedString<T>): SpannedString<T> { |
| 69 | this._string = this._string.concat(other._string); |