obsidian APIs
- Plugin
- PluginSettingTab
- Setting
- App
- TFile
- Notice
- MarkdownView
- Modal
- Editor
- Vault
- addIcon
- WorkspaceLeaf
- TFolder
- TAbstractFile
- MarkdownPostProcessorContext
- Platform
- Menu
- normalizePath
- FuzzySuggestModal
- ButtonComponent
- FuzzyMatch
- MarkdownRenderer
- debounce
- TextComponent
- EditorPosition
- ItemView
- moment
- request
- DropdownComponent
- TextAreaComponent
- FileSystemAdapter
- CachedMetadata
- Scope
- MetadataCache
- ToggleComponent
- MarkdownRenderChild
- SuggestModal
- setIcon
- HeadingCache
- getAllTags
- EditorSuggest
- EditorSuggestContext
- EditorSuggestTriggerInfo
- FrontMatterCache
- FileView
- Component
- parseYaml
- Workspace
- LinkCache
- editorViewField
- EventRef
- View
- PluginManifest
- Pos
- Debouncer
- requestUrl
- ExtraButtonComponent
- MarkdownPostProcessor
- DataAdapter
- ListedFiles
- parseLinktext
- MenuItem
- ISuggestOwner
- OpenViewState
- FileManager
- ObsidianProtocolData
- Events
- SearchComponent
- ViewState
- renderResults
- Command
- Keymap
- Loc
- TagCache
- SearchMatches
- EmbedCache
- parseFrontMatterTags
- AbstractTextComponent
- Point
- MarkdownPreviewRenderer
- getLinkpath
- requireApiVersion
- resolveSubpath
- EditorRangeOrCaret
- EditorTransaction
- FolderItem
- ClipboardManager
- DragManager
- FileExplorerView
- AFItem
- Modifier
- EditorRange
- FileStats
- finishRenderMath
- loadMathJax
- renderMath
- fuzzySearch
- InstalledPlugin
- InternalPlugins
- prepareQuery
- CommandPalettePluginInstance
- PreparedQuery
- WorkspaceItem
- WorkspaceSplit
- ViewRegistry
- SearchResult
- StarredPluginInstance
- FileStarredItem
- StarredPluginItem
- ReferenceCache
- WorkspacesPluginInstance
- sortSearchResults
- SearchStarredItem
- Plugin_2
- QuickSwitcherOptions
- QuickSwitcherPluginInstance
- Chooser
- Hotkey
- KeymapContext
- KeymapEventListener
- RequestUrlResponse
- MarkdownPreviewView
- PopoverSuggest
- BlockCache
- stringifyYaml
- UserEvent
- renderMatches
- SearchMatchPart
- TextFileView
- ViewStateResult
- htmlToMarkdown
- MomentFormatComponent
- RequestUrlParam
- EditorSelection
- EditorSelectionOrCaret
- editorLivePreviewField
Other Related APIs
- obsidian#WorkspaceLeaf
- obsidian#debounce
- obsidian#Keymap
- obsidian#Debouncer
- obsidian#setIcon
- obsidian#TextFileView
- @codemirror/state#EditorState
- @codemirror/state#Transaction
- @codemirror/state#Extension
- @codemirror/state#Annotation
- @codemirror/view#EditorView
- @codemirror/view#keymap
- @codemirror/view#highlightActiveLine
- @codemirror/view#drawSelection
obsidian#ViewStateResult TypeScript Examples
The following examples show how to use
obsidian#ViewStateResult.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PumlView.ts From obsidian-plantuml with MIT License | 6 votes |
setState(state: any, result: ViewStateResult): Promise<void> {
// switch to preview mode
if (state.mode === 'preview') {
this.currentView = 'preview';
setIcon(this.changeModeButton, 'pencil');
this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');
this.previewEl.style.setProperty('display', 'block');
this.sourceEl.style.setProperty('display', 'none');
this.renderPreview();
}
// switch to source mode
else {
this.currentView = 'source';
setIcon(this.changeModeButton, 'lines-of-text');
this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');
this.previewEl.style.setProperty('display', 'none');
this.sourceEl.style.setProperty('display', 'block');
//this.editor.refresh();
}
return super.setState(state, result);
}