Class: TextLineAdapterImpl
@ghentcdh/annotated-text / TextLineAdapterImpl
Class: TextLineAdapterImpl
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:41
This adapter is used to parse a text that includes line numbers.
f.e. 1.Χ[αι]ρήμ[ων] Ἀπολλωνίωι τῶι\n2.[φι]λτάτωι χαίρειν.
will be parsed into an array of TextLine objects of 2 lines, in the gutter the line number will appear.
Extends
Constructors
Constructor
new TextLineAdapterImpl():
TextLineAdapterImpl
Returns
TextLineAdapterImpl
Inherited from
Properties
flatText
flatText:
boolean
=false
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:28
Inherited from
name
name:
string
="TextLineAdapter"
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:42
Name of the adapter. Be unique 😃.
Overrides
textDirection
textDirection:
TextDirection
="ltr"
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:27
Inherited from
Accessors
limit
Get Signature
get limit():
object
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:46
Returns
end
end:
number
The end position in the text up to which to consider lines. This is exclusive.
ignoreLines?
optional
ignoreLines:boolean
If true, characters that are outside the range will be ignored. If false, lines that intersect with the range will be included. Defaults to false.
start
start:
number
The start position in the text from which to consider lines. This is inclusive.
Set Signature
set limit(
limit
):void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:42
Parameters
limit
end
number
The end position in the text up to which to consider lines. This is exclusive.
ignoreLines?
boolean
If true, characters that are outside the range will be ignored. If false, lines that intersect with the range will be included. Defaults to false.
start
number
The start position in the text from which to consider lines. This is inclusive.
Returns
void
Inherited from
Methods
changeConfig()
changeConfig():
void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:16
Returns
void
Inherited from
getRanges()
getRanges(
annotation
,line
):DOMRect
[]
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:38
Parameters
annotation
any
line
Returns
DOMRect
[]
Inherited from
parse()
parse(
text
):TextLine
[]
Defined in: libs/core/src/lib/adapter/text/textline/TextLineAdapter.ts:44
Parses the given text into an array of TextLine objects. The parser is also responsible for handling text limits.
Parameters
text
string
Returns
TextLine
[]
Overrides
setConfig()
setConfig<
KEY
>(key
,value
):void
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:56
Change the configuration of the adapter, it will update the eventlistener if rerendering of the annotations is needed. f.e. if the text direction changes, the adapter will emit a change event to update the annotations.
Type Parameters
KEY
KEY
extends keyof TextAdapter
Parameters
key
KEY
value
TEXT_CONFIG_VALUES
<KEY
>
Returns
void
Inherited from
setConfigListener()
setConfigListener(
callback
):void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:12
Set a listener for configuration changes.
Parameters
callback
() => void
Returns
void