Class: abstract TextAdapter
@ghentcdh/annotated-text / TextAdapter
Class: abstract
TextAdapter
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:26
Extends
BaseAdapter
Extended by
Constructors
Constructor
new TextAdapter():
TextAdapter
Returns
TextAdapter
Inherited from
BaseAdapter.constructor
Properties
flatText
flatText:
boolean
=false
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:28
name
abstract
name:string
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:5
Name of the adapter. Be unique 😃.
Inherited from
BaseAdapter.name
textDirection
textDirection:
TextDirection
="ltr"
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:27
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
Methods
changeConfig()
changeConfig():
void
Defined in: libs/core/src/lib/adapter/BaseAdapter.ts:16
Returns
void
Inherited from
BaseAdapter.changeConfig
getRanges()
getRanges(
annotation
,line
):DOMRect
[]
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:38
Parameters
annotation
any
line
Returns
DOMRect
[]
parse()
abstract
parse(text
):TextLine
[]
Defined in: libs/core/src/lib/adapter/text/TextAdapter.ts:36
Parses the given text into an array of TextLine objects. The parser is also responsible for handling text limits.
Parameters
text
string
Returns
TextLine
[]
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
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
Inherited from
BaseAdapter.setConfigListener