MarkdownBaseView
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:26
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”_children
Section titled “_children”_children:
Component
[]
Defined in: src/obsidian/augmentations/Components/Component.d.ts:13
Child Components attached to current component, will be unloaded on unloading parent component.
Inherited from
Section titled “Inherited from”_events
Section titled “_events”_events:
EventRef
[]
Defined in: src/obsidian/augmentations/Components/Component.d.ts:20
Events that are attached to the current component, will be detached on unloading parent component.
Inherited from
Section titled “Inherited from”_loaded
Section titled “_loaded”_loaded:
boolean
Defined in: src/obsidian/augmentations/Components/Component.d.ts:27
Whether the component and its children are loaded.
Inherited from
Section titled “Inherited from”app:
App
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:30
Reference to the app.
cleanupLivePreview
Section titled “cleanupLivePreview”cleanupLivePreview:
null
| () =>void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:35
Callback to clear all elements.
clipboardManager
Section titled “clipboardManager”clipboardManager:
ClipboardManager
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:40
Manager that handles pasting text, html and images into the editor.
cm:
EditorView
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:45
Codemirror editor instance.
cmInit
Section titled “cmInit”cmInit:
boolean
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:50
Whether CodeMirror is initialized.
containerEl
Section titled “containerEl”containerEl:
HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:55
Container element of the editor view.
cursorPopupEl
Section titled “cursorPopupEl”cursorPopupEl:
null
|HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:60
Popup element for internal link.
editor?
Section titled “editor?”
optional
editor:Editor
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:67
Obsidian editor instance.
editorEl
Section titled “editorEl”editorEl:
HTMLElement
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:72
Element in which the CodeMirror editor resides.
editorSuggest
Section titled “editorSuggest”editorSuggest:
EditorSuggests
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:77
Editor suggester for autocompleting files, links, aliases, etc.
livePreviewPlugin
Section titled “livePreviewPlugin”livePreviewPlugin:
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:82
The CodeMirror plugins that handle the rendering of, and interaction with Obsidian’s Markdown.
localExtensions
Section titled “localExtensions”localExtensions:
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:87
Local (always active) extensions for the editor.
owner:
MarkdownFileInfo
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:92
Controller of the editor view.
sourceMode
Section titled “sourceMode”sourceMode:
boolean
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:97
Whether live preview rendering is disabled.
tableCell
Section titled “tableCell”tableCell:
null
|TableCellEditor
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:102
Reference to editor attached to table cell, if any.
Accessors
Section titled “Accessors”activeCM
Section titled “activeCM”Get Signature
Section titled “Get Signature”get activeCM():
EditorView
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:107
Currently active CM instance (table cell CM or main CM).
Returns
Section titled “Returns”EditorView
Get Signature
Section titled “Get Signature”get file():
null
|TFile
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:112
Returns attached file of the owner instance.
Returns
Section titled “Returns”null
| TFile
Get Signature
Section titled “Get Signature”get path():
string
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:117
Returns path of the attached file.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”addChild()
Section titled “addChild()”Call Signature
Section titled “Call Signature”addChild<
T
>(component
):T
Defined in: obsidian.d.ts:911
Adds a child component, loading it if this component is loaded
Type Parameters
Section titled “Type Parameters”T
extends Component
Parameters
Section titled “Parameters”component
Section titled “component”T
Returns
Section titled “Returns”T
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”addChild<
T
>(component
):T
Defined in: src/obsidian/augmentations/Components/Component.d.ts:41
Adds a child component, loading it if this component is loaded.
Type Parameters
Section titled “Type Parameters”T
extends Component
The type of the component to add.
Parameters
Section titled “Parameters”component
Section titled “component”T
The component to add.
Returns
Section titled “Returns”T
The added component.
Example
Section titled “Example”component.addChild(childComponent);
Inherited from
Section titled “Inherited from”applyFoldInfo()
Section titled “applyFoldInfo()”applyFoldInfo(
info
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:122
Apply fold history to editor.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
buildLocalExtensions()
Section titled “buildLocalExtensions()”buildLocalExtensions():
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:129
Constructs local (always active) extensions for the editor.
Returns
Section titled “Returns”Extension
[]
clear()
Section titled “clear()”clear():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:134
Cleanup live preview, remove and then re-add all editor extensions.
Returns
Section titled “Returns”void
destroy()
Section titled “destroy()”destroy():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:139
Clean up live preview, remove all extensions, destroy editor.
Returns
Section titled “Returns”void
destroyTableCell()
Section titled “destroyTableCell()”destroyTableCell(
cell?
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:144
Removes specified tablecell.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
editTableCell()
Section titled “editTableCell()”editTableCell(
cell
,new_cell
):TableCellEditor
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:149
Edit a specified table cell, creating a table cell editor.
Parameters
Section titled “Parameters”new_cell
Section titled “new_cell”Returns
Section titled “Returns”get():
string
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:154
Get the current editor document as a string.
Returns
Section titled “Returns”string
getDynamicExtensions()
Section titled “getDynamicExtensions()”getDynamicExtensions():
Extension
[]
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:161
Constructs extensions for the editor based on user settings.
Returns
Section titled “Returns”Extension
[]
load()
Section titled “load()”Call Signature
Section titled “Call Signature”load():
void
Defined in: obsidian.d.ts:889
Load this component and its children
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”load():
void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:48
Load this component and its children.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onContextMenu()
Section titled “onContextMenu()”onContextMenu(
event
,x
):Promise
<void
>
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:178
Creates menu on right mouse click.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise
<void
>
onEditorClick()
Section titled “onEditorClick()”onEditorClick(
event
,element?
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:183
Execute click functionality on token on mouse click.
Parameters
Section titled “Parameters”element?
Section titled “element?”Returns
Section titled “Returns”void
onEditorDragStart()
Section titled “onEditorDragStart()”onEditorDragStart(
event
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:190
Execute drag functionality on drag start.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Interfaces with dragManager.
onEditorLinkMouseover()
Section titled “onEditorLinkMouseover()”onEditorLinkMouseover(
event
,target
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:195
Execute hover functionality on mouse over event.
Parameters
Section titled “Parameters”target
Section titled “target”Returns
Section titled “Returns”void
onload()
Section titled “onload()”Call Signature
Section titled “Call Signature”onload():
void
Defined in: obsidian.d.ts:895
Override this to load your component
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”onload():
void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:64
Override this to load your component.
Returns
Section titled “Returns”void
Example
Section titled “Example”class MyComponent extends Component { public override onload(): void { console.log('MyComponent loaded'); }}
Inherited from
Section titled “Inherited from”onMenu()
Section titled “onMenu()”onMenu(
event
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:202
Execute context menu functionality on right mouse click.
Use onContextMenu instead.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
onResize()
Section titled “onResize()”onResize():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:207
Reposition suggest and scroll position on resize.
Returns
Section titled “Returns”void
onunload()
Section titled “onunload()”onunload():
void
Defined in: obsidian.d.ts:906
Override this to unload your component
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onUpdate()
Section titled “onUpdate()”onUpdate(
update
,changed
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:212
Execute functionality on CM editor state update.
Parameters
Section titled “Parameters”update
Section titled “update”ViewUpdate
changed
Section titled “changed”boolean
Returns
Section titled “Returns”void
register()
Section titled “register()”Call Signature
Section titled “Call Signature”register(
cb
):void
Defined in: obsidian.d.ts:921
Registers a callback to be called when unloading
Parameters
Section titled “Parameters”() => any
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”register(
cb
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:78
Registers a callback to be called when unloading.
Parameters
Section titled “Parameters”() => any
The callback to be called when unloading.
Returns
Section titled “Returns”void
Example
Section titled “Example”component.register(() => { console.log('MyComponent unloaded');});
Inherited from
Section titled “Inherited from”registerDomEvent()
Section titled “registerDomEvent()”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: obsidian.d.ts:931
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K
extends keyof WindowEventMap
Parameters
Section titled “Parameters”K
callback
Section titled “callback”(this
, ev
) => any
options?
Section titled “options?”boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: obsidian.d.ts:936
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K
extends keyof DocumentEventMap
Parameters
Section titled “Parameters”K
callback
Section titled “callback”(this
, ev
) => any
options?
Section titled “options?”boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: obsidian.d.ts:941
Registers an DOM event to be detached when unloading
Type Parameters
Section titled “Type Parameters”K
extends keyof HTMLElementEventMap
Parameters
Section titled “Parameters”K
callback
Section titled “callback”(this
, ev
) => any
options?
Section titled “options?”boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:96
Registers an DOM event to be detached when unloading.
Type Parameters
Section titled “Type Parameters”K
extends keyof DocumentEventMap
The type of the event to register.
Parameters
Section titled “Parameters”The element to register the event on.
K
The type of the event to register.
callback
Section titled “callback”(this
, ev
) => any
The callback to be called when the event is triggered.
options?
Section titled “options?”The options for the event.
boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Example
Section titled “Example”component.registerDomEvent(document, 'click', () => { console.log('Document clicked');});
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:119
Registers an DOM event to be detached when unloading.
Type Parameters
Section titled “Type Parameters”K
extends keyof HTMLElementEventMap
The type of the event to register.
Parameters
Section titled “Parameters”The element to register the event on.
K
The type of the event to register.
callback
Section titled “callback”(this
, ev
) => any
The callback to be called when the event is triggered.
options?
Section titled “options?”The options for the event.
boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Example
Section titled “Example”component.registerDomEvent(document.body, 'click', () => { console.log('Body clicked');});
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerDomEvent<
K
>(el
,type
,callback
,options?
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:142
Registers an DOM event to be detached when unloading.
Type Parameters
Section titled “Type Parameters”K
extends keyof WindowEventMap
The type of the event to register.
Parameters
Section titled “Parameters”The element to register the event on.
K
The type of the event to register.
callback
Section titled “callback”(this
, ev
) => any
The callback to be called when the event is triggered.
options?
Section titled “options?”The options for the event.
boolean
| AddEventListenerOptions
Returns
Section titled “Returns”void
Example
Section titled “Example”component.registerDomEvent(window, 'click', () => { console.log('Window clicked');});
Inherited from
Section titled “Inherited from”registerEvent()
Section titled “registerEvent()”Call Signature
Section titled “Call Signature”registerEvent(
eventRef
):void
Defined in: obsidian.d.ts:926
Registers an event to be detached when unloading
Parameters
Section titled “Parameters”eventRef
Section titled “eventRef”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerEvent(
eventRef
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:159
Registers an event to be detached when unloading.
Parameters
Section titled “Parameters”eventRef
Section titled “eventRef”The event to be registered.
Returns
Section titled “Returns”void
Example
Section titled “Example”component.registerEvent(eventRef);
Inherited from
Section titled “Inherited from”registerInterval()
Section titled “registerInterval()”Call Signature
Section titled “Call Signature”registerInterval(
id
):number
Defined in: obsidian.d.ts:948
Registers an interval (from setInterval) to be cancelled when unloading Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”registerInterval(
id
):number
Defined in: src/obsidian/augmentations/Components/Component.d.ts:175
Registers an interval (from setInterval) to be cancelled when unloading. Use setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
Parameters
Section titled “Parameters”number
The id of the interval to register.
Returns
Section titled “Returns”number
The id of the interval.
Example
Section titled “Example”component.registerInterval(window.setInterval(() => { console.log('Interval');}, 1000));
Inherited from
Section titled “Inherited from”registerScopeEvent()
Section titled “registerScopeEvent()”registerScopeEvent(
keymapEventHandler
):void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:181
Parameters
Section titled “Parameters”keymapEventHandler
Section titled “keymapEventHandler”Returns
Section titled “Returns”void
Documentation incomplete.
Inherited from
Section titled “Inherited from”reinit()
Section titled “reinit()”reinit():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:217
Reinitialize the editor inside new container.
Returns
Section titled “Returns”void
removeChild()
Section titled “removeChild()”Call Signature
Section titled “Call Signature”removeChild<
T
>(component
):T
Defined in: obsidian.d.ts:916
Removes a child component, unloading it
Type Parameters
Section titled “Type Parameters”T
extends Component
Parameters
Section titled “Parameters”component
Section titled “component”T
Returns
Section titled “Returns”T
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”removeChild<
T
>(component
):T
Defined in: src/obsidian/augmentations/Components/Component.d.ts:195
Removes a child component, unloading it.
Type Parameters
Section titled “Type Parameters”T
extends Component
The type of the component to remove.
Parameters
Section titled “Parameters”component
Section titled “component”T
The component to remove.
Returns
Section titled “Returns”T
The removed component.
Example
Section titled “Example”component.removeChild(childComponent);
Inherited from
Section titled “Inherited from”reparent()
Section titled “reparent()”reparent(
new_container
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:222
Move the editor into the new container.
Parameters
Section titled “Parameters”new_container
Section titled “new_container”Returns
Section titled “Returns”void
resetSyntaxHighlighting()
Section titled “resetSyntaxHighlighting()”resetSyntaxHighlighting():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:229
Bodge to reset the syntax highlighting.
Returns
Section titled “Returns”void
Uses single-character replacement transaction.
saveHistory()
Section titled “saveHistory()”saveHistory():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:234
Save history of file and data (for caching, for faster reopening of same file in editor).
Returns
Section titled “Returns”void
set(
data
,clear
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:239
Set the state of the editor.
Parameters
Section titled “Parameters”string
boolean
Returns
Section titled “Returns”void
toggleFoldFrontmatter()
Section titled “toggleFoldFrontmatter()”toggleFoldFrontmatter():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:244
Enables/disables frontmatter folding.
Returns
Section titled “Returns”void
toggleSource()
Section titled “toggleSource()”toggleSource():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:249
Toggle source mode for editor and dispatch effect.
Returns
Section titled “Returns”void
triggerClickableToken()
Section titled “triggerClickableToken()”triggerClickableToken(
token
,new_leaf
):void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:254
Execute functionality of token (open external link, open internal link in leaf, …).
Parameters
Section titled “Parameters”new_leaf
Section titled “new_leaf”boolean
Returns
Section titled “Returns”void
unload()
Section titled “unload()”Call Signature
Section titled “Call Signature”unload():
void
Defined in: obsidian.d.ts:900
Unload this component and its children
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”unload():
void
Defined in: src/obsidian/augmentations/Components/Component.d.ts:211
Override this to unload your component.
Returns
Section titled “Returns”void
Example
Section titled “Example”class MyComponent extends Component { public override onunload(): void { console.log('MyComponent unloaded'); }}
Inherited from
Section titled “Inherited from”updateEvent()
Section titled “updateEvent()”updateEvent(): (
update
) =>void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:259
Callback for onUpdate functionality added as an extension.
Returns
Section titled “Returns”(
update
):void
Parameters
Section titled “Parameters”update
Section titled “update”ViewUpdate
Returns
Section titled “Returns”void
updateLinkPopup()
Section titled “updateLinkPopup()”updateLinkPopup():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:264
In mobile, creates a popover link on clickable token, if exists.
Returns
Section titled “Returns”void
updateOptions()
Section titled “updateOptions()”updateOptions():
void
Defined in: src/obsidian/internals/MarkdownBaseView.d.ts:269
Reconfigure/re-add all the dynamic extensions.
Returns
Section titled “Returns”void