UNPKG

obsidian-typings

Version:

Extended type definitions for the Obsidian API (https://obsidian.md)

1,813 lines (1,811 loc) 322 kB
// Generated by dts-bundle-generator v9.5.1 import type { ParseContext } from '@codemirror/language'; import type { SearchQuery } from '@codemirror/search'; import type { ChangeDesc, Extension, Transaction } from '@codemirror/state'; import type { EditorView, ViewUpdate } from '@codemirror/view'; import type { Tree as Tree$1 } from '@lezer/common'; import type { App as App$1, BrowserWindow } from 'electron'; import type { default as moment$1 } from 'moment'; import type { FSWatcher } from 'node:fs'; import type { App, BlockCache, CacheItem, CachedMetadata, CloseableComponent, ColorComponent, Command, Component, DataAdapter, Debouncer, EditableFileView, Editor, EditorPosition, EditorRange, EditorRangeOrCaret, EditorSuggest, EmbedCache, EventRef, Events, FileStats, FileView, FrontmatterLinkCache, FuzzySuggestModal, HoverLinkSource, HoverPopover, IconName, ItemView, KeymapInfo, LinkCache, MarkdownEditView, MarkdownFileInfo, MarkdownPostProcessorContext, MarkdownPreviewView, MarkdownView, Menu, Modal, PaneType, Platform, Plugin as Plugin, PluginManifest, PluginSettingTab, Reference, ReferenceCache, Scope, SearchComponent, SearchResult, Setting, SettingTab, SplitDirection, TAbstractFile, TFile, TFolder, TextComponent, TextFileView, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceLeaf, WorkspaceTabs } from 'obsidian'; import type { Application, Container, Graphics, ICanvas, Sprite, Text as Text$1, TextStyle } from 'pixi.js'; /** * @todo Documentation incomplete. * * @public * @unofficial */ export declare class CustomArrayDictImpl<T> implements CustomArrayDict<T> { data: Map<string, T[]>; add(key: string, value: T): void; remove(key: string, value: T): void; get(key: string): T[] | null; keys(): string[]; clear(key: string): void; clearAll(): void; contains(key: string, value: T): boolean; count(): number; } /** * @todo Documentation incomplete. * @public * @unofficial */ export declare class HighlightOutline extends Outline { /** @todo Documentation incomplete. */ constructor(outlines: unknown, box: unknown, lastPoint: any); /** @todo Documentation incomplete. */ lastPoint: unknown; /** @todo Documentation incomplete. */ get box(): Object | null; /** @todo Documentation incomplete. */ get classNamesForOutlining(): string[]; /** * Serialize the outlines into the PDF page coordinate system. * * @param bbox - the bounding box of the annotation. * @param rotation - the rotation of the annotation. * @returns Serialized outlines. */ serialize(bbox: [ blX: string, blY: string, trX: string, trY: string ], rotation: number): Array<Array<number>>; } /** * @todo Documentation incomplete. * @public * @unofficial */ export declare class HighlightOutliner { /** * Construct an outliner. * * @param boxes - An array of axis-aligned rectangles. * @param borderWidth - The width of the border of the boxes, it. * allows to make the boxes bigger (or smaller). * @param innerMargin - The margin between the boxes and the. * outlines. It's important to not have a null innerMargin when we want to. * draw the outline else the stroked outline could be clipped because of its. * width. * @param isLTR - true if we're in LTR mode. It's used to determine. * the last point of the boxes. */ constructor(boxes: Array<Object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean); /** @todo Documentation incomplete. */ getOutlines(): HighlightOutline; } /** * @todo Documentation incomplete. * @public * @unofficial */ export declare class Outline { /** @todo Documentation incomplete. */ static PRECISION: number; /** * The bounding box of the outline. * * @returns The bounding box of the outline. */ get box(): Object | null; /** @todo Documentation incomplete. */ serialize(bbox: [ blX: string, blY: string, trX: string, trY: string ], rotation: number): void; /** @todo Documentation incomplete. */ static _normalizePagePoint(x: unknown, y: unknown, rotation: unknown): unknown[]; /** @todo Documentation incomplete. */ static _normalizePoint(x: unknown, y: unknown, parentWidth: unknown, parentHeight: unknown, rotation: unknown): number[]; /** @todo Documentation incomplete. */ static _rescale(src: unknown, tx: unknown, ty: unknown, sx: unknown, sy: unknown, dest: unknown): unknown; /** @todo Documentation incomplete. */ static _rescaleAndSwap(src: unknown, tx: unknown, ty: unknown, sx: unknown, sy: unknown, dest: unknown): unknown; /** @todo Documentation incomplete. */ static _translate(src: unknown, tx: unknown, ty: unknown, dest: unknown): unknown; /** @todo Documentation incomplete. */ static createBezierPoints(x1: unknown, y1: unknown, x2: unknown, y2: unknown, x3: unknown, y3: unknown): number[]; /** @todo Documentation incomplete. */ static svgRound(x: unknown): number; /** * Converts the outline to an SVG path. * * @returns The SVG path of the outline. */ toSVGPath(): string; } /** * @todo Documentation incomplete. * * @public * @unofficial */ export declare const FileExtension: { readonly _3gp: "3gp"; readonly avif: "avif"; readonly bmp: "bmp"; readonly canvas: "canvas"; readonly flac: "flac"; readonly gif: "gif"; readonly jpeg: "jpeg"; readonly jpg: "jpg"; readonly m4a: "m4a"; readonly md: "md"; readonly mkv: "mkv"; readonly mov: "mov"; readonly mp3: "mp3"; readonly mp4: "mp4"; readonly oga: "oga"; readonly ogg: "ogg"; readonly ogv: "ogv"; readonly opus: "opus"; readonly pdf: "pdf"; readonly png: "png"; readonly svg: "svg"; readonly wav: "wav"; readonly webm: "webm"; readonly webp: "webp"; }; /** * @todo Documentation incomplete. * * @public * @unofficial */ export declare const InternalPluginName: { /** * Plugin name in UI: Audio recorder. */ readonly AudioRecorder: "audio-recorder"; /** * Plugin name in UI: Backlinks. */ readonly Backlink: "backlink"; /** * Plugin name in UI: Bases. */ readonly Bases: "bases"; /** * Plugin name in UI: Bookmarks. */ readonly Bookmarks: "bookmarks"; /** * Plugin name in UI: Canvas. */ readonly Canvas: "canvas"; /** * Plugin name in UI: Command palette. */ readonly CommandPalette: "command-palette"; /** * Plugin name in UI: Daily notes. */ readonly DailyNotes: "daily-notes"; /** * Plugin name in UI: (hidden). */ readonly EditorStatus: "editor-status"; /** * Plugin name in UI: Files. */ readonly FileExplorer: "file-explorer"; /** * Plugin name in UI: File recovery. */ readonly FileRecovery: "file-recovery"; /** * Plugin name in UI: Footnotes. */ readonly Footnotes: "footnotes"; /** * Plugin name in UI: Search. */ readonly GlobalSearch: "global-search"; /** * Plugin name in UI: Graph view. */ readonly Graph: "graph"; /** * Plugin name in UI: Format converter. */ readonly MarkdownImporter: "markdown-importer"; /** * Plugin name in UI: Note composer. */ readonly NoteComposer: "note-composer"; /** * Plugin name in UI: Outgoing links. */ readonly OutgoingLink: "outgoing-link"; /** * Plugin name in UI: Outline. */ readonly Outline: "outline"; /** * Plugin name in UI: Page preview. */ readonly PagePreview: "page-preview"; /** * Plugin name in UI: Properties view. */ readonly Properties: "properties"; /** * Plugin name in UI: Publish. */ readonly Publish: "publish"; /** * Plugin name in UI: Random note. */ readonly RandomNote: "random-note"; /** * Plugin name in UI: Slash commands. */ readonly SlashCommand: "slash-command"; /** * Plugin name in UI: Slides. */ readonly Slides: "slides"; /** * Plugin name in UI: Quick Switcher. */ readonly Switcher: "switcher"; /** * Plugin name in UI: Sync. */ readonly Sync: "sync"; /** * Plugin name in UI: Tags view. */ readonly TagPane: "tag-pane"; /** * Plugin name in UI: Templates. */ readonly Templates: "templates"; /** * Plugin name in UI: Web viewer. */ readonly Webviewer: "webviewer"; /** * Plugin name in UI: Word count. */ readonly WordCount: "word-count"; /** * Plugin name in UI: Workspaces. */ readonly Workspaces: "workspaces"; /** * Plugin name in UI: Unique note creator. */ readonly ZkPrefixer: "zk-prefixer"; }; /** * @todo Documentation incomplete. * * @public * @unofficial */ export declare const ViewType: { readonly AllProperties: "all-properties"; readonly Audio: "audio"; readonly Backlink: "backlink"; readonly Bookmarks: "bookmarks"; readonly Canvas: "canvas"; readonly Empty: "empty"; readonly FileExplorer: "file-explorer"; readonly FileProperties: "file-properties"; readonly Graph: "graph"; readonly Image: "image"; readonly LocalGraph: "localgraph"; readonly Markdown: "markdown"; readonly OutgoingLink: "outgoing-link"; readonly Outline: "outline"; readonly Pdf: "pdf"; readonly ReleaseNotes: "release-notes"; readonly Search: "search"; readonly Sync: "sync"; readonly Table: "table"; readonly Tag: "tag"; readonly Video: "video"; readonly Webviewer: "webviewer"; readonly WebviewerHistory: "webviewer-history"; }; /** * Creates and properly initializes the instance of TFile even the underlying file does not exist. * This doesn't create the missing file on the file system. * * @public * @unofficial */ export declare function createTFileInstance(app: App, path: string): TFile; /** * Creates and properly initializes the instance of TFolder even the underlying folder does not exist. * This doesn't create the missing folder on the file system. * * @public * @unofficial */ export declare function createTFolderInstance(app: App, path: string): TFolder; /** * Get the App constructor. * * @returns The App constructor. * * @public * @unofficial */ export declare function getAppConstructor(): AppConstructor; /** * Get the InternalPlugin constructor. * * @param app - The app instance. * @returns The InternalPlugin constructor. * * @public * @unofficial */ export declare function getInternalPluginConstructor<Instance>(app: App): InternalPluginConstructor<Instance>; /** * Get the InternalPlugins constructor. * * @param app - The app instance. * @returns The InternalPlugins constructor. * * @public * @unofficial */ export declare function getInternalPluginsConstructor(app: App): InternalPluginsConstructor; /** * Get the TFile constructor. * * @returns The TFile constructor. * * @public * @unofficial */ export declare function getTFileConstructor(): TFileConstructor; /** * Get the TFolder constructor. * * @returns The TFolder constructor. * * @public * @unofficial */ export declare function getTFolderConstructor(): TFolderConstructor; /** * Get the view constructor by view type. * * @param app - The app. * @param viewType - The view type. * @returns The view constructor. * * @public * @unofficial */ export declare function getViewConstructorByViewType<TViewType extends ViewTypeType>(app: App, viewType: TViewType): ViewTypeViewConstructorMapping[TViewType]; /** * Check if the reference is an embed cache. * * @param reference - The reference to check. * @returns Whether the reference is an embed cache. * * @public * @unofficial */ export declare function isEmbedCache(reference: Reference): reference is EmbedCache; /** * Check if the reference is a frontmatter link cache. * * @param reference - The reference to check. * @returns Whether the reference is a frontmatter link cache. * * @public * @unofficial */ export declare function isFrontmatterLinkCache(reference: Reference): reference is FrontmatterLinkCache; /** * Check if the reference is a link cache. * * @param reference - The reference to check. * @returns Whether the reference is a link cache. * * @public * @unofficial */ export declare function isLinkCache(reference: Reference): reference is LinkCache; /** * Check if the reference is a reference cache. * * @param reference - The reference to check. * @returns Whether the reference is a reference cache. * * @public * @unofficial */ export declare function isReferenceCache(reference: Reference): reference is ReferenceCache; /** * Get the parent folder path of a given path. * * @param path - The path to get the parent folder path of. * @returns The parent folder path. * * @public * @unofficial */ export declare function parentFolderPath(path: string): string; /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AbsFunction extends BasesFunction, HasGetDisplayName { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AbstractFileTreeItem<T extends TAbstractFile> extends TreeItem { /** * Associated file with this item. */ file: T; /** @todo Documentation incomplete. */ info: TreeNodeInfo; /** @todo Documentation incomplete. */ parent: FileTreeItemParent; /** @todo Documentation incomplete. */ rendered: boolean; /** @todo Documentation incomplete. */ view: FileExplorerView; /** @todo Documentation incomplete. */ getTitle(): string; /** @todo Documentation incomplete. */ isFullTimeShown(): boolean; /** @todo Documentation incomplete. */ onRender(): void; /** @todo Documentation incomplete. */ startRename(): void; /** @todo Documentation incomplete. */ stopRename(): void; /** @todo Documentation incomplete. */ updateTitle(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AbstractSearchComponent { /** * Reference to the app. */ app: App; /** * The container element in which the search component exists (i.e. Editor). */ containerEl: HTMLElement; /** * Container for the replacement input field. */ replaceInputEl: HTMLInputElement; /** * Keyscope for search component. */ scope: Scope; /** * Container for all the action buttons. */ searchButtonContainerEl: HTMLElement; /** * Container for the search component itself. */ searchContainerEl: HTMLElement; /** * Container for the search input field. */ searchInputEl: HTMLInputElement; /** * Returns the current search query. */ getQuery(): string; /** * Switch to the next inputElement. */ goToNextInput(event: KeyboardEvent): unknown; /** * Invokes findNextOrReplace. */ onEnter(event: KeyboardEvent): unknown; /** * Invokes findPrevious. */ onShiftEnter(event: KeyboardEvent): unknown; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface Account { /** * The company associated with the activated commercial license. */ company: string; /** * The email address associated with the account. */ email: string; /** @todo Documentation incomplete. */ expiry: number; /** @todo Documentation incomplete. */ key: string | undefined; /** @todo Documentation incomplete. */ keyValidation: string; /** * The license available to the account. */ license: "" | "insider"; /** * Profile name. */ name: string; /** @todo Documentation incomplete. */ seats: number; /** @todo Documentation incomplete. */ token: string; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AddOverlayOptions { /** @todo Documentation incomplete. */ query: RegExp; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AliasesPropertyWidgetComponent extends PropertyWidgetComponentBase { /** @todo Documentation incomplete. */ ctx: PropertyRenderContext; /** @todo Documentation incomplete. */ hoverPopover: HoverPopover | null; /** @todo Documentation incomplete. */ multiselect: Multiselect; /** @todo Documentation incomplete. */ type: "aliases"; /** @todo Documentation incomplete. */ setValue(value: string | string[]): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AllPropertiesView extends ItemView { /** * Try to rename the file. */ acceptRename(): Promise<void>; /** * Cancels the rename. */ cancelRename(): void; /** * Quits the rename. */ exitRename(): void; /** * Get the current view type. */ getViewType(): typeof ViewType.AllProperties; /** @todo Documentation incomplete */ isItem(e: unknown): boolean; /** * Select the item in focus if pressed 'Enter'. * * @param event - The event triggered this function. */ onKeyEnterInFocus(event: KeyboardEvent): void; /** * Called when 'Enter' is pressed while rename. Accepts the rename. * * @param event - The event triggered this function. */ onKeyEnterInRename(event: KeyboardEvent): void; /** * Toggles the visibility of the search. */ onToggleShowSearch(): void; /** @todo Documentation incomplete */ setShowSearch(e: boolean): void; /** * Updates the sort order and sort by it. * * @param order - The sort order. */ setSortOrder(order: unknown): void; /** * Shows the search and focus is. */ showSearch(): void; /** @todo Documentation incomplete */ startRename(e: unknown): Promise<unknown>; /** @todo Documentation incomplete */ update(): void; /** * Updates the search. */ updateSearch(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AllPropertiesViewConstructor extends TypedViewConstructor<AllPropertiesView> { } /** * The App constructor. * * @public * @unofficial */ export interface AppConstructor extends ConstructorBase<[ adapter: DataAdapter, appId: string ], App> { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AppMenuBarManager { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ constructor: AppMenuBarManagerConstructor; /** @todo Documentation incomplete. */ onLayoutChange: Debouncer<[ ], unknown>; /** @todo Documentation incomplete. */ onWindowFrameChange: Debouncer<[ ], unknown>; /** @todo Documentation incomplete. */ requestRender: Debouncer<[ ], unknown>; /** @todo Documentation incomplete. */ _onLayoutChange(): unknown; /** @todo Documentation incomplete. */ applyHotkeys(arg1: unknown): unknown; /** @todo Documentation incomplete. */ buildMenu(): unknown; /** @todo Documentation incomplete. */ getAcceleratorFromHotkey(arg1: unknown): unknown; /** @todo Documentation incomplete. */ hideUnregisteredCommands(arg1: unknown): unknown; /** @todo Documentation incomplete. */ render(): unknown; /** @todo Documentation incomplete. */ updateShareMenuItem(arg1: unknown): unknown; /** @todo Documentation incomplete. */ updateViewState(): unknown; /** @todo Documentation incomplete. */ updateWorkspace(): unknown; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AppMenuBarManagerConstructor { /** @todo Documentation incomplete. */ updateMenuItems(arg1: unknown, arg2: unknown): unknown; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AppSetting extends Modal { /** * Current active tab of the settings modal. */ activeTab: SettingTab | null; /** * Closeable component for the active tab. */ activeTabCloseable: CloseableComponent | null; /** * Container element containing the community plugins */ communityPluginTabContainer: HTMLElement; /** * Container element containing the community plugins header. */ communityPluginTabHeaderGroup: HTMLElement; /** * Container element containing the core plugins. */ corePluginTabContainer: HTMLElement; /** * Container element containing the core plugins header. */ corePluginTabHeaderGroup: HTMLElement; /** * Previously opened tab ID. */ lastTabId: string; /** * List of all plugin tabs (core and community, ordered by precedence). */ pluginTabs: SettingTab[]; /** * List of all core settings tabs (editor, files & links, ...). */ settingTabs: SettingTab[]; /** * Container element containing the core settings. */ tabContainer: HTMLElement; /** * Container for currently active settings tab. */ tabContentContainer: HTMLElement; /** * Container for all settings tabs. */ tabHeadersEl: HTMLElement; /** * Add a new plugin tab to the settings modal. * * @param tab - Tab to add. */ addSettingTab(tab: SettingTab): void; /** * Closes the currently active tab. */ closeActiveTab(): void; /** * Check whether tab is a plugin tab. * * @param tab - Tab to check. */ isPluginSettingTab(tab: SettingTab): boolean; /** * Open a specific tab by tab reference. * * @param tab - Tab to open. */ openTab(tab: SettingTab): void; /** @todo Documentation incomplete. */ openTabById(id: "hotkeys"): HotkeysSettingTab; /** * Open a specific tab by ID. * * @param id - ID of the tab to open. */ openTabById(id: string): SettingTab; /** * Remove a plugin tab from the settings modal. * * @param tab - Tab to remove. */ removeSettingTab(tab: SettingTab): void; /** * Update the title of the modal. * * @param tab - Tab to update the title to. */ updateModalTitle(tab: SettingTab): void; /** * Update a tab section. */ updatePluginSection(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AppVaultConfig { /** * Appearance \> Accent color. */ accentColor: "" | string; /** * Files & Links \> Automatically update internal links. */ alwaysUpdateLinks?: false | boolean; /** * Files & Links \> Attachment folder path. */ attachmentFolderPath?: "/" | string; /** * Editor \> Auto convert HTML. */ autoConvertHtml?: true | boolean; /** * Editor \> Auto pair brackets. */ autoPairBrackets?: true | boolean; /** * Editor \> Auto pair Markdown syntax. */ autoPairMarkdown?: true | boolean; /** * Appearance \> Font size. */ baseFontSize?: 16 | number; /** * Appearance \> Quick font size adjustment. */ baseFontSizeAction?: true | boolean; /** * Community Plugins \> Browse \> Sort order. */ communityPluginSortOrder: "download" | "update" | "release" | "alphabetical"; /** * Themes \> Browse \> Sort order. */ communityThemeSortOrder: "download" | "update" | "release" | "alphabetical"; /** * Appearance \> Theme. * * @remark is the default Obsidian theme. */ cssTheme?: "" | string; /** * Editor \> Default view for new tabs. */ defaultViewMode?: "source" | "preview"; /** @todo Documentation incomplete. */ emacsyKeys?: true | boolean; /** * Appearance \> CSS snippets. */ enabledCssSnippets?: string[]; /** @todo Documentation incomplete. */ fileSortOrder?: "alphabetical"; /** * Editor \> Always focus new tabs. */ focusNewTab?: true | boolean; /** * Editor \> Fold heading. */ foldHeading?: true | boolean; /** * Editor \> Fold indent. */ foldIndent?: true | boolean; /** * Hotkeys. * * @deprecated Likely not used anymore. */ hotkeys?: AppVaultConfigHotkeysRecord; /** * Appearance \> Interface font. */ interfaceFontFamily?: "" | string; /** * Editor \> Use legacy editor. */ legacyEditor?: false | boolean; /** @todo Documentation incomplete. */ livePreview?: true | boolean; /** * Mobile \> Configure mobile Quick Action. */ mobilePullAction?: "command-palette:open" | string; /** @todo Documentation incomplete. */ mobileQuickRibbonItem?: "" | string; /** * Mobile \> Manage toolbar options. */ mobileToolbarCommands?: string[]; /** @todo Documentation incomplete. */ monospaceFontFamily?: "" | string; /** * Appearance \> Native menus. */ nativeMenus?: null | boolean; /** * Files & Links \> Default location for new notes | 'folder' \> Folder to create new notes in. */ newFileFolderPath?: "/" | string; /** * Files & Links \> Default location for new notes. */ newFileLocation?: "root" | "current" | "folder"; /** * Files & Links \> New link format. */ newLinkFormat?: "shortest" | "relative" | "absolute"; /** * Saved on executing 'Export to PDF' command. */ pdfExportSettings?: PdfExportSettings; /** * Files & Links \> Confirm line deletion. */ promptDelete?: true | boolean; /** * Editor \> Properties in document. */ propertiesInDocument?: "visible" | "hidden" | "source"; /** * Editor \> Readable line length. */ readableLineLength?: true | boolean; /** * Editor \> Right-to-left (RTL). */ rightToLeft?: false | boolean; /** @deprecated Removed as of version 1.4.3 */ showFrontmatter?: false | boolean; /** * Editor \> Show indentation guides. */ showIndentGuide?: true | boolean; /** * Editor \> Show inline title. */ showInlineTitle?: true | boolean; /** * Editor \> Show line numbers. */ showLineNumber?: false | boolean; /** * Appearance \> Show ribbon. */ showRibbon?: true | boolean; /** * Files & Links \> Detect all file extensions. */ showUnsupportedFiles?: false | boolean; /** * Appearance \> Show tab title bar. */ showViewHeader?: false | boolean; /** * Editor \> Smart indent lists. */ smartIndentList?: true | boolean; /** * Editor \> Spellcheck. */ spellcheck?: false | boolean; /** * @deprecated Deprecated. * @todo . */ spellcheckDictionary?: [ ] | string[]; /** * Editor \> Spellcheck languages. */ spellcheckLanguages?: null | string[]; /** * Editor \> Strict line breaks. */ strictLineBreaks?: false | boolean; /** * Editor \> Tab indent size. */ tabSize?: 4 | number; /** * Appearance \> Text font. */ textFontFamily?: "" | string; /** * Appearance \> Base color scheme. * * @remark Not be confused with cssTheme, this setting is for the light/dark mode. * @remark moonstone is light theme, 'obsidian' is dark theme. */ theme?: "moonstone" | "obsidian"; /** * Appearance \> Translucent window. */ translucency?: false | boolean; /** * Files & Links \> Deleted files. */ trashOption?: "system" | "local" | "none"; /** @deprecated Probably left-over code from old properties type storage */ types: object; /** * Files & Links \> Use [[Wikilinks]]. */ useMarkdownLinks?: false | boolean; /** * Files & Links \> Excluded files. */ userIgnoreFilters?: null | string[]; /** * Editor \> Indent using tabs. */ useTab?: true | boolean; /** * Editor \> Vim key bindings. */ vimMode?: false | boolean; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AppVaultConfigHotkeysRecord extends Record<string, string> { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AudioRecorderPlugin extends InternalPlugin<AudioRecorderPluginInstance> { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AudioRecorderPluginInstance extends InternalPluginInstance<AudioRecorderPlugin> { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ extension: string; /** @todo Documentation incomplete. */ plugin: AudioRecorderPlugin; /** @todo Documentation incomplete. */ recorder: MediaRecorder | null; /** @todo Documentation incomplete. */ recording: boolean; /** @todo Documentation incomplete. */ checkPermission(): Promise<boolean>; /** @todo Documentation incomplete. */ onRecordAudio(): Promise<void>; /** @todo Documentation incomplete. */ onStartRecording(): Promise<void>; /** @todo Documentation incomplete. */ onStopRecording(): void; /** @todo Documentation incomplete. */ saveRecording(audioBuffer: ArrayBuffer): Promise<void>; /** @todo Documentation incomplete. */ showRecordingMessage(message: string, isError: boolean): void; /** @todo Documentation incomplete. */ startRecording(stream: MediaStream): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AudioView extends EditableFileView { /** * Get the current view type. */ getViewType(): typeof ViewType.Audio; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface AudioViewConstructor extends TypedViewConstructor<AudioView> { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BBox { /** @todo Documentation incomplete. */ maxX: number; /** @todo Documentation incomplete. */ maxY: number; /** @todo Documentation incomplete. */ minX: number; /** @todo Documentation incomplete. */ minY: number; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkComponent extends Component { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ backlinkCollapsed: boolean; /** @todo Documentation incomplete. */ backlinkCountEl: HTMLSpanElement; /** @todo Documentation incomplete. */ backlinkDom: ResultDom; /** @todo Documentation incomplete. */ backlinkFile: TFile | null; /** @todo Documentation incomplete. */ backlinkHeaderEl: HTMLDivElement; /** @todo Documentation incomplete. */ backlinkQueue: ItemQueue<TFile> | null; /** @todo Documentation incomplete. */ collapseAll: boolean; /** @todo Documentation incomplete. */ collapseAllButtonEl: HTMLDivElement; /** @todo Documentation incomplete. */ extraContext: boolean; /** @todo Documentation incomplete. */ extraContextButtonEl: HTMLDivElement; /** @todo Documentation incomplete. */ file: TFile | null; /** @todo Documentation incomplete. */ headerDom: HeaderDom; /** @todo Documentation incomplete. */ isShowingSearch: boolean; /** @todo Documentation incomplete. */ searchComponent: SearchComponent; /** @todo Documentation incomplete. */ searchQuery: null; /** @todo Documentation incomplete. */ showSearchButtonEl: HTMLDivElement; /** @todo Documentation incomplete. */ sortOrder: string; /** @todo Documentation incomplete. */ tooltipPlacement: string; /** @todo Documentation incomplete. */ unlinkedAliases: string; /** @todo Documentation incomplete. */ unlinkedCollapsed: boolean; /** @todo Documentation incomplete. */ unlinkedCountEl: HTMLSpanElement; /** @todo Documentation incomplete. */ unlinkedDom: ResultDom; /** @todo Documentation incomplete. */ unlinkedFile: null; /** @todo Documentation incomplete. */ unlinkedHeaderEl: HTMLDivElement; /** @todo Documentation incomplete. */ unlinkedQueue: null; /** @todo Documentation incomplete. */ addLinkFunction(arg1: unknown, arg2: unknown, arg3: unknown): unknown; /** @todo Documentation incomplete. */ getState(): unknown; /** @todo Documentation incomplete. */ onFileChanged(arg1: unknown): unknown; /** @todo Documentation incomplete. */ onFileDeleted(arg1: unknown): unknown; /** @todo Documentation incomplete. */ onFileRename(arg1: unknown): unknown; /** @todo Documentation incomplete. */ onload(): unknown; /** @todo Documentation incomplete. */ onMetadataChanged(arg1: unknown): unknown; /** @todo Documentation incomplete. */ onResize(): unknown; /** @todo Documentation incomplete. */ onToggleCollapseClick(): unknown; /** @todo Documentation incomplete. */ onToggleMoreContextClick(): unknown; /** @todo Documentation incomplete. */ onToggleShowSearch(): unknown; /** @todo Documentation incomplete. */ passSearchFilter(arg1: unknown, arg2: unknown): unknown; /** @todo Documentation incomplete. */ recomputeBacklink(backlinkFile: TFile | null): void; /** @todo Documentation incomplete. */ recomputeUnlinked(arg1: unknown): unknown; /** @todo Documentation incomplete. */ setBacklinkCollapsed(arg1: unknown, arg2: unknown): Promise<unknown>; /** @todo Documentation incomplete. */ setCollapseAll(arg1: unknown): unknown; /** @todo Documentation incomplete. */ setExtraContext(arg1: unknown): unknown; /** @todo Documentation incomplete. */ setSectionCollapsed(arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown): Promise<unknown>; /** @todo Documentation incomplete. */ setShowSearch(arg1: unknown): unknown; /** @todo Documentation incomplete. */ setSortOrder(arg1: unknown): unknown; /** @todo Documentation incomplete. */ setState(arg1: unknown): Promise<unknown>; /** @todo Documentation incomplete. */ setUnlinkedCollapsed(arg1: unknown, arg2: unknown): Promise<unknown>; /** @todo Documentation incomplete. */ stopBacklinkSearch(): void; /** @todo Documentation incomplete. */ stopUnlinkedSearch(): unknown; /** @todo Documentation incomplete. */ toggleBacklinkCollapsed(): unknown; /** @todo Documentation incomplete. */ toggleUnlinkedCollapsed(): unknown; /** @todo Documentation incomplete. */ update(): unknown; /** @todo Documentation incomplete. */ updateHeaderTooltip(arg1: unknown, arg2: unknown): unknown; /** @todo Documentation incomplete. */ updateSearch(): unknown; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkPlugin extends InternalPlugin<BacklinkPluginInstance> { /** @todo Documentation incomplete. */ views: BacklinkPluginViews; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkPluginInstance extends InternalPluginInstance<BacklinkPlugin> { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ defaultOn: true; /** @todo Documentation incomplete. */ file?: TFile | null; /** @todo Documentation incomplete. */ options: BacklinkPluginInstanceOptions; /** @todo Documentation incomplete. */ plugin: BacklinkPlugin; /** @todo Documentation incomplete. */ initLeaf(): void; /** @todo Documentation incomplete. */ onEnable(app: App, plugin: BacklinkPlugin): Promise<void>; /** @todo Documentation incomplete. */ onExternalSettingsChange(): Promise<void>; /** @todo Documentation incomplete. */ onFileMenu(menu: Menu, file: TAbstractFile, source: string, leaf?: WorkspaceLeaf): void; /** @todo Documentation incomplete. */ onFileOpen(file: TAbstractFile): void; /** @todo Documentation incomplete. */ onUserDisable(app: App): void; /** @todo Documentation incomplete. */ onUserEnable(): void; /** @todo Documentation incomplete. */ openBacklinksForActiveFile(skipSplit: boolean): boolean | undefined; /** @todo Documentation incomplete. */ toggleBacklinksInDocument(skip: boolean): boolean | undefined; /** @todo Documentation incomplete. */ updateBacklinks(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkPluginInstanceOptions { /** @todo Documentation incomplete. */ backlinkInDocument?: boolean; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkPluginViews extends Record<string, ViewCreator> { /** @todo Documentation incomplete. */ backlink(left: WorkspaceLeaf): BacklinkView; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkView extends InfoFileView { /** @todo Documentation incomplete. */ backlink: BacklinkComponent; /** * Get the current view type. */ getViewType(): typeof ViewType.Backlink; /** * Shows the search. */ showSearch(): void; /** @todo Documentation incomplete */ update(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BacklinkViewConstructor extends TypedViewConstructor<BacklinkView> { } /** * @remark `BaseEditor` is never used in the Obsidian codebase, but is exposed in the Obsidian module as `Editor`. * However, most editor components actually make use of the extended `Editor`, so this interface is purposely. * named to `BaseEditor` to not require any casting for most purposes (or overriding the `editor` property type. * for all components). * @todo Potential risk of confusion when `Editor` is constructed from the Obsidian module, as it only has the. * methods from `BaseEditor`, *not* `Editor`. */ /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BaseEditor { /** * CodeMirror editor instance. */ cm: EditorView; /** * HTML instance the CM editor is attached to. */ containerEl: HTMLElement; /** * Clean-up function executed after indenting lists. */ afterIndent(): void; /** * Expand text. */ expandText(): void; /** * Indents a list by one level. */ indentList(): void; /** * Insert a template callout at the current cursor position. */ insertCallout(): void; /** * Insert a template code block at the current cursor position. */ insertCodeblock(): void; /** * Insert a markdown link at the current cursor position. */ insertLink(): void; /** * Insert a mathjax equation block at the current cursor position. */ insertMathJax(): void; /** * Insert specified text at the current cursor position. * * @remark Might be broken, inserts at the end of the document. */ insertText(text: string): void; /** * Inserts a new line and continues a markdown bullet point list at the same level. */ newlineAndIndentContinueMarkdownList(): void; /** * Inserts a new line at the same indent level. */ newlineAndIndentOnly(): void; /** * Get the character position at a mouse event. */ posAtMouse(e: MouseEvent): EditorPosition; /** * Toggles blockquote syntax on paragraph under cursor. */ toggleBlockquote(): void; /** * Toggle bullet point list syntax on paragraph under cursor. */ toggleBulletList(): void; /** * Toggle checkbox syntax on paragraph under cursor. */ toggleCheckList(): void; /** * Toggle numbered list syntax on paragraph under cursor. */ toggleNumberList(): void; /** * Convert word under cursor into a wikilink. * * @param embed - Whether to embed the link or not. */ triggerWikiLink(embed: boolean): void; /** * Unindents a list by one level. */ unindentList(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesFunction { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ args: BasesFunctionArg[]; /** @todo Documentation incomplete. */ isOperator: boolean; /** @todo Documentation incomplete. */ name: string; /** @todo Documentation incomplete. */ returnType: string; /** @todo Documentation incomplete. */ apply(...args: unknown[]): unknown; /** @todo Documentation incomplete */ serialize(...args: unknown[]): string; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesFunctionArg { /** @todo Documentation incomplete. */ include_custom_types?: boolean; /** @todo Documentation incomplete. */ name: string; /** @todo Documentation incomplete. */ optional?: boolean; /** @todo Documentation incomplete. */ type: string[]; /** @todo Documentation incomplete. */ variadic?: boolean; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesFunctions { /** @todo Documentation incomplete. */ "!=": NotEqualFunction; /** @todo Documentation incomplete. */ "<": LessFunction; /** @todo Documentation incomplete. */ "<=": LessOrEqualFunction; /** @todo Documentation incomplete. */ "==": EqualFunction; /** @todo Documentation incomplete. */ ">": GreaterFunction; /** @todo Documentation incomplete. */ ">=": GreaterOrEqualFunction; /** @todo Documentation incomplete. */ abs: AbsFunction; /** @todo Documentation incomplete. */ ceil: CeilFunction; /** @todo Documentation incomplete. */ concat: ConcatFunction; /** @todo Documentation incomplete. */ contains: ContainsFunction; /** @todo Documentation incomplete. */ containsAll: ContainsAllFunction; /** @todo Documentation incomplete. */ containsAny: ContainsAnyFunction; /** @todo Documentation incomplete. */ containsNone: ContainsNoneFunction; /** @todo Documentation incomplete. */ dateAfter: DateAfterFunction; /** @todo Documentation incomplete. */ dateBefore: DateBeforeFunction; /** @todo Documentation incomplete. */ dateDiff: DateDiffFunction; /** @todo Documentation incomplete. */ dateEquals: DateEqualsFunction; /** @todo Documentation incomplete. */ dateModify: DateModifyFunction; /** @todo Documentation incomplete. */ dateNotEquals: DateNotEqualsFunction; /** @todo Documentation incomplete. */ dateOnOrAfter: DateOnOrAfterFunction; /** @todo Documentation incomplete. */ dateOnOrBefore: DateOnOrBeforeFunction; /** @todo Documentation incomplete. */ day: DayFunction; /** @todo Documentation incomplete. */ empty: EmptyFunction; /** @todo Documentation incomplete. */ flat: FlatFunction; /** @todo Documentation incomplete. */ floor: FloorFunction; /** @todo Documentation incomplete. */ hour: HourFunction; /** @todo Documentation incomplete. */ if: IfFunction; /** @todo Documentation incomplete. */ index: IndexFunction; /** @todo Documentation incomplete. */ inFolder: InFolderFunction; /** @todo Documentation incomplete. */ join: JoinFunction; /** @todo Documentation incomplete. */ len: LenFunction; /** @todo Documentation incomplete. */ linksTo: LinksToFunction; /** @todo Documentation incomplete. */ min: MinFunction; /** @todo Documentation incomplete. */ minute: MinuteFunction; /** @todo Documentation incomplete. */ month: MonthFunction; /** @todo Documentation incomplete. */ not: NotFunction; /** @todo Documentation incomplete. */ notContains: NotContainsFunction; /** @todo Documentation incomplete. */ notEmpty: NotEmptyFunction; /** @todo Documentation incomplete. */ now: NowFunction; /** @todo Documentation incomplete. */ round: RoundFunction; /** @todo Documentation incomplete. */ second: SecondFunction; /** @todo Documentation incomplete. */ slice: SliceFunction; /** @todo Documentation incomplete. */ taggedWith: TaggedWithFunction; /** @todo Documentation incomplete. */ title: TitleFunction; /** @todo Documentation incomplete. */ trim: TrimFunction; /** @todo Documentation incomplete. */ unique: UniqueFunction; /** @todo Documentation incomplete. */ year: YearFunction; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesHandlers extends Record<string, ViewFactory> { /** @todo Documentation incomplete. */ table: ViewFactory<TableView>; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesPlugin extends InternalPlugin<BasesPluginInstance> { } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BasesPluginInstance extends InternalPluginInstance<BasesPlugin> { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ defaultOn: boolean; /** @todo Documentation incomplete. */ functions: BasesFunctions; /** @todo Documentation incomplete. */ handlers: BasesHandlers; /** @todo Documentation incomplete. */ createAndEmbedBase(editor: Editor): Promise<void>; /** @todo Documentation incomplete. */ createNewBasesFile(location?: TFolder, filename?: string, contents?: string): Promise<TFile>; /** @todo Documentation incomplete. */ deregisterFunction(name: string): void; /** @todo Documentation incomplete. */ deregisterView(type: string): void; /** @todo Documentation incomplete. */ getFunction(name: string): BasesFunction | null; /** @todo Documentation incomplete. */ getOperatorFunctions(): BasesFunction[]; /** @todo Documentation incomplete. */ getViewFactory(type: string): ViewFactory | null; /** @todo Documentation incomplete. */ getViewTypes(): string[]; /** @todo Documentation incomplete. */ onFileMenu(menu: Menu, file: TAbstractFile, source: string, leaf?: WorkspaceLeaf): void; /** @todo Documentation incomplete. */ registerFunction(fn: BasesFunction): void; /** @todo Documentation incomplete. */ registerView(type: string, viewFactory: ViewFactory): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface Bezier { /** @todo Documentation incomplete. */ cp1: Pointer; /** @todo Documentation incomplete. */ cp2: Pointer; /** @todo Documentation incomplete. */ from: Pointer; /** @todo Documentation incomplete. */ path: string; /** @todo Documentation incomplete. */ to: Pointer; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface Bookmark { /** @todo Documentation incomplete. */ assoc: number; /** @todo Documentation incomplete. */ cm: CodeMirrorEditor; /** @todo Documentation incomplete. */ id: number; /** @todo Documentation incomplete. */ offset: number; /** @todo Documentation incomplete. */ clear(): void; /** @todo Documentation incomplete. */ find(): EditorPosition | null; /** @todo Documentation incomplete. */ update(changeDesc: ChangeDesc): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BookmarkItem { /** @todo Documentation incomplete. */ ctime: number; /** @todo Documentation incomplete. */ type: "file" | "folder" | "group" | "graph" | "search" | "url"; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BookmarksPlugin extends InternalPlugin<BookmarksPluginInstance> { /** @todo Documentation incomplete. */ views: BookmarksPluginViews; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BookmarksPluginInstance extends InternalPluginInstance<BookmarksPlugin>, Events { /** @todo Documentation incomplete. */ app: App; /** @todo Documentation incomplete. */ bookmarkedViews: WeakMap<View, HTMLElement>; /** @todo Documentation incomplete. */ bookmarkLookup: Record<string, BookmarkItem>; /** @todo Documentation incomplete. */ defaultOn: true; /** @todo Documentation incomplete. */ hasValidData: boolean; /** @todo Documentation incomplete. */ items: BookmarkItem[]; /** @todo Documentation incomplete. */ onItemsChanged: Debouncer<[ boolean ], void>; /** @todo Documentation incomplete. */ plugin: BookmarksPlugin; /** @todo Documentation incomplete. */ urlBookmarkLookup: Record<string, BookmarkItem>; /** @todo Documentation incomplete. */ _onItemsChanged(shouldSave: boolean): void; /** @todo Documentation incomplete. */ addItem(item: BookmarkItem, instance?: BookmarksPluginInstance): void; /** @todo Documentation incomplete. */ editItem(item: BookmarkItem): void; /** @todo Documentation incomplete. */ findBookmarkByView(view: FileView): BookmarkItem | null | undefined; /** @todo Documentation incomplete. */ getBookmarks(): BookmarkItem[]; /** @todo Documentation incomplete. */ getItemTitle(item: BookmarkItem): string; /** @todo Documentation incomplete. */ initLeaf(): void; /** @todo Documentation incomplete. */ loadData(): Promise<boolean>; /** @todo Documentation incomplete. */ moveItem(item: BookmarkItem, instance: BookmarksPluginInstance | undefined, index: number): void; /** @todo Documentation incomplete. */ onEditorMenu(menu: Menu, editor: Editor, info: MarkdownView | MarkdownFileInfo): void; /** @todo Documentation incomplete. */ onEnable(app: App, plugin: BookmarksPlugin): Promise<void>; /** @todo Documentation incomplete. */ onExternalSettingsChange(): Promise<void>; /** @todo Documentation incomplete. */ onFileMenu(menu: Menu, files: TAbstractFile[], source: string, leaf?: WorkspaceLeaf): void; /** @todo Documentation incomplete. */ onFileRename(file: TFile, oldPath: string): void; /** @todo Documentation incomplete. */ onFilesMenu(menu: Menu, files: TAbstractFile[], source: string, leaf?: WorkspaceLeaf): void; /** @todo Documentation incomplete. */ onLeafMenu(menu: Menu, leaf: WorkspaceLeaf): void; /** @todo Documentation incomplete. */ onSearchResultsMenu(menu: Menu, search: TypedWorkspaceLeaf<SearchView>): void; /** @todo Documentation incomplete. */ onTabGroupMenu(menu: Menu, tabsLeaf: WorkspaceTabs): void; /** @todo Documentation incomplete. */ onUserEnable(): void; /** @todo Documentation incomplete. */ openBookmark(item: BookmarkItem, newLeaf: PaneType | boolean, newLeaf2?: PaneType | boolean): Promise<void>; /** @todo Documentation incomplete. */ openBookmarkInLeaf(item: BookmarkItem, leaf: WorkspaceLeaf, newLeaf?: PaneType | boolean): Promise<void>; /** @todo Documentation incomplete. */ openBookmarks(items: BookmarkItem[], newLeaf?: PaneType | boolean): Promise<void>; /** @todo Documentation incomplete. */ rebuildBookmarkCache(): void; /** @todo Documentation incomplete. */ removeItem(item: BookmarkItem): void; /** @todo Documentation incomplete. */ saveData(): void; /** @todo Documentation incomplete. */ updateTabHeaders(): void; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BookmarksPluginViews extends Record<string, ViewCreator> { /** @todo Documentation incomplete. */ bookmarks(left: WorkspaceLeaf): BookmarksView; } /** * @todo Documentation incomplete. * @public * @unofficial */ export interface BookmarksView extends ItemView { /** @todo Documentation incomplete */ _copyToClipboard(e: unknown, t: unknown): void; /** @todo Documentation incomplete */ _getActiveBookmarks(): unknown[]; /** * Attaches the handleDrag of DragManager. */ attachDragHandler(e: unknown): void; /** * Attaches the handleDrop of DragManager to containerEl. */ attachDropHandler(): void; /** @todo Documentation incomplete */ createNewGroup(e: unknown): void; /** @todo Documentation incomplete */ dragSelectedBookmarks(e: unknown, t: unknown): unknown | null; /** @todo Documentation incomplete */ getItemDom(e: unknown): unknown; /** @todo Documentation incomplete */ getNodeId(e: unknown): string; /** * Get the current view type. */ getViewType(): typeof ViewType.Bookmarks; /** @todo Documentation incomplete */ handleCollapseAll(e: unknown): void; /** @todo Documentation incomplete */ isItem(item: unknown): boolean; /** @todo Documentation incomplete */ onContextMenu(event: unknown): void; /** * Called when delete is requested. * * @param event - The event triggered this function. */ onDeleteSelectedItems(event: unknown): unknown; /** * Called when a file is created. * * @param file - The created file. */ onFileCreate