UNPKG

obsidian-typings

Version:

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

2,203 lines (2,201 loc) 344 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 LezerTree } from '@lezer/common'; import type { App as App$1, BrowserWindow } from 'electron'; import type { Mermaid } from 'mermaid'; import type { FSWatcher } from 'node:fs'; import type { App, BasesConfigFileFilter, BlockCache, CacheItem, CachedMetadata, CloseableComponent, ColorComponent, Command, Component, DataAdapter, Debouncer, EditableFileView, Editor, EditorPosition, EditorRange, EditorRangeOrCaret, EditorSuggest, EmbedCache, EventRef, Events, FileStats, FileView, FrontmatterLinkCache, FuzzySuggestModal, HoverLinkSource, HoverParent, HoverPopover, IconName, ItemView, KeymapInfo, LinkCache, MarkdownEditView, MarkdownFileInfo, MarkdownPostProcessorContext, MarkdownPreviewView, MarkdownView, Menu, Modal, PaneType, Plugin as Plugin, PluginManifest, PluginSettingTab, PopoverSuggest, Reference, ReferenceCache, RenderContext, Scope, SearchComponent, SearchResult, Setting, SettingTab, SplitDirection, TAbstractFile, TFile, TFolder, TextComponent, TextFileView, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceLeaf, WorkspaceTabs, moment as moment$1 } from 'obsidian'; import type { default as pdfjsLib } from 'pdfjs-dist'; import type { Application, Container, Graphics, ICanvas, Sprite, Text as Text$1, TextStyle } from 'pixi.js'; import type { default as Prism$1 } from 'prismjs'; /** * @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 Bases: "bases"; 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; /** * Load Mermaid and return a promise to the global mermaid object. * Can also use `window.mermaid` after this promise resolves to get the same reference. * * @returns A promise that resolves to the global `window.mermaid` object. * * @see {@link https://mermaid.js.org/ | Official Mermaid documentation}. * @public * @unofficial */ export declare function loadMermaid(): Promise<Mermaid>; /** * Load PDF.js and return a promise to the global pdfjsLib object. * Can also use `window.pdfjsLib` after this promise resolves to get the same reference. * * @returns A promise that resolves to the global `window.pdfjsLib` object. * * @see {@link https://mozilla.github.io/pdf.js/ | Official PDF.js documentation}. * @public * @unofficial */ export declare function loadPdfJs(): Promise<typeof pdfjsLib>; /** * Load Prism.js and return a promise to the global Prism object. * Can also use `window.Prism` after this promise resolves to get the same reference. * * @returns A promise that resolves to the global `window.Prism` object. * * @see {@link https://prismjs.com/ | Official Prism documentation}. * @public * @unofficial */ export declare function loadPrism(): Promise<typeof Prism$1>; /** * 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; /** * Function `Abs`. * @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; } /** * Property widget component for aliases. * * @public * @unofficial */ export interface AliasesPropertyWidgetComponent extends PropertyWidgetComponentBase { /** The container element for the property widget. */ containerEl: HTMLElement; /** The render context for the property widget. */ ctx: PropertyRenderContext; /** The hover popover for the property widget. */ hoverPopover: null; /** The multiselect component for the property widget. */ multiselect: Multiselect; /** The type of the property widget. */ type: "aliases"; /** * Handle focus event. * * @param mode - The focus mode. */ onFocus(): void; /** * Set the value of the property widget. * * @param value - The value to set. */ setValue(value: unknown): 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; /** * 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; /** * 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> { } /** * BasesConfigFileFilter `and` clause. * * @public * @unofficial */ export interface BasesConfigFileFilterAndClause { /** * All of the following filters must match. * * @public * @since 1.10.0 * @example * ```ts * { * and: [ * '*.md', * '*.txt', * ], * } * ``` */ and: BasesConfigFileFilter[]; } /** * BasesConfigFileFilter `not` clause. * * @public * @unofficial */ export interface BasesConfigFileFilterNotClause { /** * None of the following filters should match. * * @public * @since 1.10.0 * @example * ```ts * { * not: [ * '*.md', * '*.txt', * ], * } * ``` */ not: BasesConfigFileFilter[]; } /** * BasesConfigFileFilter `or` clause. * * @public * @unofficial */ export interface BasesConfigFileFilterOrClause { /** * Some of the following filters should match. * * @public * @since 1.10.0 * @example * ```ts * { * or: [ * '*.md', * '*.txt', * ], * } * ``` */ or: BasesConfigFileFilter[]; } /** * Bases context * * @public * @unofficial */ export interface BasesContext extends Component { /** * Local context. */ _local: BasesLocal; } /** * Table view constructor. * * @public * @unofficial */ export interface BasesContextConstructor extends ConstructorBase<[ app: App, filter: Record<string, BasesFilter>, formulas: Record<string, BasesFormula>, file: TFile | null ], BasesContext> { } /** * Bases control. * * @public * @unofficial */ export interface BasesControl { /** * Render to. * * @param containerEl - The container element. * @param t - The data to render. */ renderTo(containerEl: HTMLElement, renderContext: RenderContext): void; } /** * Controller for the view. * * @public * @unofficial */ export interface BasesController extends Component { /** * The Obsidian app instance. */ app: App; /** * The context of the view controller. */ ctx: BasesContext; /** * The current file. */ currentFile: TFile | null; /** * The current error. */ error: string | null; /** * The error element. */ errorEl: HTMLDivElement; /** * The errors. */ errors: Set<string>; /** * The events. */ events: Events; /** * The filter menu. */ filterMenu: BasesFilterMenu; /** * Whether the initial scan has been completed. */ initialScan: boolean; /** * The mock context. */ mockContext: BasesMockContext; /** * The new item menu. */ newItemMenu: BasesNewItemMenu; /** * The plugin instance. */ plugin: BasesPluginInstance; /** * The property menu. */ propertyMenu: BasesPropertyMenu; /** * The query. */ query: BasesQuery | null; /** * The query state. */ queryState: string; /** * The queue. */ queue: PromisedQueue; /** * The relevant properties. */ relevantProperties: Set<string>; /** * The request to notify the view. */ requestNotifyView: Debouncer<[ ], void>; /** * The results. */ results: Map<unknown, unknown>; /** * The results menu. */ resultsMenu: BasesResultsMenu; /** * The sort menu. */ sortMenu: BasesSortMenu; /** * The view. */ view: View; /** * The view container element. */ viewContainerEl: HTMLDivElement; /** * The view states. */ viewEstates: Record<string, unknown>; /** * The view header element. */ viewHeaderEl: HTMLDivElement; /** * The view menu. */ viewMenu: BasesViewMenu; /** * The view name. */ viewName: string; /** * Adds a result to the results. */ addResult(result: unknown, arg2: unknown): unknown; /** * Builds the bases context. */ buildBasesContext(filter: BasesFilter): BasesContext; /** * Clears the view controller. */ clear(): void; /** * Clears the error. */ clearError(): void; /** * Displays an error. */ displayError(error: string, arg2: unknown): void; /** * Evaluates the relevant properties. */ evaluateRelevantProperties(relevantProperties: string[]): void; /** * Gets the active bases view of a given type. */ getActiveBasesViewOfType(viewType: string): View | null; /** * Gets the current file. */ getCurrentFile(): TFile | null; /** * Gets the editor language support. */ getEditorLanguageSupport(): EditorLanguageSupport; /** * Gets the mock value. */ getMockValue(arg1: unknown): unknown; /** * Gets the mock value for an ident. */ getMockValueForIdent(arg1: unknown): unknown; /** * Gets the properties. */ getProperties(): unknown[]; /** * Gets the query view names. */ getQueryViewNames(): string[]; /** * Gets the view config. */ getViewConfig(): unknown; /** * Gets the widget for an ident. */ getWidgetForIdent(type: string): string; /** * Notifies the view. */ notifyView(): void; /** * On config changed. */ onConfigChanged(configKey: string): void; /** * On resize. */ onResize(): void; /** * Prompt for add view. */ promptForAddView(): void; /** * Removes a result. */ removeResult(arg1: unknown): unknown; /** * Runs a query. */ runQuery(arg1: unknown): void; /** * Selects a view. */ selectView(viewName: string): void; /** * Sets the query. */ setQuery(queryOrError: BasesQuery | Error): void; /** * Sets the query and view. */ setQueryAndView(queryOrError: BasesQuery | Error, viewName: string): void; /** * Starts the loader. */ startLoader(): void; /** * Stops the loader. */ stopLoader(): void; /** * Updates the view. */ update(): void; /** * Updates the current file. */ updateCurrentFile(file: TFile): void; } /** * Bases external link. * * @public * @unofficial */ export interface BasesExternalLink extends BasesControl { } /** * Bases file. * * @public * @unofficial */ export interface BasesFile extends BasesControl { /** * Gets the links. * * @returns The links. */ getLinks(): BasesList; } /** * Bases filter. * * @public * @unofficial */ export interface BasesFilter { } /** * Bases filter menu. * * @public * @unofficial */ export interface BasesFilterMenu { } /** * Bases formula. * * @public * @unofficial */ export interface BasesFormula { } /** * Bases function. * * @public * @unofficial */ export interface BasesFunction { /** * An Obsidian app instance. */ app: App; /** * The arguments. */ args: BasesFunctionArg[]; /** * Whether the function is an operator. */ isOperator: boolean; /** * The name of the function. */ name: string; /** * The return type of the function. */ returnType: string; /** * Applies the function. */ apply(...args: unknown[]): unknown; /** * Serializes the function. */ serialize(...args: unknown[]): string; } /** * Bases function argument. * * @public * @unofficial */ export interface BasesFunctionArg { /** * Whether to include custom types. */ include_custom_types?: boolean; /** * The name of the argument. */ name: string; /** * Whether the argument is optional. */ optional?: boolean; /** * The types of the argument. */ type: string[]; /** * Whether the argument is variadic. */ variadic?: boolean; } /** * Bases functions. * * @public * @unofficial */ export interface BasesFunctions { /** * The not equal function. */ "!=": NotEqualFunction; /** * The less than function. */ "<": LessFunction; /** * The less than or equal to function. */ "<=": LessOrEqualFunction; /** * The equal function. */ "==": EqualFunction; /** * The greater than function. */ ">": GreaterFunction; /** * The greater than or equal to function. */ ">=": GreaterOrEqualFunction; /** * The absolute function. */ abs: AbsFunction; /** * The ceiling function. */ ceil: CeilFunction; /** * The concat function. */ concat: ConcatFunction; /** * The contains function. */ contains: ContainsFunction; /** * The contains all function. */ containsAll: ContainsAllFunction; /** * The contains any function. */ containsAny: ContainsAnyFunction; /** * The contains none function. */ containsNone: ContainsNoneFunction; /** * The date after function. */ dateAfter: DateAfterFunction; /** * The date before function. */ dateBefore: DateBeforeFunction; /** * The date diff function. */ dateDiff: DateDiffFunction; /** * The date equals function. */ dateEquals: DateEqualsFunction; /** * The date modify function. */ dateModify: DateModifyFunction; /** * The date not equals function. */ dateNotEquals: DateNotEqualsFunction; /** * The date on or after function. */ dateOnOrAfter: DateOnOrAfterFunction; /** * The date on or before function. */ dateOnOrBefore: DateOnOrBeforeFunction; /** * The day function. */ day: DayFunction; /** * The empty function. */ empty: EmptyFunction; /** * The flat function. */ flat: FlatFunction; /** * The floor function. */ floor: FloorFunction; /** * The hour function. */ hour: HourFunction; /** * The if function. */ if: IfFunction; /** * The index function. */ index: IndexFunction; /** * The in folder function. */ inFolder: InFolderFunction; /** * The join function. */ join: JoinFunction; /** * The length function. */ len: LenFunction; /** * The links to function. */ linksTo: LinksToFunction; /** * The minimum function. */ min: MinFunction; /** * The minute function. */ minute: MinuteFunction; /** * The month function. */ month: MonthFunction; /** * The not function. */ not: NotFunction; /** * The not contains function. */ notContains: NotContainsFunction; /** * The not empty function. */ notEmpty: NotEmptyFunction; /** * The now function. */ now: NowFunction; /** * The round function. */ round: RoundFunction; /** * The second function. */ second: SecondFunction; /** * The slice function. */ slice: SliceFunction; /** * The tagged with function. */ taggedWith: TaggedWithFunction; /** * The title function. */ title: TitleFunction; /** * The trim function. */ trim: TrimFunction; /** * The unique function. */ unique: UniqueFunction; /** * The year function. */ year: YearFunction; } /** * Bases handlers. * * @public * @unofficial */ export interface BasesHandlers extends Record<string, ViewFactory> { /** * The table view factory. */ table: ViewFactory<TableView>; } /** * Bases link. * * @public * @unofficial */ export interface BasesLink extends BasesControl { /** * The link. */ link: string; } /** * Bases link constructor. * * @public * @unofficial */ export interface BasesLinkConstructor extends ConstructorBase<[ app: App, linkText: string, sourcePath: string, displayText: string ], BasesLink> { /** * Parse {@link BasesLink} from string. * * @param app - The Obsidian application instance. * @param str - The string to parse. * @param sourcePath - The source path. * @returns The parsed {@link BasesLink}. */ parseFromString(app: App, str: string, sourcePath: string): BasesLink; } /** * Bases list. * * @public * @unofficial */ export interface BasesList extends BasesControl { /** * The controls. */ data: Record<string, BasesControl>; /** * Gets a value by key. * * @param key - The key. * @returns The value. */ get(key: string): BasesControl; } /** * Bases local. * * @public * @unofficial */ export interface BasesLocal { /** * Implicit. */ implicit: BasesFile; /** * Note. */ note: BasesNote; } /** * Bases view controller mock context. * * @public * @unofficial */ export interface BasesMockContext { } /** * Bases view controller new item menu. * * @public * @unofficial */ export interface BasesNewItemMenu { } /** * Bases note. * * @public * @unofficial */ export interface BasesNote { /** * Data. */ data: Record<string, unknown>; /** * Get control. * * @param key - The key. * @returns The control. */ get(key: string): BasesControl; } /** * Bases plugin. * * @public * @unofficial */ export interface BasesPlugin extends InternalPlugin<BasesPluginInstance> { } /** * Bases plugin instance. * * @public * @unofficial */ export interface BasesPluginInstance extends InternalPluginInstance<BasesPlugin> { /** * An Obsidian app instance. */ app: App; /** * Whether the default on. */ defaultOn: boolean; /** * The functions. */ functions: BasesFunctions; /** * The handlers. */ handlers: BasesHandlers; /** * Creates and embeds a base. */ createAndEmbedBase(editor: Editor): Promise<void>; /** * Creates a new bases file. */ createNewBasesFile(location?: TFolder, filename?: string, contents?: string): Promise<TFile>; /** * Deregisters a function. */ deregisterFunction(name: string): void; /** * Deregisters a view. */ deregisterView(type: string): void; /** * Gets a function. */ getFunction(name: string): BasesFunction | null; /** * Gets the operator functions. */ getOperatorFunctions(): BasesFunction[]; /** * Gets a view factory. */ getViewFactory(type: string): ViewFactory | null; /** * Gets the view types. */ getViewTypes(): string[]; /** * On file menu. */ onFileMenu(menu: Menu, file: TAbstractFile, source: stri