Skip to content

SyncView

Unofficial

obsidian#View that displays the Obsidian Sync status and settings.

Import:

import type { SyncView } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface SyncView extends View

Extends: View

Constructor

new SyncView(leaf: WorkspaceLeaf, syncPluginInstance: SyncPluginInstance)

Constructor.

Properties

PropertyTypeDescription
_childrenComponent[]Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from View)
_eventsEventRef[]Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from View)
_loadedbooleanWhether the component and its children are loaded.
(Inherited from View)
appAppThe Obsidian app instance.
(Inherited from View)
closeablebooleanWhether the leaf may close the view.
(Inherited from View)
containerElHTMLElementThe container HTML element for the component.
(Inherited from View)
iconIconNameThe icon of the view.
(Inherited from View)
leafWorkspaceLeafThe leaf of the view.
(Inherited from View)
navigationbooleanWhether or not the view is intended for navigation. If your view is a static view that is not intended to be navigated away, set this to false. (For example: File explorer, calendar, etc.) If your view opens a file or can be otherwise navigated, set this to true. (For example: Markdown editor view, Kanban view, PDF view, etc.)
(Inherited from View)
scopenull | ScopeAssign an optional scope to your view to register hotkeys for when the view is in focus.
(Inherited from View)

Methods

MethodReturnsDescription
addChild(component)TAdds a child component, loading it if this component is loaded.
(Inherited from View)
close()Promise<void>Closes the view.
(Inherited from View)
getDisplayText()stringGet the display text of the view.
(Inherited from View)
getEphemeralState()Record<string, unknown>Get the ephemeral state of the view.
(Inherited from View)
getIcon()IconNameGet the icon of the view.
(Inherited from View)
getSideTooltipPlacement()'left' | 'right' | undefinedReturns the placement of the tooltip.
(Inherited from View)
getState()Record<string, unknown>Get the state of the view.
(Inherited from View)
getViewType()typeof ViewType.SyncGet the current view type.
handleCopy(event)voidHandle copy event on metadata editor and serialize properties.
(Inherited from View)
handleCut(event)voidHandle cut event on metadata editor and serialize and remove properties.
(Inherited from View)
handlePaste(event)voidHandle paste event of properties on metadata editor.
(Inherited from View)
load()voidLoad this component and its children.
(Inherited from View)
onClose()Promise<void>Called when the view is closed.
(Inherited from View)
onHeaderMenu(e)voidCalled when the header context menu is triggered.
(Inherited from View)
onload()voidOverride this to load your component.
(Inherited from View)
onOpen()Promise<void>Called when the view is opened.
(Inherited from View)
onPaneMenu(menu, source)voidPopulates the pane menu.

(Replaces the previously removed onHeaderMenu and onMoreOptionsMenu)
(Inherited from View)
onResize()voidCalled when the size of this view is changed.
(Inherited from View)
onTabMenu(menu)voidAdds the menu items to the menu.
(Inherited from View)
onunload()voidOverride this to unload your component
(Inherited from View)
open(parentEl)Promise<void>Opens the view.
(Inherited from View)
register(cb)voidRegisters a callback to be called when unloading.
(Inherited from View)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading.
(Inherited from View)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from View)
registerDomEvent(el, type, callback, options?)voidRegisters a DOM event to be detached when unloading
(Inherited from View)
registerEvent(eventRef)voidRegisters an event to be detached when unloading.
(Inherited from View)
registerInterval(id)numberRegisters an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from View)
registerScopeEvent(keymapEventHandler)voidRegister a scope keymap event handler to be removed on unload.
(Inherited from View)
removeChild(component)TRemoves a child component, unloading it.
(Inherited from View)
setEphemeralState(state)voidSet the ephemeral state of the view.
(Inherited from View)
setState(state, result)Promise<void>Set the state of the view.
(Inherited from View)
unload()voidOverride this to unload your component.
(Inherited from View)

Links to this page: