WidgetEditorView
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:15
Extends
Section titled “Extends”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”after:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:19
Data after reference.
app:
App
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:20
Reference to the app.
Inherited from
Section titled “Inherited from”before
Section titled “before”before:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:24
Data before reference.
containerEl
Section titled “containerEl”containerEl:
HTMLElement
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:25
Container element for the embedded view.
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.containerEl
data:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:29
Full file contents.
dirty:
boolean
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:30
Whether the view is currently saving.
Inherited from
Section titled “Inherited from”editable
Section titled “editable”editable:
boolean
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:38
Whether the editor may be edited.
Inherited from
Section titled “Inherited from”editMode?
Section titled “editMode?”
optional
editMode:IFramedMarkdownEditor
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:43
Editor component of the view.
Inherited from
Section titled “Inherited from”editorEl
Section titled “editorEl”editorEl:
HTMLElement
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:48
Container in which the editor is embedded.
Inherited from
Section titled “Inherited from”file:
null
|TFile
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:53
File to which the view is attached.
Inherited from
Section titled “Inherited from”fileBeingRenamed
Section titled “fileBeingRenamed”fileBeingRenamed:
null
|TFile
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:34
File being currently renamed.
heading
Section titled “heading”heading:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:39
Current heading.
hoverPopover
Section titled “hoverPopover”hoverPopover:
null
|HoverPopover
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:58
Hover element container.
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.hoverPopover
indent
Section titled “indent”indent:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:44
Indent.
inlineTitleEl
Section titled “inlineTitleEl”inlineTitleEl:
HTMLElement
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:49
Inline title element.
lastSavedData
Section titled “lastSavedData”lastSavedData:
null
|string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:54
Full inline content string.
previewEl
Section titled “previewEl”previewEl:
HTMLElement
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:63
Element containing the preview for the embedded markdown.
Inherited from
Section titled “Inherited from”previewMode
Section titled “previewMode”previewMode:
MarkdownPreviewView
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:68
Preview component of the view.
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.previewMode
saveAgain
Section titled “saveAgain”saveAgain:
boolean
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:59
Whether embedding should be saved twice on save.
saving
Section titled “saving”saving:
boolean
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:64
Whether the widget is currently saving.
state:
unknown
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:73
Current state of the editor.
Inherited from
Section titled “Inherited from”subpath
Section titled “subpath”subpath:
string
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:69
Subpath reference of the path.
subpathNotFound
Section titled “subpathNotFound”subpathNotFound:
boolean
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:74
Whether the subpath was not found in the cache.
text:
string
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:78
Text contents being embedded.
Inherited from
Section titled “Inherited from”useIframe
Section titled “useIframe”useIframe:
boolean
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:83
Whether the view renders contents using an iFrame.
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”editor
Section titled “editor”Get Signature
Section titled “Get Signature”get editor():
null
|IFramedMarkdownEditor
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:88
Get the preview editor, if exists.
Returns
Section titled “Returns”null
| IFramedMarkdownEditor
Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get path():
string
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:93
Get the path to the file, if any file registered.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”scroll
Section titled “scroll”Get Signature
Section titled “Get Signature”get scroll():
unknown
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:98
Get the scroll of the file renderer component.
Returns
Section titled “Returns”unknown
Inherited from
Section titled “Inherited from”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”applyScope()
Section titled “applyScope()”applyScope(
scope
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:79
Push/pop current scope.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
destroyEditor()
Section titled “destroyEditor()”destroyEditor(
save?
):void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:103
Destroy edit component editor and save contents if specified.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.destroyEditor
getFoldInfo()
Section titled “getFoldInfo()”getFoldInfo():
null
|FoldInfo
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:84
Get the current folds of the editor.
Returns
Section titled “Returns”null
| FoldInfo
getMode()
Section titled “getMode()”getMode():
"source"
|"preview"
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:108
Gets currently active mode (editMode returns ‘source’).
Returns
Section titled “Returns”"source"
| "preview"
Inherited from
Section titled “Inherited from”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”loadContents()
Section titled “loadContents()”loadContents(
data
,cache
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:89
Splice incoming data at according to subpath for correct reference, then update heading and render.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
loadFile()
Section titled “loadFile()”loadFile():
Promise
<void
>
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:94
Load file from cache based on stored path.
Returns
Section titled “Returns”Promise
<void
>
loadFileInternal()
Section titled “loadFileInternal()”loadFileInternal(
data
,cache?
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:99
Load file and check if data is different from last saved data, then loads contents.
Parameters
Section titled “Parameters”string
cache?
Section titled “cache?”Returns
Section titled “Returns”void
onFileChanged()
Section titled “onFileChanged()”onFileChanged(
file
,data
,cache
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:104
Update representation on file finished updating.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
onFileRename()
Section titled “onFileRename()”onFileRename(
file
,oldPath
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:109
Update representation on file rename.
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
Returns
Section titled “Returns”void
onload()
Section titled “onload()”onload():
void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:114
On loading widget, register vault change and rename events.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”onMarkdownFold()
Section titled “onMarkdownFold()”onMarkdownFold():
void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:119
Save fold made in the editor to foldManager.
Returns
Section titled “Returns”void
onMarkdownScroll()
Section titled “onMarkdownScroll()”onMarkdownScroll():
void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:118
Trigger markdown scroll on workspace.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.onMarkdownScroll
onTitleChange()
Section titled “onTitleChange()”onTitleChange(
element
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:124
On change of editor title element.
Parameters
Section titled “Parameters”element
Section titled “element”Returns
Section titled “Returns”void
onTitleKeydown()
Section titled “onTitleKeydown()”onTitleKeydown(
event
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:129
On keypress on editor title element.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
onTitlePaste()
Section titled “onTitlePaste()”onTitlePaste(
element
,event
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:134
On pasting on editor title element.
Parameters
Section titled “Parameters”element
Section titled “element”Returns
Section titled “Returns”void
onunload()
Section titled “onunload()”onunload():
void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:139
On unloading widget, unload component and remove scope.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerDomEvent
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”EmbeddedEditorView
.registerEvent
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”EmbeddedEditorView
.registerEvent
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”EmbeddedEditorView
.registerInterval
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”EmbeddedEditorView
.registerInterval
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
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.registerScopeEvent
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”EmbeddedEditorView
.removeChild
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”EmbeddedEditorView
.removeChild
requestSave()
Section titled “requestSave()”requestSave():
void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:128
Debounced save of contents.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.requestSave
requestSaveFolds()
Section titled “requestSaveFolds()”requestSaveFolds():
void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:133
Debounced save of editor folds.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”EmbeddedEditorView
.requestSaveFolds
save()
Section titled “save()”save(
data
,delayed?
):Promise
<void
>
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:144
Save changes made in editable widget.
Parameters
Section titled “Parameters”string
delayed?
Section titled “delayed?”boolean
Returns
Section titled “Returns”Promise
<void
>
Overrides
Section titled “Overrides”saveTitle()
Section titled “saveTitle()”saveTitle(
element
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:149
On blur widget, save title.
Parameters
Section titled “Parameters”element
Section titled “element”Returns
Section titled “Returns”void
set(
data
,clear
):void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:143
Set the state of the editor.
Parameters
Section titled “Parameters”string
boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”showEditor()
Section titled “showEditor()”showEditor():
void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:148
Reveal the editor if editable widget and applies saved state.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”showPreview()
Section titled “showPreview()”showPreview(
show?
):void
Defined in: src/obsidian/internals/WidgetEditorView.d.ts:154
Show preview of widget.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”EmbeddedEditorView
.showPreview
showSearch()
Section titled “showSearch()”showSearch(
replace?
):void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:158
Reveal search component in file renderer component.
Parameters
Section titled “Parameters”replace?
Section titled “replace?”boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toggleMode()
Section titled “toggleMode()”toggleMode():
void
Defined in: src/obsidian/internals/EmbeddedEditorView.d.ts:163
Toggle between edit and preview mode.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”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'); }}