Skip to content

ImageView

Unofficial

View for displaying image files.

Import:

import type { ImageView } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ImageView extends EditableFileView

Extends: EditableFileView

Constructor

new ImageView(leaf: WorkspaceLeaf)

Constructor.

To extract the constructor type, use ExtractConstructor<EditableFileView>.

Properties

PropertyTypeDescription
allowNoFilebooleanWhether the view may be run without an attached file..
(Inherited from EditableFileView)
filenull | TFileThe file that is currently being viewed.
(Inherited from EditableFileView)
fileBeingRenamednull | TFileThe file that is currently being renamed.
(Inherited from EditableFileView)
navigationbooleanWhether the file view can be navigated.
(Inherited from EditableFileView)

Methods

MethodReturnsDescription
canAcceptExtension(extension)booleanWhether the file view can accept an extension.
(Inherited from EditableFileView)
getDisplayText()stringGet the display text for the file view.
(Inherited from EditableFileView)
getState()Record<string, unknown>Get the state of the file view.
(Inherited from EditableFileView)
getSyncViewState()unknownGet view state for sync plugin.
(Inherited from EditableFileView)
getViewType()typeof ViewType.ImageGet the current view type.
loadFile(file)Promise<unknown>Loads the file with the onLoadFile function.
(Inherited from EditableFileView)
onDelete(file)Promise<void>Updates the view if it contains the deleted file.
(Inherited from EditableFileView)
onload()voidCalled when the file view is loaded.
(Inherited from EditableFileView)
onLoadFile(file)Promise<void>Called when the file is loaded.
(Inherited from EditableFileView)
onRename(file)Promise<void>Called when the file is renamed.
(Inherited from EditableFileView)
onTitleBlur()Promise<void>Is called when the titleEl looses focus.

Event type: 'blur'.
(Inherited from EditableFileView)
onTitleChange(titleEl)voidIs called when the titleEl is changed.

Event type: 'input'.
(Inherited from EditableFileView)
onTitleFocus()voidIs called when the titleEl gains focus.

Event type: 'focus'.
(Inherited from EditableFileView)
onTitleKeydown(event)voidIs called when the titleEl is focused and a keydown is triggered.

Event type: 'keydown'.
(Inherited from EditableFileView)
onTitlePaste(titleEl, event)voidIs called when the titleEl is focused and a paste event is triggered.

Event type: 'paste'.
(Inherited from EditableFileView)
onUnloadFile(file)Promise<void>Called when the file is unloaded.
(Inherited from EditableFileView)
receiveSyncState(view)voidReceives sync state from another file view, opening the other view's file if it differs.
(Inherited from EditableFileView)
renderBreadcrumbs()voidRender the breadcrumb navigation for this file view.
(Inherited from EditableFileView)
saveTitle(titleEl)Promise<void>Updates the file to match the updated title.
(Inherited from EditableFileView)
setState(state, result)Promise<void>Set the state of the file view.
(Inherited from EditableFileView)
syncState(e)Promise<unknown>Synchronize the view state with the sync plugin.
(Inherited from EditableFileView)

Links to this page: