Skip to content

SyncView

Defined in: src/obsidian/internals/InternalPlugins/Sync/SyncView.d.ts:5

Extends

Properties

_children

_children: Component[]

Defined in: src/obsidian/augmentations/Components/Component.d.ts:9

Child Components attached to current component, will be unloaded on unloading parent component

Inherited from

View._children


_events

_events: EventRef[]

Defined in: src/obsidian/augmentations/Components/Component.d.ts:13

Events that are attached to the current component, will be detached on unloading parent component

Inherited from

View._events


_loaded

_loaded: boolean

Defined in: src/obsidian/augmentations/Components/Component.d.ts:17

Whether the component and its children are loaded

Inherited from

View._loaded


app

app: App

Defined in: obsidian.d.ts:4461

Inherited from

View.app


closeable

closeable: boolean

Defined in: src/obsidian/augmentations/Views/View.d.ts:10

Whether the leaf may close the view

Inherited from

View.closeable


containerEl

containerEl: HTMLElement

Defined in: obsidian.d.ts:4484

Inherited from

View.containerEl


icon

icon: string

Defined in: obsidian.d.ts:4465

Inherited from

View.icon


leaf

leaf: WorkspaceLeaf

Defined in: obsidian.d.ts:4480

Inherited from

View.leaf


navigation: boolean

Defined in: obsidian.d.ts:4475

Whether 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.navigation


scope

scope: null | Scope

Defined in: obsidian.d.ts:4496

Assign an optional scope to your view to register hotkeys for when the view is in focus.

Example

this.scope = new Scope(this.app.scope);

Default

null
@public

Inherited from

View.scope

Methods

addChild()

addChild<T>(component): T

Defined in: obsidian.d.ts:887

Adds a child component, loading it if this component is loaded

Type Parameters

T extends Component

Parameters

component

T

Returns

T

Inherited from

View.addChild


close()

close(): Promise<void>

Defined in: src/obsidian/augmentations/Views/View.d.ts:21

Closes the view

Returns

Promise<void>

Inherited from

View.close


getDisplayText()

abstract getDisplayText(): string

Defined in: obsidian.d.ts:4542

Returns

string

Inherited from

View.getDisplayText


getEphemeralState()

Call Signature

getEphemeralState(): Record<string, unknown>

Defined in: obsidian.d.ts:4525

Returns

Record<string, unknown>

Inherited from

View.getEphemeralState

Call Signature

getEphemeralState(): object

Defined in: src/obsidian/augmentations/Views/View.d.ts:25

Gets the ephemeral (non-persistent) state of the editor

Returns

object

Inherited from

View.getEphemeralState


getIcon()

Call Signature

getIcon(): string

Defined in: obsidian.d.ts:4533

Returns

string

Inherited from

View.getIcon

Call Signature

getIcon(): string

Defined in: src/obsidian/augmentations/Views/View.d.ts:29

Returns the icon name

Returns

string

Inherited from

View.getIcon


getSideTooltipPlacement()

getSideTooltipPlacement(): undefined | "left" | "right"

Defined in: src/obsidian/augmentations/Views/View.d.ts:33

Returns the placement of the tooltip

Returns

undefined | "left" | "right"

Inherited from

View.getSideTooltipPlacement


getState()

Call Signature

getState(): Record<string, unknown>

Defined in: obsidian.d.ts:4517

Returns

Record<string, unknown>

Inherited from

View.getState

Call Signature

getState(): object

Defined in: src/obsidian/augmentations/Views/View.d.ts:37

Returns the current state of the view

Returns

object

Inherited from

View.getState


getViewType()

getViewType(): "sync"

Defined in: src/obsidian/internals/InternalPlugins/Sync/SyncView.d.ts:6

Returns

"sync"

Overrides

View.getViewType


handleCopy()

handleCopy(event): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:41

Handle copy event on metadata editor and serialize properties

Parameters

event

ClipboardEvent

Returns

void

Inherited from

View.handleCopy


handleCut()

handleCut(event): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:45

Handle cut event on metadata editor and serialize and remove properties

Parameters

event

ClipboardEvent

Returns

void

Inherited from

View.handleCut


handlePaste()

handlePaste(event): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:49

Handle paste event of properties on metadata editor

Parameters

event

ClipboardEvent

Returns

void

Inherited from

View.handlePaste


load()

load(): void

Defined in: obsidian.d.ts:865

Load this component and its children

Returns

void

Inherited from

View.load


onClose()

onClose(): Promise<void>

Defined in: obsidian.d.ts:4509

Returns

Promise<void>

Inherited from

View.onClose


onHeaderMenu()

onHeaderMenu(e): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:51

Parameters

e

unknown

Returns

void

Inherited from

View.onHeaderMenu


onload()

onload(): void

Defined in: obsidian.d.ts:871

Override this to load your component

Returns

void

Inherited from

View.onload


onOpen()

onOpen(): Promise<void>

Defined in: obsidian.d.ts:4505

Returns

Promise<void>

Inherited from

View.onOpen


onPaneMenu()

onPaneMenu(menu, source): void

Defined in: obsidian.d.ts:4549

Populates the pane menu.

(Replaces the previously removed onHeaderMenu and onMoreOptionsMenu)

Parameters

Menu

source

string

Returns

void

Inherited from

View.onPaneMenu


onResize()

onResize(): void

Defined in: obsidian.d.ts:4538

Called when the size of this view is changed.

Returns

void

Inherited from

View.onResize


onTabMenu()

onTabMenu(menu): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:56

Adds the menu items to the menu

Parameters

Menu

the menu to fill

Returns

void

Inherited from

View.onTabMenu


onunload()

onunload(): void

Defined in: obsidian.d.ts:882

Override this to unload your component

Returns

void

Inherited from

View.onunload


open()

open(parentEl): Promise<void>

Defined in: src/obsidian/augmentations/Views/View.d.ts:61

Opens the view

Parameters

parentEl

Node

The node the view get attached to

Returns

Promise<void>

Inherited from

View.open


register()

register(cb): void

Defined in: obsidian.d.ts:897

Registers a callback to be called when unloading

Parameters

cb

() => any

Returns

void

Inherited from

View.register


registerDomEvent()

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:907

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof WindowEventMap

Parameters
el

Window

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

View.registerDomEvent

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:912

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof DocumentEventMap

Parameters
el

Document

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

View.registerDomEvent

Call Signature

registerDomEvent<K>(el, type, callback, options?): void

Defined in: obsidian.d.ts:917

Registers an DOM event to be detached when unloading

Type Parameters

K extends keyof HTMLElementEventMap

Parameters
el

HTMLElement

type

K

callback

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Inherited from

View.registerDomEvent


registerEvent()

registerEvent(eventRef): void

Defined in: obsidian.d.ts:902

Registers an event to be detached when unloading

Parameters

eventRef

EventRef

Returns

void

Inherited from

View.registerEvent


registerInterval()

registerInterval(id): number

Defined in: obsidian.d.ts:924

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

id

number

Returns

number

Inherited from

View.registerInterval


registerScopeEvent()

registerScopeEvent(keymapEventHandler): void

Defined in: src/obsidian/augmentations/Components/Component.d.ts:19

Parameters

keymapEventHandler

KeymapEventHandler

Returns

void

Inherited from

View.registerScopeEvent


removeChild()

removeChild<T>(component): T

Defined in: obsidian.d.ts:892

Removes a child component, unloading it

Type Parameters

T extends Component

Parameters

component

T

Returns

T

Inherited from

View.removeChild


setEphemeralState()

Call Signature

setEphemeralState(state): void

Defined in: obsidian.d.ts:4529

Parameters
state

unknown

Returns

void

Inherited from

View.setEphemeralState

Call Signature

setEphemeralState(state): void

Defined in: src/obsidian/augmentations/Views/View.d.ts:65

Set the ephemeral (non-persistent) state of the editor

Parameters
state

any

Returns

void

Inherited from

View.setEphemeralState


setState()

Call Signature

setState(state, result): Promise<void>

Defined in: obsidian.d.ts:4521

Parameters
state

unknown

result

ViewStateResult

Returns

Promise<void>

Inherited from

View.setState

Call Signature

setState(state, result): Promise<void>

Defined in: src/obsidian/augmentations/Views/View.d.ts:73

Parameters
state

any

result

ViewStateResult

Returns

Promise<void>

Inherited from

View.setState


unload()

unload(): void

Defined in: obsidian.d.ts:876

Unload this component and its children

Returns

void

Inherited from

View.unload