Obsidian_API
2021-11-27 03:09:11 0 举报
AI智能生成
可以搭配 Templater 插件使用,在Templater中可调用API
作者其他创作
大纲/内容
leftSplit
rightSplit
leftRibbon
rightRibbon
rootSplit
activeLeaf
containerEl
layoutReady
requestSaveLayout: () => void;
requestSaveHistory: () => void;
onLayoutReady(callback: () => any): void;
Promise<void>;
changeLayout(workspace: any)
any;
getLayout()
createLeafInParent(font color=\"#f57c00\
void
splitLeaf(font color=\"#f57c00\
createLeafBySplit(leaf: font color=\"#f5f5f5\
splitActiveLeaf(direction?: SplitDirection)
Promise<void>;
getUnpinnedLeaf(type?: string)
getLeaf(newLeaf?: boolean)
openLinkText(font color=\"#f57c00\
setActiveLeaf(font color=\"#f57c00\
getLeafById(id: string)
getGroupLeaves(group: string)
getMostRecentLeaf()
getLeftLeaf(split: boolean)
getRightLeaf(split: boolean)
getActiveViewOfType<T extends View>(type: Constructor<T>)
getActiveFile()
iterateRootLeaves(callback: (leaf: WorkspaceLeaf) => any)
iterateAllLeaves(callback: (leaf: WorkspaceLeaf) => any)
getLeavesOfType(viewType: string)
detachLeavesOfType(viewType: string)
revealLeaf(leaf: WorkspaceLeaf)
getLastOpenFiles()
iterateCodeMirrors(callback: (cm: CodeMirror.Editor) => any)
on
workspace
adapter
configDir
根目录名称
getName()
getAbstractFileByPath(path: string)
getRoot()
Promise<TFile>
create(font color=\"#f57c00\
createBinary(font color=\"#f57c00\
createFolder(path: string)
Promise<string>
read(file: TFile)
cachedRead(file: TFile):
Promise<ArrayBuffer>
readBinary(file: TFile)
getResourcePath(file: TFile)
Promise<void>
delete(font color=\"#f57c00\
trash(font color=\"#f57c00\
rename(font color=\"#f57c00\
modify(font color=\"#f57c00\
modifyBinary(font color=\"#f57c00\
append(font color=\"#f57c00\
Promise<TFile>
copy(font color=\"#f57c00\
getAllLoadedFiles()
static recurseChildren(font color=\"#f57c00\
getMarkdownFiles()
getFiles()
on
vault
getFirstLinkpathDest(font color=\"#f57c00\
getFileCache(file: TFile)
getCache(path: string)
fileToLinktext(font color=\"#f57c00\
resolvedLinks
unresolvedLinks
metadataCache
getNewFileParent(sourcePath: string)
renameFile(font color=\"#f57c00\
generateMarkdownLink(font color=\"#f57c00\
fileManager
path
name
parent
TAbstractFile
links?: LinkCache[];
embeds?: EmbedCache[];
tags?: TagCache[];
headings?: HeadingCache[];
sections?: SectionCache[];
listItems?: ListItemCache[];
frontmatter?: FrontMatterCache;
CachedMetadata
getBasePath()
mkdir(normalizedPath: string)
Promise<boolean>
trashSystem(normalizedPath: string)
trashLocal(normalizedPath: string)
rmdir(font color=\"#f57c00\
read(normalizedPath: string)
readBinary(normalizedPath: string)
write(font color=\"#f57c00\
writeBinary(font color=\"#f57c00\
getResourcePath(normalizedPath: string)
remove(normalizedPath: string)
exists(font color=\"#f57c00\
Promise<Stat | null>
stat(normalizedPath: string)
Promise<ListedFiles>
list(normalizedPath: string)
getFullPath(normalizedPath: string)
static readLocalFile(path: string)
static mkdir(path: string)
DataAdapter
files: string[];
folders: string[];
ListedFiles
type: 'file' | 'folder';
ctime: number;
mtime: number;
size: number;
Stat
显示此文本区
show(): void;
隐藏此文本区
hide(): void;
toggle(show: boolean)
toggleVisibility(visible: boolean)
HTMLElement
app
icon
navigation
leaf
constructor(leaf: WorkspaceLeaf)
protected onOpen()
protected onClose()
abstract getViewType()
any
getState()
setState(font color=\"#f57c00\
getEphemeralState()
setEphemeralState(state: any)
getIcon()
onResize()
abstract getDisplayText()
onHeaderMenu(menu: Menu)
view
openFile (font color=\"#f57c00\
open (view: View)
getViewState()
setViewState (font color=\"#f57c00\
togglePinned()
setPinned(pinned: boolean)
setGroupMember(other: WorkspaceLeaf)
setGroup(group: string)
detach()
getDisplayText()
WorkspaceLeaf
stat
basename
文件后缀
extension
TFile
ctime
mtime
size
FileStats
切换左边工作区展开状态
toggle()
关闭左边工作区
collapse()
展开左边工作区
expand()
collapsed
WorkspaceSidedock
WorkspaceRibbon
WorkspaceSplit
type: string;
state?: any;
active?: boolean;
pinned?: boolean;
group?: WorkspaceLeaf;
ViewState
children
isRoot
TFolder
type UserEvent = MouseEvent | KeyboardEvent | TouchEvent | PointerEvent
lastEvent
收藏
0 条评论
回复 删除
下一页