trilium
Preparing search index...
Frontend Script API
<internal>
TextEditor
Interface TextEditor
interface
TextEditor
{
conversion
:
{
for
(
filter
:
string
,
)
:
{
markerToHighlight
(
data
:
{
model
:
string
;
view
:
(
data
:
{
markerName
:
string
}
)
=>
void
}
,
)
:
any
;
}
;
}
;
data
:
{
processor
:
{
toView
(
html
:
string
)
:
any
}
;
toModel
(
viewFeragment
:
any
)
:
any
;
}
;
editing
:
{
view
:
{
document
:
{
getRoot
()
:
CKNode
;
on
(
event
:
string
,
cb
:
(
event
:
CKEvent
,
data
:
{
preventDefault
()
:
any
}
)
=>
void
,
opts
?:
{
priority
:
"high"
}
,
)
:
any
;
}
;
domRoots
:
{
values
:
()
=>
{
next
:
()
=>
{
value
:
string
}
}
}
;
change
(
cb
:
(
writer
:
Writer
)
=>
void
)
:
any
;
focus
()
:
void
;
scrollToTheSelection
()
:
void
;
}
;
}
;
model
:
{
document
:
{
differ
:
{
getChanges
()
:
{
name
:
string
;
position
?:
{
nodeAfter
?:
CKNode
;
parent
:
CKNode
;
toJSON
()
:
Object
}
;
type
:
string
;
}
[]
;
}
;
selection
:
{
isCollapsed
:
boolean
;
getAttribute
(
attribute
:
string
)
:
string
;
getFirstPosition
()
:
undefined
|
TextPosition
;
getFirstRange
()
:
Range
;
getLastPosition
()
:
undefined
|
TextPosition
;
getSelectedElement
()
:
CKNode
;
hasAttribute
(
attribute
:
string
)
:
boolean
;
}
;
getRoot
()
:
CKNode
;
on
(
event
:
string
,
cb
:
()
=>
void
)
:
any
;
registerPostFixer
(
callback
:
(
writer
:
Writer
)
=>
boolean
)
:
any
;
}
;
change
(
cb
:
(
writer
:
Writer
)
=>
void
)
:
any
;
insertContent
(
modelFragment
:
any
,
selection
?:
any
)
:
any
;
}
;
plugins
:
{
get
(
command
:
string
)
:
any
}
;
sourceElement
:
HTMLElement
;
create
(
el
:
HTMLElement
,
config
:
{
mention
:
MentionConfig
;
placeholder
:
string
;
removePlugins
?:
string
[]
;
toolbar
:
{
items
:
any
[]
}
;
}
,
)
:
any
;
enableReadOnlyMode
(
reason
:
string
)
:
any
;
execute
<
T
>
(
action
:
string
,
...
args
:
unknown
[]
)
:
T
;
focus
()
:
void
;
getData
()
:
string
;
getSelectedHtml
()
:
string
;
removeSelection
()
:
void
;
setData
(
data
:
string
)
:
void
;
}
Index
Properties
conversion
data
editing
model
plugins
source
Element
Methods
create
enable
Read
Only
Mode
execute
focus
get
Data
get
Selected
Html
remove
Selection
set
Data
Properties
conversion
conversion
:
{
for
(
filter
:
string
,
)
:
{
markerToHighlight
(
data
:
{
model
:
string
;
view
:
(
data
:
{
markerName
:
string
}
)
=>
void
}
,
)
:
any
;
}
;
}
data
data
:
{
processor
:
{
toView
(
html
:
string
)
:
any
}
;
toModel
(
viewFeragment
:
any
)
:
any
;
}
editing
editing
:
{
view
:
{
document
:
{
getRoot
()
:
CKNode
;
on
(
event
:
string
,
cb
:
(
event
:
CKEvent
,
data
:
{
preventDefault
()
:
any
}
)
=>
void
,
opts
?:
{
priority
:
"high"
}
,
)
:
any
;
}
;
domRoots
:
{
values
:
()
=>
{
next
:
()
=>
{
value
:
string
}
}
}
;
change
(
cb
:
(
writer
:
Writer
)
=>
void
)
:
any
;
focus
()
:
void
;
scrollToTheSelection
()
:
void
;
}
;
}
model
model
:
{
document
:
{
differ
:
{
getChanges
()
:
{
name
:
string
;
position
?:
{
nodeAfter
?:
CKNode
;
parent
:
CKNode
;
toJSON
()
:
Object
}
;
type
:
string
;
}
[]
;
}
;
selection
:
{
isCollapsed
:
boolean
;
getAttribute
(
attribute
:
string
)
:
string
;
getFirstPosition
()
:
undefined
|
TextPosition
;
getFirstRange
()
:
Range
;
getLastPosition
()
:
undefined
|
TextPosition
;
getSelectedElement
()
:
CKNode
;
hasAttribute
(
attribute
:
string
)
:
boolean
;
}
;
getRoot
()
:
CKNode
;
on
(
event
:
string
,
cb
:
()
=>
void
)
:
any
;
registerPostFixer
(
callback
:
(
writer
:
Writer
)
=>
boolean
)
:
any
;
}
;
change
(
cb
:
(
writer
:
Writer
)
=>
void
)
:
any
;
insertContent
(
modelFragment
:
any
,
selection
?:
any
)
:
any
;
}
plugins
plugins
:
{
get
(
command
:
string
)
:
any
}
source
Element
sourceElement
:
HTMLElement
Methods
create
create
(
el
:
HTMLElement
,
config
:
{
mention
:
MentionConfig
;
placeholder
:
string
;
removePlugins
?:
string
[]
;
toolbar
:
{
items
:
any
[]
}
;
}
,
)
:
any
Parameters
el
:
HTMLElement
config
:
{
mention
:
MentionConfig
;
placeholder
:
string
;
removePlugins
?:
string
[]
;
toolbar
:
{
items
:
any
[]
}
;
}
Returns
any
enable
Read
Only
Mode
enableReadOnlyMode
(
reason
:
string
)
:
any
Parameters
reason
:
string
Returns
any
execute
execute
<
T
>
(
action
:
string
,
...
args
:
unknown
[]
)
:
T
Type Parameters
T
Parameters
action
:
string
...
args
:
unknown
[]
Returns
T
focus
focus
()
:
void
Returns
void
get
Data
getData
()
:
string
Returns
string
get
Selected
Html
getSelectedHtml
()
:
string
Returns
string
remove
Selection
removeSelection
()
:
void
Returns
void
set
Data
setData
(
data
:
string
)
:
void
Parameters
data
:
string
Returns
void
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Properties
conversion
data
editing
model
plugins
source
Element
Methods
create
enable
Read
Only
Mode
execute
focus
get
Data
get
Selected
Html
remove
Selection
set
Data
trilium
Loading...