App
Official
The main app object.
Import:
import { App } from 'obsidian';Signature:
export class AppConstructor
new App(adapter: DataAdapter, appId: string)Constructor.
To get the constructor instance, use getAppConstructor from obsidian-typings/implementations.
Properties
| Property | Type | Description | |
|---|---|---|---|
| appId | string | ID that uniquely identifies the vault. | |
| appMenuBarManager | AppMenuBarManager | Manager for the application menu bar (desktop only). | |
| cli | Cli | CLI handler for the app. | |
| commands | Commands | Contains all registered commands. | |
| customCss | CustomCSS | Custom CSS (snippets/themes) applied to the application. | |
| dom | ObsidianDOM | References to important DOM elements of the application. | |
| dragManager | DragManager | Manager for drag-and-drop operations within the app. | |
| embedRegistry | EmbedRegistry | Registry that manages the creation of generic media type embeds. | |
| fileManager | FileManager | The file manager object. | |
| foldManager | FoldManager | Manager for editor fold (collapse) state persistence. | |
| hotkeyManager | HotkeyManager | Manages global hotkeys. | |
| internalPlugins | InternalPlugins | Manager of internal 'core' plugins. | |
| isMobile | boolean | Whether the application is currently running on mobile. | |
| keymap | Keymap | The keymap object. | |
| lastEvent | null | UserEvent | The last known user interaction event, to help commands find out what modifier keys are pressed. | |
| metadataCache | MetadataCache | Manages the gathering and updating of metadata for all files in the vault. | |
| metadataTypeManager | MetadataTypeManager | Manages the frontmatter properties of the vault and the rendering of the properties. | |
| mobileNavbar | MobileNavbar | null | Navigation bar for mobile devices, or null on desktop. | |
| mobileQuickActions | unknown | Quick actions for mobile, null on desktop. | |
| mobileTabSwitcher | MobileTabSwitcher | null | Tab switcher for mobile devices, or null on desktop. | |
| mobileToolbar | MobileToolbar | null | Toolbar for mobile devices, or null on desktop. | |
| nextFrameEvents | (() => void)[] | Events to execute on the next frame | |
| nextFrameTimer | null | number | Timer for the next frame | |
| plugins | Plugins | Manages loading and enabling of community (non-core) plugins. | |
| renderContext | RenderContext | The render context. | |
| scope | Scope | The scope object. | |
| secretStorage | SecretStorage | The secret storage. | |
| setting | AppSetting | Manages the settings modal and its tabs. | |
| shareReceiver | ShareReceiver | Handler for receiving shared content from external apps (mobile). | |
| statusBar | StatusBar | Status bar of the application | |
| title | string | Name of the vault with version suffix. | |
| vault | Vault | The vault object. Manages all file operations for the vault, contains hooks for file changes, and an adapter for low-level file system operations. | |
| viewRegistry | ViewRegistry | Manages the construction of appropriate views when opening a file of a certain type. | |
| workspace | Workspace | The workspace object. Manages the workspace layout, construction, rendering and manipulation of leaves. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| changeTheme(theme) | void | Sets the accent color of the application (light/dark mode). | |
| copyObsidianUrl(file) | void | Copies Obsidian URI of given file to clipboard. | |
| debugMode(isEnabled) | void | Toggles debug mode. | |
| disableCssTransition() | void | Disables all CSS transitions in the vault (until manually re-enabled). | |
| emulateMobile(emulate) | void | Restarts Obsidian and renders workspace in mobile mode. | |
| enableCssTransition() | void | Enables all CSS transitions in the vault. | |
| fixFileLinks(element, sourcePath) | void | Manually fix all file links pointing towards image/audio/video resources in element. | |
| garbleText() | void | Applies an obfuscation font to all text characters in the vault. | |
| getAccentColor() | string | Get the accent color of the application. | |
| getAppTitle(title?) | string | Get the current title of the application. | |
| getObsidianUrl(file) | string | Get the URI for opening specified file in Obsidian. | |
| getSpellcheckLanguages() | string[] | Get currently active spellcheck languages. | |
| getTheme() | 'moonstone' | 'obsidian' | Get the current color scheme of the application. | |
| getWebviewPartition() | string | Get webview partition identifier. | |
| importAttachments(attachmentsToImport, folder) | Promise<void> | Import attachments into specified folder. | |
| initializeWithAdapter(adapter) | Promise<void> | Initialize the entire application using the provided FS adapter | |
| isDarkMode() | boolean | Check if the application is in dark mode. | |
| isVimEnabled() | boolean | Check whether Vim keybindings are enabled. | |
| loadLocalStorage(key) | any | null | Retrieve value from localStorage for this vault. | |
| nextFrame(callback) | void | Add callback to execute on next frame | |
| nextFrameOnceCallback(callback) | void | Add callback to execute on next frame, and remove after execution | |
| on() | void | Register an event listener on the app. | |
| onConfigChanged(configKey) | void | Called when app config changes. | |
| onNextFrame(callback) | void | Execute all logged callback (called when next frame is loaded) | |
| openHelp() | void | Open the help vault (or site if mobile). | |
| openVaultChooser(closeWindow?) | void | Open the vault picker. | |
| openWithDefaultApp(path) | void | Open the file with OS defined default file browser application. | |
| registerCommands() | void | Register all basic application commands | |
| registerQuitHook() | void | Register a hook for saving workspace data before unload | |
| runOpeningBehavior(behavior) | void | Run the vault opening behavior. | |
| saveAttachment(name, extension, data) | Promise<TFile> | Save attachment at default attachments location | |
| saveLocalStorage(key, data) | void | Save vault-specific value to localStorage. If data is null, the entry will be cleared. | |
| setAccentColor(color) | void | Set the accent color of the application. | |
| setSpellcheckLanguages(languages) | void | Set the spellcheck languages. | |
| setTheme(theme) | void | Set the current color scheme of the application and reload the CSS. | |
| showInFolder(path) | void | Open the OS file picker at path location. | |
| showReleaseNotes(version?) | void | Show the release notes for provided version as a new leaf. | |
| updateAccentColor() | void | Updates the accent color and reloads the CSS. | |
| updateAutoFullScreenDisplay() | void | Update auto full screen display. | |
| updateFloatingNavigationDisplay() | void | Update floating navigation display. | |
| updateFontFamily() | void | Update the font family of the application and reloads the CSS. | |
| updateFontSize() | void | Update the font size of the application and reloads the CSS. | |
| updateInlineTitleDisplay() | void | Update the inline title rendering in notes. | |
| updateMobileFrameTheme(isDark) | void | Update mobile frame theme. | |
| updateRibbonDisplay() | void | Update the ribbon display. | |
| updateTabSize() | void | Update tab size setting. | |
| updateTheme() | void | Update the color scheme of the application and reloads the CSS. | |
| updateUseNativeMenu() | void | Update native menu usage. | |
| updateViewHeaderDisplay() | void | Update the view header display in notes. | |
| static getOverrideConfigDir(appId) | string | null | Get the override config directory for the given app ID. |
Links to this page:
- AbsFunction
- AbstractInputSuggest
- AbstractSearchComponent
- AllPropertiesView
- app
- AppMenuBarManager
- AppSetting
- AudioRecorderPlugin
- AudioRecorderPluginInstance
- BacklinkComponent
- BacklinkPlugin
- BacklinkPluginInstance
- BasesController
- BasesFunction
- BasesPlugin
- BasesPluginInstance
- BasesQueryQueue
- BasesSearchMenu
- BasesView
- BlockCache
- BookmarksPlugin
- BookmarksPluginInstance
- BookmarksView
- CanvasDataManager
- CanvasIndex
- CanvasLinkUpdater
- CanvasPlugin
- CanvasPluginInstance
- CanvasViewCanvas
- CanvasViewCanvasNode
- CeilFunction
- Cli
- ClipboardManager
- CommandPalettePlugin
- CommandPalettePluginInstance
- Commands
- ConcatFunction
- ConfirmationModal
- ContainsAllFunction
- ContainsAnyFunction
- ContainsFunction
- ContainsNoneFunction
- createTFileInstance
- createTFolderInstance
- CustomCSS
- DailyNotesPlugin
- DailyNotesPluginInstance
- DateAfterFunction
- DateBeforeFunction
- DateDiffFunction
- DateEqualsFunction
- DateModifyFunction
- DateNotEqualsFunction
- DateOnOrAfterFunction
- DateOnOrBeforeFunction
- DayFunction
- DeferredView
- DomEventsHandlersInfo
- DragManager
- EditorSearchComponent
- EditorStatusPlugin
- EditorStatusPluginInstance
- EditorSuggest
- EmbedContext
- EmbeddedEditorView
- EmptyFunction
- EmptyView
- EqualFunction
- FileExplorerPlugin
- FileExplorerPluginInstance
- FileExplorerView
- FileManager
- FileRecoveryPlugin
- FileRecoveryPluginInstance
- FileSuggest
- FileSuggestManager
- FileValue
- FlatFunction
- FloorFunction
- FoldManager
- FootnotesPlugin
- getAllPropertiesViewConstructor
- getAppConstructor
- getAppMenuBarManagerConstructor
- getAppSettingConstructor
- getAudioViewConstructor
- getBacklinkViewConstructor
- getBasesContextConstructor
- getBasesQueryResultConstructor
- getBasesViewConstructor
- getBookmarksViewConstructor
- getCanvasViewConstructor
- getCliConstructor
- getCommandsConstructor
- getCustomCSSConstructor
- getDataAdapterEx
- getDragManagerConstructor
- getEditorSuggestsConstructor
- getEmbedRegistryConstructor
- getEmptyViewConstructor
- getFileExplorerViewConstructor
- getFileManagerConstructor
- getFilePropertiesViewConstructor
- getFileValueConstructor
- getFoldManagerConstructor
- getFuzzySuggestModalConstructor
- getGraphViewConstructor
- getHotkeyManagerConstructor
- getImageViewConstructor
- getInternalPluginConstructor
- getInternalPluginsConstructor
- getLinkValueConstructor
- getLocalGraphViewConstructor
- getMarkdownRendererConstructor
- getMetadataCacheConstructor
- getMetadataTypeManagerConstructor
- getModalConstructor
- getObsidianDOMConstructor
- getOutgoingLinkViewConstructor
- getOutlineViewConstructor
- getPdfViewConstructor
- getPluginsConstructor
- getQueryControllerConstructor
- getRecentFileTrackerConstructor
- getReleaseNotesViewConstructor
- getRenderContextConstructor
- getSearchViewConstructor
- getSecretComponentConstructor
- getSecretStorageConstructor
- getSettingTabConstructor
- getShareReceiverConstructor
- getStatusBarConstructor
- getSyncViewConstructor
- getTableViewConstructor
- getTagViewConstructor
- getVideoViewConstructor
- getViewConstructorByViewType
- getViewRegistryConstructor
- getWebviewerHistoryViewConstructor
- getWebviewerViewConstructor
- getWorkspaceConstructor
- getWorkspaceLeafConstructor
- getWorkspaceLeafHistoryConstructor
- GlobalSearchPlugin
- GlobalSearchPluginInstance
- GraphEngine
- GraphPlugin
- GraphPluginInstance
- GraphView
- GreaterFunction
- GreaterOrEqualFunction
- HeaderDom
- HotkeyManager
- HotkeysSettingTab
- HourFunction
- IfFunction
- IndexFunction
- InFolderFunction
- InternalPlugin
- InternalPlugins
- ItemView
- JoinFunction
- LenFunction
- LessFunction
- LessOrEqualFunction
- LinksToFunction
- LinkValue
- MarkdownBaseView
- MarkdownEditView
- MarkdownFileInfo
- MarkdownImporterPlugin
- MarkdownImporterPluginInstance
- MarkdownPreviewView
- MarkdownRenderer
- MarkdownScrollableEditView
- MarkdownView
- MetadataCache
- MetadataEditor
- MetadataEditorProperty
- MetadataTypeManager
- MinFunction
- MinuteFunction
- MobileTabSwitcher
- Modal
- MonthFunction
- NotContainsFunction
- NoteComposerPlugin
- NoteComposerPluginInstance
- NotEmptyFunction
- NotEqualFunction
- NotFunction
- NowFunction
- OutgoingLinkPlugin
- OutgoingLinkPluginInstance
- OutlinePlugin
- OutlinePluginInstance
- PagePreviewPlugin
- PagePreviewPluginInstance
- Plugin
- Plugins
- PluginSettingTab
- PopoverSuggest
- PropertiesPlugin
- PropertiesPluginInstance
- PropertyPropertyWidgetComponentComboBox
- PropertyRenderContext
- PublishPlugin
- PublishPluginInstance
- QueryController
- RandomNotePlugin
- RandomNotePluginInstance
- ReleaseNotesView
- RenderContext
- ResultDom
- ResultDomItem
- RoundFunction
- SearchView
- SecondFunction
- SecretStorage
- SettingTab
- ShareReceiver
- SlashCommandPlugin
- SliceFunction
- SlidesPlugin
- SlidesPluginInstance
- StatusBar
- SuggestModal
- SwitcherPlugin
- SwitcherPluginInstance
- SyncPlugin
- SyncPluginInstance
- SyncView
- TableCellEditor
- TableView
- TaggedWithFunction
- TagPanePlugin
- TagPanePluginInstance
- TagView
- TemplatesPlugin
- TemplatesPluginInstance
- TitleFunction
- Tree
- TrimFunction
- TypedWorkspaceLeaf
- UniqueFunction
- UnknownView
- View
- WebviewerDBStore
- WebviewerHistoryView
- WebviewerPlugin
- WebviewerView
- WidgetEditorView
- Window
- WordCountPlugin
- WordCountPluginInstance
- Workspace
- WorkspaceItem
- WorkspaceLeaf
- WorkspaceParent
- WorkspaceSplit
- WorkspacesPlugin
- WorkspacesPluginInstance
- WorkspaceTabs
- YearFunction
- ZkPrefixerPlugin
- ZkPrefixerPluginInstance