forked from mii-key/obsidian-links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIVault.ts
20 lines (19 loc) · 977 Bytes
/
IVault.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { INoteView } from "INoteView";
import { DataWriteOptions, TAbstractFile, TFile, TFolder } from "obsidian";
import { LinkData } from "utils";
export interface IVault {
exists(path: string, caseSensitive?: boolean): Promise<boolean>;
createNote(path: string, content: string): Promise<TFile>;
getActiveNoteView(): INoteView | null;
createFolder(path: string): Promise<TFolder>;
rename(normalizedPath: string, normalizedNewPath: string): Promise<void>;
getBacklinksForFileByPath(file: string | TFile): Record<string, LinkData[]> | null;
read(file: TFile): Promise<string>;
modify(file: TFile, data: string, options?: DataWriteOptions): Promise<void>;
getFilesInFolder(folder: TFolder): TFile[];
getRoot(): TFolder;
getName(): string;
delete(file: TAbstractFile, force?: boolean): Promise<void>;
trash(file: TAbstractFile, system: boolean): Promise<void>;
getAbstractFileByPath(path: string): TAbstractFile | null;
}