-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathobsidian.d.ts
92 lines (91 loc) · 2.66 KB
/
obsidian.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import NavboxManager from "./src/manager";
declare module "obsidian" {
interface MarkdownView {
navboxManager: NavboxManager;
}
interface WorkspaceLeaf {
openLinkText(
linktext: string,
sourcePath: string,
openViewState?: OpenViewState
): Promise<void>;
parent: WorkspaceParent;
pinned: boolean;
}
interface Workspace {
handleLinkContextMenu: (
menu: Menu,
path: string,
currentPath: string,
unknown = undefined
) => void;
editorSuggest: {
currentSuggest: EditorSuggest<any> | null;
suggests: EditorSuggest<any>[];
removeSuggest(suggest: EditorSuggest<any>): void;
};
createLeafInTabGroup(root: WorkspaceParent): WorkspaceLeaf;
getRecentFiles(): string[];
}
interface App {
hotkeyManager: {
printHotkeyForCommand(command_id: string): string;
getHotkeys(command_id: string);
getDefaultHotkeys(command_id: string);
};
dom: any;
plugins: {
plugins: Plugin[];
};
commands: {
registerCommand(command: string, callback: () => void): void;
executeCommand(command: Command);
listCommands(): Command[];
};
setting: {
open(): void;
openTabById(id: string): { setQuery(query: string): void };
};
}
interface DataAdapter {
getBasePath: () => string;
}
interface Menu {
addSections: (sections: string[]) => this;
setParentElement: (element: HTMLElement) => this;
}
interface MetadataCache {
getTags(): { [k: `#${string}`]: number };
userIgnoreFilterCache: { [k: string]: boolean };
}
interface WorkspaceParent {
id: string;
}
interface Scope {
keys: any[];
}
interface SuggestModal<T> {
chooser: {
values: T[];
suggestions: HTMLElement;
selectedItem: number;
addMessage(emptyStateText: string): unknown;
setSuggestions(arg0: T[]): void;
setSelectedItem(index: number, e: KeyboardEvent): void;
};
}
interface EditorSuggest<T> {
suggestions: {
chooser: this;
containerEl: HTMLDivElement;
selectedItem: number;
suggestions: Array<HTMLDivElement>;
values: T[];
useSelectedItem(e: KeyboardEvent): boolean;
};
}
interface Valut {
getConfig(key: string): any;
setConfig(key: string, value: any): void;
}
}