forked from eth-p/jest-environment-obsidian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.ts
3698 lines (3317 loc) · 87.3 KB
/
todo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
export {};
// Remaining type definitions to create an implementation for.
// declare global {
// interface EventListenerInfo {
// selector: string;
// listener: Function;
// options?: boolean | AddEventListenerOptions;
// callback: Function;
// }
// interface HTMLElement extends Element {
// _EVENTS?: {
// [K in keyof HTMLElementEventMap]?: EventListenerInfo[];
// };
// on<K extends keyof HTMLElementEventMap>(this: HTMLElement, type: K, selector: string, listener: (this: HTMLElement, ev: HTMLElementEventMap[K], delegateTarget: HTMLElement) => any, options?: boolean | AddEventListenerOptions): void;
// off<K extends keyof HTMLElementEventMap>(this: HTMLElement, type: K, selector: string, listener: (this: HTMLElement, ev: HTMLElementEventMap[K], delegateTarget: HTMLElement) => any, options?: boolean | AddEventListenerOptions): void;
// onClickEvent(this: HTMLElement, listener: (this: HTMLElement, ev: MouseEvent) => any, options?: boolean | AddEventListenerOptions): void;
// /**
// * @param listener - the callback to call when this node is inserted into the DOM.
// * @param once - if true, this will only fire once and then unhook itself.
// * @returns destroy - a function to remove the event handler to avoid memory leaks.
// */
// onNodeInserted(this: HTMLElement, listener: () => any, once?: boolean): () => void;
// /**
// * @param listener - the callback to call when this node has been migrated to another window.
// * @returns destroy - a function to remove the event handler to avoid memory leaks.
// */
// onWindowMigrated(this: HTMLElement, listener: (win: Window) => any): () => void;
// trigger(eventType: string): void;
// }
// interface Document {
// _EVENTS?: {
// [K in keyof DocumentEventMap]?: EventListenerInfo[];
// };
// on<K extends keyof DocumentEventMap>(this: Document, type: K, selector: string, listener: (this: Document, ev: DocumentEventMap[K], delegateTarget: HTMLElement) => any, options?: boolean | AddEventListenerOptions): void;
// off<K extends keyof DocumentEventMap>(this: Document, type: K, selector: string, listener: (this: Document, ev: DocumentEventMap[K], delegateTarget: HTMLElement) => any, options?: boolean | AddEventListenerOptions): void;
// }
// interface UIEvent extends Event {
// targetNode: Node | null;
// win: Window;
// doc: Document;
// /**
// * Cross-window capable instanceof check, a drop-in replacement
// * for instanceof checks on UIEvents.
// * @param type
// */
// instanceOf<T>(type: {
// new (...data: any[]): T;
// }): this is T;
// }
// }
// declare global {
// interface Touch {
// touchType: 'stylus' | 'direct';
// }
// }
// /**
// * @public
// */
// export class AbstractTextComponent<T extends HTMLInputElement | HTMLTextAreaElement> extends ValueComponent<string> {
// /**
// * @public
// */
// inputEl: T;
// /**
// * @public
// */
// constructor(inputEl: T);
// /**
// * @public
// */
// setDisabled(disabled: boolean): this;
// /**
// * @public
// */
// getValue(): string;
// /**
// * @public
// */
// setValue(value: string): this;
// /**
// * @public
// */
// setPlaceholder(placeholder: string): this;
// /**
// * @public
// */
// onChanged(): void;
// /**
// * @public
// */
// onChange(callback: (value: string) => any): this;
// }
// /**
// * @public
// */
// export class App {
// /** @public */
// keymap: Keymap;
// /** @public */
// scope: Scope;
// /** @public */
// workspace: Workspace;
// /** @public */
// vault: Vault;
// /** @public */
// metadataCache: MetadataCache;
// /** @public */
// fileManager: FileManager;
// /**
// * The last known user interaction event, to help commands find out what modifier keys are pressed.
// * @public
// */
// lastEvent: UserEvent | null;
// }
// /** @public */
// export function arrayBufferToBase64(buffer: ArrayBuffer): string;
// /** @public */
// export function arrayBufferToHex(data: ArrayBuffer): string;
// /** @public */
// export function base64ToArrayBuffer(base64: string): ArrayBuffer;
// /**
// * @public
// */
// export interface BlockCache extends CacheItem {
// /** @public */
// id: string;
// }
// /**
// * @public
// */
// export interface BlockSubpathResult extends SubpathResult {
// /**
// * @public
// */
// type: 'block';
// /**
// * @public
// */
// block: BlockCache;
// /**
// * @public
// */
// list?: ListItemCache;
// }
// /**
// * @public
// */
// export class ButtonComponent extends BaseComponent {
// /**
// * @public
// */
// buttonEl: HTMLButtonElement;
// /**
// * @public
// */
// constructor(containerEl: HTMLElement);
// /**
// * @public
// */
// setDisabled(disabled: boolean): this;
// /**
// * @public
// */
// setCta(): this;
// /**
// * @public
// */
// removeCta(): this;
// /**
// * @public
// */
// setWarning(): this;
// /**
// * @public
// */
// setTooltip(tooltip: string, options?: TooltipOptions): this;
// /**
// * @public
// */
// setButtonText(name: string): this;
// /**
// * @public
// */
// setIcon(icon: IconName): this;
// /**
// * @public
// */
// setClass(cls: string): this;
// /**
// * @public
// */
// onClick(callback: (evt: MouseEvent) => any): this;
// }
// /**
// * @public
// */
// export interface CachedMetadata {
// /**
// * @public
// */
// links?: LinkCache[];
// /**
// * @public
// */
// embeds?: EmbedCache[];
// /**
// * @public
// */
// tags?: TagCache[];
// /**
// * @public
// */
// headings?: HeadingCache[];
// /**
// * Sections are root level markdown blocks, which can be used to divide the document up.
// * @public
// */
// sections?: SectionCache[];
// /**
// * @public
// */
// listItems?: ListItemCache[];
// /**
// * @public
// */
// frontmatter?: FrontMatterCache;
// /**
// * @public
// */
// blocks?: Record<string, BlockCache>;
// }
// /**
// * @public
// */
// export interface CacheItem {
// /**
// * @public
// */
// position: Pos;
// }
// /** @public */
// export interface CloseableComponent {
// /** @public */
// close(): any;
// }
// /**
// * Color picker component. Values are by default 6-digit hash-prefixed hex strings like `#000000`.
// * @public
// */
// export class ColorComponent extends ValueComponent<string> {
// /**
// * @public
// */
// constructor(containerEl: HTMLElement);
// /**
// * @public
// */
// getValue(): HexString;
// /**
// * @public
// */
// getValueRgb(): RGB;
// /**
// * @public
// */
// getValueHsl(): HSL;
// /**
// * @public
// */
// setValue(value: HexString): this;
// /**
// * @public
// */
// setValueRgb(rgb: RGB): this;
// /**
// * @public
// */
// setValueHsl(hsl: HSL): this;
// /**
// * @public
// */
// onChange(callback: (value: string) => any): this;
// }
// /**
// * @public
// */
// export interface Command {
// /**
// * Globally unique ID to identify this command.
// * @public
// */
// id: string;
// /**
// * Human friendly name for searching.
// * @public
// */
// name: string;
// /**
// * Icon ID to be used in the toolbar.
// * @public
// */
// icon?: IconName;
// /** @public */
// mobileOnly?: boolean;
// /**
// * Whether holding the hotkey should repeatedly trigger this command. Defaults to false.
// * @public
// */
// repeatable?: boolean;
// /**
// * Simple callback, triggered globally.
// * @public
// */
// callback?: () => any;
// /**
// * Complex callback, overrides the simple callback.
// * Used to "check" whether your command can be performed in the current circumstances.
// * For example, if your command requires the active focused pane to be a MarkdownSourceView, then
// * you should only return true if the condition is satisfied. Returning false or undefined causes
// * the command to be hidden from the command palette.
// *
// * @param checking - Whether the command palette is just "checking" if your command should show right now.
// * If checking is true, then this function should not perform any action.
// * If checking is false, then this function should perform the action.
// * @returns Whether this command can be executed at the moment.
// * @public
// */
// checkCallback?: (checking: boolean) => boolean | void;
// /**
// * A command callback that is only triggered when the user is in an editor.
// * Overrides `callback` and `checkCallback`
// * @public
// */
// editorCallback?: (editor: Editor, ctx: MarkdownView | MarkdownFileInfo) => any;
// /**
// * A command callback that is only triggered when the user is in an editor.
// * Overrides `editorCallback`, `callback` and `checkCallback`
// * @public
// */
// editorCheckCallback?: (checking: boolean, editor: Editor, ctx: MarkdownView | MarkdownFileInfo) => boolean | void;
// /**
// * Sets the default hotkey. It is recommended for plugins to avoid setting default hotkeys if possible,
// * to avoid conflicting hotkeys with one that's set by the user, even though customized hotkeys have higher priority.
// * @public
// */
// hotkeys?: Hotkey[];
// }
// /** @public */
// export type Constructor<T> = abstract new (...args: any[]) => T;
// /**
// * @public
// */
// export interface DataAdapter {
// /**
// * @public
// */
// getName(): string;
// /**
// * @public
// */
// exists(normalizedPath: string, sensitive?: boolean): Promise<boolean>;
// /**
// * @public
// */
// stat(normalizedPath: string): Promise<Stat | null>;
// /**
// * @public
// */
// list(normalizedPath: string): Promise<ListedFiles>;
// /**
// * @public
// */
// read(normalizedPath: string): Promise<string>;
// /**
// * @public
// */
// readBinary(normalizedPath: string): Promise<ArrayBuffer>;
// /**
// * @public
// */
// write(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// writeBinary(normalizedPath: string, data: ArrayBuffer, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// append(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// process(normalizedPath: string, fn: (data: string) => string, options?: DataWriteOptions): Promise<string>;
// /**
// * @public
// */
// getResourcePath(normalizedPath: string): string;
// /**
// * @public
// */
// mkdir(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// trashSystem(normalizedPath: string): Promise<boolean>;
// /**
// * @public
// */
// trashLocal(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// rmdir(normalizedPath: string, recursive: boolean): Promise<void>;
// /**
// * @public
// */
// remove(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// rename(normalizedPath: string, normalizedNewPath: string): Promise<void>;
// /**
// * @public
// */
// copy(normalizedPath: string, normalizedNewPath: string): Promise<void>;
// }
// /**
// * @public
// */
// export interface DataWriteOptions {
// /** @public */
// ctime?: number;
// /** @public */
// mtime?: number;
// }
// /**
// * A standard debounce function.
// *
// * @param cb - The function to call.
// * @param timeout - The timeout to wait.
// * @param resetTimer - Whether to reset the timeout when the debouncer is called again.
// * @returns a debounced function that takes the same parameter as the original function.
// * @public
// */
// export function debounce<T extends unknown[], V>(cb: (...args: [...T]) => V, timeout?: number, resetTimer?: boolean): Debouncer<T, V>;
// /** @public */
// export interface Debouncer<T extends unknown[], V> {
// /** @public */
// (...args: [...T]): this;
// /** @public */
// cancel(): this;
// }
// /**
// * @public
// */
// export class DropdownComponent extends ValueComponent<string> {
// /**
// * @public
// */
// selectEl: HTMLSelectElement;
// /**
// * @public
// */
// constructor(containerEl: HTMLElement);
// /**
// * @public
// */
// setDisabled(disabled: boolean): this;
// /**
// * @public
// */
// addOption(value: string, display: string): this;
// /**
// * @public
// */
// addOptions(options: Record<string, string>): this;
// /**
// * @public
// */
// getValue(): string;
// /**
// * @public
// */
// setValue(value: string): this;
// /**
// * @public
// */
// onChange(callback: (value: string) => any): this;
// }
// /**
// * @public
// */
// export abstract class EditableFileView extends FileView {
// }
// /**
// * A common interface that bridges the gap between CodeMirror 5 and CodeMirror 6.
// * @public
// */
// export abstract class Editor {
// /** @public */
// getDoc(): this;
// /** @public */
// abstract refresh(): void;
// /** @public */
// abstract getValue(): string;
// /** @public */
// abstract setValue(content: string): void;
// /**
// * Get the text at line (0-indexed)
// * @public
// */
// abstract getLine(line: number): string;
// /** @public */
// setLine(n: number, text: string): void;
// /**
// * Gets the number of lines in the document
// * @public
// */
// abstract lineCount(): number;
// /** @public */
// abstract lastLine(): number;
// /** @public */
// abstract getSelection(): string;
// /** @public */
// somethingSelected(): boolean;
// /** @public */
// abstract getRange(from: EditorPosition, to: EditorPosition): string;
// /** @public */
// abstract replaceSelection(replacement: string, origin?: string): void;
// /** @public */
// abstract replaceRange(replacement: string, from: EditorPosition, to?: EditorPosition, origin?: string): void;
// /** @public */
// abstract getCursor(string?: 'from' | 'to' | 'head' | 'anchor'): EditorPosition;
// /** @public */
// abstract listSelections(): EditorSelection[];
// /** @public */
// setCursor(pos: EditorPosition | number, ch?: number): void;
// /** @public */
// abstract setSelection(anchor: EditorPosition, head?: EditorPosition): void;
// /** @public */
// abstract setSelections(ranges: EditorSelectionOrCaret[], main?: number): void;
// /** @public */
// abstract focus(): void;
// /** @public */
// abstract blur(): void;
// /** @public */
// abstract hasFocus(): boolean;
// /** @public */
// abstract getScrollInfo(): {
// /** @public */
// top: number;
// /** @public */
// left: number;
// };
// /** @public */
// abstract scrollTo(x?: number | null, y?: number | null): void;
// /** @public */
// abstract scrollIntoView(range: EditorRange, center?: boolean): void;
// /** @public */
// abstract undo(): void;
// /** @public */
// abstract redo(): void;
// /** @public */
// abstract exec(command: EditorCommandName): void;
// /** @public */
// abstract transaction(tx: EditorTransaction, origin?: string): void;
// /** @public */
// abstract wordAt(pos: EditorPosition): EditorRange | null;
// /** @public */
// abstract posToOffset(pos: EditorPosition): number;
// /** @public */
// abstract offsetToPos(offset: number): EditorPosition;
// /** @public */
// processLines<T>(read: (line: number, lineText: string) => T | null, write: (line: number, lineText: string, value: T | null) => EditorChange | void, ignoreEmpty?: boolean): void;
// }
// /** @public */
// export interface EditorChange extends EditorRangeOrCaret {
// /** @public */
// text: string;
// }
// /** @public */
// export type EditorCommandName = 'goUp' | 'goDown' | 'goLeft' | 'goRight' | 'goStart' | 'goEnd' | 'goWordLeft' | 'goWordRight' | 'indentMore' | 'indentLess' | 'newlineAndIndent' | 'swapLineUp' | 'swapLineDown' | 'deleteLine' | 'toggleFold' | 'foldAll' | 'unfoldAll';
// /**
// * Use this StateField to get a reference to the EditorView
// * @public
// */
// export const editorEditorField: StateField<EditorView>;
// /**
// * Use this StateField to get information about this markdown editor, such as the associated file, or the Editor.
// * @public
// */
// export const editorInfoField: StateField<MarkdownFileInfo>;
// /**
// * Use this StateField to check whether Live Preview is active
// * @public
// */
// export const editorLivePreviewField: StateField<boolean>;
// /** @public */
// export interface EditorPosition {
// /** @public */
// line: number;
// /** @public */
// ch: number;
// }
// /** @public */
// export interface EditorRange {
// /** @public */
// from: EditorPosition;
// /** @public */
// to: EditorPosition;
// }
// /** @public */
// export interface EditorRangeOrCaret {
// /** @public */
// from: EditorPosition;
// /** @public */
// to?: EditorPosition;
// }
// /** @public */
// export interface EditorScrollInfo {
// /** @public */
// left: number;
// /** @public */
// top: number;
// /** @public */
// width: number;
// /** @public */
// height: number;
// /** @public */
// clientWidth: number;
// /** @public */
// clientHeight: number;
// }
// /** @public */
// export interface EditorSelection {
// /** @public */
// anchor: EditorPosition;
// /** @public */
// head: EditorPosition;
// }
// /** @public */
// export interface EditorSelectionOrCaret {
// /** @public */
// anchor: EditorPosition;
// /** @public */
// head?: EditorPosition;
// }
// /** @public */
// export abstract class EditorSuggest<T> extends PopoverSuggest<T> {
// /**
// * Current suggestion context, containing the result of `onTrigger`.
// * This will be null any time the EditorSuggest is not supposed to run.
// * @public
// */
// context: EditorSuggestContext | null;
// /**
// * Override this to use a different limit for suggestion items
// * @public
// */
// limit: number;
// /** @public */
// constructor(app: App);
// /**
// * @public
// */
// setInstructions(instructions: Instruction[]): void;
// /**
// * Based on the editor line and cursor position, determine if this EditorSuggest should be triggered at this moment.
// * Typically, you would run a regular expression on the current line text before the cursor.
// * Return null to indicate that this editor suggest is not supposed to be triggered.
// *
// * Please be mindful of performance when implementing this function, as it will be triggered very often (on each keypress).
// * Keep it simple, and return null as early as possible if you determine that it is not the right time.
// * @public
// */
// abstract onTrigger(cursor: EditorPosition, editor: Editor, file: TFile | null): EditorSuggestTriggerInfo | null;
// /**
// * Generate suggestion items based on this context. Can be async, but preferably sync.
// * When generating async suggestions, you should pass the context along.
// * @public
// */
// abstract getSuggestions(context: EditorSuggestContext): T[] | Promise<T[]>;
// }
// /** @public */
// export interface EditorSuggestContext extends EditorSuggestTriggerInfo {
// /** @public */
// editor: Editor;
// /** @public */
// file: TFile;
// }
// /** @public */
// export interface EditorSuggestTriggerInfo {
// /**
// * The start position of the triggering text. This is used to position the popover.
// * @public
// */
// start: EditorPosition;
// /**
// * The end position of the triggering text. This is used to position the popover.
// * @public
// */
// end: EditorPosition;
// /**
// * They query string (usually the text between start and end) that will be used to generate the suggestion content.
// * @public
// */
// query: string;
// }
// /** @public */
// export interface EditorTransaction {
// /** @public */
// replaceSelection?: string;
// /** @public */
// changes?: EditorChange[];
// /**
// * Multiple selections, overrides `selection`.
// * @public
// */
// selections?: EditorRangeOrCaret[];
// /** @public */
// selection?: EditorRangeOrCaret;
// }
// /**
// * Use this StateField to get a reference to the MarkdownView.
// * This is now deprecated because it is possible for an editor to not be associated with a MarkdownView.
// * @see {@link editorInfoField} - for the new recommended field to use.
// * @public
// * @deprecated
// */
// export const editorViewField: StateField<MarkdownView>;
// /**
// * @public
// */
// export interface EmbedCache extends ReferenceCache {
// }
// /**
// * @public
// */
// export class ExtraButtonComponent extends BaseComponent {
// /**
// * @public
// */
// extraSettingsEl: HTMLElement;
// /**
// * @public
// */
// constructor(containerEl: HTMLElement);
// /**
// * @public
// */
// setDisabled(disabled: boolean): this;
// /**
// * @public
// */
// setTooltip(tooltip: string, options?: TooltipOptions): this;
// /**
// * @public
// */
// setIcon(icon: IconName): this;
// /**
// * @public
// */
// onClick(callback: () => any): this;
// }
// /**
// * Manage the creation, deletion and renaming of files from the UI.
// * @public
// */
// export class FileManager {
// /**
// * Gets the folder that new files should be saved to, given the user's preferences.
// * @param sourcePath - The path to the current open/focused file,
// * used when the user wants new files to be created "in the same folder".
// * Use an empty string if there is no active file.
// * @param newFilePath - The path to the file that will be newly created,
// * used to infer what settings to use based on the path's extension.
// * @public
// */
// getNewFileParent(sourcePath: string, newFilePath?: string): TFolder;
// /**
// * Rename or move a file safely, and update all links to it depending on the user's preferences.
// * @param file - the file to rename
// * @param newPath - the new path for the file
// * @public
// */
// renameFile(file: TAbstractFile, newPath: string): Promise<void>;
// /**
// * Generate a markdown link based on the user's preferences.
// * @param file - the file to link to.
// * @param sourcePath - where the link is stored in, used to compute relative links.
// * @param subpath - A subpath, starting with `#`, used for linking to headings or blocks.
// * @param alias - The display text if it's to be different than the file name. Pass empty string to use file name.
// * @public
// */
// generateMarkdownLink(file: TFile, sourcePath: string, subpath?: string, alias?: string): string;
// /**
// * Atomically read, modify, and save the frontmatter of a note.
// * The frontmatter is passed in as a JS object, and should be mutated directly to achieve the desired result.
// *
// * Remember to handle errors thrown by this method.
// *
// * @param file - the file to be modified. Must be a markdown file.
// * @param fn - a callback function which mutates the frontMatter object synchronously.
// * @throws YAMLParseError if the YAML parsing fails
// * @throws any errors that your callback function throws
// * @public
// */
// processFrontMatter(file: TFile, fn: (frontMatter: any) => void): Promise<void>;
// }
// /**
// * @public
// */
// export interface FileStats {
// /** @public */
// ctime: number;
// /** @public */
// mtime: number;
// /** @public */
// size: number;
// }
// /**
// * @public
// */
// export class FileSystemAdapter implements DataAdapter {
// /**
// * @public
// */
// getName(): string;
// /**
// * @public
// */
// getBasePath(): string;
// /**
// * @public
// */
// mkdir(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// trashSystem(normalizedPath: string): Promise<boolean>;
// /**
// * @public
// */
// trashLocal(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// rmdir(normalizedPath: string, recursive: boolean): Promise<void>;
// /**
// * @public
// */
// read(normalizedPath: string): Promise<string>;
// /**
// * @public
// */
// readBinary(normalizedPath: string): Promise<ArrayBuffer>;
// /**
// * @public
// */
// write(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// writeBinary(normalizedPath: string, data: ArrayBuffer, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// append(normalizedPath: string, data: string, options?: DataWriteOptions): Promise<void>;
// /**
// * @public
// */
// process(normalizedPath: string, fn: (data: string) => string, options?: DataWriteOptions): Promise<string>;
// /**
// * @public
// */
// getResourcePath(normalizedPath: string): string;
// /**
// * Returns the file:// path of this file
// * @public
// */
// getFilePath(normalizedPath: string): string;
// /**
// * @public
// */
// remove(normalizedPath: string): Promise<void>;
// /**
// * @public
// */
// rename(normalizedPath: string, normalizedNewPath: string): Promise<void>;
// /**
// * @public
// */
// copy(normalizedPath: string, normalizedNewPath: string): Promise<void>;
// /**
// * @public
// */
// exists(normalizedPath: string, sensitive?: boolean): Promise<boolean>;
// /**
// * @public
// */
// stat(normalizedPath: string): Promise<Stat | null>;
// /**
// * @public
// */
// list(normalizedPath: string): Promise<ListedFiles>;
// /**
// * @public
// */
// getFullPath(normalizedPath: string): string;
// /**
// * @public
// */
// static readLocalFile(path: string): Promise<ArrayBuffer>;
// /**
// * @public
// */
// static mkdir(path: string): Promise<void>;
// }