obsidian-typings 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3899 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import { Extension } from '@codemirror/state';
4
+ import { EditorView, ViewUpdate } from '@codemirror/view';
5
+ import { App, CachedMetadata, CloseableComponent, Command, Component, DataAdapter, Debouncer, Editor, EditorPosition, EditorRange, EditorSuggest, EmbedCache, Events, FileStats, FileView, FrontmatterLinkCache, HoverLinkSource, HoverPopover, IconName, ItemView, KeymapInfo, LinkCache, Loc, MarkdownFileInfo, MarkdownView, Menu, Modal, PaneType, Plugin as Plugin$1, PluginManifest, PluginSettingTab, Reference, ReferenceCache, Scope, SearchComponent, SearchResult, SettingTab, SplitDirection, TAbstractFile, TFile, TFolder, TextFileView, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceLeaf, WorkspaceTabs } from 'obsidian';
6
+
7
+ export declare function parentFolderPath(path: string): string;
8
+ export type StyleModule = {};
9
+ export type StyleSpec = {};
10
+ /**
11
+ * Creates and properly initializes the instance of TFolder even the underlying folder does not exist.
12
+ * This doesn't create the missing folder on the file system.
13
+ */
14
+ export declare function createTFolderInstance(vault: Vault, path: string): TFolder;
15
+ /** @todo Documentation incomplete */
16
+ /** @public */
17
+ export interface CustomArrayDict<T> {
18
+ data: Map<string, T[]>;
19
+ add(key: string, value: T): void;
20
+ clear(key: string): void;
21
+ clearAll(): void;
22
+ contains(key: string, value: T): boolean;
23
+ count(): number;
24
+ get(key: string): T[] | null;
25
+ keys(): string[];
26
+ remove(key: string, value: T): void;
27
+ }
28
+ export declare class CustomArrayDictImpl<T> implements CustomArrayDict<T> {
29
+ data: Map<string, T[]>;
30
+ add(key: string, value: T): void;
31
+ remove(key: string, value: T): void;
32
+ get(key: string): T[] | null;
33
+ keys(): string[];
34
+ clear(key: string): void;
35
+ clearAll(): void;
36
+ contains(key: string, value: T): boolean;
37
+ count(): number;
38
+ }
39
+ export declare const InternalPluginName: {
40
+ readonly AudioRecorder: "audio-recorder";
41
+ readonly Backlink: "backlink";
42
+ readonly Bookmarks: "bookmarks";
43
+ readonly Canvas: "canvas";
44
+ readonly CommandPalette: "command-palette";
45
+ readonly DailyNotes: "daily-notes";
46
+ readonly EditorStatus: "editor-status";
47
+ readonly FileExplorer: "file-explorer";
48
+ readonly FileRecovery: "file-recovery";
49
+ readonly GlobalSearch: "global-search";
50
+ readonly Graph: "graph";
51
+ readonly MarkdownImporter: "markdown-importer";
52
+ readonly NoteComposer: "note-composer";
53
+ readonly OutgoingLink: "outgoing-link";
54
+ readonly Outline: "outline";
55
+ readonly PagePreview: "page-preview";
56
+ readonly Properties: "properties";
57
+ readonly Publish: "publish";
58
+ readonly RandomNote: "random-note";
59
+ readonly SlashCommand: "slash-command";
60
+ readonly Slides: "slides";
61
+ readonly Switcher: "switcher";
62
+ readonly Sync: "sync";
63
+ readonly TagPane: "tag-pane";
64
+ readonly Templates: "templates";
65
+ readonly WordCount: "word-count";
66
+ readonly Workspaces: "workspaces";
67
+ readonly ZkPrefixer: "zk-prefixer";
68
+ };
69
+ /**
70
+ * Creates and properly initializes the instance of TFile even the underlying file does not exist.
71
+ * This doesn't create the missing file on the file system.
72
+ */
73
+ export declare function createTFileInstance(vault: Vault, path: string): TFile;
74
+ export declare function isEmbedCache(reference: Reference): reference is EmbedCache;
75
+ export declare function isFrontmatterLinkCache(reference: Reference): reference is FrontmatterLinkCache;
76
+ export declare function isReferenceCache(reference: Reference): reference is ReferenceCache;
77
+ export declare function isLinkCache(reference: Reference): reference is LinkCache;
78
+ /**
79
+ * Constructs a new TFolder instance.
80
+ *
81
+ * @param vault - The vault to which the folder belongs.
82
+ * @param path - The path of the folder.
83
+ * @returns The constructed TFolder instance.
84
+ */
85
+ export declare function constructTFolder(vault: Vault, path: string): TFolder;
86
+ /** @public */
87
+ export interface MobileFileInfo {
88
+ renderCallback(el: HTMLElement): void;
89
+ }
90
+ /** @public */
91
+ export interface RibbonItem {
92
+ hidden: boolean;
93
+ icon: IconName;
94
+ id: string;
95
+ title: string;
96
+ callback(): Promise<void>;
97
+ }
98
+ /** @todo Documentation incomplete */
99
+ /** @public */
100
+ export interface InternalPlugin<InternalPluginInstance> extends Component {
101
+ addedButtonEls: HTMLDivElement[];
102
+ app: App;
103
+ commands: Command[];
104
+ enabled: boolean;
105
+ hasStatusBarItem: boolean;
106
+ instance: InternalPluginInstance;
107
+ lastSave: number;
108
+ manager: InternalPlugins;
109
+ mobileFileInfo: MobileFileInfo[];
110
+ onConfigFileChange: Debouncer<[
111
+ ], Promise<void>>;
112
+ ribbonItems: RibbonItem[];
113
+ statusBarEl: HTMLDivElement | null;
114
+ views: Record<string, ViewCreator>;
115
+ addSettingTab(settingTab: PluginSettingTab): void;
116
+ deleteData(): Promise<void>;
117
+ disable(isDisabledByUser?: boolean): void;
118
+ enable(isEnabledByUser?: boolean): Promise<void>;
119
+ getModifiedTime(): Promise<number | undefined>;
120
+ handleConfigFileChange(): Promise<void>;
121
+ init(): void;
122
+ loadData(): Promise<object | null>;
123
+ registerGlobalCommand(command: Command): void;
124
+ registerMobileFileInfo(renderCallback: (el: HTMLElement) => void): void;
125
+ registerRibbonItem(title: string, icon: IconName, callback: () => Promise<void>): void;
126
+ registerStatusBarItem(): void;
127
+ registerViewType(type: string, creator: ViewCreator): void;
128
+ saveData(data: object): Promise<void>;
129
+ }
130
+ /** @public */
131
+ export interface InternalPluginInstance<InternalPlugin> {
132
+ description: string;
133
+ id: string;
134
+ name: string;
135
+ init(app: App, plugin: InternalPlugin): void;
136
+ }
137
+ /** @public */
138
+ export interface AudioRecorderPlugin extends InternalPlugin<AudioRecorderPluginInstance> {
139
+ }
140
+ /** @public */
141
+ export interface AudioRecorderPluginInstance extends InternalPluginInstance<AudioRecorderPlugin> {
142
+ app: App;
143
+ extension: string;
144
+ plugin: AudioRecorderPlugin;
145
+ recorder: MediaRecorder | null;
146
+ recording: boolean;
147
+ checkPermission(): Promise<boolean>;
148
+ onRecordAudio(): Promise<void>;
149
+ onStartRecording(): Promise<void>;
150
+ onStopRecording(): void;
151
+ saveRecording(audioBuffer: ArrayBuffer): Promise<void>;
152
+ showRecordingMessage(message: string, isError: boolean): void;
153
+ startRecording(stream: MediaStream): void;
154
+ }
155
+ /** @todo This is probably not the right term */
156
+ /** @public */
157
+ export interface InfoFileView extends FileView {
158
+ /**
159
+ * Called when a file is opened. Loads the file and requests a content update
160
+ * @param file - The opened file
161
+ */
162
+ onFileOpen(file: TFile): void;
163
+ }
164
+ /** @todo Documentation incomplete */
165
+ /** @public */
166
+ export interface BacklinkView extends InfoFileView {
167
+ /**
168
+ * Get the current view type
169
+ */
170
+ getViewType(): "backlink";
171
+ /**
172
+ * Shows the search
173
+ */
174
+ showSearch(): void;
175
+ /** @todo Documentation incomplete */
176
+ update(): void;
177
+ }
178
+ /** @public */
179
+ export interface BacklinkPlugin extends InternalPlugin<BacklinkPluginInstance> {
180
+ views: {
181
+ backlink(left: WorkspaceLeaf): BacklinkView;
182
+ };
183
+ }
184
+ /** @public */
185
+ export interface BacklinkPluginInstance extends InternalPluginInstance<BacklinkPlugin> {
186
+ app: App;
187
+ defaultOn: boolean;
188
+ file?: TFile | null;
189
+ options: {
190
+ backlinkInDocument?: boolean;
191
+ };
192
+ plugin: BacklinkPlugin;
193
+ initLeaf(): void;
194
+ onEnable(app: App, plugin: BacklinkPlugin): Promise<void>;
195
+ onExternalSettingsChange(): Promise<void>;
196
+ onFileMenu(menu: Menu, file: TAbstractFile, title: string, leaf?: WorkspaceLeaf): Menu;
197
+ onFileOpen(file: TAbstractFile): void;
198
+ onUserDisable(app: App): void;
199
+ onUserEnable(): void;
200
+ openBacklinksForActiveFile(skipSplit: boolean): boolean | undefined;
201
+ toggleBacklinksInDocument(skip: boolean): boolean | undefined;
202
+ updateBacklinks(): void;
203
+ }
204
+ /** @todo Documentation incomplete */
205
+ /** @public */
206
+ export interface GlobalSearchLeaf extends WorkspaceLeaf {
207
+ }
208
+ /** @public */
209
+ export interface BookmarkItem {
210
+ query: string;
211
+ subpath: string;
212
+ title: string;
213
+ type: "file" | "folder" | "search";
214
+ }
215
+ /** @todo Documentation incomplete */
216
+ /** @public */
217
+ export interface BookmarksView extends ItemView {
218
+ /** @todo Documentation incomplete */
219
+ _copyToClipboard(e: unknown, t: unknown): void;
220
+ /** @todo Documentation incomplete */
221
+ _getActiveBookmarks(): unknown[];
222
+ /**
223
+ * Attaches the handleDrag of DragManager
224
+ */
225
+ attachDragHandler(e: unknown): void;
226
+ /**
227
+ * Attaches the handleDrop of DragManager to containerEl
228
+ */
229
+ attachDropHandler(): void;
230
+ /** @todo Documentation incomplete */
231
+ createNewGroup(e: unknown): void;
232
+ /** @todo Documentation incomplete */
233
+ dragSelectedBookmarks(e: unknown, t: unknown): unknown | null;
234
+ /** @todo Documentation incomplete */
235
+ getItemDom(e: unknown): unknown;
236
+ /** @todo Documentation incomplete */
237
+ getNodeId(e: unknown): string;
238
+ /**
239
+ * Get the current view type
240
+ */
241
+ getViewType(): "bookmarks";
242
+ /** @todo Documentation incomplete */
243
+ handleCollapseAll(e: unknown): void;
244
+ /** @todo Documentation incomplete */
245
+ isItem(item: unknown): boolean;
246
+ /** @todo Documentation incomplete */
247
+ onContextMenu(event: unknown): void;
248
+ /**
249
+ * Called when delete is requested
250
+ * @param event - The event triggered this function
251
+ */
252
+ onDeleteSelectedItems(event: unknown): unknown;
253
+ /**
254
+ * Called when a file is created.
255
+ * @param file - The created file
256
+ */
257
+ onFileCreate(file: TFile): void;
258
+ /**
259
+ * Called when a file is deleted.
260
+ * @param file - The deleted file
261
+ */
262
+ onFileDelete(file: TFile): void;
263
+ /** @todo Documentation incomplete */
264
+ onFileOpen(file: TFile): void;
265
+ /**
266
+ * Called when the rename shortcut is pressed
267
+ * @param event - The event triggered this function
268
+ */
269
+ onRenameKey(event: KeyboardEvent): void;
270
+ /** @todo Documentation incomplete */
271
+ update(): void;
272
+ }
273
+ /** @public */
274
+ export interface BookmarksPlugin extends InternalPlugin<BookmarksPluginInstance> {
275
+ views: {
276
+ bookmarks(left: WorkspaceLeaf): BookmarksView;
277
+ };
278
+ }
279
+ /** @public */
280
+ export interface BookmarksPluginInstance extends InternalPluginInstance<BookmarksPlugin>, Events {
281
+ app: App;
282
+ bookmarkedViews: WeakMap<View, HTMLElement>;
283
+ bookmarkLookup: Record<string, BookmarkItem>;
284
+ defaultOn: boolean;
285
+ hasValidData: boolean;
286
+ items: BookmarkItem[];
287
+ onItemsChanged: Debouncer<[
288
+ boolean
289
+ ], void>;
290
+ plugin: BookmarksPlugin;
291
+ urlBookmarkLookup: Record<string, BookmarkItem>;
292
+ _onItemsChanged(arg1: boolean): void;
293
+ addItem(item: BookmarkItem, instance: BookmarksPluginInstance): void;
294
+ editItem(item: BookmarkItem): void;
295
+ findBookmarkByView(view: FileView): BookmarkItem | null | undefined;
296
+ getBookmarks(): BookmarkItem[];
297
+ getItemTitle(item: BookmarkItem): string;
298
+ initLeaf(): void;
299
+ loadData(): Promise<boolean>;
300
+ moveItem(item: BookmarkItem, instance: BookmarksPluginInstance, arg3: number): void;
301
+ onEditorMenu(menu: Menu, editor: Editor, info: MarkdownView | MarkdownFileInfo): void;
302
+ onEnable(app: App, plugin: BookmarksPlugin): Promise<void>;
303
+ onExternalSettingsChange(): Promise<void>;
304
+ onFileMenu(menu: Menu, files: TAbstractFile[], source: string, leaf?: WorkspaceLeaf): void;
305
+ onFileRename(file: TFile, oldPath: string): void;
306
+ onFilesMenu(menu: Menu, files: TAbstractFile[], source: string, leaf?: WorkspaceLeaf): void;
307
+ onLeafMenu(menu: Menu, leaf: WorkspaceLeaf): void;
308
+ onSearchResultsMenu(menu: Menu, search: GlobalSearchLeaf): void;
309
+ onTabGroupMenu(menu: Menu, tabsLeaf: WorkspaceTabs): void;
310
+ onUserEnable(): void;
311
+ openBookmark(item: BookmarkItem, newLeaf: PaneType | boolean, newLeaf2?: PaneType | boolean): Promise<void>;
312
+ openBookmarkInLeaf(item: BookmarkItem, leaf: WorkspaceLeaf, newLeaf?: PaneType | boolean): Promise<void>;
313
+ openBookmarks(items: BookmarkItem[], newLeaf?: PaneType | boolean): Promise<void>;
314
+ rebuildBookmarkCache(): void;
315
+ removeItem(item: BookmarkItem): void;
316
+ saveData(): void;
317
+ updateTabHeaders(): void;
318
+ }
319
+ /** @public */
320
+ export interface PromisedQueue {
321
+ promise: Promise<void>;
322
+ queue(next: () => void | Promise<void>): Promise<void>;
323
+ }
324
+ /** @public */
325
+ export interface CanvasDataManager {
326
+ app: App;
327
+ handleDelete(arg1: unknown): unknown;
328
+ handleRename(arg1: unknown, arg2: unknown): unknown;
329
+ load(arg1: unknown): unknown;
330
+ remove(arg1: unknown): unknown;
331
+ save(arg1: unknown, arg2: unknown): unknown;
332
+ }
333
+ /** @public */
334
+ export interface CanvasEmbed {
335
+ file: string;
336
+ subpath?: string;
337
+ }
338
+ /** @public */
339
+ export interface CanvasIndexEntry {
340
+ caches: Record<string, CachedMetadata>;
341
+ embeds: CanvasEmbed[];
342
+ }
343
+ /** @public */
344
+ export interface CanvasIndex extends Component {
345
+ app: App;
346
+ fileQueue: unknown[];
347
+ frame: null;
348
+ index: Record<string, CanvasIndexEntry>;
349
+ refNodeIds: WeakMap<object, unknown>;
350
+ canProcess(arg1: unknown): unknown;
351
+ get(arg1: unknown): unknown;
352
+ getAll(): unknown;
353
+ getForPath(arg1: unknown): unknown;
354
+ onCreate(arg1: unknown): unknown;
355
+ onDelete(arg1: unknown): unknown;
356
+ onload(): unknown;
357
+ onModify(arg1: unknown): unknown;
358
+ onRename(arg1: unknown, arg2: unknown): unknown;
359
+ onunload(): unknown;
360
+ parseText(arg1: unknown): Promise<unknown>;
361
+ process(arg1: unknown): Promise<unknown>;
362
+ queue(arg1: unknown): unknown;
363
+ requestFrame(): unknown;
364
+ run(): Promise<unknown>;
365
+ }
366
+ /** @public */
367
+ export interface CanvasPlugin extends InternalPlugin<CanvasPluginInstance> {
368
+ }
369
+ /** @public */
370
+ export interface CanvasPluginInstance extends InternalPluginInstance<CanvasPlugin> {
371
+ app: App;
372
+ defaultOn: boolean;
373
+ index: CanvasIndex;
374
+ localDataManager: CanvasDataManager;
375
+ options: {
376
+ cardLabelVisibility?: "always" | "hover" | "never";
377
+ defaultModDragBehavior?: "card" | "group" | "media" | "menu" | "note" | "webpage";
378
+ defaultWheelBehavior?: "pan" | "zoom";
379
+ newFileLocation?: "root" | "current" | "folder";
380
+ newFileFolderPath?: string;
381
+ snapToGrid?: boolean;
382
+ snapToObjects?: boolean;
383
+ zoomBreakpoint?: number;
384
+ };
385
+ plugin: CanvasPlugin;
386
+ renameQueue: PromisedQueue;
387
+ renames: unknown[];
388
+ requestProcessRename: Debouncer<[
389
+ ], unknown>;
390
+ }
391
+ /** @public */
392
+ export interface CommandPalettePlugin extends InternalPlugin<CommandPalettePluginInstance> {
393
+ }
394
+ /** @public */
395
+ export interface CommandPalettePluginInstance extends InternalPluginInstance<CommandPalettePlugin> {
396
+ app: App;
397
+ defaultOn: boolean;
398
+ plugin: CommandPalettePlugin;
399
+ }
400
+ /** @public */
401
+ export interface DailyNotesPlugin extends InternalPlugin<DailyNotesPluginInstance> {
402
+ }
403
+ /** @public */
404
+ export interface DailyNotesPluginInstance extends InternalPluginInstance<DailyNotesPlugin> {
405
+ app: App;
406
+ defaultOn: boolean;
407
+ plugin: DailyNotesPlugin;
408
+ }
409
+ /** @public */
410
+ export interface EditorStatusPlugin extends InternalPlugin<EditorStatusPluginInstance> {
411
+ }
412
+ /** @public */
413
+ export interface EditorStatusPluginInstance extends InternalPluginInstance<EditorStatusPlugin> {
414
+ app: App;
415
+ defaultOn: boolean;
416
+ plugin: EditorStatusPlugin;
417
+ }
418
+ /** @todo Documentation incomplete */
419
+ /** @public */
420
+ export interface FileExplorerPlugin extends InternalPlugin<FileExplorerPluginInstance> {
421
+ /**
422
+ * Reveals a file or folder in the file explorer view, opens the view if it is not already
423
+ * open/visible
424
+ */
425
+ revealInFolder(item: TFile | TFolder): void;
426
+ }
427
+ /** @todo Documentation incomplete */
428
+ /** @public */
429
+ export interface FileExplorerPluginInstance extends InternalPluginInstance<FileExplorerPlugin> {
430
+ app: App;
431
+ defaultOn: boolean;
432
+ plugin: FileExplorerPlugin;
433
+ /**
434
+ * Reveals a file or folder in the file explorer view, opens the view if it is not already
435
+ * open/visible
436
+ */
437
+ revealInFolder(item: TFile | TFolder): void;
438
+ }
439
+ /** @public */
440
+ export interface FileRecoveryPlugin extends InternalPlugin<FileRecoveryPluginInstance> {
441
+ }
442
+ /** @public */
443
+ export interface FileRecoveryPluginInstance extends InternalPluginInstance<FileRecoveryPlugin> {
444
+ app: App;
445
+ defaultOn: boolean;
446
+ }
447
+ /** @todo Documentation incomplete */
448
+ /** @public */
449
+ export interface GlobalSearchPlugin extends InternalPlugin<GlobalSearchPluginInstance> {
450
+ }
451
+ /** @todo Documentation incomplete */
452
+ /** @public */
453
+ export interface GlobalSearchPluginInstance extends InternalPluginInstance<GlobalSearchPlugin> {
454
+ app: App;
455
+ defaultOn: boolean;
456
+ plugin: GlobalSearchPlugin;
457
+ }
458
+ /** @public */
459
+ export interface GraphPlugin extends InternalPlugin<GraphPluginInstance> {
460
+ }
461
+ /** @public */
462
+ export interface GraphPluginInstance extends InternalPluginInstance<GraphPlugin> {
463
+ app: App;
464
+ defaultOn: boolean;
465
+ plugin: GraphPlugin;
466
+ }
467
+ declare const InternalPluginName$1: {
468
+ readonly AudioRecorder: "audio-recorder";
469
+ readonly Backlink: "backlink";
470
+ readonly Bookmarks: "bookmarks";
471
+ readonly Canvas: "canvas";
472
+ readonly CommandPalette: "command-palette";
473
+ readonly DailyNotes: "daily-notes";
474
+ readonly EditorStatus: "editor-status";
475
+ readonly FileExplorer: "file-explorer";
476
+ readonly FileRecovery: "file-recovery";
477
+ readonly GlobalSearch: "global-search";
478
+ readonly Graph: "graph";
479
+ readonly MarkdownImporter: "markdown-importer";
480
+ readonly NoteComposer: "note-composer";
481
+ readonly OutgoingLink: "outgoing-link";
482
+ readonly Outline: "outline";
483
+ readonly PagePreview: "page-preview";
484
+ readonly Properties: "properties";
485
+ readonly Publish: "publish";
486
+ readonly RandomNote: "random-note";
487
+ readonly SlashCommand: "slash-command";
488
+ readonly Slides: "slides";
489
+ readonly Switcher: "switcher";
490
+ readonly Sync: "sync";
491
+ readonly TagPane: "tag-pane";
492
+ readonly Templates: "templates";
493
+ readonly WordCount: "word-count";
494
+ readonly Workspaces: "workspaces";
495
+ readonly ZkPrefixer: "zk-prefixer";
496
+ };
497
+ /** @public */
498
+ export interface MarkdownImporterPlugin extends InternalPlugin<MarkdownImporterPluginInstance> {
499
+ }
500
+ /** @public */
501
+ export interface MarkdownImporterPluginInstance extends InternalPluginInstance<MarkdownImporterPlugin> {
502
+ app: App;
503
+ }
504
+ /** @public */
505
+ export interface NoteComposerPlugin extends InternalPlugin<NoteComposerPluginInstance> {
506
+ }
507
+ /** @public */
508
+ export interface NoteComposerPluginInstance extends InternalPluginInstance<NoteComposerPlugin> {
509
+ app: App;
510
+ defaultOn: boolean;
511
+ }
512
+ /** @public */
513
+ export interface OutgoingLinkPlugin extends InternalPlugin<OutgoingLinkPluginInstance> {
514
+ }
515
+ /** @public */
516
+ export interface OutgoingLinkPluginInstance extends InternalPluginInstance<OutgoingLinkPlugin> {
517
+ app: App;
518
+ defaultOn: boolean;
519
+ plugin: OutgoingLinkPlugin;
520
+ }
521
+ /** @public */
522
+ export interface OutlinePlugin extends InternalPlugin<OutlinePluginInstance> {
523
+ }
524
+ /** @public */
525
+ export interface OutlinePluginInstance extends InternalPluginInstance<OutlinePlugin> {
526
+ app: App;
527
+ defaultOn: boolean;
528
+ plugin: OutlinePlugin;
529
+ }
530
+ /** @public */
531
+ export interface PagePreviewPlugin extends InternalPlugin<PagePreviewPluginInstance> {
532
+ }
533
+ /** @public */
534
+ export interface PagePreviewPluginInstance extends InternalPluginInstance<PagePreviewPlugin> {
535
+ app: App;
536
+ defaultOn: boolean;
537
+ }
538
+ /** @public */
539
+ export interface PropertiesPlugin extends InternalPlugin<PropertiesPluginInstance> {
540
+ }
541
+ /** @public */
542
+ export interface PropertiesPluginInstance extends InternalPluginInstance<PropertiesPlugin> {
543
+ app: App;
544
+ defaultOn: boolean;
545
+ plugin: PropertiesPlugin;
546
+ }
547
+ /** @public */
548
+ export interface PublishPlugin extends InternalPlugin<PublishPluginInstance> {
549
+ }
550
+ /** @public */
551
+ export interface PublishPluginInstance extends InternalPluginInstance<PublishPlugin> {
552
+ app: App;
553
+ plugin: PublishPlugin;
554
+ }
555
+ /** @public */
556
+ export interface RandomNotePlugin extends InternalPlugin<RandomNotePluginInstance> {
557
+ }
558
+ /** @public */
559
+ export interface RandomNotePluginInstance extends InternalPluginInstance<RandomNotePlugin> {
560
+ app: App;
561
+ }
562
+ /** @public */
563
+ export interface SlashCommandPlugin extends InternalPlugin<SlashCommandPluginInstance> {
564
+ }
565
+ /** @public */
566
+ export interface SlashCommandPluginInstance extends InternalPluginInstance<SlashCommandPlugin> {
567
+ defaultOn: boolean;
568
+ }
569
+ /** @public */
570
+ export interface SlidesPlugin extends InternalPlugin<SlidesPluginInstance> {
571
+ }
572
+ /** @public */
573
+ export interface SlidesPluginInstance extends InternalPluginInstance<SlidesPlugin> {
574
+ app: App;
575
+ }
576
+ /** @public */
577
+ export interface SwitcherPlugin extends InternalPlugin<SwitcherPluginInstance> {
578
+ }
579
+ /** @public */
580
+ export interface SwitcherPluginInstance extends InternalPluginInstance<SwitcherPlugin> {
581
+ app: App;
582
+ defaultOn: boolean;
583
+ plugin: SwitcherPlugin;
584
+ }
585
+ /** @public */
586
+ export interface SyncPlugin extends InternalPlugin<SyncPluginInstance> {
587
+ }
588
+ /** @public */
589
+ export interface SyncPluginInstance extends InternalPluginInstance<SyncPlugin> {
590
+ app: App;
591
+ plugin: SyncPlugin;
592
+ }
593
+ /** @public */
594
+ export interface TagPanePlugin extends InternalPlugin<TagPanePluginInstance> {
595
+ }
596
+ /** @public */
597
+ export interface TagPanePluginInstance extends InternalPluginInstance<TagPanePlugin> {
598
+ app: App;
599
+ defaultOn: boolean;
600
+ plugin: TagPanePlugin;
601
+ }
602
+ /** @public */
603
+ export interface TemplatesPlugin extends InternalPlugin<TemplatesPluginInstance> {
604
+ }
605
+ /** @public */
606
+ export interface TemplatesPluginInstance extends InternalPluginInstance<TemplatesPlugin> {
607
+ app: App;
608
+ defaultOn: boolean;
609
+ plugin: TemplatesPlugin;
610
+ }
611
+ /** @public */
612
+ export interface WordCountPlugin extends InternalPlugin<WordCountPluginInstance> {
613
+ }
614
+ /** @public */
615
+ export interface WordCountPluginInstance extends InternalPluginInstance<WordCountPlugin> {
616
+ app: App;
617
+ defaultOn: boolean;
618
+ plugin: WordCountPlugin;
619
+ }
620
+ /** @public */
621
+ export interface WorkspacesPlugin extends InternalPlugin<WorkspacesPluginInstance> {
622
+ }
623
+ /** @public */
624
+ export interface WorkspacesPluginInstance extends InternalPluginInstance<WorkspacesPlugin> {
625
+ app: App;
626
+ plugin: WorkspacesPlugin;
627
+ }
628
+ /** @public */
629
+ export interface ZkPrefixerPlugin extends InternalPlugin<ZkPrefixerPluginInstance> {
630
+ }
631
+ /** @public */
632
+ export interface ZkPrefixerPluginInstance extends InternalPluginInstance<ZkPrefixerPlugin> {
633
+ app: App;
634
+ plugin: ZkPrefixerPlugin;
635
+ }
636
+ /** @public */
637
+ export type InternalPluginNameInstancesMapping = {
638
+ [InternalPluginName$1.AudioRecorder]: AudioRecorderPluginInstance;
639
+ [InternalPluginName$1.Backlink]: BacklinkPluginInstance;
640
+ [InternalPluginName$1.Bookmarks]: BookmarksPluginInstance;
641
+ [InternalPluginName$1.Canvas]: CanvasPluginInstance;
642
+ [InternalPluginName$1.CommandPalette]: CommandPalettePluginInstance;
643
+ [InternalPluginName$1.DailyNotes]: DailyNotesPluginInstance;
644
+ [InternalPluginName$1.EditorStatus]: EditorStatusPluginInstance;
645
+ [InternalPluginName$1.FileExplorer]: FileExplorerPluginInstance;
646
+ [InternalPluginName$1.FileRecovery]: FileRecoveryPluginInstance;
647
+ [InternalPluginName$1.GlobalSearch]: GlobalSearchPluginInstance;
648
+ [InternalPluginName$1.Graph]: GraphPluginInstance;
649
+ [InternalPluginName$1.MarkdownImporter]: MarkdownImporterPluginInstance;
650
+ [InternalPluginName$1.NoteComposer]: NoteComposerPluginInstance;
651
+ [InternalPluginName$1.OutgoingLink]: OutgoingLinkPluginInstance;
652
+ [InternalPluginName$1.Outline]: OutlinePluginInstance;
653
+ [InternalPluginName$1.PagePreview]: PagePreviewPluginInstance;
654
+ [InternalPluginName$1.Properties]: PropertiesPluginInstance;
655
+ [InternalPluginName$1.Publish]: PublishPluginInstance;
656
+ [InternalPluginName$1.RandomNote]: RandomNotePluginInstance;
657
+ [InternalPluginName$1.SlashCommand]: SlashCommandPluginInstance;
658
+ [InternalPluginName$1.Slides]: SlidesPluginInstance;
659
+ [InternalPluginName$1.Switcher]: SwitcherPluginInstance;
660
+ [InternalPluginName$1.Sync]: SyncPluginInstance;
661
+ [InternalPluginName$1.TagPane]: TagPanePluginInstance;
662
+ [InternalPluginName$1.Templates]: TemplatesPluginInstance;
663
+ [InternalPluginName$1.WordCount]: WordCountPluginInstance;
664
+ [InternalPluginName$1.Workspaces]: WorkspacesPluginInstance;
665
+ [InternalPluginName$1.ZkPrefixer]: ZkPrefixerPluginInstance;
666
+ };
667
+ /** @public */
668
+ export type InternalPluginNamePluginsMapping = {
669
+ [InternalPluginName$1.AudioRecorder]: AudioRecorderPlugin;
670
+ [InternalPluginName$1.Backlink]: BacklinkPlugin;
671
+ [InternalPluginName$1.Bookmarks]: BookmarksPlugin;
672
+ [InternalPluginName$1.Canvas]: CanvasPlugin;
673
+ [InternalPluginName$1.CommandPalette]: CommandPalettePlugin;
674
+ [InternalPluginName$1.DailyNotes]: DailyNotesPlugin;
675
+ [InternalPluginName$1.EditorStatus]: EditorStatusPlugin;
676
+ [InternalPluginName$1.FileExplorer]: FileExplorerPlugin;
677
+ [InternalPluginName$1.FileRecovery]: FileRecoveryPlugin;
678
+ [InternalPluginName$1.GlobalSearch]: GlobalSearchPlugin;
679
+ [InternalPluginName$1.Graph]: GraphPlugin;
680
+ [InternalPluginName$1.MarkdownImporter]: MarkdownImporterPlugin;
681
+ [InternalPluginName$1.NoteComposer]: NoteComposerPlugin;
682
+ [InternalPluginName$1.OutgoingLink]: OutgoingLinkPlugin;
683
+ [InternalPluginName$1.Outline]: OutlinePlugin;
684
+ [InternalPluginName$1.PagePreview]: PagePreviewPlugin;
685
+ [InternalPluginName$1.Properties]: PropertiesPlugin;
686
+ [InternalPluginName$1.Publish]: PublishPlugin;
687
+ [InternalPluginName$1.RandomNote]: RandomNotePlugin;
688
+ [InternalPluginName$1.SlashCommand]: SlashCommandPlugin;
689
+ [InternalPluginName$1.Slides]: SlidesPlugin;
690
+ [InternalPluginName$1.Switcher]: SwitcherPlugin;
691
+ [InternalPluginName$1.Sync]: SyncPlugin;
692
+ [InternalPluginName$1.TagPane]: TagPanePlugin;
693
+ [InternalPluginName$1.Templates]: TemplatesPlugin;
694
+ [InternalPluginName$1.WordCount]: WordCountPlugin;
695
+ [InternalPluginName$1.Workspaces]: WorkspacesPlugin;
696
+ [InternalPluginName$1.ZkPrefixer]: ZkPrefixerPlugin;
697
+ };
698
+ /** @public */
699
+ export type InternalPluginNameType = (typeof InternalPluginName$1)[keyof typeof InternalPluginName$1];
700
+ /** @public */
701
+ export interface InternalPluginsConfigRecord extends Record<InternalPluginNameType, boolean> {
702
+ }
703
+ /** @public */
704
+ export interface InternalPlugins extends Events {
705
+ /**
706
+ * Reference to App
707
+ */
708
+ app: App;
709
+ /**
710
+ * Mapping of whether an internal plugin is enabled
711
+ */
712
+ config: InternalPluginsConfigRecord;
713
+ /**
714
+ * Plugin configs for internal plugins
715
+ *
716
+ * @remark Prefer usage of getPluginById to access a plugin
717
+ */
718
+ plugins: {
719
+ [ID in InternalPluginNameType]: InternalPluginNamePluginsMapping[ID];
720
+ };
721
+ /** @internal Request save of plugin configs */
722
+ requestSaveConfig: Debouncer<[
723
+ ], Promise<void>>;
724
+ /** @internal - Load plugin configs and enable plugins */
725
+ enable(): Promise<void>;
726
+ /**
727
+ * Get an enabled internal plugin by ID
728
+ *
729
+ * @param id - ID of the plugin to get
730
+ */
731
+ getEnabledPluginById<ID extends InternalPluginNameType>(id: ID): InternalPluginNameInstancesMapping[ID] | null;
732
+ /**
733
+ * Get all enabled internal plugins
734
+ */
735
+ getEnabledPlugins(): InternalPlugin<unknown>[];
736
+ /**
737
+ * Get an internal plugin by ID
738
+ *
739
+ * @param id - ID of the plugin to get
740
+ */
741
+ getPluginById<ID extends InternalPluginNameType>(id: ID): InternalPluginNamePluginsMapping[ID] | null;
742
+ /** @internal */
743
+ loadPlugin<Instance extends InternalPluginInstance<unknown>>(internalPluginInstance: Instance): Instance;
744
+ /** @internal */
745
+ onRaw(configPath: string): void;
746
+ /** @internal - Save current plugin configs */
747
+ saveConfig(): Promise<void>;
748
+ }
749
+ /**
750
+ * Constructs a new InternalPlugins instance.
751
+ *
752
+ * @param app - The app instance.
753
+ * @returns The constructed InternalPlugins instance.
754
+ */
755
+ export declare function constructInternalPlugins(app: App): InternalPlugins;
756
+ /**
757
+ * Constructs a new InternalPlugin instance.
758
+ *
759
+ * @param app - The app instance.
760
+ * @param instance - The instance of the plugin.
761
+ * @param internalPlugins - The internal plugins instance.
762
+ * @returns The constructed InternalPlugin instance.
763
+ */
764
+ export declare function constructInternalPlugin<Instance>(app: App, instance: Instance, internalPlugins: InternalPlugins): InternalPlugin<Instance>;
765
+ /**
766
+ * Constructs a new App instance.
767
+ *
768
+ * @param adapter - The data adapter to use.
769
+ * @param appId - The ID of the app.
770
+ * @returns The constructed App instance.
771
+ */
772
+ export declare function constructApp(adapter: DataAdapter, appId: string): App;
773
+ /**
774
+ * Constructs a new TFile instance.
775
+ *
776
+ * @param vault - The vault to which the file belongs.
777
+ * @param path - The path of the file.
778
+ * @returns The constructed TFile instance.
779
+ */
780
+ export declare function constructTFile(vault: Vault, path: string): TFile;
781
+ /** @public */
782
+ export interface EditorViewState {
783
+ printing: boolean;
784
+ }
785
+ /** @todo Documentation incomplete */
786
+ /** @public */
787
+ export interface VimState {
788
+ vim: {
789
+ inputState: {
790
+ changeQueue: null;
791
+ keyBuffer: [
792
+ ];
793
+ motion: null;
794
+ motionArgs: null;
795
+ motionRepeat: [
796
+ ];
797
+ operator: null;
798
+ operatorArgs: null;
799
+ prefixRepeat: [
800
+ ];
801
+ registerName: null;
802
+ };
803
+ insertMode: false;
804
+ insertModeRepeat: undefined;
805
+ lastEditActionCommand: undefined;
806
+ lastEditInputState: undefined;
807
+ lastHPos: number;
808
+ lastHSPos: number;
809
+ lastMotion: {
810
+ name?: string;
811
+ };
812
+ lastPastedText: null;
813
+ lastSelection: null;
814
+ };
815
+ vimPlugin: {
816
+ lastKeydown: string;
817
+ };
818
+ }
819
+ /** @todo Documentation incomplete */
820
+ /** @public */
821
+ export interface VimEditor {
822
+ state: VimState;
823
+ }
824
+ /** @public */
825
+ export interface AppVaultConfigHotkeysRecord extends Record<string, string> {
826
+ }
827
+ /** @public */
828
+ export interface AppVaultConfig {
829
+ /**
830
+ * Appearance \> Accent color
831
+ */
832
+ accentColor: "" | string;
833
+ /**
834
+ * Files & Links \> Automatically update internal links
835
+ */
836
+ alwaysUpdateLinks?: false | boolean;
837
+ /**
838
+ * Files & Links \> Attachment folder path
839
+ */
840
+ attachmentFolderPath?: "/" | string;
841
+ /**
842
+ * Editor \> Auto convert HTML
843
+ */
844
+ autoConvertHtml?: true | boolean;
845
+ /**
846
+ * Editor \> Auto pair brackets
847
+ */
848
+ autoPairBrackets?: true | boolean;
849
+ /**
850
+ * Editor \> Auto pair Markdown syntax
851
+ */
852
+ autoPairMarkdown?: true | boolean;
853
+ /**
854
+ * Appearance \> Font size
855
+ */
856
+ baseFontSize?: 16 | number;
857
+ /**
858
+ * Appearance \> Quick font size adjustment
859
+ */
860
+ baseFontSizeAction?: true | boolean;
861
+ /**
862
+ * Community Plugins \> Browse \> Sort order
863
+ */
864
+ communityPluginSortOrder: "download" | "update" | "release" | "alphabetical";
865
+ /**
866
+ * Themes \> Browse \> Sort order
867
+ */
868
+ communityThemeSortOrder: "download" | "update" | "release" | "alphabetical";
869
+ /**
870
+ * Appearance \> Theme
871
+ *
872
+ * @remark is the default Obsidian theme
873
+ */
874
+ cssTheme?: "" | string;
875
+ /**
876
+ * Editor \> Default view for new tabs
877
+ */
878
+ defaultViewMode?: "source" | "preview";
879
+ emacsyKeys?: true | boolean;
880
+ /**
881
+ * Appearance \> CSS snippets
882
+ */
883
+ enabledCssSnippets?: string[];
884
+ fileSortOrder?: "alphabetical";
885
+ /**
886
+ * Editor \> Always focus new tabs
887
+ */
888
+ focusNewTab?: true | boolean;
889
+ /**
890
+ * Editor \> Fold heading
891
+ */
892
+ foldHeading?: true | boolean;
893
+ /**
894
+ * Editor \> Fold indent
895
+ */
896
+ foldIndent?: true | boolean;
897
+ /**
898
+ * Hotkeys
899
+ *
900
+ * @deprecated Likely not used anymore
901
+ */
902
+ hotkeys?: AppVaultConfigHotkeysRecord;
903
+ /**
904
+ * Appearance \> Interface font
905
+ */
906
+ interfaceFontFamily?: "" | string;
907
+ /**
908
+ * Editor \> Use legacy editor
909
+ */
910
+ legacyEditor?: false | boolean;
911
+ livePreview?: true | boolean;
912
+ /**
913
+ * Mobile \> Configure mobile Quick Action
914
+ */
915
+ mobilePullAction?: "command-palette:open" | string;
916
+ mobileQuickRibbonItem?: "" | string;
917
+ /**
918
+ * Mobile \> Manage toolbar options
919
+ */
920
+ mobileToolbarCommands?: string[];
921
+ monospaceFontFamily?: "" | string;
922
+ /**
923
+ * Appearance \> Native menus
924
+ */
925
+ nativeMenus?: null | boolean;
926
+ /**
927
+ * Files & Links \> Default location for new notes | 'folder' \> Folder to create new notes in
928
+ */
929
+ newFileFolderPath?: "/" | string;
930
+ /**
931
+ * Files & Links \> Default location for new notes
932
+ */
933
+ newFileLocation?: "root" | "current" | "folder";
934
+ /**
935
+ * Files & Links \> New link format
936
+ */
937
+ newLinkFormat?: "shortest" | "relative" | "absolute";
938
+ /**
939
+ * Saved on executing 'Export to PDF' command
940
+ */
941
+ pdfExportSettings?: {
942
+ pageSize: "letter" | string;
943
+ landscape: false | boolean;
944
+ margin: "0" | string;
945
+ downscalePercent: 100 | number;
946
+ };
947
+ /**
948
+ * Files & Links \> Confirm line deletion
949
+ */
950
+ promptDelete?: true | boolean;
951
+ /**
952
+ * Editor \> Properties in document
953
+ */
954
+ propertiesInDocument?: "visible" | "hidden" | "source";
955
+ /**
956
+ * Editor \> Readable line length
957
+ */
958
+ readableLineLength?: true | boolean;
959
+ /**
960
+ * Editor \> Right-to-left (RTL)
961
+ */
962
+ rightToLeft?: false | boolean;
963
+ /** @deprecated Removed as of version 1.4.3 */
964
+ showFrontmatter?: false | boolean;
965
+ /**
966
+ * Editor \> Show indentation guides
967
+ */
968
+ showIndentGuide?: true | boolean;
969
+ /**
970
+ * Editor \> Show inline title
971
+ */
972
+ showInlineTitle?: true | boolean;
973
+ /**
974
+ * Editor \> Show line numbers
975
+ */
976
+ showLineNumber?: false | boolean;
977
+ /**
978
+ * Appearance \> Show ribbon
979
+ */
980
+ showRibbon?: true | boolean;
981
+ /**
982
+ * Files & Links \> Detect all file extensions
983
+ */
984
+ showUnsupportedFiles?: false | boolean;
985
+ /**
986
+ * Appearance \> Show tab title bar
987
+ */
988
+ showViewHeader?: false | boolean;
989
+ /**
990
+ * Editor \> Smart indent lists
991
+ */
992
+ smartIndentList?: true | boolean;
993
+ /**
994
+ * Editor \> Spellcheck
995
+ */
996
+ spellcheck?: false | boolean;
997
+ /**
998
+ * @deprecated Deprecated
999
+ * @todo
1000
+ */
1001
+ spellcheckDictionary?: [
1002
+ ] | string[];
1003
+ /**
1004
+ * Editor \> Spellcheck languages
1005
+ */
1006
+ spellcheckLanguages?: null | string[];
1007
+ /**
1008
+ * Editor \> Strict line breaks
1009
+ */
1010
+ strictLineBreaks?: false | boolean;
1011
+ /**
1012
+ * Editor \> Tab indent size
1013
+ */
1014
+ tabSize?: 4 | number;
1015
+ /**
1016
+ * Appearance \> Text font
1017
+ */
1018
+ textFontFamily?: "" | string;
1019
+ /**
1020
+ * Appearance \> Base color scheme
1021
+ *
1022
+ * @remark Not be confused with cssTheme, this setting is for the light/dark mode
1023
+ * @remark moonstone is light theme, 'obsidian' is dark theme
1024
+ */
1025
+ theme?: "moonstone" | "obsidian";
1026
+ /**
1027
+ * Appearance \> Translucent window
1028
+ */
1029
+ translucency?: false | boolean;
1030
+ /**
1031
+ * Files & Links \> Deleted files
1032
+ */
1033
+ trashOption?: "system" | "local" | "none";
1034
+ /** @deprecated Probably left-over code from old properties type storage */
1035
+ types: object;
1036
+ /**
1037
+ * Files & Links \> Use [[Wikilinks]]
1038
+ */
1039
+ useMarkdownLinks?: false | boolean;
1040
+ /**
1041
+ * Files & Links \> Excluded files
1042
+ */
1043
+ userIgnoreFilters?: null | string[];
1044
+ /**
1045
+ * Editor \> Indent using tabs
1046
+ */
1047
+ useTab?: true | boolean;
1048
+ /**
1049
+ * Editor \> Vim key bindings
1050
+ */
1051
+ vimMode?: false | boolean;
1052
+ }
1053
+ /** @todo Documentation incomplete */
1054
+ /** @public */
1055
+ export type ConfigItem = "accentColor" | "alwaysUpdateLinks" | "attachmentFolderPath" | "autoConvertHtml" | "autoPairBrackets" | "autoPairMarkdown" | "baseFontSize" | "baseFontSizeAction" | "cssTheme" | "defaultViewMode" | "enabledCssSnippets" | "focusNewTab" | "foldHeading" | "foldIndent" | "hotkeys" | "interfaceFontFamily" | "livePreview" | "mobilePullAction" | "mobileQuickRibbonItem" | "mobileToolbarCommands" | "monospaceFontFamily" | "nativeMenus" | "newFileFolderPath" | "newFileLocation" | "newLinkFormat" | "pdfExportSettings" | "promptDelete" | "propertiesInDocument" | "readableLineLength" | "rightToLeft" | "showIndentGuide" | "showInlineTitle" | "showLineNumber" | "showRibbon" | "showUnsupportedFiles" | "showViewHeader" | "smartIndentList" | "spellcheck" | "spellcheckLanguages" | "strictLineBreaks" | "tabSize" | "textFontFamily" | "theme" | "translucency" | "trashOption" | "types" | "uriCallbacks" | "useMarkdownLinks" | "useTab" | "userIgnoreFilters" | "vimMode";
1056
+ /** @public */
1057
+ export type FileSystemWatchHandler = (eventType: string, path: string, oldPath?: string, stats?: FileStats) => void;
1058
+ /** @public */
1059
+ export interface VaultFileMapRecord extends Record<string, TAbstractFile> {
1060
+ }
1061
+ /** @public */
1062
+ export interface SerializedWorkspaceItem {
1063
+ dimension?: number;
1064
+ id: string;
1065
+ type: string;
1066
+ }
1067
+ /** @public */
1068
+ export interface AppMenuBarManager {
1069
+ app: App;
1070
+ constructor: {
1071
+ updateMenuItems(arg1: unknown, arg2: unknown): unknown;
1072
+ };
1073
+ onLayoutChange: Debouncer<[
1074
+ ], unknown>;
1075
+ onWindowFrameChange: Debouncer<[
1076
+ ], unknown>;
1077
+ requestRender: Debouncer<[
1078
+ ], unknown>;
1079
+ _onLayoutChange(): unknown;
1080
+ applyHotkeys(arg1: unknown): unknown;
1081
+ buildMenu(): unknown;
1082
+ getAcceleratorFromHotkey(arg1: unknown): unknown;
1083
+ hideUnregisteredCommands(arg1: unknown): unknown;
1084
+ render(): unknown;
1085
+ updateShareMenuItem(arg1: unknown): unknown;
1086
+ updateViewState(): unknown;
1087
+ updateWorkspace(): unknown;
1088
+ }
1089
+ /** @public */
1090
+ export interface HotkeysSettingTab extends SettingTab {
1091
+ searchComponent: SearchComponent;
1092
+ updateHotkeyVisibility(): void;
1093
+ }
1094
+ /** @public */
1095
+ export interface AppSetting extends Modal {
1096
+ /**
1097
+ * Current active tab of the settings modal
1098
+ */
1099
+ activeTab: SettingTab | null;
1100
+ /**
1101
+ * Closeable component for the active tab
1102
+ */
1103
+ activeTabCloseable: CloseableComponent | null;
1104
+ /** @internal Container element containing the community plugins */
1105
+ communityPluginTabContainer: HTMLElement;
1106
+ /** @internal Container element containing the community plugins header */
1107
+ communityPluginTabHeaderGroup: HTMLElement;
1108
+ /** @internal Container element containing the core plugins */
1109
+ corePluginTabContainer: HTMLElement;
1110
+ /** @internal Container element containing the core plugins header */
1111
+ corePluginTabHeaderGroup: HTMLElement;
1112
+ /**
1113
+ * Previously opened tab ID
1114
+ */
1115
+ lastTabId: string;
1116
+ /**
1117
+ * List of all plugin tabs (core and community, ordered by precedence)
1118
+ */
1119
+ pluginTabs: SettingTab[];
1120
+ /**
1121
+ * List of all core settings tabs (editor, files & links, ...)
1122
+ */
1123
+ settingTabs: SettingTab[];
1124
+ /** @internal Container element containing the core settings */
1125
+ tabContainer: HTMLElement;
1126
+ /** @internal Container for currently active settings tab */
1127
+ tabContentContainer: HTMLElement;
1128
+ /** @internal Container for all settings tabs */
1129
+ tabHeadersEl: HTMLElement;
1130
+ /**
1131
+ * @param tab - Tab to add
1132
+ * @internal Add a new plugin tab to the settings modal
1133
+ */
1134
+ addSettingTab(tab: SettingTab): void;
1135
+ /** @internal Closes the currently active tab */
1136
+ closeActiveTab(): void;
1137
+ /**
1138
+ * @param tab - Tab to check
1139
+ * @internal Check whether tab is a plugin tab
1140
+ */
1141
+ isPluginSettingTab(tab: SettingTab): boolean;
1142
+ /**
1143
+ * @param tab - Tab to open
1144
+ * @internal Open a specific tab by tab reference
1145
+ */
1146
+ openTab(tab: SettingTab): void;
1147
+ openTabById(id: "hotkeys"): HotkeysSettingTab;
1148
+ /**
1149
+ * Open a specific tab by ID
1150
+ *
1151
+ * @param id - ID of the tab to open
1152
+ */
1153
+ openTabById(id: string): SettingTab;
1154
+ /**
1155
+ * @param tab - Tab to remove
1156
+ * @internal Remove a plugin tab from the settings modal
1157
+ */
1158
+ removeSettingTab(tab: SettingTab): void;
1159
+ /**
1160
+ * @param tab - Tab to update the title to
1161
+ * @internal Update the title of the modal
1162
+ */
1163
+ updateModalTitle(tab: SettingTab): void;
1164
+ /** @internal Update a tab section */
1165
+ updatePluginSection(): void;
1166
+ }
1167
+ /** @public */
1168
+ export interface CommandsCommandsRecord extends Record<string, Command> {
1169
+ }
1170
+ /** @public */
1171
+ export interface CommandsEditorCommandsRecord extends Record<string, Command> {
1172
+ }
1173
+ /** @public */
1174
+ export interface Commands {
1175
+ /**
1176
+ * Reference to App
1177
+ */
1178
+ app: App;
1179
+ /**
1180
+ * Commands *without* editor callback, will always be available in the command palette
1181
+ *
1182
+ * @example
1183
+ * `app:open-vault` or `app:reload`
1184
+ */
1185
+ commands: CommandsCommandsRecord;
1186
+ /**
1187
+ * Commands *with* editor callback, will only be available when editor is active and callback returns
1188
+ * true
1189
+ *
1190
+ * @example
1191
+ * `editor:fold-all` or `command-palette:open`
1192
+ */
1193
+ editorCommands: CommandsEditorCommandsRecord;
1194
+ /**
1195
+ * Add a command to the command registry
1196
+ *
1197
+ * @param command - Command to add
1198
+ */
1199
+ addCommand(command: Command): void;
1200
+ /**
1201
+ * Execute a command by reference
1202
+ *
1203
+ * @param command - Command to execute
1204
+ */
1205
+ executeCommand(command: Command): boolean;
1206
+ /**
1207
+ * Execute a command by ID
1208
+ *
1209
+ * @param commandId - ID of command to execute
1210
+ */
1211
+ executeCommandById(commandId: string): boolean;
1212
+ /**
1213
+ * Find a command by ID
1214
+ *
1215
+ * @param commandId - ID of command to find
1216
+ */
1217
+ findCommand(commandId: string): Command | undefined;
1218
+ /**
1219
+ * Lists **all** commands, both with and without editor callback
1220
+ */
1221
+ listCommands(): Command[];
1222
+ /**
1223
+ * Remove a command from the command registry
1224
+ *
1225
+ * @param commandId - ID of command to remove
1226
+ */
1227
+ removeCommand(commandId: string): void;
1228
+ }
1229
+ /** @public */
1230
+ export interface ThemeManifest {
1231
+ /**
1232
+ * Name of the author of the theme
1233
+ */
1234
+ author: string;
1235
+ /**
1236
+ * URL to the author's website
1237
+ */
1238
+ authorUrl?: string;
1239
+ /**
1240
+ * Storage location of the theme relative to the vault root
1241
+ */
1242
+ dir: string;
1243
+ /**
1244
+ * URL for funding the author
1245
+ */
1246
+ fundingUrl?: string;
1247
+ /**
1248
+ * Minimum Obsidian version compatible with the theme
1249
+ */
1250
+ minAppVersion: string;
1251
+ /**
1252
+ * Name of the theme
1253
+ */
1254
+ name: string;
1255
+ /**
1256
+ * Version of the theme
1257
+ *
1258
+ * @remark Defaults to '0.0.0' if no theme manifest was provided in the repository
1259
+ */
1260
+ version: "0.0.0" | string;
1261
+ }
1262
+ /** @public */
1263
+ export interface CustomCSSThemesRecord extends Record<string, ThemeManifest> {
1264
+ }
1265
+ /** @public */
1266
+ export interface CustomCSSUpdatesRecord extends Record<string, unknown> {
1267
+ }
1268
+ /** @todo Documentation incomplete */
1269
+ /** @public */
1270
+ export interface CustomCSS extends Component {
1271
+ /**
1272
+ * Reference to App
1273
+ */
1274
+ app: App;
1275
+ /** @internal Cache of CSS snippet filepath (relative to vault root) to CSS snippet contents */
1276
+ csscache: Map<string, string>;
1277
+ /**
1278
+ * Set of enabled snippet, given by filenames
1279
+ */
1280
+ enabledSnippets: Set<string>;
1281
+ /**
1282
+ * @internal
1283
+ * Contains references to Style elements containing custom CSS snippets
1284
+ */
1285
+ extraStyleEls: HTMLStyleElement[];
1286
+ /**
1287
+ * List of theme names not fully updated to post v1.0.0 theme guidelines
1288
+ */
1289
+ oldThemes: string[];
1290
+ /** @internal */
1291
+ queue: PromisedQueue;
1292
+ /** @internal */
1293
+ requestLoadSnippets: Debouncer<[
1294
+ ], void>;
1295
+ /** @internal */
1296
+ requestLoadTheme: Debouncer<[
1297
+ ], void>;
1298
+ /** @internal */
1299
+ requestReadThemes: Debouncer<[
1300
+ ], void>;
1301
+ /**
1302
+ * List of snippets detected by Obsidian, given by their filenames
1303
+ */
1304
+ snippets: string[];
1305
+ /**
1306
+ * Currently active theme, given by its name
1307
+ *
1308
+ * @remark is the default Obsidian theme
1309
+ */
1310
+ theme: "" | string;
1311
+ /**
1312
+ * Mapping of theme names to their manifest
1313
+ */
1314
+ themes: CustomCSSThemesRecord;
1315
+ /** @internal */
1316
+ updates: CustomCSSUpdatesRecord;
1317
+ /** @internal */
1318
+ boundRaw(themeName: string): void;
1319
+ /**
1320
+ * Check whether a specific theme can be updated
1321
+ *
1322
+ * @param themeName - Name of the theme to check
1323
+ */
1324
+ checkForUpdate(themeName: string): void;
1325
+ /**
1326
+ * Check all themes for updates
1327
+ */
1328
+ checkForUpdates(): void;
1329
+ /**
1330
+ * Disable translucency of application background
1331
+ */
1332
+ disableTranslucency(): void;
1333
+ /**
1334
+ * Fetch legacy theme CSS using the pre-v1.0.0 theme download pipeline
1335
+ *
1336
+ * @returns String obsidian.css contents
1337
+ */
1338
+ downloadLegacyTheme(arg: {
1339
+ repo: string;
1340
+ }): Promise<string>;
1341
+ /**
1342
+ * Enable translucency of application background
1343
+ */
1344
+ enableTranslucency(): void;
1345
+ /**
1346
+ * Fetch a theme's manifest using repository URL
1347
+ *
1348
+ * @remark Do **not** include github prefix, only `username/repo`
1349
+ */
1350
+ getManifest(repoUrl: string): Promise<ThemeManifest>;
1351
+ /**
1352
+ * Convert snippet name to its corresponding filepath (relative to vault root)
1353
+ *
1354
+ * @returns String `.obsidian/snippets/${snippetName}.css`
1355
+ */
1356
+ getSnippetPath(snippetName: string): string;
1357
+ /**
1358
+ * Returns the folder path where snippets are stored (relative to vault root)
1359
+ */
1360
+ getSnippetsFolder(): string;
1361
+ /**
1362
+ * Returns the folder path where themes are stored (relative to vault root)
1363
+ */
1364
+ getThemeFolder(): string;
1365
+ /**
1366
+ * Convert theme name to its corresponding filepath (relative to vault root)
1367
+ *
1368
+ * @returns String `.obsidian/themes/${themeName}/theme.css`
1369
+ */
1370
+ getThemePath(themeName: string): string;
1371
+ /**
1372
+ * Returns whether there are themes that can be updated
1373
+ */
1374
+ hasUpdates(): boolean;
1375
+ /**
1376
+ * Install a legacy theme using the pre-v1.0.0 theme download pipeline<br> Will create a corresponding
1377
+ * dummy manifest for the theme
1378
+ *
1379
+ * @remark Name will be used as the folder name for the theme
1380
+ */
1381
+ installLegacyTheme(arg: {
1382
+ name: string;
1383
+ repo: string;
1384
+ author: string;
1385
+ }): Promise<void>;
1386
+ /**
1387
+ * Install a theme using the regular theme download pipeline
1388
+ */
1389
+ installTheme(arg: {
1390
+ name: string;
1391
+ repo: string;
1392
+ author: string;
1393
+ }, version: string): Promise<void>;
1394
+ /**
1395
+ * Check whether a specific theme is installed by theme name
1396
+ */
1397
+ isThemeInstalled(themeName: string): boolean;
1398
+ loadCss(arg1: unknown): Promise<unknown>;
1399
+ loadData(): unknown;
1400
+ loadSnippets(): unknown;
1401
+ loadTheme(arg1: unknown): unknown;
1402
+ /** @internal */
1403
+ onload(): void;
1404
+ /** @internal */
1405
+ onRaw(themeName: string): void;
1406
+ /** @internal */
1407
+ readSnippets(): void;
1408
+ /** @internal */
1409
+ readThemes(): void;
1410
+ /**
1411
+ * Remove a theme by theme name
1412
+ */
1413
+ removeTheme(themeName: string): Promise<void>;
1414
+ /**
1415
+ * Set the activation status of a snippet by snippet name
1416
+ */
1417
+ setCssEnabledStatus(snippetName: string, enabled: boolean): void;
1418
+ /**
1419
+ * Set the active theme by theme name
1420
+ */
1421
+ setTheme(themeName: string): void;
1422
+ /**
1423
+ * Set the translucency of application background
1424
+ */
1425
+ setTranslucency(translucency: boolean): void;
1426
+ }
1427
+ /** @public */
1428
+ export interface Draggable {
1429
+ file?: TAbstractFile;
1430
+ files?: TAbstractFile[];
1431
+ icon: string;
1432
+ linktext?: string;
1433
+ source?: unknown;
1434
+ sourcePath?: string;
1435
+ title: string;
1436
+ type: string;
1437
+ }
1438
+ /** @public */
1439
+ export interface DragStartEvent {
1440
+ evt: DragEvent;
1441
+ moved: boolean;
1442
+ }
1443
+ /** @public */
1444
+ export interface DropResult {
1445
+ action: string | null;
1446
+ dropEffect: "none" | "copy" | "link" | "move";
1447
+ hoverClass: string;
1448
+ hoverEl: HTMLElement | null;
1449
+ }
1450
+ /** @todo Documentation incomplete */
1451
+ /** @public */
1452
+ export interface DragManager {
1453
+ actionEl: HTMLElement | null;
1454
+ app: App;
1455
+ draggable: Draggable | null;
1456
+ dragStart: DragStartEvent | null;
1457
+ ghostEl: HTMLElement | null;
1458
+ hoverClass: string;
1459
+ hoverEl: HTMLElement | null;
1460
+ isDragOverHandled: boolean;
1461
+ overlayEl: HTMLElement;
1462
+ shouldHideOverlay: boolean;
1463
+ sourceClass: string;
1464
+ sourceEls: HTMLElement[] | null;
1465
+ dragFile(event: DragEvent, file: TFile, source?: unknown): Draggable;
1466
+ dragFiles(event: DragEvent, files: TAbstractFile[], source?: unknown): Draggable | null;
1467
+ dragFolder(event: DragEvent, folder: TFolder, source?: unknown): Draggable;
1468
+ dragLink(event: DragEvent, linkText: string, sourcePath: string, title?: string, source?: unknown): Draggable;
1469
+ handleDrag(el: HTMLElement, draggableGetter: (event: DragEvent) => Draggable | null): void;
1470
+ handleDrop(el: HTMLElement, dropHandler: (event: DragEvent, draggable: Draggable, isOver: boolean) => DropResult | null, draggable?: boolean): void;
1471
+ hideOverlay(): void;
1472
+ onDragEnd(): void;
1473
+ onDragLeave(event: DragEvent): void;
1474
+ onDragOver(event: DragEvent): void;
1475
+ onDragOverFirst(): void;
1476
+ onDragStart(event: DragEvent, draggable: Draggable): void;
1477
+ onDragStartGlobal(event: DragEvent): void;
1478
+ onTouchEnd(event: TouchEvent): void;
1479
+ removeOverlay(): void;
1480
+ setAction(action: string | null): void;
1481
+ showOverlay(doc: Document, rect: DOMRect): void;
1482
+ updateHover(hoverEl: HTMLElement | null, hoverClass: string): void;
1483
+ updateSource(sourceEls: HTMLElement[] | null, sourceClass: string): void;
1484
+ }
1485
+ /** @public */
1486
+ export interface EmbedContext {
1487
+ /**
1488
+ * Reference to the app
1489
+ */
1490
+ app: App;
1491
+ /**
1492
+ * Element where the embed should be displayed
1493
+ */
1494
+ containerEl: HTMLElement;
1495
+ /**
1496
+ * Depth of the embed within its container (how many levels of embeds are above it)
1497
+ */
1498
+ depth?: number;
1499
+ /**
1500
+ * Whether the embed should be dynamic (CM) or static (postProcessed)
1501
+ */
1502
+ displayMode?: boolean;
1503
+ /**
1504
+ * Text that should be displayed in the embed
1505
+ */
1506
+ linktext?: string;
1507
+ /**
1508
+ * Whether the embed should be an inline embed
1509
+ */
1510
+ showInline?: boolean;
1511
+ /**
1512
+ * Optional path to the current open file
1513
+ */
1514
+ sourcePath?: string;
1515
+ /** @internal */
1516
+ state?: unknown;
1517
+ }
1518
+ /** @todo Documentation incomplete */
1519
+ /** @public */
1520
+ export type EmbeddableConstructor = (context: EmbedContext, file: TFile, path?: string) => Component;
1521
+ /** @public */
1522
+ export interface EmbedRegistryEmbedByExtensionRecord extends Record<string, EmbeddableConstructor> {
1523
+ }
1524
+ /** @public */
1525
+ export interface EmbedRegistry extends Events {
1526
+ /**
1527
+ * Mapping of file extensions to constructors for embeddable widgets
1528
+ */
1529
+ embedByExtension: EmbedRegistryEmbedByExtensionRecord;
1530
+ /**
1531
+ * Get the embed constructor for a specific file type
1532
+ */
1533
+ getEmbedCreator(file: TFile): EmbeddableConstructor | null;
1534
+ /**
1535
+ * Check whether a file extension has a registered embed constructor
1536
+ */
1537
+ isExtensionRegistered(extension: string): boolean;
1538
+ /**
1539
+ * Register an embed constructor for a specific file extension
1540
+ */
1541
+ registerExtension(extension: string, embedCreator: EmbeddableConstructor): void;
1542
+ /**
1543
+ * Register an embed constructor for a list of file extensions
1544
+ */
1545
+ registerExtensions(extensions: string[], embedCreator: EmbeddableConstructor): void;
1546
+ /**
1547
+ * Unregister an embed constructor for a specific file extension
1548
+ */
1549
+ unregisterExtension(extension: string): void;
1550
+ /**
1551
+ * Unregister an embed constructor for a list of file extensions
1552
+ */
1553
+ unregisterExtensions(extensions: string[]): void;
1554
+ }
1555
+ /** @public */
1556
+ export interface FoldManager {
1557
+ app: App;
1558
+ cleanup(): unknown;
1559
+ load(arg1: unknown): unknown;
1560
+ loadPath(arg1: unknown): unknown;
1561
+ save(arg1: unknown, arg2: unknown): unknown;
1562
+ savePath(arg1: unknown, arg2: unknown): unknown;
1563
+ }
1564
+ /** @public */
1565
+ export interface HotkeyManagerCustomKeysRecord extends Record<string, KeymapInfo[]> {
1566
+ }
1567
+ /** @public */
1568
+ export interface HotkeyManagerDefaultKeysRecord extends Record<string, KeymapInfo[]> {
1569
+ }
1570
+ /** @public */
1571
+ export interface HotkeyManager {
1572
+ /**
1573
+ * Reference to App
1574
+ */
1575
+ app: App;
1576
+ /** @internal Whether hotkeys have been baked (checks completed) */
1577
+ baked: boolean;
1578
+ /**
1579
+ * Assigned hotkeys
1580
+ */
1581
+ bakedHotkeys: KeymapInfo[];
1582
+ /**
1583
+ * Array of hotkey index to command ID
1584
+ */
1585
+ bakedIds: string[];
1586
+ /**
1587
+ * Custom (non-Obsidian default) hotkeys, one to many mapping of command ID to assigned hotkey
1588
+ */
1589
+ customKeys: HotkeyManagerCustomKeysRecord;
1590
+ /**
1591
+ * Default hotkeys, one to many mapping of command ID to assigned hotkey
1592
+ */
1593
+ defaultKeys: HotkeyManagerDefaultKeysRecord;
1594
+ /** @internal */
1595
+ onConfigFileChange: Debouncer<[
1596
+ ], Promise<void>>;
1597
+ /**
1598
+ * Add a hotkey to the default hotkeys
1599
+ *
1600
+ * @param command - Command ID to add hotkey to
1601
+ * @param keys - Hotkeys to add
1602
+ */
1603
+ addDefaultHotkeys(command: string, keys: KeymapInfo[]): void;
1604
+ /** @internal Bake hotkeys (create mapping of pressed key to command ID) */
1605
+ bake(): void;
1606
+ /**
1607
+ * Get hotkey associated with command ID
1608
+ *
1609
+ * @param command - Command ID to get hotkey for
1610
+ */
1611
+ getDefaultHotkeys(command: string): KeymapInfo[];
1612
+ /**
1613
+ * Get hotkey associated with command ID
1614
+ *
1615
+ * @param command - Command ID to get hotkey for
1616
+ */
1617
+ getHotkeys(command: string): KeymapInfo[];
1618
+ /** @internal Load hotkeys from storage */
1619
+ load(): void;
1620
+ /** @internal */
1621
+ onRaw(e: unknown): void;
1622
+ /**
1623
+ * Trigger a command by keyboard event
1624
+ *
1625
+ * @param event - Keyboard event to trigger command with
1626
+ * @param keypress - Pressed key information
1627
+ */
1628
+ onTrigger(event: KeyboardEvent, keypress: KeymapInfo): boolean;
1629
+ /**
1630
+ * Pretty-print hotkey of a command
1631
+ *
1632
+ * @param commandId - Command ID to print hotkey for
1633
+ */
1634
+ printHotkeyForCommand(commandId: string): string;
1635
+ /** @internal */
1636
+ registerListeners(): void;
1637
+ /**
1638
+ * Remove a hotkey from the default hotkeys
1639
+ *
1640
+ * @param command - Command ID to remove hotkey from
1641
+ */
1642
+ removeDefaultHotkeys(command: string): void;
1643
+ /**
1644
+ * Remove a hotkey from the custom hotkeys
1645
+ *
1646
+ * @param command - Command ID to remove hotkey from
1647
+ */
1648
+ removeHotkeys(command: string): void;
1649
+ /** @internal Save custom hotkeys to storage */
1650
+ save(): void;
1651
+ /**
1652
+ * Add a hotkey to the custom hotkeys (overrides default hotkeys)
1653
+ *
1654
+ * @param command - Command ID to add hotkey to
1655
+ * @param keys - Hotkeys to add
1656
+ */
1657
+ setHotkeys(command: string, keys: KeymapInfo[]): void;
1658
+ }
1659
+ /** @todo Documentation incomplete */
1660
+ /** @public */
1661
+ export interface ImportedAttachments {
1662
+ data: Promise<ArrayBuffer>;
1663
+ extension: string;
1664
+ filename: string;
1665
+ name: string;
1666
+ }
1667
+ /** @todo Documentation incomplete */
1668
+ /** @public */
1669
+ export interface LoadProgress {
1670
+ }
1671
+ /** @public */
1672
+ export interface PropertyInfo {
1673
+ /**
1674
+ * Usage count of property
1675
+ */
1676
+ count: number;
1677
+ /**
1678
+ * Name of property
1679
+ */
1680
+ name: string;
1681
+ /**
1682
+ * Type of property
1683
+ */
1684
+ type: string;
1685
+ }
1686
+ /** @public */
1687
+ export interface PropertyEntryData<T> {
1688
+ /**
1689
+ * Property key
1690
+ */
1691
+ key: string;
1692
+ /**
1693
+ * Property widget type
1694
+ */
1695
+ type: string;
1696
+ /**
1697
+ * Property value
1698
+ */
1699
+ value: T;
1700
+ }
1701
+ /** @public */
1702
+ export interface MetadataWidget {
1703
+ }
1704
+ /** @public */
1705
+ export interface MetadataEditorProperty extends Component {
1706
+ /**
1707
+ * Reference to the app
1708
+ */
1709
+ app: App;
1710
+ /**
1711
+ * Container element for the metadata editor property
1712
+ */
1713
+ containerEl: HTMLElement;
1714
+ /**
1715
+ * Entry information for the property
1716
+ */
1717
+ entry: PropertyEntryData<unknown>;
1718
+ /**
1719
+ * Icon element of the property
1720
+ */
1721
+ iconEl: HTMLSpanElement;
1722
+ /**
1723
+ * Key value of the property
1724
+ */
1725
+ keyEl: HTMLElement;
1726
+ /**
1727
+ * Input field for key value of the property
1728
+ */
1729
+ keyInputEl: HTMLInputElement;
1730
+ /**
1731
+ * Metadata editor the property is attached to
1732
+ */
1733
+ metadataEditor: MetadataEditor;
1734
+ /**
1735
+ * Widget that handles user input for this property widget type
1736
+ */
1737
+ rendered: MetadataWidget | null;
1738
+ /**
1739
+ * Info about the inferred and expected property widget given key-value pair
1740
+ */
1741
+ typeInfo: {
1742
+ expected: PropertyWidget<unknown>;
1743
+ inferred: PropertyWidget<unknown>;
1744
+ };
1745
+ /**
1746
+ * Element that contains the value input or widget
1747
+ */
1748
+ valueEl: HTMLElement;
1749
+ /**
1750
+ * Element containing the displayed warning on malformed property field
1751
+ */
1752
+ warningEl: HTMLElement;
1753
+ /**
1754
+ * Focus on the key input element
1755
+ */
1756
+ focusKey(): void;
1757
+ /**
1758
+ * Focus on the property (container element)
1759
+ */
1760
+ focusProperty(): void;
1761
+ /**
1762
+ * Focus on the value input element
1763
+ */
1764
+ focusValue(which?: "both" | "end" | "start"): void;
1765
+ /**
1766
+ * Reveal the property menu on click event
1767
+ */
1768
+ handleItemClick(event: MouseEvent): void;
1769
+ /**
1770
+ * Focus on property on blur event
1771
+ */
1772
+ handlePropertyBlur(): void;
1773
+ /**
1774
+ * Update key of property and saves, returns false if error
1775
+ */
1776
+ handleUpdateKey(key: string): boolean;
1777
+ /**
1778
+ * Update value of property and saves
1779
+ */
1780
+ handleUpdateValue(value: unknown): void;
1781
+ /**
1782
+ * Loads as draggable property element
1783
+ */
1784
+ onload(): void;
1785
+ /**
1786
+ * Render property widget based on type
1787
+ */
1788
+ renderProperty(entry: PropertyEntryData<unknown>, check_errors?: boolean, use_expected_type?: boolean): void;
1789
+ /**
1790
+ * Set the selected class of property
1791
+ */
1792
+ setSelected(selected: boolean): void;
1793
+ /**
1794
+ * Reveal property selection menu at mouse event
1795
+ */
1796
+ showPropertyMenu(event: MouseEvent): void;
1797
+ }
1798
+ /** @public */
1799
+ export interface MetadataEditor extends Component {
1800
+ /**
1801
+ * Button element for adding a new property
1802
+ */
1803
+ addPropertyButtonEl: HTMLButtonElement;
1804
+ /**
1805
+ * Reference to the app
1806
+ */
1807
+ app: App;
1808
+ /**
1809
+ * Whether the frontmatter editor is collapsed
1810
+ */
1811
+ collapsed: boolean;
1812
+ /**
1813
+ * Container element for the metadata editor
1814
+ */
1815
+ containerEl: HTMLElement;
1816
+ /**
1817
+ * Element containing metadata table and addPropertyButton
1818
+ */
1819
+ contentEl: HTMLElement;
1820
+ /**
1821
+ * The currently focused property
1822
+ */
1823
+ focusedLine: null | MetadataEditorProperty;
1824
+ /**
1825
+ * Fold button for folding away the frontmatter editor on hovering over headingEl
1826
+ */
1827
+ foldEl: HTMLElement;
1828
+ /**
1829
+ * Heading element for the metadata editor
1830
+ */
1831
+ headingEl: HTMLElement;
1832
+ /**
1833
+ * Hover element container
1834
+ */
1835
+ hoverPopover: null | HoverPopover;
1836
+ /**
1837
+ * Owner of the metadata editor
1838
+ */
1839
+ owner: MarkdownView;
1840
+ /**
1841
+ * All properties existing in the metadata editor
1842
+ */
1843
+ properties: PropertyEntryData<unknown>[];
1844
+ /**
1845
+ * Element containing all property elements
1846
+ */
1847
+ propertyListEl: HTMLElement;
1848
+ /**
1849
+ * List of all property field editors
1850
+ */
1851
+ rendered: MetadataEditorProperty[];
1852
+ /**
1853
+ * Set of all selected property editors
1854
+ */
1855
+ selectedLines: Set<MetadataEditorProperty>;
1856
+ /**
1857
+ * Convert given properties to a serialized object and store in clipboard as obsidian/properties
1858
+ */
1859
+ _copyToClipboard(event: ClipboardEvent, properties: MetadataEditorProperty[]): void;
1860
+ /**
1861
+ * Uncollapse editor if collapsed and create a new property row
1862
+ */
1863
+ addProperty(): void;
1864
+ /**
1865
+ * Clear all properties
1866
+ */
1867
+ clear(): void;
1868
+ /**
1869
+ * Unselect all lines
1870
+ */
1871
+ clearSelection(): void;
1872
+ /**
1873
+ * Focus on property field with given key
1874
+ */
1875
+ focusKey(key: string): void;
1876
+ /**
1877
+ * Focus on property
1878
+ */
1879
+ focusProperty(property: MetadataEditorProperty): void;
1880
+ /**
1881
+ * Focus on property at specified index
1882
+ */
1883
+ focusPropertyAtIndex(index: number): void;
1884
+ /**
1885
+ * Focus on property with value
1886
+ */
1887
+ focusValue(value: string, which: "both" | "end" | "start"): void;
1888
+ /**
1889
+ * Handle copy event on selection and serialize properties
1890
+ */
1891
+ handleCopy(event: ClipboardEvent): void;
1892
+ /**
1893
+ * Handle cut event and serialize and remove properties
1894
+ */
1895
+ handleCut(event: ClipboardEvent): void;
1896
+ /**
1897
+ * Handle selection of item for drag handling
1898
+ */
1899
+ handleItemSelection(event: PointerEvent, property: MetadataEditorProperty): boolean;
1900
+ /**
1901
+ * Handle key press event for controlling selection or movement of property up/down
1902
+ */
1903
+ handleKeypress(event: KeyboardEvent): void;
1904
+ /**
1905
+ * Handle paste event of properties into metadata editor
1906
+ */
1907
+ handlePaste(event: ClipboardEvent): void;
1908
+ /**
1909
+ * Whether the editor has focus
1910
+ */
1911
+ hasFocus(): boolean;
1912
+ /**
1913
+ * Whether there is a property that is focused
1914
+ */
1915
+ hasPropertyFocused(): boolean;
1916
+ /**
1917
+ * Add new properties to the metadata editor and save
1918
+ */
1919
+ insertProperties(properties: Record<string, any>): void;
1920
+ /**
1921
+ * On loading of the metadata editor, register on metadata type change event
1922
+ */
1923
+ onload(): void;
1924
+ /**
1925
+ * On vault metadata update, update property render
1926
+ */
1927
+ onMetadataTypeChange(property: MetadataEditorProperty): void;
1928
+ /**
1929
+ * Remove specified properties from the metadata editor and save, and reset focus if specified
1930
+ */
1931
+ removeProperties(properties: MetadataEditorProperty[], reset_focus?: boolean): unknown;
1932
+ /**
1933
+ * Reorder the entry to specified index position and save
1934
+ */
1935
+ reorderKey(entry: PropertyEntryData<unknown>, index: number): unknown;
1936
+ /**
1937
+ * Serialize the properties and save frontmatter
1938
+ */
1939
+ save(): void;
1940
+ /**
1941
+ * Select all property fields
1942
+ */
1943
+ selectAll(): void;
1944
+ /**
1945
+ * Mark specified property as selected
1946
+ */
1947
+ selectProperty(property: MetadataEditorProperty | undefined, select: boolean): void;
1948
+ /**
1949
+ * Convert properties to a serialized object
1950
+ */
1951
+ serialize(): Record<string, any>;
1952
+ /**
1953
+ * Sets frontmatter as collapsed or uncollapsed
1954
+ */
1955
+ setCollapse(collapsed: boolean, x: boolean): void;
1956
+ /**
1957
+ * On context menu event on header element, show property menu
1958
+ */
1959
+ showPropertiesMenu(event: MouseEvent): void;
1960
+ /**
1961
+ * Synchronize data with given properties and re-render them
1962
+ */
1963
+ synchronize(data: Record<string, any>): void;
1964
+ /**
1965
+ * Toggle collapsed state of the metadata editor
1966
+ */
1967
+ toggleCollapse(): void;
1968
+ }
1969
+ /** @public */
1970
+ export interface PropertyRenderContext {
1971
+ /**
1972
+ * Reference to the app
1973
+ */
1974
+ app: App;
1975
+ /**
1976
+ * Key of the property field
1977
+ */
1978
+ key: string;
1979
+ /**
1980
+ * Reference to the metadata editor
1981
+ */
1982
+ metadataEditor: MetadataEditor;
1983
+ /**
1984
+ * Determine the source path of current context
1985
+ */
1986
+ sourcePath: string;
1987
+ /**
1988
+ * Callback called on property field unfocus
1989
+ */
1990
+ blur(): void;
1991
+ /**
1992
+ * Callback called on property value change
1993
+ */
1994
+ onChange(value: unknown): void;
1995
+ }
1996
+ /** @public */
1997
+ export interface PropertyWidget<T> {
1998
+ /**
1999
+ * Lucide-dev icon associated with the widget
2000
+ */
2001
+ icon: string;
2002
+ /**
2003
+ * Reserved keys for the widget
2004
+ */
2005
+ reservedKeys?: string[];
2006
+ /**
2007
+ * Identifier for the widget
2008
+ */
2009
+ type: string;
2010
+ /**
2011
+ * Get the default value for the property widget
2012
+ */
2013
+ default(): T;
2014
+ /**
2015
+ * Returns the I18N name of the widget
2016
+ */
2017
+ name(): string;
2018
+ /**
2019
+ * Render function for the widget on field container given context and data
2020
+ */
2021
+ render(containerEl: HTMLElement, data: PropertyEntryData<T>, context: PropertyRenderContext): Component | void;
2022
+ /**
2023
+ * Validate whether the input value to the widget is correct
2024
+ */
2025
+ validate(value: T): boolean;
2026
+ }
2027
+ /**
2028
+ * @todo Documentation incomplete
2029
+ */
2030
+ /** @public */
2031
+ export type PropertyWidgetType = "aliases" | "checkbox" | "date" | "datetime" | "multitext" | "number" | "tags" | "text" | string;
2032
+ /** @public */
2033
+ export interface MetadataTypeManagerPropertiesRecord extends Record<string, PropertyInfo> {
2034
+ }
2035
+ /** @public */
2036
+ export interface MetadataTypeManagerRegisteredTypeWidgetsRecord extends Record<PropertyWidgetType, PropertyWidget<unknown>> {
2037
+ }
2038
+ /** @public */
2039
+ export interface PropertyWidgetEntry {
2040
+ name: string;
2041
+ type: PropertyWidgetType;
2042
+ }
2043
+ /** @public */
2044
+ export interface MetadataTypeManagerTypesRecord extends Record<string, PropertyWidgetEntry> {
2045
+ }
2046
+ /** @public */
2047
+ export interface MetadataTypeManager extends Events {
2048
+ /**
2049
+ * Reference to App
2050
+ */
2051
+ app: App;
2052
+ onConfigFileChange: Debouncer<[
2053
+ ], Promise<void>>;
2054
+ /**
2055
+ * Registered properties of the vault
2056
+ */
2057
+ properties: MetadataTypeManagerPropertiesRecord;
2058
+ /** @internal Registered type widgets */
2059
+ registeredTypeWidgets: MetadataTypeManagerRegisteredTypeWidgetsRecord;
2060
+ /**
2061
+ * Associated widget types for each property
2062
+ */
2063
+ types: MetadataTypeManagerTypesRecord;
2064
+ /**
2065
+ * Get all registered properties of the vault
2066
+ */
2067
+ getAllProperties(): Record<string, PropertyInfo>;
2068
+ /**
2069
+ * Get assigned widget type for property
2070
+ */
2071
+ getAssignedType(property: string): PropertyWidgetType | null;
2072
+ /**
2073
+ * Get info for property
2074
+ */
2075
+ getPropertyInfo(property: string): PropertyInfo;
2076
+ /** @internal Get expected widget type for property and the one inferred from the property value */
2077
+ getTypeInfo(arg: {
2078
+ key: string;
2079
+ type: string;
2080
+ value: unknown;
2081
+ }): {
2082
+ inferred: PropertyWidget<unknown>;
2083
+ expected: PropertyWidget<unknown>;
2084
+ };
2085
+ /**
2086
+ * Get all properties with an assigned widget type
2087
+ */
2088
+ getTypes(): string[];
2089
+ /** @internal Load property types from config */
2090
+ loadData(): Promise<void>;
2091
+ /** @internal */
2092
+ onRaw(e: unknown): void;
2093
+ /** @internal */
2094
+ registerListeners(): void;
2095
+ /** @internal Save property types to config */
2096
+ save(): Promise<void>;
2097
+ /** @internal Get all properties from metadata cache */
2098
+ savePropertyInfo(): void;
2099
+ /** @internal Set widget type for property */
2100
+ setType(property: string, type: PropertyWidgetType): Promise<void>;
2101
+ /** @internal Unset widget type for property */
2102
+ unsetType(property: string): Promise<void>;
2103
+ }
2104
+ /** @todo Documentation incomplete */
2105
+ /** @public */
2106
+ export interface MobileNavbar {
2107
+ }
2108
+ /** @public */
2109
+ export interface MobileTabSwitcher {
2110
+ app: App;
2111
+ cacheDir: string;
2112
+ containerEl: HTMLDivElement;
2113
+ innerScrollEl: HTMLDivElement;
2114
+ isVisible: boolean;
2115
+ requestRender: Debouncer<[
2116
+ ], void>;
2117
+ scrollEl: HTMLDivElement;
2118
+ tabPreviewLookup: WeakMap<object, unknown>;
2119
+ close(): void;
2120
+ hide(): void;
2121
+ onLayoutChange(): void;
2122
+ render(): void;
2123
+ setupCacheDir(): Promise<void>;
2124
+ show(): Promise<void>;
2125
+ showTabManagementMenu(e: MouseEvent): void;
2126
+ }
2127
+ /** @todo Documentation incomplete */
2128
+ /** @public */
2129
+ export interface MobileToolbar {
2130
+ }
2131
+ /** @public */
2132
+ export interface ObsidianDOM {
2133
+ /**
2134
+ * Root element of the application
2135
+ */
2136
+ appContainerEl: HTMLElement;
2137
+ /**
2138
+ * Child of `appContainerEl` containing the main content of the application
2139
+ */
2140
+ horizontalMainContainerEl: HTMLElement;
2141
+ /**
2142
+ * Status bar element containing word count among other things
2143
+ */
2144
+ statusBarEl: HTMLElement;
2145
+ /**
2146
+ * Child of `horizontalMainContainerEl` containing the workspace DOM
2147
+ */
2148
+ workspaceEl: HTMLElement;
2149
+ }
2150
+ /** @public */
2151
+ export interface PluginUpdateManifest {
2152
+ /**
2153
+ * Manifest of the plugin
2154
+ */
2155
+ manifest: PluginManifest;
2156
+ /**
2157
+ * Repository of the plugin
2158
+ */
2159
+ repo: string;
2160
+ /**
2161
+ * New version of the plugin
2162
+ */
2163
+ version: string;
2164
+ }
2165
+ /** @public */
2166
+ export interface PluginsManifestsRecord extends Record<string, PluginManifest> {
2167
+ }
2168
+ /** @public */
2169
+ export interface PluginsPluginsRecord extends Record<string, Plugin$1> {
2170
+ }
2171
+ /** @public */
2172
+ export interface Plugins {
2173
+ /**
2174
+ * Reference to App
2175
+ */
2176
+ app: App;
2177
+ /**
2178
+ * Set of enabled plugin IDs
2179
+ *
2180
+ * @remark The plugin ids aren't guaranteed to be either active (in `app.plugins.plugins`) or installed (in `app.plugins.manifests`)
2181
+ */
2182
+ enabledPlugins: Set<string>;
2183
+ /** @internal Plugin ID that is currently being enabled */
2184
+ loadingPluginId: string | null;
2185
+ /**
2186
+ * Manifests of all the plugins that are installed
2187
+ */
2188
+ manifests: PluginsManifestsRecord;
2189
+ /**
2190
+ * Mapping of plugin ID to active plugin instance
2191
+ *
2192
+ * @remark Prefer usage of getPlugin to access a plugin
2193
+ */
2194
+ plugins: PluginsPluginsRecord;
2195
+ requestSaveConfig: Debouncer<[
2196
+ ], Promise<void>>;
2197
+ /**
2198
+ * Mapping of plugin ID to available updates
2199
+ */
2200
+ updates: Map<string, PluginUpdateManifest>;
2201
+ /** @internal Check online list for deprecated plugins to automatically disable */
2202
+ checkForDeprecations(): Promise<void>;
2203
+ /**
2204
+ * Check for plugin updates
2205
+ */
2206
+ checkForUpdates(): Promise<void>;
2207
+ /**
2208
+ * Unload a plugin by ID
2209
+ */
2210
+ disablePlugin(id: string): Promise<void>;
2211
+ /**
2212
+ * Unload a plugin by ID and save config for persistence
2213
+ */
2214
+ disablePluginAndSave(id: string): Promise<void>;
2215
+ /**
2216
+ * Enable a plugin by ID
2217
+ */
2218
+ enablePlugin(id: string): Promise<void>;
2219
+ /**
2220
+ * Enable a plugin by ID and save config for persistence
2221
+ */
2222
+ enablePluginAndSave(id: string): Promise<void>;
2223
+ /**
2224
+ * Get a plugin by ID
2225
+ */
2226
+ getPlugin(id: string): Plugin$1 | null;
2227
+ /**
2228
+ * Get the folder where plugins are stored
2229
+ */
2230
+ getPluginFolder(): string;
2231
+ /** @internal Load plugin manifests and enable plugins from config */
2232
+ initialize(): Promise<void>;
2233
+ /**
2234
+ * Install a plugin from a given URL
2235
+ */
2236
+ installPlugin(repo: string, version: string, manifest: PluginManifest): Promise<void>;
2237
+ /**
2238
+ * Check whether a plugin is deprecated
2239
+ */
2240
+ isDeprecated(id: string): boolean;
2241
+ /**
2242
+ * Check whether community plugins are enabled
2243
+ */
2244
+ isEnabled(): boolean;
2245
+ /**
2246
+ * Load a specific plugin's manifest by its folder path
2247
+ */
2248
+ loadManifest(path: string): Promise<void>;
2249
+ /** @internal Load all plugin manifests from plugin folder */
2250
+ loadManifests(): Promise<void>;
2251
+ /**
2252
+ * Load a plugin by its ID
2253
+ */
2254
+ loadPlugin(id: string): Promise<Plugin$1>;
2255
+ /** @internal */
2256
+ onRaw(e: unknown): void;
2257
+ /** @internal - Save current plugin configs */
2258
+ saveConfig(): Promise<void>;
2259
+ /** @internal Toggle whether community plugins are enabled */
2260
+ setEnable(enabled: boolean): Promise<void>;
2261
+ /**
2262
+ * Uninstall a plugin by ID
2263
+ */
2264
+ uninstallPlugin(id: string): Promise<void>;
2265
+ /**
2266
+ * Unload a plugin by ID
2267
+ */
2268
+ unloadPlugin(id: string): Promise<void>;
2269
+ }
2270
+ /** @public */
2271
+ export interface SharedFile {
2272
+ name: string;
2273
+ uri: string;
2274
+ }
2275
+ /** @public */
2276
+ export interface ShareReceiver {
2277
+ app: App;
2278
+ /**
2279
+ * Handles shared files.
2280
+ *
2281
+ * @param files - Shared files
2282
+ */
2283
+ handleShareFiles(files: SharedFile[]): Promise<void>;
2284
+ /**
2285
+ * Handles shared text.
2286
+ *
2287
+ * @param text - Shared text
2288
+ */
2289
+ handleShareText(text: string): Promise<void>;
2290
+ /**
2291
+ * Imports shared files.
2292
+ *
2293
+ * @param files - Shared files
2294
+ */
2295
+ importFiles(files: SharedFile[]): Promise<void>;
2296
+ /**
2297
+ * Configures mobile native events to handle file and text sharing.
2298
+ */
2299
+ setupNative(): void;
2300
+ /**
2301
+ * Configures the workspace to handle file and text sharing.
2302
+ */
2303
+ setupWorkspace(): void;
2304
+ }
2305
+ /** @public */
2306
+ export interface PositionedReference extends Reference {
2307
+ /**
2308
+ * Position of the reference in the file
2309
+ */
2310
+ position: {
2311
+ start: Loc;
2312
+ end: Loc;
2313
+ };
2314
+ }
2315
+ /** @public */
2316
+ export interface LinkUpdate {
2317
+ /**
2318
+ * Reference to App
2319
+ */
2320
+ app: App;
2321
+ /**
2322
+ * Link position in the file
2323
+ */
2324
+ reference: PositionedReference;
2325
+ /**
2326
+ * File that was resolved
2327
+ */
2328
+ resolvedFile: TFile;
2329
+ /**
2330
+ * Paths the file could have been resolved to
2331
+ */
2332
+ resolvedPaths: string[];
2333
+ /**
2334
+ * File that contains the link
2335
+ */
2336
+ sourceFile: TFile;
2337
+ }
2338
+ /** @public */
2339
+ export type LinkUpdateHandler = (link: LinkUpdate) => void | Promise<void>;
2340
+ /** @public */
2341
+ export interface LinkChangeUpdate {
2342
+ change: string;
2343
+ reference: ReferenceCache;
2344
+ sourcePath: string;
2345
+ }
2346
+ /** @public */
2347
+ export interface LinkUpdater {
2348
+ applyUpdates(file: TFile, updates: LinkChangeUpdate[]): Promise<void>;
2349
+ iterateReferences(callback: (path: string, reference: ReferenceCache) => void): void;
2350
+ renameSubpath(file: TFile, oldSubpath: string, newSubpath: string): Promise<void>;
2351
+ }
2352
+ /** @public */
2353
+ export interface CanvasLinkUpdater extends LinkUpdater {
2354
+ app: App;
2355
+ canvas: CanvasPluginInstance;
2356
+ }
2357
+ /** @public */
2358
+ export interface LinkUpdaters extends Record<string, LinkUpdater> {
2359
+ canvas?: CanvasLinkUpdater;
2360
+ }
2361
+ /** @public */
2362
+ export interface FileEntry extends Partial<FileStats> {
2363
+ /**
2364
+ * Name of file or folder
2365
+ */
2366
+ name?: string;
2367
+ /**
2368
+ * Full path to file or folder
2369
+ *
2370
+ * @remark Might be used for resolving symlinks
2371
+ */
2372
+ realpath: string;
2373
+ /**
2374
+ * Type of entry
2375
+ */
2376
+ type: "file" | "folder";
2377
+ /**
2378
+ * URI of file or folder
2379
+ */
2380
+ uri?: string;
2381
+ }
2382
+ /** @public */
2383
+ export interface DataAdapterFilesRecord extends Record<string, FileEntry> {
2384
+ }
2385
+ /** @todo Documentation incomplete */
2386
+ /** @public */
2387
+ export interface KeyScope {
2388
+ /**
2389
+ * Key to match
2390
+ */
2391
+ key: string | null;
2392
+ /**
2393
+ * Modifiers to match
2394
+ */
2395
+ modifiers: string | null;
2396
+ /**
2397
+ * Scope where the key interceptor is registered
2398
+ */
2399
+ scope: Scope;
2400
+ /**
2401
+ * Callback of function to execute when key is pressed
2402
+ */
2403
+ func(): void;
2404
+ }
2405
+ /** @public */
2406
+ export interface CanvasConnection {
2407
+ }
2408
+ /** @public */
2409
+ export interface CanvasNode {
2410
+ }
2411
+ /** @todo Documentation incomplete */
2412
+ /** @public */
2413
+ export interface FileTreeItem {
2414
+ file: TAbstractFile;
2415
+ }
2416
+ /** @todo Documentation incomplete */
2417
+ /** @public */
2418
+ export interface InfinityScroll {
2419
+ height: number;
2420
+ lastScroll: number;
2421
+ queued: unknown | null;
2422
+ renderBlockSize: number;
2423
+ rootEl: unknown;
2424
+ scrollEl: HTMLElement;
2425
+ setWidth: boolean;
2426
+ width: number;
2427
+ _layout(x: unknown, y: unknown): unknown;
2428
+ _measure(x: unknown): unknown;
2429
+ _precompute(x: unknown): unknown;
2430
+ compute(x: unknown): unknown;
2431
+ findElementTop(x: unknown, y: unknown, z: unknown): unknown;
2432
+ getRootTop(): unknown;
2433
+ invalidate(x: unknown, y: unknown): unknown;
2434
+ invalidateAll(): unknown;
2435
+ measure(x: unknown, y: unknown): unknown;
2436
+ onResize(): unknown;
2437
+ onScroll(): unknown;
2438
+ queueCompute(): unknown;
2439
+ scrollIntoView(x: unknown, y: unknown): unknown;
2440
+ update(x: unknown, y: unknown, z: unknown, u: unknown, v: unknown, w: unknown): unknown;
2441
+ updateVirtualDisplay(x: unknown): unknown;
2442
+ }
2443
+ /**
2444
+ * @todo Documentation incomplete
2445
+ */
2446
+ /** @public */
2447
+ export type TreeNode<T = object> = T & {
2448
+ childrenEl: HTMLElement;
2449
+ el: HTMLElement;
2450
+ info: {
2451
+ childLeft: number;
2452
+ childLeftPadding: number;
2453
+ childTop: number;
2454
+ computed: boolean;
2455
+ height: number;
2456
+ hidden: boolean;
2457
+ next: boolean;
2458
+ queued: boolean;
2459
+ width: number;
2460
+ };
2461
+ pusherEl: HTMLElement;
2462
+ vChildren: {
2463
+ _children: TreeNode<T>[];
2464
+ owner: TreeNode<T>;
2465
+ };
2466
+ };
2467
+ /** @public */
2468
+ export interface Tree<T> {
2469
+ /**
2470
+ * Currently active item in tree view
2471
+ */
2472
+ activeDom: TreeNode<T> | null;
2473
+ /**
2474
+ * Reference to App
2475
+ */
2476
+ app: App;
2477
+ /**
2478
+ * Container element of the tree view
2479
+ */
2480
+ containerEl: HTMLElement;
2481
+ /**
2482
+ * Currently focused item in tree view
2483
+ */
2484
+ focusedItem: TreeNode<T> | null;
2485
+ /**
2486
+ * Handle collapsing of all nodes
2487
+ */
2488
+ handleCollapseAll: () => void;
2489
+ /**
2490
+ * Handle renaming of focused item
2491
+ */
2492
+ handleRenameFocusedItem: () => void;
2493
+ /**
2494
+ * ID of the view the tree is associated with
2495
+ */
2496
+ id: string;
2497
+ /** @internal Facilitates rendering of tree view */
2498
+ infinityScroll: InfinityScroll;
2499
+ /**
2500
+ * Whether all items in the tree are collapsed
2501
+ */
2502
+ isAllCollapsed: boolean;
2503
+ /**
2504
+ * Whether tree items should default to collapsed state
2505
+ */
2506
+ prefersCollapsed: boolean;
2507
+ /**
2508
+ * Request saving of the current fold states
2509
+ */
2510
+ requestSaveFolds: () => void;
2511
+ /**
2512
+ * Key scope for tree view
2513
+ */
2514
+ scope: Scope;
2515
+ /**
2516
+ * Currently selected items in tree view
2517
+ */
2518
+ selectedDoms: Set<TreeNode<T>>;
2519
+ /**
2520
+ * The view the tree is associated with
2521
+ */
2522
+ view: View;
2523
+ /**
2524
+ * Root item of the tree view
2525
+ */
2526
+ get root(): TreeNode<T>;
2527
+ /**
2528
+ * Change the focused item to the next item in specified direction
2529
+ */
2530
+ changeFocusedItem(direction: "forwards" | "backwards"): void;
2531
+ /**
2532
+ * Unselect all selected items in the tree view
2533
+ */
2534
+ clearSelectedDoms(): void;
2535
+ /**
2536
+ * Mark tree item as deselected
2537
+ */
2538
+ deselectItem(node: TreeNode<T>): void;
2539
+ /**
2540
+ * Get the local storage key for the saved tree view folds
2541
+ */
2542
+ getFoldKey(): string;
2543
+ /**
2544
+ * Gets the ID of a tree item given its Node
2545
+ */
2546
+ getNodeId(node: TreeNode<T>): string | undefined;
2547
+ /**
2548
+ * Handle deletion of selected nodes
2549
+ */
2550
+ handleDeleteSelectedItems(event: KeyboardEvent): Promise<void>;
2551
+ /**
2552
+ * Handle selection of tree item via keyboard event
2553
+ */
2554
+ handleItemSelection(event: MouseEvent, node: TreeNode<T>): void;
2555
+ /** @internal Registers all keyboard actions to the tree view keyscope */
2556
+ initializeKeyboardNav(): void;
2557
+ /**
2558
+ * Check whether item is a valid tree item
2559
+ */
2560
+ isItem(node: TreeNode<T> | undefined): boolean;
2561
+ /**
2562
+ * Load the saved fold states of the tree view from local storage
2563
+ */
2564
+ loadFolds(): void;
2565
+ /**
2566
+ * Handle keyboard event for moving/selecting tree item below
2567
+ */
2568
+ onKeyArrowDown(event: KeyboardEvent): void;
2569
+ /**
2570
+ * Handle keyboard event for moving through the hierarchy of tree items (and/or folding/unfolding)
2571
+ */
2572
+ onKeyArrowLeft(event: KeyboardEvent): void;
2573
+ /**
2574
+ * Handle keyboard event for moving through the hierarchy of tree items (and/or folding/unfolding)
2575
+ */
2576
+ onKeyArrowRight(event: KeyboardEvent): void;
2577
+ /**
2578
+ * Handle keyboard event for moving/selecting tree item above
2579
+ */
2580
+ onKeyArrowUp(event: KeyboardEvent): void;
2581
+ /**
2582
+ * Handle keyboard event for opening tree item
2583
+ */
2584
+ onKeyOpen(event: KeyboardEvent): void;
2585
+ /** @internal Update scroll representation on resize */
2586
+ onResize(): void;
2587
+ /**
2588
+ * Save the current fold states of the tree view to local storage
2589
+ */
2590
+ saveFolds(): void;
2591
+ /**
2592
+ * Mark tree item as selected
2593
+ */
2594
+ selectItem(node: TreeNode<T>): void;
2595
+ /**
2596
+ * Set all items in the tree view to be collapsed or expanded
2597
+ */
2598
+ setCollapseAll(collapse: boolean): void;
2599
+ /**
2600
+ * Set the focused item in the tree view
2601
+ */
2602
+ setFocusedItem(node: TreeNode<T>, scrollIntoView?: boolean): void;
2603
+ /**
2604
+ * (Un)Collapse all items in the tree view
2605
+ */
2606
+ toggleCollapseAll(): void;
2607
+ }
2608
+ /** @public */
2609
+ export interface WeakMapWrapper<K extends object, V> extends WeakMap<K, V> {
2610
+ map: WeakMap<K, V>;
2611
+ }
2612
+ /** @todo Documentation incomplete */
2613
+ /** @public */
2614
+ export type TreeItem<T> = TreeNode<T> & {
2615
+ collapseEl: HTMLElement;
2616
+ /**
2617
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
2618
+ */
2619
+ collapsed: boolean;
2620
+ /**
2621
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
2622
+ */
2623
+ collapsible: boolean;
2624
+ coverEl: HTMLElement;
2625
+ innerEl: HTMLElement;
2626
+ parent: TreeNode<T> | undefined;
2627
+ selfEl: HTMLElement;
2628
+ view: View;
2629
+ /**
2630
+ * Execute collapse functionality on mouse click
2631
+ */
2632
+ onCollapseClick(event: MouseEvent): void;
2633
+ /**
2634
+ * Execute item functionality on clicking tree item
2635
+ */
2636
+ onSelfClick(event: MouseEvent): void;
2637
+ /**
2638
+ * Set clickable state of tree item
2639
+ */
2640
+ setClickable(clickable: boolean): void;
2641
+ /**
2642
+ * Set collapsed state of tree item
2643
+ */
2644
+ setCollapsed(collapsed: boolean, check: boolean): Promise<undefined>;
2645
+ /**
2646
+ * Set collapsible state of tree item
2647
+ */
2648
+ setCollapsible(collapsible: boolean): void;
2649
+ /**
2650
+ * Toggle collapsed state of tree item
2651
+ */
2652
+ toggleCollapsed(check: boolean): Promise<undefined>;
2653
+ /**
2654
+ * @internal Update the tree item's cover element
2655
+ */
2656
+ updateCollapsed(check: boolean): Promise<undefined>;
2657
+ };
2658
+ /** @public */
2659
+ export interface FileExplorerViewFileItemsRecord extends Record<string, TreeItem<FileTreeItem>> {
2660
+ }
2661
+ /** @todo Documentation incomplete */
2662
+ /** @public */
2663
+ export interface FileExplorerView extends View {
2664
+ /**
2665
+ * Mapping of file path to tree item
2666
+ */
2667
+ fileItems: FileExplorerViewFileItemsRecord;
2668
+ /**
2669
+ * Mapping of tree self element to abstract file
2670
+ */
2671
+ files: WeakMapWrapper<HTMLElement, TAbstractFile>;
2672
+ /**
2673
+ * Tree view of files
2674
+ */
2675
+ tree: Tree<FileTreeItem>;
2676
+ /**
2677
+ * Try to rename the file
2678
+ */
2679
+ acceptRename(): Promise<void>;
2680
+ /**
2681
+ * Is Executed after creating the file or folder and opens the view and/or starts the rename
2682
+ * @param file - The created file
2683
+ * @param newLeaf - Where to open the view for this file
2684
+ */
2685
+ afterCreate(file: TFile, newLeaf: PaneType | boolean): Promise<void>;
2686
+ /** @todo Documentation incomplete */
2687
+ attachFileEvents(e: unknown): void;
2688
+ /**
2689
+ * Creates an file or folder
2690
+ * @param type - The type of file to create
2691
+ * @param location - The location where to create the file
2692
+ * @param newLeaf - Where to open the view for this file
2693
+ */
2694
+ createAbstractFile(type: "file" | "folder", location: TFolder, newLeaf: PaneType | boolean): Promise<void>;
2695
+ /** @todo Documentation incomplete */
2696
+ createFolderDom(folder: TFolder): unknown;
2697
+ /** @todo Documentation incomplete */
2698
+ createItemDom(file: TFile): unknown;
2699
+ /** @todo Documentation incomplete */
2700
+ displayError(message: string, fileItem: unknown): void;
2701
+ /** @todo Documentation incomplete */
2702
+ dragFiles(event: DragEvent, t: unknown): unknown;
2703
+ /**
2704
+ * Quits the rename
2705
+ */
2706
+ exitRename(): void;
2707
+ /** @todo Documentation incomplete */
2708
+ getNodeId(e: unknown): unknown;
2709
+ /**
2710
+ * Get the current view type
2711
+ */
2712
+ getViewType(): "file-explorer";
2713
+ /** @todo Documentation incomplete maybe FileTreeItem */
2714
+ isItem(item: unknown): boolean;
2715
+ /**
2716
+ * Is called when a new file is created in vault. Updates the file tree
2717
+ * @param file - The new file
2718
+ */
2719
+ onCreate(file: TFile): void;
2720
+ /**
2721
+ * Is called when on the new folder icon is clicked. Call createAbstractFile()
2722
+ * @param event - The MouseEvent which triggered this function
2723
+ */
2724
+ onCreateNewFolderClick(event: MouseEvent): Promise<void>;
2725
+ /**
2726
+ * Is called when on the new note icon is clicked. Call createAbstractFile()
2727
+ * @param event - The MouseEvent which triggered this function
2728
+ */
2729
+ onCreateNewNoteClick(event: MouseEvent): Promise<void>;
2730
+ /**
2731
+ * Is called when a file in vault is deleted. Updates the file tree
2732
+ * @param file - The deleted file
2733
+ */
2734
+ onDelete(file: TFile): void;
2735
+ /**
2736
+ * Called when delete is requested
2737
+ * @param event - The event triggered this function
2738
+ */
2739
+ onDeleteSelectedFiles(event: unknown): unknown;
2740
+ /**
2741
+ * Called when a extensions update is triggered
2742
+ * Event: 'extensions-updated'
2743
+ */
2744
+ onExtensionsUpdated(): void;
2745
+ /**
2746
+ * Called when the mouse pointer moves away from an element.
2747
+ * Event: 'mouseout'
2748
+ * @param event - The event triggered this function
2749
+ * @param targetEl - The target Element
2750
+ */
2751
+ onFileMouseout(event: MouseEvent, targetEl: HTMLElement): void;
2752
+ /**
2753
+ * Called when the mouse pointer is moved over an element. Updates the tooltip information
2754
+ * Event: 'mouseover'
2755
+ * @param event - The event triggered this function
2756
+ * @param targetEl - The target Element
2757
+ */
2758
+ onFileMouseover(event: MouseEvent, targetEl: HTMLElement): void;
2759
+ /**
2760
+ * Called when a file is opened. Brings the file to the front.
2761
+ * @param file - The opened file
2762
+ */
2763
+ onFileOpen(file: TFile): void;
2764
+ /** @todo Documentation incomplete */
2765
+ onFileRenameInput(e: unknown): void;
2766
+ /**
2767
+ * Called when 'Enter' is pressed while rename. Accepts the rename
2768
+ * @param event - The event triggered this function
2769
+ */
2770
+ onKeyEnterInRename(event: KeyboardEvent): void;
2771
+ /**
2772
+ * Called when 'ESC' is pressed while rename. Denies the rename
2773
+ */
2774
+ onKeyEscInRename(): void;
2775
+ /**
2776
+ * Called when the rename shortcut is pressed
2777
+ * @param event - The event triggered this function
2778
+ */
2779
+ onKeyRename(event: KeyboardEvent): void;
2780
+ /**
2781
+ * Request a sort if not sorted properly
2782
+ */
2783
+ onModify(): void;
2784
+ /**
2785
+ * Is called when a file in vault is renamed. Updates the file tree
2786
+ * @param file - The renamed file
2787
+ * @param oldPath - The old file path
2788
+ */
2789
+ onRename(file: TFile, oldPath: string): void;
2790
+ /**
2791
+ * Called when the title is deselected. Calls acceptRename()
2792
+ */
2793
+ onTitleBlur(): void;
2794
+ /**
2795
+ * Opens the context menu for the file item
2796
+ * @param event - The event
2797
+ * @param fileItemEl - The file item clicked on
2798
+ */
2799
+ openFileContextMenu(event: Event, fileItemEl: HTMLElement): void;
2800
+ /**
2801
+ * Reveal a file or folder in the file tree
2802
+ */
2803
+ revealInFolder(file: TFile | TFolder): void;
2804
+ /** @todo Documentation incomplete */
2805
+ setIsAllCollapsed(e: unknown): void;
2806
+ /**
2807
+ * Updates the sort order and sort by it
2808
+ * @param order - The sort order
2809
+ */
2810
+ setSortOrder(order: unknown): void;
2811
+ /**
2812
+ * Sorts the file items in this view
2813
+ */
2814
+ sort(): void;
2815
+ /** @todo Documentation incomplete */
2816
+ startRenameFile(e: unknown): unknown;
2817
+ /**
2818
+ * Reloads the config from vault and update all items
2819
+ */
2820
+ updateConfig(): void;
2821
+ }
2822
+ /** @todo Documentation incomplete */
2823
+ /** @public */
2824
+ export interface FileExplorerLeaf extends WorkspaceLeaf {
2825
+ view: FileExplorerView;
2826
+ /** @internal */
2827
+ attachDropHandler(x: unknown, y: unknown, z: unknown): unknown;
2828
+ /** @internal Get a sorted list of the tree items for a specific folder) */
2829
+ getSortedFolderItems(folder: TFolder): FileTreeItem[];
2830
+ }
2831
+ /** @todo Documentation incomplete */
2832
+ /** @public */
2833
+ export interface HoverLinkEvent {
2834
+ event: MouseEvent;
2835
+ hoverParent: WorkspaceLeaf;
2836
+ linktext: string;
2837
+ source: "search" | "editor" | "preview" | "properties" | "graph" | "file-explorer" | "hover-link";
2838
+ sourcePath?: string;
2839
+ state?: {
2840
+ scroll: unknown;
2841
+ };
2842
+ targetEl: HTMLElement | null;
2843
+ }
2844
+ /** @todo Documentation incomplete */
2845
+ /** @public */
2846
+ export interface LeafEntry {
2847
+ children?: LeafEntry[];
2848
+ direction?: SplitDirection;
2849
+ id: string;
2850
+ state?: ViewState;
2851
+ type: string;
2852
+ width?: number;
2853
+ }
2854
+ /** @public */
2855
+ export interface AbstractSearchComponent {
2856
+ /**
2857
+ * Reference to the app
2858
+ */
2859
+ app: App;
2860
+ /**
2861
+ * The container element in which the search component exists (i.e. Editor)
2862
+ */
2863
+ containerEl: HTMLElement;
2864
+ /**
2865
+ * Container for the replacement input field
2866
+ */
2867
+ replaceInputEl: HTMLInputElement;
2868
+ /**
2869
+ * Keyscope for search component
2870
+ */
2871
+ scope: Scope;
2872
+ /**
2873
+ * Container for all the action buttons
2874
+ */
2875
+ searchButtonContainerEl: HTMLElement;
2876
+ /**
2877
+ * Container for the search component itself
2878
+ */
2879
+ searchContainerEl: HTMLElement;
2880
+ /**
2881
+ * Container for the search input field
2882
+ */
2883
+ searchInputEl: HTMLInputElement;
2884
+ /**
2885
+ * Returns the current search query
2886
+ */
2887
+ getQuery(): string;
2888
+ /**
2889
+ * Switch to the next inputElement
2890
+ */
2891
+ goToNextInput(event: KeyboardEvent): unknown;
2892
+ /**
2893
+ * Invokes findNextOrReplace
2894
+ */
2895
+ onEnter(event: KeyboardEvent): unknown;
2896
+ /**
2897
+ * Invokes findPrevious
2898
+ */
2899
+ onShiftEnter(event: KeyboardEvent): unknown;
2900
+ }
2901
+ /** @public */
2902
+ export interface SearchCursor {
2903
+ /**
2904
+ * Current editor search position
2905
+ */
2906
+ current(): {
2907
+ from: EditorPosition;
2908
+ to: EditorPosition;
2909
+ };
2910
+ /**
2911
+ * All search results
2912
+ */
2913
+ findAll(): {
2914
+ from: EditorPosition;
2915
+ to: EditorPosition;
2916
+ }[];
2917
+ /**
2918
+ * Next editor search position
2919
+ */
2920
+ findNext(): {
2921
+ from: EditorPosition;
2922
+ to: EditorPosition;
2923
+ };
2924
+ /**
2925
+ * Previous editor search position
2926
+ */
2927
+ findPrevious(): {
2928
+ from: EditorPosition;
2929
+ to: EditorPosition;
2930
+ };
2931
+ /**
2932
+ * Replace current search result with specified text
2933
+ *
2934
+ * @remark origin is used by CodeMirror to determine which component was responsible for the change
2935
+ */
2936
+ replace(replacement: string, origin: string): void;
2937
+ /**
2938
+ * Replace all search results with specified text
2939
+ */
2940
+ replaceAll(replacement: string, origin: string): void;
2941
+ }
2942
+ /** @public */
2943
+ export interface EditorSearchComponent extends AbstractSearchComponent {
2944
+ /**
2945
+ * Search cursor for editor, handles search and replace functionality for editor
2946
+ */
2947
+ cursor: null | SearchCursor;
2948
+ /**
2949
+ * Linked editor for search component
2950
+ */
2951
+ editor: Editor;
2952
+ /**
2953
+ * Whether search component is currently rendering
2954
+ */
2955
+ isActive: boolean;
2956
+ /**
2957
+ * Whether search component is replacing text (includes 'Replace' input field)
2958
+ */
2959
+ isReplace: boolean;
2960
+ /**
2961
+ * Remove all highlights from editor
2962
+ */
2963
+ clear(): void;
2964
+ /**
2965
+ * Find next search results from cursor and highlights it
2966
+ */
2967
+ findNext(): void;
2968
+ /**
2969
+ * Replace cursor with replacement string if not null and moves to next search result
2970
+ */
2971
+ findNextOrReplace(): void;
2972
+ /**
2973
+ * Find previous search results from cursor and highlights it
2974
+ */
2975
+ findPrevious(): void;
2976
+ /**
2977
+ * Hide/detaches the search component and removes cursor highlights
2978
+ */
2979
+ hide(): void;
2980
+ /**
2981
+ * Add highlights for specified ranges
2982
+ *
2983
+ * @remark Invokes editor.addHighlights
2984
+ */
2985
+ highlight(ranges: EditorRange[]): void;
2986
+ /**
2987
+ * Highlights all matches if search element focused
2988
+ */
2989
+ onAltEnter(e?: KeyboardEvent): void;
2990
+ /**
2991
+ * Replace all search results with specified text if replace mode and replacement element is focused
2992
+ */
2993
+ onModAltEnter(e?: KeyboardEvent): void;
2994
+ /**
2995
+ * Updates search cursor on new input query and highlights search results
2996
+ */
2997
+ onSearchInput(): void;
2998
+ /**
2999
+ * Replaces all search results with replacement query
3000
+ */
3001
+ replaceAll(): void;
3002
+ /**
3003
+ * Replace current search result, if any, with replacement query
3004
+ */
3005
+ replaceCurrentMatch(): void;
3006
+ /**
3007
+ * Find all matches of search query and highlights them
3008
+ */
3009
+ searchAll(): void;
3010
+ /**
3011
+ * Reveal the search (and replace) component
3012
+ */
3013
+ show(replace: boolean): void;
3014
+ }
3015
+ /** @public */
3016
+ export interface ClipBoardManager {
3017
+ /**
3018
+ * Reference to the app
3019
+ */
3020
+ app: App;
3021
+ /**
3022
+ * Reference to the Editor View
3023
+ */
3024
+ info: MarkdownView;
3025
+ /**
3026
+ * Get current path of editor view for determining storage location embed
3027
+ */
3028
+ getPath(): string;
3029
+ /**
3030
+ * Process incoming data (image, text, url, html)
3031
+ *
3032
+ * @remark When processing HTML, function will be async
3033
+ */
3034
+ handleDataTransfer(data: DataTransfer): null | Promise<void>;
3035
+ /**
3036
+ * Handle an incoming drag-over event
3037
+ */
3038
+ handleDragOver(event: DragEvent): void;
3039
+ /**
3040
+ * Handle an incoming drag-drop event
3041
+ */
3042
+ handleDrop(event: DragEvent): boolean;
3043
+ /**
3044
+ * Process a drop event into the editor
3045
+ */
3046
+ handleDropIntoEditor(event: DragEvent): null | string;
3047
+ /**
3048
+ * Handle an incoming paste event
3049
+ */
3050
+ handlePaste(event: ClipboardEvent): boolean;
3051
+ /**
3052
+ * Insert single file as embed into the editor
3053
+ */
3054
+ insertAttachmentEmbed(file: TAbstractFile, replace: boolean): Promise<void>;
3055
+ /**
3056
+ * Insert files from drop-event into the editor
3057
+ */
3058
+ insertFiles(files: ImportedAttachments[]): Promise<void>;
3059
+ /**
3060
+ * Save an attachment of specified name and extension to the vault
3061
+ *
3062
+ * @remark Invokes insertAttachmentEmbed
3063
+ */
3064
+ saveAttachment(name: string, extension: string, data: ArrayBuffer, replace: boolean): Promise<void>;
3065
+ }
3066
+ /** @public */
3067
+ export interface EditorSuggests {
3068
+ /**
3069
+ * Currently active and rendered editor suggestion popup
3070
+ */
3071
+ currentSuggest: null | EditorSuggest<any>;
3072
+ /**
3073
+ * Registered editor suggestions
3074
+ *
3075
+ * @remark Used for providing autocompletions for specific strings
3076
+ * @tutorial Reference official documentation under EditorSuggest<T> for usage
3077
+ */
3078
+ suggests: EditorSuggest<any>[];
3079
+ /**
3080
+ * Add a new editor suggestion to the list of registered suggestion providers
3081
+ */
3082
+ addSuggest(suggest: EditorSuggest<any>): void;
3083
+ /**
3084
+ * Close the currently active editor suggestion popup
3085
+ */
3086
+ close(): void;
3087
+ /**
3088
+ * Whether there is a editor suggestion popup active and visible
3089
+ */
3090
+ isShowingSuggestion(): boolean;
3091
+ /**
3092
+ * Remove a registered editor suggestion from the list of registered suggestion providers
3093
+ */
3094
+ removeSuggest(suggest: EditorSuggest<any>): void;
3095
+ /**
3096
+ * Update position of currently active and rendered editor suggestion popup
3097
+ */
3098
+ reposition(): void;
3099
+ /**
3100
+ * Set the currently active editor suggestion popup to specified suggester
3101
+ */
3102
+ setCurrentSuggest(suggest: EditorSuggest<any>): void;
3103
+ /**
3104
+ * Run check on focused editor to see whether a suggestion should be triggered and rendered
3105
+ */
3106
+ trigger(editor: MarkdownBaseView, t: TFile, n: boolean): void;
3107
+ }
3108
+ /** @todo Documentation incomplete */
3109
+ /** @public */
3110
+ export interface FoldInfo {
3111
+ folds: {
3112
+ from: number;
3113
+ to: number;
3114
+ }[];
3115
+ lines: number;
3116
+ }
3117
+ /** @todo Documentation incomplete */
3118
+ /** @public */
3119
+ export interface TableCellEditor extends MarkdownBaseView, TableCell {
3120
+ }
3121
+ /** @todo Documentation incomplete */
3122
+ /** @public */
3123
+ export interface TableCell {
3124
+ col: number;
3125
+ contentEl: HTMLElement;
3126
+ dirty: boolean;
3127
+ el: HTMLElement;
3128
+ end: number;
3129
+ padEnd: number;
3130
+ padStart: number;
3131
+ row: number;
3132
+ start: number;
3133
+ table: TableCellEditor;
3134
+ text: string;
3135
+ }
3136
+ /** @todo Documentation incomplete */
3137
+ /** @public */
3138
+ export interface TableEditor {
3139
+ }
3140
+ /** @todo Documentation incomplete */
3141
+ /** @public */
3142
+ export interface Token extends EditorRange {
3143
+ text: string;
3144
+ type: "tag" | "external-link" | "internal-link";
3145
+ }
3146
+ /** @public */
3147
+ export interface MarkdownBaseView extends Component {
3148
+ /**
3149
+ * Reference to the app
3150
+ */
3151
+ app: App;
3152
+ /**
3153
+ * Callback to clear all elements
3154
+ */
3155
+ cleanupLivePreview: null | (() => void);
3156
+ /**
3157
+ * Manager that handles pasting text, html and images into the editor
3158
+ */
3159
+ clipboardManager: ClipBoardManager;
3160
+ /**
3161
+ * Codemirror editor instance
3162
+ */
3163
+ cm: EditorView;
3164
+ /**
3165
+ * Whether CodeMirror is initialized
3166
+ */
3167
+ cmInit: boolean;
3168
+ /**
3169
+ * Container element of the editor view
3170
+ */
3171
+ containerEl: HTMLElement;
3172
+ /**
3173
+ * Popup element for internal link
3174
+ */
3175
+ cursorPopupEl: HTMLElement | null;
3176
+ /**
3177
+ * Obsidian editor instance
3178
+ *
3179
+ * @remark Handles formatting, table creation, highlight adding, etc.
3180
+ */
3181
+ editor?: Editor;
3182
+ /**
3183
+ * Element in which the CodeMirror editor resides
3184
+ */
3185
+ editorEl: HTMLElement;
3186
+ /**
3187
+ * Editor suggester for autocompleting files, links, aliases, etc.
3188
+ */
3189
+ editorSuggest: EditorSuggests;
3190
+ /**
3191
+ * The CodeMirror plugins that handle the rendering of, and interaction with Obsidian's Markdown
3192
+ */
3193
+ livePreviewPlugin: Extension[];
3194
+ /**
3195
+ * Local (always active) extensions for the editor
3196
+ */
3197
+ localExtensions: Extension[];
3198
+ /**
3199
+ * Controller of the editor view
3200
+ */
3201
+ owner: MarkdownFileInfo;
3202
+ /**
3203
+ * Whether live preview rendering is disabled
3204
+ */
3205
+ sourceMode: boolean;
3206
+ /**
3207
+ * Reference to editor attached to table cell, if any
3208
+ */
3209
+ tableCell: null | TableCellEditor;
3210
+ /**
3211
+ * Currently active CM instance (table cell CM or main CM)
3212
+ */
3213
+ get activeCM(): EditorView;
3214
+ /**
3215
+ * Returns attached file of the owner instance
3216
+ */
3217
+ get file(): TFile | null;
3218
+ /**
3219
+ * Returns path of the attached file
3220
+ */
3221
+ get path(): string;
3222
+ /**
3223
+ * Apply fold history to editor
3224
+ */
3225
+ applyFoldInfo(info: FoldInfo): void;
3226
+ /**
3227
+ * Constructs local (always active) extensions for the editor
3228
+ *
3229
+ * @remark Creates extensions for handling dom events, editor info state fields, update listener, suggestions
3230
+ */
3231
+ buildLocalExtensions(): Extension[];
3232
+ /**
3233
+ * Cleanup live preview, remove and then re-add all editor extensions
3234
+ */
3235
+ clear(): void;
3236
+ /**
3237
+ * Clean up live preview, remove all extensions, destroy editor
3238
+ */
3239
+ destroy(): void;
3240
+ /**
3241
+ * Removes specified tablecell
3242
+ */
3243
+ destroyTableCell(cell?: TableCellEditor): void;
3244
+ /**
3245
+ * Edit a specified table cell, creating a table cell editor
3246
+ */
3247
+ editTableCell(cell: TableEditor, new_cell: TableCell): TableCellEditor;
3248
+ /**
3249
+ * Get the current editor document as a string
3250
+ */
3251
+ get(): string;
3252
+ /**
3253
+ * Constructs extensions for the editor based on user settings
3254
+ *
3255
+ * @remark Creates extension for tab size, RTL rendering, spellchecking, pairing markdown syntax, live preview and vim
3256
+ */
3257
+ getDynamicExtensions(): Extension[];
3258
+ /**
3259
+ * Get the current folds of the editor
3260
+ */
3261
+ getFoldInfo(): null | FoldInfo;
3262
+ /**
3263
+ * Builds all local extensions and assigns to this.localExtensions
3264
+ *
3265
+ * @remark Will build extensions if they were not already built
3266
+ */
3267
+ getLocalExtensions(): unknown;
3268
+ /**
3269
+ * Creates menu on right mouse click
3270
+ */
3271
+ onContextMenu(event: PointerEvent, x: boolean): Promise<void>;
3272
+ /**
3273
+ * Execute click functionality on token on mouse click
3274
+ */
3275
+ onEditorClick(event: MouseEvent, element?: HTMLElement): void;
3276
+ /**
3277
+ * Execute drag functionality on drag start
3278
+ *
3279
+ * @remark Interfaces with dragManager
3280
+ */
3281
+ onEditorDragStart(event: DragEvent): void;
3282
+ /**
3283
+ * Execute hover functionality on mouse over event
3284
+ */
3285
+ onEditorLinkMouseover(event: MouseEvent, target: HTMLElement): void;
3286
+ /**
3287
+ * Execute context menu functionality on right mouse click
3288
+ *
3289
+ * @deprecated Use onContextMenu instead
3290
+ */
3291
+ onMenu(event: MouseEvent): void;
3292
+ /**
3293
+ * Reposition suggest and scroll position on resize
3294
+ */
3295
+ onResize(): void;
3296
+ /**
3297
+ * Execute functionality on CM editor state update
3298
+ */
3299
+ onUpdate(update: ViewUpdate, changed: boolean): void;
3300
+ /**
3301
+ * Reinitialize the editor inside new container
3302
+ */
3303
+ reinit(): void;
3304
+ /**
3305
+ * Move the editor into the new container
3306
+ */
3307
+ reparent(new_container: HTMLElement): void;
3308
+ /**
3309
+ * Bodge to reset the syntax highlighting
3310
+ *
3311
+ * @remark Uses single-character replacement transaction
3312
+ */
3313
+ resetSyntaxHighlighting(): void;
3314
+ /** @internal Save history of file and data (for caching, for faster reopening of same file in editor) */
3315
+ saveHistory(): void;
3316
+ /**
3317
+ * Set the state of the editor
3318
+ */
3319
+ set(data: string, clear: boolean): void;
3320
+ /**
3321
+ * Enables/disables frontmatter folding
3322
+ */
3323
+ toggleFoldFrontmatter(): void;
3324
+ /**
3325
+ * Toggle source mode for editor and dispatch effect
3326
+ */
3327
+ toggleSource(): void;
3328
+ /**
3329
+ * Execute functionality of token (open external link, open internal link in leaf, ...)
3330
+ */
3331
+ triggerClickableToken(token: Token, new_leaf: boolean): void;
3332
+ /** @internal Callback for onUpdate functionality added as an extension */
3333
+ updateEvent(): (update: ViewUpdate) => void;
3334
+ /**
3335
+ * In mobile, creates a popover link on clickable token, if exists
3336
+ */
3337
+ updateLinkPopup(): void;
3338
+ /**
3339
+ * Reconfigure/re-add all the dynamic extensions
3340
+ */
3341
+ updateOptions(): void;
3342
+ }
3343
+ /** @public */
3344
+ export interface MarkdownScrollableEditView extends MarkdownBaseView {
3345
+ /**
3346
+ * List of CSS classes applied to the editor
3347
+ */
3348
+ cssClasses: [
3349
+ ];
3350
+ /**
3351
+ * Whether the editor is currently scrolling
3352
+ */
3353
+ isScrolling: boolean;
3354
+ /**
3355
+ * Scope for the search component, if exists
3356
+ */
3357
+ scope: Scope | undefined;
3358
+ /**
3359
+ * Search component for the editor, provides highlight and search functionality
3360
+ */
3361
+ search: EditorSearchComponent;
3362
+ /**
3363
+ * Container for the editor, handles editor size
3364
+ */
3365
+ sizerEl: HTMLElement;
3366
+ /**
3367
+ * Set the scroll count of the editor scrollbar
3368
+ */
3369
+ applyScroll(scroll: number): void;
3370
+ /**
3371
+ * Constructs local (always active) extensions for the editor
3372
+ *
3373
+ * @remark Creates extensions for list indentation, tab indentations
3374
+ */
3375
+ buildLocalExtensions(): Extension[];
3376
+ /**
3377
+ * Focus the editor (and for mobile: render keyboard)
3378
+ */
3379
+ focus(): void;
3380
+ /**
3381
+ * Constructs extensions for the editor based on user settings
3382
+ *
3383
+ * @remark Creates toggleable extensions for showing line numbers, indentation guides,
3384
+ * folding, brackets pairing and properties rendering
3385
+ */
3386
+ getDynamicExtensions(): Extension[];
3387
+ /**
3388
+ * Get the current scroll count of the editor scrollbar
3389
+ */
3390
+ getScroll(): number;
3391
+ /**
3392
+ * Invokes onMarkdownScroll on scroll
3393
+ */
3394
+ handleScroll(): void;
3395
+ /**
3396
+ * Hides the editor (sets display: none)
3397
+ */
3398
+ hide(): void;
3399
+ /**
3400
+ * Clear editor cache and refreshes editor on app css change
3401
+ */
3402
+ onCssChange(): void;
3403
+ /**
3404
+ * Update editor size and bottom padding on resize
3405
+ */
3406
+ onResize(): void;
3407
+ /**
3408
+ * Update editor suggest position and invokes handleScroll on scroll
3409
+ */
3410
+ onScroll(): void;
3411
+ /**
3412
+ * Execute functionality on CM editor state update
3413
+ */
3414
+ onUpdate(update: ViewUpdate, changed: boolean): void;
3415
+ /**
3416
+ * Close editor suggest and removes highlights on click
3417
+ */
3418
+ onViewClick(event?: MouseEvent): void;
3419
+ /**
3420
+ * Add classes to the editor, functions as a toggle
3421
+ */
3422
+ setCssClass(classes: string[]): void;
3423
+ /**
3424
+ * Reveal the editor (sets display: block)
3425
+ */
3426
+ show(): void;
3427
+ /**
3428
+ * Reveal the search (and replace) component
3429
+ */
3430
+ showSearch(replace: boolean): void;
3431
+ /**
3432
+ * Update the bottom padding of the CodeMirror contentdom
3433
+ */
3434
+ updateBottomPadding(height: number): void;
3435
+ }
3436
+ /** @todo Documentation incomplete */
3437
+ /** @public */
3438
+ export interface ObsidianTouchEvent {
3439
+ direction: "x" | "y";
3440
+ evt: TouchEvent;
3441
+ points: number;
3442
+ registerCallback: {
3443
+ move(x: number): void;
3444
+ cancel(): void;
3445
+ finish(x: number, y: number, z: number): void;
3446
+ };
3447
+ startX: number;
3448
+ startY: number;
3449
+ targetEl: HTMLElement;
3450
+ touch: Touch;
3451
+ x: number;
3452
+ y: number;
3453
+ }
3454
+ /** @public */
3455
+ export interface RecentFileTracker {
3456
+ /**
3457
+ * List of last opened file paths, limited to 50
3458
+ */
3459
+ lastOpenFiles: string[];
3460
+ /**
3461
+ * Reference to Vault
3462
+ */
3463
+ vault: Vault;
3464
+ /**
3465
+ * Reference to Workspace
3466
+ */
3467
+ workspace: Workspace;
3468
+ /** @internal */
3469
+ collect(file: TFile): void;
3470
+ /**
3471
+ * Returns the last 10 opened files
3472
+ */
3473
+ getLastOpenFiles(): string[];
3474
+ /**
3475
+ * Get last n files of type (defaults to 10)
3476
+ */
3477
+ getRecentFiles(arg?: {
3478
+ showMarkdown: boolean;
3479
+ showCanvas: boolean;
3480
+ showNonImageAttachments: boolean;
3481
+ showImages: boolean;
3482
+ maxCount: number;
3483
+ }): string[];
3484
+ /**
3485
+ * Set the last opened files
3486
+ */
3487
+ load(savedFiles: string[]): void;
3488
+ /** @internal On file create, save file to last opened files */
3489
+ onFileCreated(file: TFile): void;
3490
+ /** @internal On file open, save file to last opened files */
3491
+ onFileOpen(prevFile: TFile, file: TFile): void;
3492
+ /** @internal On file rename, update file path in last opened files */
3493
+ onRename(file: TFile, oldPath: string): void;
3494
+ /** @internal Get last opened files */
3495
+ serialize(): string[];
3496
+ }
3497
+ /** @public */
3498
+ export interface StateHistory {
3499
+ /**
3500
+ * Ephemeral cursor state within Editor of leaf
3501
+ */
3502
+ eState: {
3503
+ cursor: EditorRange;
3504
+ scroll: number;
3505
+ };
3506
+ /**
3507
+ * Icon of the leaf
3508
+ */
3509
+ icon?: string;
3510
+ /**
3511
+ * History of previous and future states of leaf
3512
+ */
3513
+ leafHistory?: {
3514
+ backHistory: StateHistory[];
3515
+ forwardHistory: StateHistory[];
3516
+ };
3517
+ /**
3518
+ * Id of parent to which the leaf belonged
3519
+ */
3520
+ parentId?: string;
3521
+ /**
3522
+ * Id of root to which the leaf belonged
3523
+ */
3524
+ rootId?: string;
3525
+ /**
3526
+ * Last state of the leaf
3527
+ */
3528
+ state: ViewState;
3529
+ /**
3530
+ * Title of the leaf
3531
+ */
3532
+ title?: string;
3533
+ }
3534
+ /** @todo Documentation incomplete */
3535
+ /** @public */
3536
+ export interface CanvasView extends TextFileView {
3537
+ /**
3538
+ * Loads the local data of the canvas
3539
+ */
3540
+ getLocalData(): unknown;
3541
+ /**
3542
+ * Get the current view type
3543
+ */
3544
+ getViewType(): "canvas";
3545
+ /**
3546
+ * Saves the local data of the canvas
3547
+ */
3548
+ saveLocalData(): void;
3549
+ }
3550
+ /** @public */
3551
+ export interface SerializedWorkspaceLeftRibbonHiddenItemsRecord extends Record<string, boolean> {
3552
+ }
3553
+ /** @public */
3554
+ export interface SerializedWorkspace {
3555
+ /**
3556
+ * Last active leaf
3557
+ */
3558
+ active: string;
3559
+ /**
3560
+ * Last opened files
3561
+ */
3562
+ lastOpenFiles: string[];
3563
+ /**
3564
+ * Left opened leaf
3565
+ */
3566
+ left: LeafEntry;
3567
+ /**
3568
+ * Left ribbon
3569
+ */
3570
+ leftRibbon: {
3571
+ hiddenItems: SerializedWorkspaceLeftRibbonHiddenItemsRecord;
3572
+ };
3573
+ /**
3574
+ * Main (center) workspace leaf
3575
+ */
3576
+ main: LeafEntry;
3577
+ /**
3578
+ * Right opened leaf
3579
+ */
3580
+ right: LeafEntry;
3581
+ }
3582
+ /** @public */
3583
+ export interface WorkspaceHoverLinkSourcesRecord extends Record<string, HoverLinkSource> {
3584
+ }
3585
+ /** @todo Documentation incomplete */
3586
+ /** @public */
3587
+ export interface WindowSelection {
3588
+ focusEl: HTMLElement;
3589
+ range: Range;
3590
+ win: Window;
3591
+ }
3592
+ /** @todo Documentation incomplete */
3593
+ /** @public */
3594
+ export interface RendererSection {
3595
+ el: HTMLElement;
3596
+ html: string;
3597
+ rendered: boolean;
3598
+ }
3599
+ /** @todo Documentation incomplete */
3600
+ /** @public */
3601
+ export interface ReadViewRenderer {
3602
+ addBottomPadding: boolean;
3603
+ asyncSections: unknown[];
3604
+ lastRender: number;
3605
+ lastScroll: number;
3606
+ lastText: string;
3607
+ previewEl: HTMLElement;
3608
+ pusherEl: HTMLElement;
3609
+ recycledSections: unknown[];
3610
+ rendered: unknown[];
3611
+ sections: RendererSection[];
3612
+ text: string;
3613
+ clear(): void;
3614
+ parseAsync(): void;
3615
+ parseSync(): void;
3616
+ queueRender(): void;
3617
+ set(text: string): void;
3618
+ }
3619
+ /** @public */
3620
+ export interface ViewRegistryTypeByExtensionRecord extends Record<string, string> {
3621
+ }
3622
+ /** @public */
3623
+ export interface ViewRegistryViewByTypeRecord extends Record<string, (leaf: WorkspaceLeaf) => View> {
3624
+ }
3625
+ /** @public */
3626
+ export interface MenuSubmenuConfigRecord extends Record<string, {
3627
+ title: string;
3628
+ icon: string;
3629
+ }> {
3630
+ }
3631
+ /** @public */
3632
+ export interface EventsEntry {
3633
+ ctx: unknown;
3634
+ e: Events;
3635
+ name: string;
3636
+ fn(...data: unknown[]): unknown;
3637
+ }
3638
+ /** @public */
3639
+ export interface FileCacheEntry {
3640
+ /**
3641
+ * Hash of file contents
3642
+ */
3643
+ hash: string;
3644
+ /**
3645
+ * Last modified time of file
3646
+ */
3647
+ mtime: number;
3648
+ /**
3649
+ * Size of file in bytes
3650
+ */
3651
+ size: number;
3652
+ }
3653
+ /** @todo Documentation incomplete */
3654
+ /** @public */
3655
+ export interface Runnable {
3656
+ cancelled: boolean;
3657
+ onCancel: null | (() => void);
3658
+ onStart: null | (() => void);
3659
+ onStop: null | (() => void);
3660
+ running: boolean;
3661
+ cancel(): void;
3662
+ isCancelled(): boolean;
3663
+ isRunning(): boolean;
3664
+ start(): void;
3665
+ stop(): void;
3666
+ }
3667
+ /** @public */
3668
+ export interface QueueItems<T> {
3669
+ length: number;
3670
+ offset: number;
3671
+ queue: T[];
3672
+ clear(): void;
3673
+ dequeue(): T | undefined;
3674
+ enqueue(item: T): void;
3675
+ enqueueArray(items: T[]): void;
3676
+ get(): T[];
3677
+ isEmpty(): boolean;
3678
+ peek(): T | undefined;
3679
+ remove(item: T): void;
3680
+ }
3681
+ /** @public */
3682
+ export interface LinkResolverQueue {
3683
+ items: QueueItems<TFile | null>;
3684
+ promise: PromiseWithResolvers<TFile | null> | null;
3685
+ runnable: Runnable;
3686
+ add(item: TFile | null): void;
3687
+ addList(items: TFile[]): void;
3688
+ cancel(): void;
3689
+ clear(): void;
3690
+ generator(): AsyncGenerator<TFile | null>;
3691
+ notify(): void;
3692
+ remove(file: TFile): void;
3693
+ }
3694
+ /**
3695
+ * @public
3696
+ * Suggestion for a link to a file
3697
+ */
3698
+ export interface LinkSuggestion {
3699
+ /**
3700
+ * Resolved link note alias.
3701
+ */
3702
+ alias?: string;
3703
+ /**
3704
+ * File that is suggested. `null` if the link cannot be resolved.
3705
+ */
3706
+ file: TFile | null;
3707
+ /**
3708
+ * Path to the file if the link can be resolved.
3709
+ * Link text if the link cannot be resolved.
3710
+ */
3711
+ path: string;
3712
+ }
3713
+ /** @public */
3714
+ export interface MetadataCacheFileCacheRecord extends Record<string, FileCacheEntry> {
3715
+ }
3716
+ /** @public */
3717
+ export interface MetadataCacheMetadataCacheRecord extends Record<string, CachedMetadata> {
3718
+ }
3719
+ /** @public */
3720
+ export interface SuggestionContainer<T> {
3721
+ /**
3722
+ * Which suggestions should be picked from
3723
+ */
3724
+ chooser: EditorSuggest<T>;
3725
+ /**
3726
+ * Pop-up element that displays the suggestions
3727
+ */
3728
+ containerEl: HTMLElement;
3729
+ /**
3730
+ * The currently focused item
3731
+ */
3732
+ selectedItem: number;
3733
+ /**
3734
+ * List of all possible suggestions as elements
3735
+ */
3736
+ suggestions: HTMLElement[];
3737
+ /**
3738
+ * List of all possible suggestions as data
3739
+ */
3740
+ values: SearchResult[];
3741
+ /**
3742
+ * Amount of suggestions that can be displayed at once within containerEl
3743
+ */
3744
+ get numVisibleItems(): number;
3745
+ /**
3746
+ * Height in pixels of the selected item
3747
+ */
3748
+ get rowHeight(): number;
3749
+ /**
3750
+ * Add an empty message with provided text
3751
+ */
3752
+ addMessage(text: string): HTMLElement;
3753
+ /**
3754
+ * Add suggestion to container
3755
+ */
3756
+ addSuggestion(suggestion: SearchResult): void;
3757
+ /**
3758
+ * Set selected item to one specified by index, if keyboard navigation, force scroll into view
3759
+ *
3760
+ * @remark Prefer setSelectedItem, which clamps the index to within suggestions array
3761
+ */
3762
+ forceSetSelectedItem(index: number, event: Event): void;
3763
+ /**
3764
+ * Move selected item to next suggestion
3765
+ */
3766
+ moveDown(event: KeyboardEvent): boolean;
3767
+ /**
3768
+ * Move selected item to previous suggestion
3769
+ */
3770
+ moveUp(event: KeyboardEvent): boolean;
3771
+ /**
3772
+ * Process click on suggestion item
3773
+ */
3774
+ onSuggestionClick(event: MouseEvent, element: HTMLElement): void;
3775
+ /**
3776
+ * Process hover on suggestion item
3777
+ */
3778
+ onSuggestionMouseover(event: MouseEvent, element: HTMLElement): unknown;
3779
+ /**
3780
+ * Move selected item to the one in the next 'page' (next visible block)
3781
+ */
3782
+ pageDown(event: KeyboardEvent): boolean;
3783
+ /**
3784
+ * Move selected item to the one in the previous 'page' (previous visible block)
3785
+ */
3786
+ pageUp(event: KeyboardEvent): boolean;
3787
+ /**
3788
+ * Set selected item to one specified by index, invokes forceSetSelectedItem
3789
+ */
3790
+ setSelectedItem(index: number, event: Event): void;
3791
+ /**
3792
+ * Empties original container and adds multiple suggestions
3793
+ */
3794
+ setSuggestions(suggestions: SearchResult[]): void;
3795
+ /**
3796
+ * Use currently selected suggestion as the accepted one
3797
+ */
3798
+ useSelectedItem(event: Event): boolean;
3799
+ }
3800
+ /**
3801
+ * @remark `BaseEditor` is never used in the Obsidian codebase, but is exposed in the Obsidian module as `Editor`.
3802
+ * However, most editor components actually make use of the extended `Editor`, so this interface is purposely
3803
+ * named to `BaseEditor` to not require any casting for most purposes (or overriding the `editor` property type
3804
+ * for all components).
3805
+ * @todo Potential risk of confusion when `Editor` is constructed from the Obsidian module, as it only has the
3806
+ * methods from `BaseEditor`, *not* `Editor`
3807
+ */
3808
+ /** @public */
3809
+ export interface BaseEditor {
3810
+ /**
3811
+ * CodeMirror editor instance
3812
+ */
3813
+ cm: EditorView;
3814
+ /**
3815
+ * HTML instance the CM editor is attached to
3816
+ */
3817
+ containerEl: HTMLElement;
3818
+ /**
3819
+ * Clean-up function executed after indenting lists
3820
+ */
3821
+ afterIndent(): void;
3822
+ /**
3823
+ * Expand text
3824
+ *
3825
+ * @internal
3826
+ */
3827
+ expandText(): void;
3828
+ /**
3829
+ * Indents a list by one level
3830
+ */
3831
+ indentList(): void;
3832
+ /**
3833
+ * Insert a template callout at the current cursor position
3834
+ */
3835
+ insertCallout(): void;
3836
+ /**
3837
+ * Insert a template code block at the current cursor position
3838
+ */
3839
+ insertCodeblock(): void;
3840
+ /**
3841
+ * Insert a markdown link at the current cursor position
3842
+ */
3843
+ insertLink(): void;
3844
+ /**
3845
+ * Insert a mathjax equation block at the current cursor position
3846
+ */
3847
+ insertMathJax(): void;
3848
+ /**
3849
+ * Insert specified text at the current cursor position
3850
+ *
3851
+ * @remark Might be broken, inserts at the end of the document
3852
+ */
3853
+ insertText(text: string): void;
3854
+ /**
3855
+ * Inserts a new line and continues a markdown bullet point list at the same level
3856
+ */
3857
+ newlineAndIndentContinueMarkdownList(): void;
3858
+ /**
3859
+ * Inserts a new line at the same indent level
3860
+ */
3861
+ newlineAndIndentOnly(): void;
3862
+ /**
3863
+ * Get the character position at a mouse event
3864
+ */
3865
+ posAtMouse(e: MouseEvent): EditorPosition;
3866
+ /**
3867
+ * Toggles blockquote syntax on paragraph under cursor
3868
+ */
3869
+ toggleBlockquote(): void;
3870
+ /**
3871
+ * Toggle bullet point list syntax on paragraph under cursor
3872
+ */
3873
+ toggleBulletList(): void;
3874
+ /**
3875
+ * Toggle checkbox syntax on paragraph under cursor
3876
+ */
3877
+ toggleCheckList(): void;
3878
+ /**
3879
+ * Toggle numbered list syntax on paragraph under cursor
3880
+ */
3881
+ toggleNumberList(): void;
3882
+ /**
3883
+ * Convert word under cursor into a wikilink
3884
+ *
3885
+ * @param embed - Whether to embed the link or not
3886
+ */
3887
+ triggerWikiLink(embed: boolean): void;
3888
+ /**
3889
+ * Unindents a list by one level
3890
+ */
3891
+ unindentList(): void;
3892
+ }
3893
+ /** @public */
3894
+ export interface SerializedWorkspaceSidedock extends SerializedWorkspaceItem {
3895
+ collapsed: boolean;
3896
+ width: number;
3897
+ }
3898
+
3
3899
  export {};