obsidian-typings 2.3.2 → 2.3.3

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.
package/dist/types.d.ts CHANGED
@@ -6651,895 +6651,229 @@ declare module "obsidian" {
6651
6651
  setSize(size: number): void;
6652
6652
  }
6653
6653
  }
6654
- /** @public */
6655
- export interface ElectronWindow extends BrowserWindow {
6656
- _browserViews: unknown;
6657
- _events: unknown;
6658
- _eventsCount: unknown;
6659
- devToolsWebContents: unknown;
6660
- }
6661
- /** @public */
6662
- export interface FrameDom {
6663
- eWin: Electron.BrowserWindow;
6664
- isMac: boolean;
6665
- leftButtonContainerEl: HTMLDivElement;
6666
- titleBarEl: HTMLDivElement;
6667
- titleBarInnerEl: HTMLDivElement;
6668
- titleBarTextEl: HTMLDivElement;
6669
- win: Window;
6670
- updateStatus(): void;
6671
- updateTitle(): void;
6672
- }
6673
- /** @public */
6674
- export interface Localization {
6675
- [key: string]: string | Localization;
6654
+ declare module "obsidian" {
6655
+ interface TextFileView extends EditableFileView {
6656
+ /**
6657
+ * Whether current file is dirty (different from saved contents)
6658
+ */
6659
+ dirty: boolean;
6660
+ /**
6661
+ * Whether editor should be rendered as plaintext
6662
+ */
6663
+ isPlaintext: boolean;
6664
+ /**
6665
+ * The data that was last saved
6666
+ */
6667
+ lastSavedData: null | string;
6668
+ /**
6669
+ * Whether on saving, the file should be saved again (for dirtiness checks)
6670
+ */
6671
+ saveAgain: boolean;
6672
+ /**
6673
+ * Whether the file is currently saving
6674
+ */
6675
+ saving: boolean;
6676
+ /** @todo Documentation incomplete */
6677
+ loadFileInternal(file: TFile, clear: boolean): Promise<unknown>;
6678
+ /**
6679
+ * Is called when the vault has a 'modify' event. Reloads the file if the view is currently not saving the file and the modified file is the file in this view.
6680
+ * @param file The modified file
6681
+ */
6682
+ onModify(file: TFile): void;
6683
+ /**
6684
+ * Saves the opened file
6685
+ * @param clear If set clears the editor under certain conditions
6686
+ */
6687
+ save(clear?: boolean): Promise<void>;
6688
+ /**
6689
+ * If any changes(dirty = true) in the file forces the file to save
6690
+ */
6691
+ saveImmediately(): void;
6692
+ /**
6693
+ * Set the data to the editor. This is used to load the file contents.
6694
+ * @param data The new data
6695
+ * @param clear If clear is set, then it means we're opening a completely different file. In that case, you should call clear(), or implement a slightly more efficient clearing mechanism given the new data to be set.
6696
+ */
6697
+ setData(data: string, clear: boolean): void;
6698
+ }
6676
6699
  }
6677
- /** @public */
6678
- export interface SQLError {
6679
- code: number;
6680
- message: string;
6700
+ declare module "obsidian" {
6701
+ /** @todo Documentation incomplete */
6702
+ interface View extends Component {
6703
+ app: App;
6704
+ /**
6705
+ * Whether the leaf may close the view
6706
+ */
6707
+ closeable: boolean;
6708
+ containerEl: HTMLElement;
6709
+ /**
6710
+ * The icon string
6711
+ */
6712
+ icon: IconName;
6713
+ leaf: WorkspaceLeaf;
6714
+ /**
6715
+ * Closes the view
6716
+ */
6717
+ close(): Promise<void>;
6718
+ /**
6719
+ * Gets the ephemeral (non-persistent) state of the editor
6720
+ */
6721
+ getEphemeralState(): {};
6722
+ /**
6723
+ * Returns the icon name
6724
+ */
6725
+ getIcon(): IconName;
6726
+ /**
6727
+ * Returns the placement of the tooltip
6728
+ */
6729
+ getSideTooltipPlacement(): "left" | "right" | undefined;
6730
+ /**
6731
+ * Returns the current state of the view
6732
+ */
6733
+ getState(): {};
6734
+ /**
6735
+ * Handle copy event on metadata editor and serialize properties
6736
+ */
6737
+ handleCopy(event: ClipboardEvent): void;
6738
+ /**
6739
+ * Handle cut event on metadata editor and serialize and remove properties
6740
+ */
6741
+ handleCut(event: ClipboardEvent): void;
6742
+ /**
6743
+ * Handle paste event of properties on metadata editor
6744
+ */
6745
+ handlePaste(event: ClipboardEvent): void;
6746
+ /** @deprecated use `onPaneMenu` instead */
6747
+ onHeaderMenu(e: unknown): void;
6748
+ /**
6749
+ * Adds the menu items to the menu
6750
+ * @param menu the menu to fill
6751
+ */
6752
+ onTabMenu(menu: Menu): void;
6753
+ /**
6754
+ * Opens the view
6755
+ * @param parentEl The node the view get attached to
6756
+ */
6757
+ open(parentEl: Node): Promise<void>;
6758
+ /**
6759
+ * Set the ephemeral (non-persistent) state of the editor
6760
+ */
6761
+ setEphemeralState(state: any & {
6762
+ focus: boolean;
6763
+ focusOnMobile: boolean;
6764
+ cursor: EditorRangeOrCaret;
6765
+ }): void;
6766
+ /** @todo Documentation incomplete */
6767
+ setState(state: any, result: ViewStateResult): Promise<void>;
6768
+ }
6681
6769
  }
6682
- /** @public */
6683
- export interface SQLResultSetRowList {
6684
- length: number;
6685
- item(index: number): any;
6770
+ declare module "obsidian" {
6771
+ interface EditableFileView extends FileView {
6772
+ /**
6773
+ * The file that is currently being renamed
6774
+ */
6775
+ fileBeingRenamed: null | TFile;
6776
+ /**
6777
+ * Is called when the titleEl looses focus
6778
+ * Event type: 'blur'
6779
+ */
6780
+ onTitleBlur(): Promise<void>;
6781
+ /**
6782
+ * Is called when the titleEl is changed
6783
+ * Event type: 'input'
6784
+ * @param titleEl The titleEl of the view
6785
+ */
6786
+ onTitleChange(titleEl: HTMLElement): void;
6787
+ /**
6788
+ * Is called when the titleEl gains focus
6789
+ * Event type: 'focus'
6790
+ */
6791
+ onTitleFocus(): void;
6792
+ /**
6793
+ * Is called when the titleEl is focused and a keydown is triggered
6794
+ * Event type: 'keydown'
6795
+ * @param event The KeyboardEvent which triggered this function
6796
+ */
6797
+ onTitleKeydown(event: KeyboardEvent): void;
6798
+ /**
6799
+ * Is called when the titleEl is focused and a paste event is triggered
6800
+ * Event type: 'paste'
6801
+ * @param titleEl The titleEl of the view
6802
+ * @param event The ClipboardEvent which triggered this function
6803
+ */
6804
+ onTitlePaste(titleEl: HTMLElement, event: ClipboardEvent): void;
6805
+ /**
6806
+ * Updates the file to match the updated title
6807
+ * @param titleEl The current titleEl
6808
+ */
6809
+ saveTitle(titleEl: HTMLElement): Promise<void>;
6810
+ }
6686
6811
  }
6687
- /** @public */
6688
- export interface SQLResultSet {
6689
- insertId: number;
6690
- rows: SQLResultSetRowList;
6691
- rowsAffected: number;
6692
- }
6693
- /** @public */
6694
- export interface SQLTransaction {
6695
- executeSql(sqlStatement: string, arguments?: unknown[], callback?: (transaction: SQLTransaction, resultSet: SQLResultSet) => void, errorCallback?: (transaction: SQLTransaction, error: SQLError) => boolean): void;
6696
- }
6697
- /** @public */
6698
- export interface Database {
6699
- version: string;
6700
- changeVersion(oldVersion: string, newVersion: string, callback?: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
6701
- readTransaction(callback: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
6702
- transaction(callback: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
6703
- }
6704
- declare global {
6705
- /**
6706
- * Global reference to the app
6707
- * @public
6708
- * @deprecated - Prefer not to use this value directly.
6709
- */
6710
- var app: App;
6711
- /**
6712
- * @public
6713
- */
6714
- var bl: typeof Object.hasOwnProperty;
6715
- /**
6716
- * @public
6717
- */
6718
- var blinkfetch: typeof fetch;
6719
- /**
6720
- * @public
6721
- */
6722
- var blinkFormData: typeof FormData;
6723
- /**
6724
- * @public
6725
- */
6726
- var blinkHeaders: typeof Headers;
6727
- /**
6728
- * @public
6729
- */
6730
- var blinkRequest: typeof Request;
6731
- /**
6732
- * @public
6733
- */
6734
- var blinkResponse: typeof Response;
6735
- /**
6736
- * @public
6737
- */
6738
- var Capacitor: typeof _Capacitor;
6739
- /**
6740
- * @public
6741
- */
6742
- var CapacitorPlatforms: typeof _CapacitorPlatforms;
6743
- /**
6744
- * @public
6745
- */
6746
- var Cf: typeof Object.getOwnPropertyDescriptors;
6747
- /**
6748
- * @public
6749
- *
6750
- * Commented out because the global variable is already declared in the `@types/codemirror` package.
6751
- */
6752
- // var CodeMirror: typeof import('codemirror');
6753
- /**
6754
- * @public
6755
- */
6756
- var CodeMirrorAdapter: CodeMirrorAdapter2;
6757
- /**
6758
- * DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.
6759
- * @public
6760
- *
6761
- * Commented out because the global variable is already declared in the `@types/dompurify` package.
6762
- */
6763
- // var DOMPurify: typeof import('dompurify);
6764
- /**
6765
- * @public
6766
- */
6767
- var El: typeof Object.propertyIsEnumerable;
6768
- /**
6769
- * @public
6770
- */
6771
- var electron: typeof import("electron");
6772
- /**
6773
- * @public
6774
- */
6775
- var electronWindow: ElectronWindow;
6776
- /**
6777
- * @public
6778
- */
6779
- var frameDom: FrameDom;
6780
- /**
6781
- * Constructor for the Capacitor file system adapter.
6782
- * @public
6783
- */
6784
- var FS: new (dir: string) => CapacitorAdapterFs;
6785
- /**
6786
- * @public
6787
- */
6788
- var globalEnhance: () => void;
6789
- /**
6790
- * @public
6791
- */
6792
- var i18next: typeof _i18next & {
6793
- observers: object;
6794
- isLanguageChangingTo: string | undefined;
6795
- logger: unknown;
6796
- translator: unknown;
6797
- };
6798
- /**
6799
- * vim.js based on https://github.com/codemirror/CodeMirror/commit/793c9e65e09ec7fba3f4f5aaf366b3d36e1a709e (2021-12-04)
6800
- *
6801
- * Modified from https://github.com/nightwing/cm6-vim-mode-experiment/blob/master/src/vim.js 103a9b5 2021-12-03
6802
- *
6803
- * CodeMirror, copyright (c) by Marijn Haverbeke and others
6804
- *
6805
- * Distributed under an MIT license: https://codemirror.net/5/LICENSE
6806
- *
6807
- * Supported keybindings:
6808
- * Too many to list. Refer to defaultKeymap below.
6809
- *
6810
- * Supported Ex commands:
6811
- * Refer to defaultExCommandMap below.
6812
- *
6813
- * Registers: unnamed, -, ., :, /, _, a-z, A-Z, 0-9
6814
- * (Does not respect the special case for number registers when delete
6815
- * operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
6816
- * TODO: Implement the remaining registers.
6817
- *
6818
- * Marks: a-z, A-Z, and 0-9
6819
- * TODO: Implement the remaining special marks. They have more complex
6820
- * behavior.
6821
- *
6822
- * Events:
6823
- * 'vim-mode-change' - raised on the editor anytime the current mode changes,
6824
- * Event object: {mode: "visual", subMode: "linewise"}
6825
- *
6826
- * Code structure:
6827
- * 1. Default keymap
6828
- * 2. Variable declarations and short basic helpers
6829
- * 3. Instance (External API) implementation
6830
- * 4. Internal state tracking objects (input state, counter) implementation
6831
- * and instantiation
6832
- * 5. Key handler (the main command dispatcher) implementation
6833
- * 6. Motion, operator, and action implementations
6834
- * 7. Helper functions for the key handler, motions, operators, and actions
6835
- * 8. Set up Vim to work as a keymap for CodeMirror.
6836
- * 9. Ex command implementations.
6837
- *
6838
- * @public
6839
- */
6840
- var initVimMode: (CodeMirror: CodeMirrorAdapter2) => VimApi;
6841
- /**
6842
- * @public
6843
- */
6844
- var li: (target: object, source: object) => object;
6845
- /**
6846
- * @public
6847
- */
6848
- var mo: (target: object, propertyNames: string[]) => object;
6849
- /**
6850
- * Parse, validate, manipulate, and display dates in javascript.
6851
- * @public
6852
- *
6853
- * Commented out because the global variable is already declared in the `moment` package.
6854
- */
6855
- // var moment: typeof import('moment');
6856
- /**
6857
- * @public
6858
- */
6859
- var mr: typeof Object.getOwnPropertySymbols;
6860
- /**
6861
- * Notification component. Use to present timely, high-value information.
6862
- * @public
6863
- */
6864
- /**
6865
- * @public
6866
- */
6867
- var Notice: typeof _Notice;
6868
- /**
6869
- * Invoke obsidian protocol action.
6870
- * @public
6871
- */
6872
- var OBS_ACT: (obsidianProtocolData: ObsidianProtocolData) => void;
6873
- /**
6874
- * @public
6875
- */
6876
- var OBSIDIAN_DEFAULT_I18N: Localization;
6877
- /**
6878
- * @public
6879
- */
6880
- var openDatabase: (name: string, version: string, displayName: string, estimatedSize: number, creationCallback?: (database: Database) => void) => Database;
6881
- /**
6882
- * @public
6883
- *
6884
- * Commented out because the global variable is already declared in the `@types/pixi.js` package.
6885
- */
6886
- // var PIXI: typeof import('pixi.js');
6887
- /**
6888
- * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
6889
- * Returns the text value of the response.
6890
- * @public
6891
- */
6892
- var request: typeof _request;
6893
- /**
6894
- * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
6895
- * @public
6896
- */
6897
- var requestUrl: typeof _requestUrl;
6898
- /**
6899
- * @public
6900
- *
6901
- * Commented out because the global variable is already declared in the `scrypt-js` package.
6902
- */
6903
- // var scrypt: typeof import('scrypt-js');
6904
- /**
6905
- * Select a language file location.
6906
- * @public
6907
- */
6908
- var selectLanguageFileLocation: () => void;
6909
- /**
6910
- * @public
6911
- */
6912
- var Sf: typeof Object.defineProperties;
6913
- /**
6914
- * @public
6915
- */
6916
- var St: (target: object, source: object | undefined) => object;
6917
- /**
6918
- * @public
6919
- */
6920
- var temp1: Database["changeVersion"];
6921
- /**
6922
- * @public
6923
- */
6924
- var titlebarStyle: string;
6925
- /**
6926
- * @public
6927
- */
6928
- var Tl: (target: object, propertyName: string, propertyValue: unknown) => unknown;
6929
- /**
6930
- * @public
6931
- */
6932
- var TurndownService: typeof _TurndownService;
6933
- /**
6934
- * @public
6935
- */
6936
- var WebView: HTMLElement & {
6937
- new (): HTMLElement;
6938
- };
6939
- /**
6940
- * @public
6941
- */
6942
- var wf: typeof Object.defineProperty;
6943
- }
6944
- declare global {
6945
- interface DomElementInfo {
6946
- [eventName: `on${string}`]: EventListenerOrEventListenerObject;
6947
- }
6948
- }
6949
- /** @public */
6950
- export interface IFramedMarkdownEditor extends MarkdownScrollableEditView {
6951
- /**
6952
- * Function that cleans up the iframe and listeners
6953
- */
6954
- cleanup: null | (() => void);
6955
- /**
6956
- * Element where the editor is embedded into
6957
- */
6958
- iframeEl: null | HTMLIFrameElement;
6959
- /**
6960
- * Executes cleanup function if exists
6961
- */
6962
- cleanupIframe(): void;
6963
- /**
6964
- * Constructs extensions for the editor based on user settings
6965
- *
6966
- * @remark Creates extension for overriding escape keymap to showPreview
6967
- */
6968
- getDynamicExtensions(): Extension[];
6969
- /**
6970
- * Loads the iframe element and prepare cleanup function
6971
- */
6972
- onIframeLoad(): void;
6973
- /**
6974
- * Execute cleanup of the iframe
6975
- */
6976
- onunload(): void;
6977
- /**
6978
- * Execute functionality on CM editor state update
6979
- */
6980
- onUpdate(update: ViewUpdate, changed: boolean): void;
6981
- }
6982
- /** @public */
6983
- export interface EmbeddedEditorView extends Component {
6984
- /**
6985
- * Reference to the app
6986
- */
6987
- app: App;
6988
- /**
6989
- * Container element for the embedded view
6990
- */
6991
- containerEl: HTMLElement;
6992
- /**
6993
- * Whether the view is currently saving
6994
- */
6995
- dirty: boolean;
6996
- /**
6997
- * Whether the editor may be edited
6998
- *
6999
- * @remark Fun fact, setting this to true and calling showEditor() for embedded MD views, allows them to be edited.
7000
- * Though the experience is a little buggy
7001
- */
7002
- editable: boolean;
7003
- /**
7004
- * Editor component of the view
7005
- */
7006
- editMode?: IFramedMarkdownEditor | undefined;
7007
- /**
7008
- * Container in which the editor is embedded
7009
- */
7010
- editorEl: HTMLElement;
7011
- /**
7012
- * File to which the view is attached
7013
- */
7014
- file: null | TFile;
7015
- /**
7016
- * Hover element container
7017
- */
7018
- hoverPopover: null | HoverPopover;
7019
- /**
7020
- * Element containing the preview for the embedded markdown
7021
- */
7022
- previewEl: HTMLElement;
7023
- /**
7024
- * Preview component of the view
7025
- */
7026
- previewMode: MarkdownPreviewView;
7027
- /**
7028
- * Current state of the editor
7029
- */
7030
- state: {} | EditorState | unknown;
7031
- /**
7032
- * Text contents being embedded
7033
- */
7034
- text: string;
7035
- /**
7036
- * Whether the view renders contents using an iFrame
7037
- */
7038
- useIframe: boolean;
7039
- /**
7040
- * Get the preview editor, if exists
7041
- */
7042
- get editor(): IFramedMarkdownEditor | null;
7043
- /**
7044
- * Get the path to the file, if any file registered
7045
- */
7046
- get path(): string;
7047
- /**
7048
- * Get the scroll of the file renderer component
7049
- */
7050
- get scroll(): unknown;
7051
- /**
7052
- * Destroy edit component editor and save contents if specified
7053
- */
7054
- destroyEditor(save?: boolean): void;
7055
- /**
7056
- * Gets currently active mode (editMode returns 'source')
7057
- */
7058
- getMode(): "source" | "preview";
7059
- /**
7060
- * On load of editor, show preview
7061
- */
7062
- onload(): void;
7063
- /**
7064
- * Trigger markdown scroll on workspace
7065
- */
7066
- onMarkdownScroll(): void;
7067
- /**
7068
- * On unload of editor, destroy editor and unset workspace activeEditor
7069
- */
7070
- onunload(): void;
7071
- /**
7072
- * Debounced save of contents
7073
- */
7074
- requestSave(): void;
7075
- /**
7076
- * Debounced save of editor folds
7077
- */
7078
- requestSaveFolds(): void;
7079
- /**
7080
- * Set file contents
7081
- */
7082
- save(data: string, save?: boolean): void;
7083
- /**
7084
- * Set the state of the editor
7085
- */
7086
- set(data: string, clear: boolean): void;
7087
- /**
7088
- * Reveal the editor if editable widget and applies saved state
7089
- */
7090
- showEditor(): void;
7091
- /**
7092
- * Reveal preview mode and destroy editor, save if specified
7093
- */
7094
- showPreview(save?: boolean): void;
7095
- /**
7096
- * Reveal search component in file renderer component
7097
- */
7098
- showSearch(replace?: boolean): void;
7099
- /**
7100
- * Toggle between edit and preview mode
7101
- */
7102
- toggleMode(): void;
7103
- }
7104
- /** @public */
7105
- export interface WidgetEditorView extends EmbeddedEditorView {
7106
- /**
7107
- * Data after reference
7108
- */
7109
- after: string;
7110
- /**
7111
- * Data before reference
7112
- */
7113
- before: string;
7114
- /**
7115
- * Full file contents
7116
- */
7117
- data: string;
7118
- /**
7119
- * File being currently renamed
7120
- */
7121
- fileBeingRenamed: null | TFile;
7122
- /**
7123
- * Current heading
7124
- */
7125
- heading: string;
7126
- /**
7127
- * Indent
7128
- */
7129
- indent: string;
7130
- /**
7131
- * Inline title element
7132
- */
7133
- inlineTitleEl: HTMLElement;
7134
- /**
7135
- * Full inline content string
7136
- */
7137
- lastSavedData: null | string;
7138
- /**
7139
- * Whether embedding should be saved twice on save
7140
- */
7141
- saveAgain: boolean;
7142
- /**
7143
- * Whether the widget is currently saving
7144
- */
7145
- saving: boolean;
7146
- /**
7147
- * Subpath reference of the path
7148
- */
7149
- subpath: string;
7150
- /**
7151
- * Whether the subpath was not found in the cache
7152
- */
7153
- subpathNotFound: boolean;
7154
- /**
7155
- * Push/pop current scope
7156
- */
7157
- applyScope(scope: Scope): void;
7158
- /**
7159
- * Get the current folds of the editor
7160
- */
7161
- getFoldInfo(): null | FoldInfo;
7162
- /**
7163
- * Splice incoming data at according to subpath for correct reference, then update heading and render
7164
- */
7165
- loadContents(data: string, cache: CachedMetadata): void;
7166
- /**
7167
- * Load file from cache based on stored path
7168
- */
7169
- loadFile(): Promise<void>;
7170
- /**
7171
- * Load file and check if data is different from last saved data, then loads contents
7172
- */
7173
- loadFileInternal(data: string, cache?: CachedMetadata): void;
7174
- /**
7175
- * Update representation on file finished updating
7176
- */
7177
- onFileChanged(file: TFile, data: string, cache: CachedMetadata): void;
7178
- /**
7179
- * Update representation on file rename
7180
- */
7181
- onFileRename(file: TAbstractFile, oldPath: string): void;
7182
- /**
7183
- * On loading widget, register vault change and rename events
7184
- */
7185
- onload(): void;
7186
- /**
7187
- * Save fold made in the editor to foldManager
7188
- */
7189
- onMarkdownFold(): void;
7190
- /** @internal On change of editor title element */
7191
- onTitleChange(element: HTMLElement): void;
7192
- /** @internal On keypress on editor title element */
7193
- onTitleKeydown(event: KeyboardEvent): void;
7194
- /** @internal On pasting on editor title element */
7195
- onTitlePaste(element: HTMLElement, event: ClipboardEvent): void;
7196
- /**
7197
- * On unloading widget, unload component and remove scope
7198
- */
7199
- onunload(): void;
7200
- /**
7201
- * Save changes made in editable widget
7202
- */
7203
- save(data: string, delayed?: boolean): Promise<void>;
7204
- /**
7205
- * On blur widget, save title
7206
- */
7207
- saveTitle(element: HTMLElement): void;
7208
- /**
7209
- * Show preview of widget
7210
- */
7211
- showPreview(show?: boolean): void;
7212
- }
7213
- /** @public */
7214
- export interface CanvasLeaf extends WorkspaceLeaf {
7215
- }
7216
- /** @public */
7217
- export interface FileSuggestManager {
7218
- /**
7219
- * Reference to the app
7220
- */
7221
- app: App;
7222
- /**
7223
- * Selection of files and their paths that can be matched to
7224
- */
7225
- fileSuggestions: null | {
7226
- file: TFile | null;
7227
- path: string;
7228
- }[];
7229
- /**
7230
- * Whether search should be vault-wide rather than scoped to current file
7231
- */
7232
- global: boolean;
7233
- /**
7234
- * Type of suggestions that should be provided
7235
- */
7236
- mode: "file" | "heading" | "block" | "display" | string;
7237
- /**
7238
- * Executor of the search
7239
- */
7240
- runnable: null | Runnable;
7241
- /**
7242
- * Get suggestions for block query
7243
- */
7244
- getBlockSuggestions(runner: Runnable, file: TFile, text: string): Promise<SearchResult[]>;
7245
- /**
7246
- * Get suggestions for display alias query
7247
- */
7248
- getDisplaySuggestions(runner: Runnable, linkpath: string, subpath: string, alias: string): Promise<SearchResult[]>;
7249
- /**
7250
- * Get suggestions for file query
7251
- */
7252
- getFileSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7253
- /**
7254
- * Get suggestions for global block query
7255
- */
7256
- getGlobalBlockSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7257
- /**
7258
- * Get suggestions for global heading query
7259
- */
7260
- getGlobalHeadingSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7261
- /**
7262
- * Get suggestions for file heading query
7263
- */
7264
- getHeadingSuggestions(runner: Runnable, file: TFile, text: string): Promise<SearchResult[]>;
7265
- /** @internal Generate instructions for specific actions in suggestion manager (e.g. accept, select, ...) */
7266
- getInstructions(): [
7267
- {
7268
- command: "string";
7269
- purpose: "string";
7270
- }
7271
- ];
7272
- /**
7273
- * Determine the source path of current context
7274
- */
7275
- getSourcePath(): null | string;
7276
- /**
7277
- * Get suggestions for current input text
7278
- *
7279
- * @remark Type is determined from text: e.g. [[Thi]] will give completions for files, [[Thi^]] for blocks, etc.
7280
- */
7281
- getSuggestionsAsync(runner: Runnable, text: string): Promise<SearchResult[]>;
7282
- /**
7283
- * Match search fragments to a block
7284
- */
7285
- matchBlock(path: string, file: TFile, block: BlockCache, sourcePath: null | string, content: string, text_parts: string[]): SearchResult | null;
7286
- }
7287
- /** @todo Documentation incomplete */
7288
- /** @public */
7289
- export interface Account {
7290
- /**
7291
- * The company associated with the activated commercial license
7292
- */
7293
- company: string;
7294
- /**
7295
- * The email address associated with the account
7296
- */
7297
- email: string;
7298
- expiry: number;
7299
- key: string | undefined;
7300
- keyValidation: string;
7301
- /**
7302
- * The license available to the account
7303
- */
7304
- license: "" | "insider";
7305
- /**
7306
- * Profile name
7307
- */
7308
- name: string;
7309
- seats: number;
7310
- token: string;
7311
- }
7312
- /** @todo Documentation incomplete */
7313
- /** @public */
7314
- export interface FileSuggest<T> extends EditorSuggest<T> {
7315
- /**
7316
- * Manages fetching of suggestions from metadatacache
7317
- */
7318
- suggestManager: FileSuggestManager;
7319
- }
7320
- declare module "obsidian" {
7321
- interface TextFileView extends EditableFileView {
7322
- /**
7323
- * Whether current file is dirty (different from saved contents)
7324
- */
7325
- dirty: boolean;
7326
- /**
7327
- * Whether editor should be rendered as plaintext
7328
- */
7329
- isPlaintext: boolean;
7330
- /**
7331
- * The data that was last saved
7332
- */
7333
- lastSavedData: null | string;
7334
- /**
7335
- * Whether on saving, the file should be saved again (for dirtiness checks)
7336
- */
7337
- saveAgain: boolean;
7338
- /**
7339
- * Whether the file is currently saving
7340
- */
7341
- saving: boolean;
7342
- /** @todo Documentation incomplete */
7343
- loadFileInternal(file: TFile, clear: boolean): Promise<unknown>;
7344
- /**
7345
- * Is called when the vault has a 'modify' event. Reloads the file if the view is currently not saving the file and the modified file is the file in this view.
7346
- * @param file The modified file
7347
- */
7348
- onModify(file: TFile): void;
7349
- /**
7350
- * Saves the opened file
7351
- * @param clear If set clears the editor under certain conditions
7352
- */
7353
- save(clear?: boolean): Promise<void>;
7354
- /**
7355
- * If any changes(dirty = true) in the file forces the file to save
7356
- */
7357
- saveImmediately(): void;
7358
- /**
7359
- * Set the data to the editor. This is used to load the file contents.
7360
- * @param data The new data
7361
- * @param clear If clear is set, then it means we're opening a completely different file. In that case, you should call clear(), or implement a slightly more efficient clearing mechanism given the new data to be set.
7362
- */
7363
- setData(data: string, clear: boolean): void;
7364
- }
7365
- }
7366
- declare module "obsidian" {
7367
- /** @todo Documentation incomplete */
7368
- interface View extends Component {
7369
- app: App;
7370
- /**
7371
- * Whether the leaf may close the view
7372
- */
7373
- closeable: boolean;
7374
- containerEl: HTMLElement;
7375
- /**
7376
- * The icon string
7377
- */
7378
- icon: IconName;
7379
- leaf: WorkspaceLeaf;
7380
- /**
7381
- * Closes the view
7382
- */
7383
- close(): Promise<void>;
7384
- /**
7385
- * Gets the ephemeral (non-persistent) state of the editor
7386
- */
7387
- getEphemeralState(): {};
7388
- /**
7389
- * Returns the icon name
7390
- */
7391
- getIcon(): IconName;
7392
- /**
7393
- * Returns the placement of the tooltip
7394
- */
7395
- getSideTooltipPlacement(): "left" | "right" | undefined;
7396
- /**
7397
- * Returns the current state of the view
7398
- */
7399
- getState(): {};
7400
- /**
7401
- * Handle copy event on metadata editor and serialize properties
7402
- */
7403
- handleCopy(event: ClipboardEvent): void;
7404
- /**
7405
- * Handle cut event on metadata editor and serialize and remove properties
7406
- */
7407
- handleCut(event: ClipboardEvent): void;
7408
- /**
7409
- * Handle paste event of properties on metadata editor
7410
- */
7411
- handlePaste(event: ClipboardEvent): void;
7412
- /** @deprecated use `onPaneMenu` instead */
7413
- onHeaderMenu(e: unknown): void;
7414
- /**
7415
- * Adds the menu items to the menu
7416
- * @param menu the menu to fill
7417
- */
7418
- onTabMenu(menu: Menu): void;
7419
- /**
7420
- * Opens the view
7421
- * @param parentEl The node the view get attached to
7422
- */
7423
- open(parentEl: Node): Promise<void>;
7424
- /**
7425
- * Set the ephemeral (non-persistent) state of the editor
7426
- */
7427
- setEphemeralState(state: any & {
7428
- focus: boolean;
7429
- focusOnMobile: boolean;
7430
- cursor: EditorRangeOrCaret;
7431
- }): void;
7432
- /** @todo Documentation incomplete */
7433
- setState(state: any, result: ViewStateResult): Promise<void>;
7434
- }
7435
- }
7436
- declare module "obsidian" {
7437
- interface EditableFileView extends FileView {
7438
- /**
7439
- * The file that is currently being renamed
7440
- */
7441
- fileBeingRenamed: null | TFile;
7442
- /**
7443
- * Is called when the titleEl looses focus
7444
- * Event type: 'blur'
7445
- */
7446
- onTitleBlur(): Promise<void>;
7447
- /**
7448
- * Is called when the titleEl is changed
7449
- * Event type: 'input'
7450
- * @param titleEl The titleEl of the view
7451
- */
7452
- onTitleChange(titleEl: HTMLElement): void;
7453
- /**
7454
- * Is called when the titleEl gains focus
7455
- * Event type: 'focus'
7456
- */
7457
- onTitleFocus(): void;
7458
- /**
7459
- * Is called when the titleEl is focused and a keydown is triggered
7460
- * Event type: 'keydown'
7461
- * @param event The KeyboardEvent which triggered this function
7462
- */
7463
- onTitleKeydown(event: KeyboardEvent): void;
7464
- /**
7465
- * Is called when the titleEl is focused and a paste event is triggered
7466
- * Event type: 'paste'
7467
- * @param titleEl The titleEl of the view
7468
- * @param event The ClipboardEvent which triggered this function
7469
- */
7470
- onTitlePaste(titleEl: HTMLElement, event: ClipboardEvent): void;
7471
- /**
7472
- * Updates the file to match the updated title
7473
- * @param titleEl The current titleEl
7474
- */
7475
- saveTitle(titleEl: HTMLElement): Promise<void>;
7476
- }
7477
- }
7478
- declare module "obsidian" {
7479
- /** @todo Documentation incomplete */
7480
- interface ItemView extends View {
7481
- /**
7482
- * Container of actions for the view
7483
- */
7484
- actionsEl: HTMLElement;
7485
- /**
7486
- * Back button element for changing view history
7487
- */
7488
- backButtonEl: HTMLButtonElement;
7489
- /**
7490
- * Whether the view may be dropped anywhere in workspace
7491
- */
7492
- canDropAnywhere: boolean;
7493
- /**
7494
- * Forward button element for changing view history
7495
- */
7496
- forwardButtonEl: HTMLButtonElement;
7497
- /**
7498
- * Header bar container of view
7499
- */
7500
- headerEl: HTMLElement;
7501
- /**
7502
- * Icon element for the view (for dragging)
7503
- */
7504
- iconEl: HTMLElement;
7505
- /**
7506
- * Anchor button for revealing more view actions
7507
- */
7508
- moreOptionsButtonEl: HTMLAnchorElement;
7509
- /**
7510
- * Container for the title of the view
7511
- */
7512
- titleContainerEl: HTMLElement;
7513
- /**
7514
- * Title element for the view
7515
- */
7516
- titleEl: HTMLElement;
7517
- /**
7518
- * Title of the parent
7519
- *
7520
- * @remark Used for breadcrumbs rendering
7521
- */
7522
- titleParentEl: HTMLElement;
7523
- /**
7524
- * Adds an action button to the header of the view
7525
- * @param icon - The icon for the action
7526
- * @param title - The title for the action
7527
- * @param callback - Callback to execute on click
7528
- */
7529
- addAction(icon: IconName, title: string, callback: (evt: MouseEvent) => any): HTMLElement;
7530
- /** @todo Documentation incomplete */
7531
- handleDrop(event: DragEvent, t: unknown, n: unknown): unknown;
7532
- /** @todo Documentation incomplete */
7533
- onGroupChange(): void;
7534
- /** @todo Documentation incomplete */
7535
- onMoreOptions(event: Event): void;
7536
- /** @deprecated use onPaneMenu instead */
7537
- onMoreOptionsMenu(e: unknown): void;
7538
- /**
7539
- * Updates the navigation buttons depending on the history
7540
- */
7541
- updateNavButtons(): void;
7542
- }
6812
+ declare module "obsidian" {
6813
+ /** @todo Documentation incomplete */
6814
+ interface ItemView extends View {
6815
+ /**
6816
+ * Container of actions for the view
6817
+ */
6818
+ actionsEl: HTMLElement;
6819
+ /**
6820
+ * Back button element for changing view history
6821
+ */
6822
+ backButtonEl: HTMLButtonElement;
6823
+ /**
6824
+ * Whether the view may be dropped anywhere in workspace
6825
+ */
6826
+ canDropAnywhere: boolean;
6827
+ /**
6828
+ * Forward button element for changing view history
6829
+ */
6830
+ forwardButtonEl: HTMLButtonElement;
6831
+ /**
6832
+ * Header bar container of view
6833
+ */
6834
+ headerEl: HTMLElement;
6835
+ /**
6836
+ * Icon element for the view (for dragging)
6837
+ */
6838
+ iconEl: HTMLElement;
6839
+ /**
6840
+ * Anchor button for revealing more view actions
6841
+ */
6842
+ moreOptionsButtonEl: HTMLAnchorElement;
6843
+ /**
6844
+ * Container for the title of the view
6845
+ */
6846
+ titleContainerEl: HTMLElement;
6847
+ /**
6848
+ * Title element for the view
6849
+ */
6850
+ titleEl: HTMLElement;
6851
+ /**
6852
+ * Title of the parent
6853
+ *
6854
+ * @remark Used for breadcrumbs rendering
6855
+ */
6856
+ titleParentEl: HTMLElement;
6857
+ /**
6858
+ * Adds an action button to the header of the view
6859
+ * @param icon - The icon for the action
6860
+ * @param title - The title for the action
6861
+ * @param callback - Callback to execute on click
6862
+ */
6863
+ addAction(icon: IconName, title: string, callback: (evt: MouseEvent) => any): HTMLElement;
6864
+ /** @todo Documentation incomplete */
6865
+ handleDrop(event: DragEvent, t: unknown, n: unknown): unknown;
6866
+ /** @todo Documentation incomplete */
6867
+ onGroupChange(): void;
6868
+ /** @todo Documentation incomplete */
6869
+ onMoreOptions(event: Event): void;
6870
+ /** @deprecated use onPaneMenu instead */
6871
+ onMoreOptionsMenu(e: unknown): void;
6872
+ /**
6873
+ * Updates the navigation buttons depending on the history
6874
+ */
6875
+ updateNavButtons(): void;
6876
+ }
7543
6877
  }
7544
6878
  declare module "obsidian" {
7545
6879
  interface MarkdownView extends TextFileView {
@@ -7762,52 +7096,718 @@ declare module "obsidian" {
7762
7096
  updateShowBacklinks(): void;
7763
7097
  }
7764
7098
  }
7765
- declare module "obsidian" {
7766
- /** @todo Documentation incomplete */
7767
- interface FileView extends ItemView {
7768
- /**
7769
- * Whether the view may be run without an attached file
7770
- */
7771
- allowNoFile: boolean;
7772
- /**
7773
- * Determines whether the specified file extension can be opened in this view.
7774
- * @param extension The file extension to be evaluated
7775
- */
7776
- canAcceptExtension(extension: string): boolean;
7777
- /**
7778
- * Get view state for sync plugin
7779
- */
7780
- getSyncViewState(): any;
7781
- /**
7782
- * Loads the file with the onLoadFile function
7783
- * @param file The File to load
7784
- */
7785
- loadFile(file: TFile): Promise<unknown>;
7786
- /**
7787
- * Updates the view if it contains the deleted file
7788
- * @param file The file that is deleted
7789
- */
7790
- onDelete(file: TFile): Promise<void>;
7791
- /**
7792
- * Is called when a file get loaded
7793
- * @param file The file that is loaded
7794
- */
7795
- onLoadFile(file: TFile): Promise<void>;
7796
- /**
7797
- * Updates the view information based on the new file name
7798
- * @param file The file that is renamed
7799
- */
7800
- onRename(file: TFile): Promise<void>;
7801
- /**
7802
- * Is called when a file get unloaded
7803
- * @param file The file that is unloaded
7804
- */
7805
- onUnloadFile(file: TFile): Promise<void>;
7806
- /** @todo Documentation incomplete */
7807
- renderBreadcrumbs(): void;
7808
- /** @todo Documentation incomplete */
7809
- syncState(e: boolean): Promise<unknown>;
7810
- }
7099
+ declare module "obsidian" {
7100
+ /** @todo Documentation incomplete */
7101
+ interface FileView extends ItemView {
7102
+ /**
7103
+ * Whether the view may be run without an attached file
7104
+ */
7105
+ allowNoFile: boolean;
7106
+ /**
7107
+ * Determines whether the specified file extension can be opened in this view.
7108
+ * @param extension The file extension to be evaluated
7109
+ */
7110
+ canAcceptExtension(extension: string): boolean;
7111
+ /**
7112
+ * Get view state for sync plugin
7113
+ */
7114
+ getSyncViewState(): any;
7115
+ /**
7116
+ * Loads the file with the onLoadFile function
7117
+ * @param file The File to load
7118
+ */
7119
+ loadFile(file: TFile): Promise<unknown>;
7120
+ /**
7121
+ * Updates the view if it contains the deleted file
7122
+ * @param file The file that is deleted
7123
+ */
7124
+ onDelete(file: TFile): Promise<void>;
7125
+ /**
7126
+ * Is called when a file get loaded
7127
+ * @param file The file that is loaded
7128
+ */
7129
+ onLoadFile(file: TFile): Promise<void>;
7130
+ /**
7131
+ * Updates the view information based on the new file name
7132
+ * @param file The file that is renamed
7133
+ */
7134
+ onRename(file: TFile): Promise<void>;
7135
+ /**
7136
+ * Is called when a file get unloaded
7137
+ * @param file The file that is unloaded
7138
+ */
7139
+ onUnloadFile(file: TFile): Promise<void>;
7140
+ /** @todo Documentation incomplete */
7141
+ renderBreadcrumbs(): void;
7142
+ /** @todo Documentation incomplete */
7143
+ syncState(e: boolean): Promise<unknown>;
7144
+ }
7145
+ }
7146
+ /** @public */
7147
+ export interface ElectronWindow extends BrowserWindow {
7148
+ _browserViews: unknown;
7149
+ _events: unknown;
7150
+ _eventsCount: unknown;
7151
+ devToolsWebContents: unknown;
7152
+ }
7153
+ /** @public */
7154
+ export interface FrameDom {
7155
+ eWin: Electron.BrowserWindow;
7156
+ isMac: boolean;
7157
+ leftButtonContainerEl: HTMLDivElement;
7158
+ titleBarEl: HTMLDivElement;
7159
+ titleBarInnerEl: HTMLDivElement;
7160
+ titleBarTextEl: HTMLDivElement;
7161
+ win: Window;
7162
+ updateStatus(): void;
7163
+ updateTitle(): void;
7164
+ }
7165
+ /** @public */
7166
+ export interface Localization {
7167
+ [key: string]: string | Localization;
7168
+ }
7169
+ /** @public */
7170
+ export interface SQLError {
7171
+ code: number;
7172
+ message: string;
7173
+ }
7174
+ /** @public */
7175
+ export interface SQLResultSetRowList {
7176
+ length: number;
7177
+ item(index: number): any;
7178
+ }
7179
+ /** @public */
7180
+ export interface SQLResultSet {
7181
+ insertId: number;
7182
+ rows: SQLResultSetRowList;
7183
+ rowsAffected: number;
7184
+ }
7185
+ /** @public */
7186
+ export interface SQLTransaction {
7187
+ executeSql(sqlStatement: string, arguments?: unknown[], callback?: (transaction: SQLTransaction, resultSet: SQLResultSet) => void, errorCallback?: (transaction: SQLTransaction, error: SQLError) => boolean): void;
7188
+ }
7189
+ /** @public */
7190
+ export interface Database {
7191
+ version: string;
7192
+ changeVersion(oldVersion: string, newVersion: string, callback?: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
7193
+ readTransaction(callback: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
7194
+ transaction(callback: (transaction: SQLTransaction) => void, errorCallback?: (error: SQLError) => void, successCallback?: () => void): void;
7195
+ }
7196
+ declare global {
7197
+ /**
7198
+ * Global reference to the app
7199
+ * @public
7200
+ * @deprecated - Prefer not to use this value directly.
7201
+ */
7202
+ var app: App;
7203
+ /**
7204
+ * @public
7205
+ */
7206
+ var bl: typeof Object.hasOwnProperty;
7207
+ /**
7208
+ * @public
7209
+ */
7210
+ var blinkfetch: typeof fetch;
7211
+ /**
7212
+ * @public
7213
+ */
7214
+ var blinkFormData: typeof FormData;
7215
+ /**
7216
+ * @public
7217
+ */
7218
+ var blinkHeaders: typeof Headers;
7219
+ /**
7220
+ * @public
7221
+ */
7222
+ var blinkRequest: typeof Request;
7223
+ /**
7224
+ * @public
7225
+ */
7226
+ var blinkResponse: typeof Response;
7227
+ /**
7228
+ * @public
7229
+ */
7230
+ var Capacitor: typeof _Capacitor;
7231
+ /**
7232
+ * @public
7233
+ */
7234
+ var CapacitorPlatforms: typeof _CapacitorPlatforms;
7235
+ /**
7236
+ * @public
7237
+ */
7238
+ var Cf: typeof Object.getOwnPropertyDescriptors;
7239
+ /**
7240
+ * @public
7241
+ *
7242
+ * Commented out because the global variable is already declared in the `@types/codemirror` package.
7243
+ */
7244
+ // var CodeMirror: typeof import('codemirror');
7245
+ /**
7246
+ * @public
7247
+ */
7248
+ var CodeMirrorAdapter: CodeMirrorAdapter2;
7249
+ /**
7250
+ * DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.
7251
+ * @public
7252
+ *
7253
+ * Commented out because the global variable is already declared in the `@types/dompurify` package.
7254
+ */
7255
+ // var DOMPurify: typeof import('dompurify);
7256
+ /**
7257
+ * @public
7258
+ */
7259
+ var El: typeof Object.propertyIsEnumerable;
7260
+ /**
7261
+ * @public
7262
+ */
7263
+ var electron: typeof import("electron");
7264
+ /**
7265
+ * @public
7266
+ */
7267
+ var electronWindow: ElectronWindow;
7268
+ /**
7269
+ * @public
7270
+ */
7271
+ var frameDom: FrameDom;
7272
+ /**
7273
+ * Constructor for the Capacitor file system adapter.
7274
+ * @public
7275
+ */
7276
+ var FS: new (dir: string) => CapacitorAdapterFs;
7277
+ /**
7278
+ * @public
7279
+ */
7280
+ var globalEnhance: () => void;
7281
+ /**
7282
+ * @public
7283
+ */
7284
+ var i18next: typeof _i18next & {
7285
+ observers: object;
7286
+ isLanguageChangingTo: string | undefined;
7287
+ logger: unknown;
7288
+ translator: unknown;
7289
+ };
7290
+ /**
7291
+ * vim.js based on https://github.com/codemirror/CodeMirror/commit/793c9e65e09ec7fba3f4f5aaf366b3d36e1a709e (2021-12-04)
7292
+ *
7293
+ * Modified from https://github.com/nightwing/cm6-vim-mode-experiment/blob/master/src/vim.js 103a9b5 2021-12-03
7294
+ *
7295
+ * CodeMirror, copyright (c) by Marijn Haverbeke and others
7296
+ *
7297
+ * Distributed under an MIT license: https://codemirror.net/5/LICENSE
7298
+ *
7299
+ * Supported keybindings:
7300
+ * Too many to list. Refer to defaultKeymap below.
7301
+ *
7302
+ * Supported Ex commands:
7303
+ * Refer to defaultExCommandMap below.
7304
+ *
7305
+ * Registers: unnamed, -, ., :, /, _, a-z, A-Z, 0-9
7306
+ * (Does not respect the special case for number registers when delete
7307
+ * operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
7308
+ * TODO: Implement the remaining registers.
7309
+ *
7310
+ * Marks: a-z, A-Z, and 0-9
7311
+ * TODO: Implement the remaining special marks. They have more complex
7312
+ * behavior.
7313
+ *
7314
+ * Events:
7315
+ * 'vim-mode-change' - raised on the editor anytime the current mode changes,
7316
+ * Event object: {mode: "visual", subMode: "linewise"}
7317
+ *
7318
+ * Code structure:
7319
+ * 1. Default keymap
7320
+ * 2. Variable declarations and short basic helpers
7321
+ * 3. Instance (External API) implementation
7322
+ * 4. Internal state tracking objects (input state, counter) implementation
7323
+ * and instantiation
7324
+ * 5. Key handler (the main command dispatcher) implementation
7325
+ * 6. Motion, operator, and action implementations
7326
+ * 7. Helper functions for the key handler, motions, operators, and actions
7327
+ * 8. Set up Vim to work as a keymap for CodeMirror.
7328
+ * 9. Ex command implementations.
7329
+ *
7330
+ * @public
7331
+ */
7332
+ var initVimMode: (CodeMirror: CodeMirrorAdapter2) => VimApi;
7333
+ /**
7334
+ * @public
7335
+ */
7336
+ var li: (target: object, source: object) => object;
7337
+ /**
7338
+ * @public
7339
+ */
7340
+ var mo: (target: object, propertyNames: string[]) => object;
7341
+ /**
7342
+ * Parse, validate, manipulate, and display dates in javascript.
7343
+ * @public
7344
+ *
7345
+ * Commented out because the global variable is already declared in the `moment` package.
7346
+ */
7347
+ // var moment: typeof import('moment');
7348
+ /**
7349
+ * @public
7350
+ */
7351
+ var mr: typeof Object.getOwnPropertySymbols;
7352
+ /**
7353
+ * Notification component. Use to present timely, high-value information.
7354
+ * @public
7355
+ */
7356
+ /**
7357
+ * @public
7358
+ */
7359
+ var Notice: typeof _Notice;
7360
+ /**
7361
+ * Invoke obsidian protocol action.
7362
+ * @public
7363
+ */
7364
+ var OBS_ACT: (obsidianProtocolData: ObsidianProtocolData) => void;
7365
+ /**
7366
+ * @public
7367
+ */
7368
+ var OBSIDIAN_DEFAULT_I18N: Localization;
7369
+ /**
7370
+ * @public
7371
+ */
7372
+ var openDatabase: (name: string, version: string, displayName: string, estimatedSize: number, creationCallback?: (database: Database) => void) => Database;
7373
+ /**
7374
+ * @public
7375
+ *
7376
+ * Commented out because the global variable is already declared in the `@types/pixi.js` package.
7377
+ */
7378
+ // var PIXI: typeof import('pixi.js');
7379
+ /**
7380
+ * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
7381
+ * Returns the text value of the response.
7382
+ * @public
7383
+ */
7384
+ var request: typeof _request;
7385
+ /**
7386
+ * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions.
7387
+ * @public
7388
+ */
7389
+ var requestUrl: typeof _requestUrl;
7390
+ /**
7391
+ * @public
7392
+ *
7393
+ * Commented out because the global variable is already declared in the `scrypt-js` package.
7394
+ */
7395
+ // var scrypt: typeof import('scrypt-js');
7396
+ /**
7397
+ * Select a language file location.
7398
+ * @public
7399
+ */
7400
+ var selectLanguageFileLocation: () => void;
7401
+ /**
7402
+ * @public
7403
+ */
7404
+ var Sf: typeof Object.defineProperties;
7405
+ /**
7406
+ * @public
7407
+ */
7408
+ var St: (target: object, source: object | undefined) => object;
7409
+ /**
7410
+ * @public
7411
+ */
7412
+ var temp1: Database["changeVersion"];
7413
+ /**
7414
+ * @public
7415
+ */
7416
+ var titlebarStyle: string;
7417
+ /**
7418
+ * @public
7419
+ */
7420
+ var Tl: (target: object, propertyName: string, propertyValue: unknown) => unknown;
7421
+ /**
7422
+ * @public
7423
+ */
7424
+ var TurndownService: typeof _TurndownService;
7425
+ /**
7426
+ * @public
7427
+ */
7428
+ var WebView: HTMLElement & {
7429
+ new (): HTMLElement;
7430
+ };
7431
+ /**
7432
+ * @public
7433
+ */
7434
+ var wf: typeof Object.defineProperty;
7435
+ }
7436
+ declare global {
7437
+ interface DomElementInfo {
7438
+ [eventName: `on${string}`]: EventListenerOrEventListenerObject;
7439
+ }
7440
+ }
7441
+ /** @public */
7442
+ export interface IFramedMarkdownEditor extends MarkdownScrollableEditView {
7443
+ /**
7444
+ * Function that cleans up the iframe and listeners
7445
+ */
7446
+ cleanup: null | (() => void);
7447
+ /**
7448
+ * Element where the editor is embedded into
7449
+ */
7450
+ iframeEl: null | HTMLIFrameElement;
7451
+ /**
7452
+ * Executes cleanup function if exists
7453
+ */
7454
+ cleanupIframe(): void;
7455
+ /**
7456
+ * Constructs extensions for the editor based on user settings
7457
+ *
7458
+ * @remark Creates extension for overriding escape keymap to showPreview
7459
+ */
7460
+ getDynamicExtensions(): Extension[];
7461
+ /**
7462
+ * Loads the iframe element and prepare cleanup function
7463
+ */
7464
+ onIframeLoad(): void;
7465
+ /**
7466
+ * Execute cleanup of the iframe
7467
+ */
7468
+ onunload(): void;
7469
+ /**
7470
+ * Execute functionality on CM editor state update
7471
+ */
7472
+ onUpdate(update: ViewUpdate, changed: boolean): void;
7473
+ }
7474
+ /** @public */
7475
+ export interface EmbeddedEditorView extends Component {
7476
+ /**
7477
+ * Reference to the app
7478
+ */
7479
+ app: App;
7480
+ /**
7481
+ * Container element for the embedded view
7482
+ */
7483
+ containerEl: HTMLElement;
7484
+ /**
7485
+ * Whether the view is currently saving
7486
+ */
7487
+ dirty: boolean;
7488
+ /**
7489
+ * Whether the editor may be edited
7490
+ *
7491
+ * @remark Fun fact, setting this to true and calling showEditor() for embedded MD views, allows them to be edited.
7492
+ * Though the experience is a little buggy
7493
+ */
7494
+ editable: boolean;
7495
+ /**
7496
+ * Editor component of the view
7497
+ */
7498
+ editMode?: IFramedMarkdownEditor | undefined;
7499
+ /**
7500
+ * Container in which the editor is embedded
7501
+ */
7502
+ editorEl: HTMLElement;
7503
+ /**
7504
+ * File to which the view is attached
7505
+ */
7506
+ file: null | TFile;
7507
+ /**
7508
+ * Hover element container
7509
+ */
7510
+ hoverPopover: null | HoverPopover;
7511
+ /**
7512
+ * Element containing the preview for the embedded markdown
7513
+ */
7514
+ previewEl: HTMLElement;
7515
+ /**
7516
+ * Preview component of the view
7517
+ */
7518
+ previewMode: MarkdownPreviewView;
7519
+ /**
7520
+ * Current state of the editor
7521
+ */
7522
+ state: {} | EditorState | unknown;
7523
+ /**
7524
+ * Text contents being embedded
7525
+ */
7526
+ text: string;
7527
+ /**
7528
+ * Whether the view renders contents using an iFrame
7529
+ */
7530
+ useIframe: boolean;
7531
+ /**
7532
+ * Get the preview editor, if exists
7533
+ */
7534
+ get editor(): IFramedMarkdownEditor | null;
7535
+ /**
7536
+ * Get the path to the file, if any file registered
7537
+ */
7538
+ get path(): string;
7539
+ /**
7540
+ * Get the scroll of the file renderer component
7541
+ */
7542
+ get scroll(): unknown;
7543
+ /**
7544
+ * Destroy edit component editor and save contents if specified
7545
+ */
7546
+ destroyEditor(save?: boolean): void;
7547
+ /**
7548
+ * Gets currently active mode (editMode returns 'source')
7549
+ */
7550
+ getMode(): "source" | "preview";
7551
+ /**
7552
+ * On load of editor, show preview
7553
+ */
7554
+ onload(): void;
7555
+ /**
7556
+ * Trigger markdown scroll on workspace
7557
+ */
7558
+ onMarkdownScroll(): void;
7559
+ /**
7560
+ * On unload of editor, destroy editor and unset workspace activeEditor
7561
+ */
7562
+ onunload(): void;
7563
+ /**
7564
+ * Debounced save of contents
7565
+ */
7566
+ requestSave(): void;
7567
+ /**
7568
+ * Debounced save of editor folds
7569
+ */
7570
+ requestSaveFolds(): void;
7571
+ /**
7572
+ * Set file contents
7573
+ */
7574
+ save(data: string, save?: boolean): void;
7575
+ /**
7576
+ * Set the state of the editor
7577
+ */
7578
+ set(data: string, clear: boolean): void;
7579
+ /**
7580
+ * Reveal the editor if editable widget and applies saved state
7581
+ */
7582
+ showEditor(): void;
7583
+ /**
7584
+ * Reveal preview mode and destroy editor, save if specified
7585
+ */
7586
+ showPreview(save?: boolean): void;
7587
+ /**
7588
+ * Reveal search component in file renderer component
7589
+ */
7590
+ showSearch(replace?: boolean): void;
7591
+ /**
7592
+ * Toggle between edit and preview mode
7593
+ */
7594
+ toggleMode(): void;
7595
+ }
7596
+ /** @public */
7597
+ export interface WidgetEditorView extends EmbeddedEditorView {
7598
+ /**
7599
+ * Data after reference
7600
+ */
7601
+ after: string;
7602
+ /**
7603
+ * Data before reference
7604
+ */
7605
+ before: string;
7606
+ /**
7607
+ * Full file contents
7608
+ */
7609
+ data: string;
7610
+ /**
7611
+ * File being currently renamed
7612
+ */
7613
+ fileBeingRenamed: null | TFile;
7614
+ /**
7615
+ * Current heading
7616
+ */
7617
+ heading: string;
7618
+ /**
7619
+ * Indent
7620
+ */
7621
+ indent: string;
7622
+ /**
7623
+ * Inline title element
7624
+ */
7625
+ inlineTitleEl: HTMLElement;
7626
+ /**
7627
+ * Full inline content string
7628
+ */
7629
+ lastSavedData: null | string;
7630
+ /**
7631
+ * Whether embedding should be saved twice on save
7632
+ */
7633
+ saveAgain: boolean;
7634
+ /**
7635
+ * Whether the widget is currently saving
7636
+ */
7637
+ saving: boolean;
7638
+ /**
7639
+ * Subpath reference of the path
7640
+ */
7641
+ subpath: string;
7642
+ /**
7643
+ * Whether the subpath was not found in the cache
7644
+ */
7645
+ subpathNotFound: boolean;
7646
+ /**
7647
+ * Push/pop current scope
7648
+ */
7649
+ applyScope(scope: Scope): void;
7650
+ /**
7651
+ * Get the current folds of the editor
7652
+ */
7653
+ getFoldInfo(): null | FoldInfo;
7654
+ /**
7655
+ * Splice incoming data at according to subpath for correct reference, then update heading and render
7656
+ */
7657
+ loadContents(data: string, cache: CachedMetadata): void;
7658
+ /**
7659
+ * Load file from cache based on stored path
7660
+ */
7661
+ loadFile(): Promise<void>;
7662
+ /**
7663
+ * Load file and check if data is different from last saved data, then loads contents
7664
+ */
7665
+ loadFileInternal(data: string, cache?: CachedMetadata): void;
7666
+ /**
7667
+ * Update representation on file finished updating
7668
+ */
7669
+ onFileChanged(file: TFile, data: string, cache: CachedMetadata): void;
7670
+ /**
7671
+ * Update representation on file rename
7672
+ */
7673
+ onFileRename(file: TAbstractFile, oldPath: string): void;
7674
+ /**
7675
+ * On loading widget, register vault change and rename events
7676
+ */
7677
+ onload(): void;
7678
+ /**
7679
+ * Save fold made in the editor to foldManager
7680
+ */
7681
+ onMarkdownFold(): void;
7682
+ /** @internal On change of editor title element */
7683
+ onTitleChange(element: HTMLElement): void;
7684
+ /** @internal On keypress on editor title element */
7685
+ onTitleKeydown(event: KeyboardEvent): void;
7686
+ /** @internal On pasting on editor title element */
7687
+ onTitlePaste(element: HTMLElement, event: ClipboardEvent): void;
7688
+ /**
7689
+ * On unloading widget, unload component and remove scope
7690
+ */
7691
+ onunload(): void;
7692
+ /**
7693
+ * Save changes made in editable widget
7694
+ */
7695
+ save(data: string, delayed?: boolean): Promise<void>;
7696
+ /**
7697
+ * On blur widget, save title
7698
+ */
7699
+ saveTitle(element: HTMLElement): void;
7700
+ /**
7701
+ * Show preview of widget
7702
+ */
7703
+ showPreview(show?: boolean): void;
7704
+ }
7705
+ /** @public */
7706
+ export interface CanvasLeaf extends WorkspaceLeaf {
7707
+ }
7708
+ /** @public */
7709
+ export interface FileSuggestManager {
7710
+ /**
7711
+ * Reference to the app
7712
+ */
7713
+ app: App;
7714
+ /**
7715
+ * Selection of files and their paths that can be matched to
7716
+ */
7717
+ fileSuggestions: null | {
7718
+ file: TFile | null;
7719
+ path: string;
7720
+ }[];
7721
+ /**
7722
+ * Whether search should be vault-wide rather than scoped to current file
7723
+ */
7724
+ global: boolean;
7725
+ /**
7726
+ * Type of suggestions that should be provided
7727
+ */
7728
+ mode: "file" | "heading" | "block" | "display" | string;
7729
+ /**
7730
+ * Executor of the search
7731
+ */
7732
+ runnable: null | Runnable;
7733
+ /**
7734
+ * Get suggestions for block query
7735
+ */
7736
+ getBlockSuggestions(runner: Runnable, file: TFile, text: string): Promise<SearchResult[]>;
7737
+ /**
7738
+ * Get suggestions for display alias query
7739
+ */
7740
+ getDisplaySuggestions(runner: Runnable, linkpath: string, subpath: string, alias: string): Promise<SearchResult[]>;
7741
+ /**
7742
+ * Get suggestions for file query
7743
+ */
7744
+ getFileSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7745
+ /**
7746
+ * Get suggestions for global block query
7747
+ */
7748
+ getGlobalBlockSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7749
+ /**
7750
+ * Get suggestions for global heading query
7751
+ */
7752
+ getGlobalHeadingSuggestions(runner: Runnable, text: string): Promise<SearchResult[]>;
7753
+ /**
7754
+ * Get suggestions for file heading query
7755
+ */
7756
+ getHeadingSuggestions(runner: Runnable, file: TFile, text: string): Promise<SearchResult[]>;
7757
+ /** @internal Generate instructions for specific actions in suggestion manager (e.g. accept, select, ...) */
7758
+ getInstructions(): [
7759
+ {
7760
+ command: "string";
7761
+ purpose: "string";
7762
+ }
7763
+ ];
7764
+ /**
7765
+ * Determine the source path of current context
7766
+ */
7767
+ getSourcePath(): null | string;
7768
+ /**
7769
+ * Get suggestions for current input text
7770
+ *
7771
+ * @remark Type is determined from text: e.g. [[Thi]] will give completions for files, [[Thi^]] for blocks, etc.
7772
+ */
7773
+ getSuggestionsAsync(runner: Runnable, text: string): Promise<SearchResult[]>;
7774
+ /**
7775
+ * Match search fragments to a block
7776
+ */
7777
+ matchBlock(path: string, file: TFile, block: BlockCache, sourcePath: null | string, content: string, text_parts: string[]): SearchResult | null;
7778
+ }
7779
+ /** @todo Documentation incomplete */
7780
+ /** @public */
7781
+ export interface Account {
7782
+ /**
7783
+ * The company associated with the activated commercial license
7784
+ */
7785
+ company: string;
7786
+ /**
7787
+ * The email address associated with the account
7788
+ */
7789
+ email: string;
7790
+ expiry: number;
7791
+ key: string | undefined;
7792
+ keyValidation: string;
7793
+ /**
7794
+ * The license available to the account
7795
+ */
7796
+ license: "" | "insider";
7797
+ /**
7798
+ * Profile name
7799
+ */
7800
+ name: string;
7801
+ seats: number;
7802
+ token: string;
7803
+ }
7804
+ /** @todo Documentation incomplete */
7805
+ /** @public */
7806
+ export interface FileSuggest<T> extends EditorSuggest<T> {
7807
+ /**
7808
+ * Manages fetching of suggestions from metadatacache
7809
+ */
7810
+ suggestManager: FileSuggestManager;
7811
7811
  }
7812
7812
  /** @todo Documentation incomplete */
7813
7813
  /** @public */