// Generated by dts-bundle-generator v9.5.1 import type { Annotation, AnnotationType, ChangeDesc, ChangeSet, ChangeSpec, CharCategory, EditorSelection as CmEditorSelection, EditorState, EditorStateConfig, Extension, Facet, FacetReader, Line, Range as Range, RangeComparator, RangeCursor, RangeSet, RangeValue, SelectionRange, SpanIterator, StateEffect, StateEffectType, StateField, Text as Text, Transaction, TransactionSpec } from '@codemirror/state'; import type { BlockType, DOMEventHandlers, DOMEventMap, DecorationSet, Direction, EditorView, Rect, ViewPlugin, ViewUpdate, WidgetType } from '@codemirror/view'; import * as fs from 'node:fs'; import type { FSWatcher, Stats } from 'node:fs'; import * as fsPromises from 'node:fs/promises'; import * as path from 'node:path'; import type { AbstractTextComponent, App, BaseComponent, BasesConfigFileFilter, BasesEntry, BasesEntryGroup, BasesQueryResult, BasesViewConfig, BlockCache, BlockSubpathResult, BooleanValue, ButtonComponent, CacheItem, CachedMetadata, CapacitorAdapter, CliFlag, CliFlags, CliHandler, ColorComponent, Command, Component, Constructor, DataAdapter, DateValue, Debouncer, DropdownComponent, DurationValue, EditableFileView, Editor, EditorPosition, EditorRange, EditorRangeOrCaret, EditorSelection, EditorSuggest, EmbedCache, EventRef, Events, ExtraButtonComponent, FileManager, FileStats, FileSystemAdapter, FileValue, FileView, FootnoteSubpathResult, FrontmatterLinkCache, FuzzySuggestModal, HTMLValue, HeadingSubpathResult, HoverLinkSource, HoverParent, HoverPopover, IconName, IconValue, ImageValue, Instruction, ItemView, Keymap, KeymapInfo, LinkCache, LinkValue, ListValue, MarkdownEditView, MarkdownFileInfo, MarkdownPostProcessorContext, MarkdownPreviewRenderer, MarkdownPreviewView, MarkdownRenderChild, MarkdownRenderer, MarkdownView, Menu, MenuItem, MenuSeparator, MetadataCache, Modal, MomentFormatComponent, NotNullValue, Notice as Notice, Notice as NoticeInstance, NullValue, NumberValue, ObjectValue, ObsidianProtocolHandler, PaneType, Plugin as Plugin, PluginManifest, PluginSettingTab, Point, PopoverSuggest, ProgressBarComponent, QueryController, Reference, ReferenceCache, RegExpValue, RelativeDateValue, RenderContext, Scope, SearchComponent, SearchResult, SearchResultContainer, SecretComponent, SecretStorage, Setting, SettingGroup, SettingTab, SliderComponent, SplitDirection, StringValue, TAbstractFile, TFile, TFolder, TagValue, Tasks, TextAreaComponent, TextComponent, TextFileView, ToggleComponent, TooltipOptions, UrlValue, Value, ValueComponent, Vault, View, ViewCreator, ViewState, Workspace, WorkspaceContainer, WorkspaceFloating, WorkspaceItem, WorkspaceLeaf, WorkspaceMobileDrawer, WorkspaceParent, WorkspaceRibbon, WorkspaceRoot, WorkspaceSidedock, WorkspaceSplit, WorkspaceTabs, WorkspaceWindow, moment as momentInstance, request as requestInstance, requestUrl as requestUrlInstance } from 'obsidian'; /** * Converts HTML to Markdown. * * @public * @unofficial */ declare class TurndownService { /** Current conversion options. */ options: TurndownServiceOptions; /** Collection of conversion rules. */ rules: TurndownServiceRules; /** * Create new instance of {@link TurndownService}. * * @param options - Options. */ constructor(options?: TurndownServiceOptions); /** * Add a conversion rule. * * @param key - Rule identifier. * @param rule - The rule definition. * @returns This instance for chaining. */ addRule(key: string, rule: TurndownServiceRule): this; /** * Escape a string for use in Markdown. * * @param str - The string to escape. * @returns The escaped string. */ escape(str: string): string; /** * Keep elements matching a filter (pass through as HTML). * * @param filter - The filter to match. * @returns This instance for chaining. */ keep(filter: TurndownServiceFilter): this; /** * Remove elements matching a filter from output. * * @param filter - The filter to match. * @returns This instance for chaining. */ remove(filter: TurndownServiceFilter): this; /** * Convert HTML to Markdown. * * @param html - HTML string or DOM node to convert. * @returns The Markdown string. */ turndown(html: string | TurndownServiceNode): string; /** * Register plugin(s). * * @param plugins - Plugin or array of plugins. * @returns This instance for chaining. */ use(plugins: TurndownServicePlugin | TurndownServicePlugin[]): this; } /** * Capacitor global instance. * * @public * @unofficial */ declare const Capacitor: CapacitorGlobal; /** * Capacitor platforms instance. * * @deprecated Deprecated. * @public * @unofficial */ declare const CapacitorPlatforms: CapacitorPlatformsGlobal; /** * Electron app instance for managing the application lifecycle. * * @public * @unofficial */ declare const app: ElectronApp; declare global { /** * Apply global DOM enhancements and polyfills used by Obsidian. * * @unofficial */ function globalEnhance(): void; } declare global { /** * Augments the built-in {@link ArrayConstructor} interface. */ interface ArrayConstructor { /** * Combines an array of arrays into a single array. * * @typeParam T - The type of the elements in the arrays. * @param arrays - The array of arrays to combine. * @returns A single array containing all elements from the input arrays. * @example * ```ts * console.log(Array.combine([[1, 2], [3, 4], [5, 6]])); // [1, 2, 3, 4, 5, 6] * ``` * @official */ combine(arrays: T[][]): T[]; } } declare global { /** * Augments the built-in {@link Array} interface. * * @typeParam T - The type of the elements in the array. */ interface Array { /** * Checks if the array contains a specific element. * * @param target - The element to check for. * @returns `true` if the element is found, `false` otherwise. * @example * ```ts * console.log([1, 2, 3].contains(2)); // true * console.log([1, 2, 3].contains(4)); // false * ``` * @official */ contains(target: T): boolean; /** * Returns the index of the last element that satisfies the provided predicate. * * @param predicate - The predicate to test each element. * @returns The index of the last element that satisfies the predicate, or `-1` if no such element is found. * @example * ```ts * console.log([1, 2, 3, 2, 1].findLastIndex(x => x === 2)); // 3 * console.log([1, 2, 3, 2, 1].findLastIndex(x => x === 4)); // -1 * ``` * @official * @since 1.4.4 */ findLastIndex(predicate: (value: T) => boolean): number; /** * Returns the first element of the array. * * @returns The first element of the array, or `undefined` if the array is empty. * @example * ```ts * console.log([1, 2, 3].first()); // 1 * console.log([].first()); // undefined * ``` * @official */ first(): T | undefined; /** * Returns the last element of the array. * * @returns The last element of the array, or `undefined` if the array is empty. * @example * ```ts * console.log([1, 2, 3].last()); // 3 * console.log([].last()); // undefined * ``` * @official */ last(): T | undefined; /** * Removes an element from the array, if it exists, otherwise returns the array unchanged. * * @param target - The element to remove. * @example * ```ts * let arr = [1, 2, 3]; * arr.remove(2); * console.log(arr); // [1, 3] * arr = [1, 2, 3]; * arr.remove(4); * console.log(arr); // [1, 2, 3] * ``` * @official */ remove(target: T): void; /** * Shuffles the array in place. * * @returns The array itself. * @example * ```ts * const arr = [1, 2, 3]; * console.log(arr.shuffle()); // something like [2, 3, 1] * console.log(arr); // same as above * ``` * @official */ shuffle(): this; /** * Returns a new array with unique elements. * * @returns A new array with unique elements. * @example * ```ts * console.log([1, 2, 3, 2, 1].unique()); // [1, 2, 3] * ``` * @official */ unique(): T[]; } } declare global { /** * Augments the built-in {@link DocumentFragment} interface. */ interface DocumentFragment extends Node, NonElementParentNode, ParentNode { /** * Finds the first descendant element that matches the selector. * * @param selector - The selector to find the element with. * @returns The first descendant element that matches the selector, or `null` if no match is found. * @example * ```ts * const fragment = createFragment(); * fragment.createEl('strong', { cls: 'foo' }); * console.log(fragment.find('.foo')); // * console.log(fragment.find('.bar')); // null * ``` * @remarks See bug {@link https://forum.obsidian.md/t/bug-find-findall-findallself/98108}. * @official */ find(selector: string): Element | null; /** * Finds all descendant elements that match the selector. * * @param selector - The selector to find the elements with. * @returns An array of all descendant elements that match the selector. * @example * ```ts * const fragment = createFragment(); * fragment.createEl('strong', { cls: 'foo' }); * fragment.createEl('strong', { cls: 'foo' }); * console.log(fragment.findAll('.foo')); // [, ] * console.log(fragment.findAll('.bar')); // [] * ``` * @remarks See bug {@link https://forum.obsidian.md/t/bug-find-findall-findallself/98108}. * @official */ findAll(selector: string): Element[]; } } declare global { /** * Augments the built-in {@link Document} interface. */ interface Document { /** * The event listeners of the document. * * @official */ _EVENTS?: { [K in keyof DocumentEventMap]?: EventListenerInfo[]; }; /** * Removes an event listener from the document. * * @typeParam K - The type of the event to listen for. * @param this - The document to remove the event listener from. * @param type - The type of event to listen for. * @param selector - The selector of the event target. * @param listener - The listener to call when the event is triggered. * @param options - The options of the event listener. * @example * ```ts * document.off('click', 'div', document.body._EVENTS.click[0].listener); * ``` * @official */ off(this: Document, type: K, selector: string, listener: (this: Document, ev: DocumentEventMap[K], delegateTarget: HTMLElement) => unknown, options?: AddEventListenerOptions | boolean): void; /** * Adds an event listener to the document. * * @typeParam K - The type of the event to listen for. * @param this - The document to add the event listener to. * @param type - The type of event to listen for. * @param selector - The selector of the event target. * @param listener - The listener to call when the event is triggered. * @param options - The options of the event listener. * @example * ```ts * document.on('click', 'div', (ev) => { * console.log(ev); * }); * ``` * @official */ on(this: Document, type: K, selector: string, listener: (this: Document, ev: DocumentEventMap[K], delegateTarget: HTMLElement) => unknown, options?: AddEventListenerOptions | boolean): void; } } declare global { /** * Augments the built-in {@link Element} interface. */ interface Element extends Node { /** * Adds a class to the element. * * @param classes - The class to add. * @example * ```ts * const element = createEl('p'); * element.addClass('foo', 'bar'); * console.log(element.className); // foo * @official */ addClass(...classes: string[]): void; /** * Adds multiple classes to the element. * * @param classes - The classes to add. * @example * ```ts * const element = createEl('p'); * element.addClasses(['foo', 'bar']); * console.log(element.className); // foo bar * ``` * @official */ addClasses(classes: string[]): void; /** * Finds the first descendant element that matches the selector. * * @param selector - The selector to find the element with. * @returns The first descendant element that matches the selector, or `null` if no match is found. * @example * ```ts * const element = createEl('p'); * element.createEl('strong', { cls: 'foo' }); * console.log(element.find('.foo')); // * console.log(element.find('.bar')); // null * ``` * @official */ find(selector: string): Element | null; /** * Finds all descendant elements that match the selector. * * @param selector - The selector to find the elements with. * @returns An array of all descendant elements that match the selector. * @example * ```ts * const element = createEl('p'); * element.createEl('strong', { cls: 'foo' }); * element.createEl('strong', { cls: 'foo' }); * console.log(element.findAll('.foo')); // [, ] * console.log(element.findAll('.bar')); // [] * ``` * @remarks See bug {@link https://forum.obsidian.md/t/bug-find-findall-findallself/98108}. * @official */ findAll(selector: string): Element[]; /** * Finds all descendant elements or self that match the selector. * * @param selector - The selector to find the elements with. * @returns An array of all descendant elements or self that match the selector. * @example * ```ts * const element = createEl('p', { cls: 'foo' }); * element.createEl('strong', { cls: 'foo' }); * console.log(element.findAllSelf('.foo')); // [

, ] * console.log(element.findAllSelf('.bar')); // [] * ``` * @remarks See bug {@link https://forum.obsidian.md/t/bug-find-findall-findallself/98108}. * @official */ findAllSelf(selector: string): Element[]; /** * Gets an attribute from the element. * * @param qualifiedName - The name of the attribute to get. * @returns The value of the attribute. * @example * ```ts * const element = createEl('p'); * element.setAttr('data-foo', 'bar'); * console.log(element.getAttr('data-foo')); // bar * ``` * @official */ getAttr(qualifiedName: string): null | string; /** * Gets the value of a CSS property of the element. * * @param property - The property to get the value of. * @param pseudoElement - The pseudo-element to get the value of. * @returns The value of the CSS property. * @example * ```ts * const element = document.body.createEl('p'); * element.style.color = 'red'; * console.log(element.getCssPropertyValue('color')); // rgb(255, 0, 0) * console.log(element.getCssPropertyValue('color', ':after')); // rgb(255, 0, 0) * ``` * @official */ getCssPropertyValue(property: string, pseudoElement?: string): string; /** * Returns the text content of the element. * * @returns The text content of the element. * @example * ```ts * const element = createEl('p'); * element.createEl('strong', { text: 'foo' }); * element.createEl('strong', { text: 'bar' }); * console.log(element.getText()); // foobar * ``` * @official */ getText(): string; /** * Checks if the element has a class. * * @param cls - The class to check for. * @returns `true` if the element has the class, `false` otherwise. * @example * ```ts * const element = createEl('p'); * element.addClass('foo', 'bar'); * console.log(element.hasClass('foo')); // true * console.log(element.hasClass('baz')); // false * ``` * @official */ hasClass(cls: string): boolean; /** * Checks if the element is the active element. * * @returns `true` if the element is the active element, `false` otherwise. * @example * ```ts * const element = document.body.createEl('p'); * console.log(element.isActiveElement()); // false * console.log(document.activeElement.isActiveElement()); // true * ``` * @official */ isActiveElement(): boolean; /** * Matches the selector recursively up the DOM tree. * * @param selector - The selector to match the parent with. * @param lastParent - The last parent to stop matching against. * @returns The matched element or `null` if no match is found. * @example * ```ts * const element = createEl('p'); * console.log(element.matchParent('p')); //

* console.log(element.matchParent('strong')); // null * const child = element.createEl('strong'); * console.log(child.matchParent('strong')); // * console.log(child.matchParent('p')); //

* const grandchild = child.createEl('em'); * console.log(grandchild.matchParent('p', child)); // null * ``` * @official */ matchParent(selector: string, lastParent?: Element): Element | null; /** * Removes a class from the element. * * @param classes - The class to remove. * @example * ```ts * const element = createEl('p'); * element.addClass('foo bar'); * element.removeClass('foo', 'baz'); * console.log(element.className); // bar * ``` * @official */ removeClass(...classes: string[]): void; /** * Removes multiple classes from the element. * * @param classes - The classes to remove. * @example * ```ts * const element = createEl('p'); * element.addClass('foo bar'); * element.removeClasses(['foo', 'baz']); * console.log(element.className); // bar * ``` * @official */ removeClasses(classes: string[]): void; /** * Sets an attribute on the element. * * @param qualifiedName - The name of the attribute to set. * @param value - The value to set the attribute to. * @example * ```ts * const element = createEl('p'); * element.setAttr('data-foo', 'bar'); * console.log(element.getAttr('data-foo')); // bar * ``` * @official */ setAttr(qualifiedName: string, value: boolean | null | number | string): void; /** * Sets multiple attributes on the element. * * @param obj - The attributes to set. * @example * ```ts * const element = createEl('p'); * element.setAttrs({ * 'data-foo': 'bar', * 'data-baz': 'qux', * }); * console.log(element.getAttr('data-foo')); // bar * console.log(element.getAttr('data-baz')); // qux * ``` * @official */ setAttrs(obj: Record): void; /** * Sets the text content of the element. * * @param val - The text content to set. * @example * ```ts * const element = createEl('p'); * element.setText('foo'); * console.log(element); //

foo

* const fragment = createFragment(); * fragment.createEl('strong', { text: 'bar' }); * element.setText(fragment); * console.log(element); //

bar

* ``` * @official */ setText(val: DocumentFragment | string): void; /** * Toggles a class on the element. * * @param classes - The class to toggle. * @param value - If `true`, the class will be added, if `false`, the class will be removed. * @example * ```ts * const element = createEl('p'); * element.addClass('foo', 'bar'); * element.toggleClass('foo', false); * console.log(element.className); // bar * element.toggleClass('foo', true); * console.log(element.className); // bar foo * element.toggleClass('baz', false); * console.log(element.className); // bar foo * element.toggleClass('baz', true); * console.log(element.className); // bar foo baz * ``` * @official */ toggleClass(classes: string | string[], value: boolean): void; } } declare global { /** * Augments the built-in {@link HTMLElement} interface. */ interface HTMLElement extends Element { /** * The event listeners of the element. * * @official */ _EVENTS?: { [K in keyof HTMLElementEventMap]?: EventListenerInfo[]; }; /** * Get the inner height of this element without padding. * * @official */ readonly innerHeight: number; /** * Get the inner width of this element without padding. * * @official */ readonly innerWidth: number; /** * Hides the element using css `display` property. * * @example * ```ts * document.body.hide(); * ``` * @official */ hide(): void; /** * Returns whether this element is shown, when the element is attached to the DOM and * none of the parent and ancestor elements are hidden with `display: none`. * * Exception: Does not work on `` and ``, or on elements with `position: fixed`. * * @returns `true` if the element is shown, `false` otherwise. * @example * ```ts * const element = document.body.createEl('p'); * console.log(element.isShown()); // true * element.hide(); * console.log(element.isShown()); // false * ``` * @official */ isShown(): boolean; /** * Removes an event listener from the element. * * @typeParam K - The type of the event to listen for. * @param this - The element to remove the event listener from. * @param type - The type of event to listen for. * @param selector - The selector of the event target. * @param listener - The listener to call when the event is triggered. * @param options - The options of the event listener. * @example * ```ts * document.body.off('click', 'div', document.body._EVENTS.click[0].listener); * ``` * @official */ off(this: HTMLElement, type: K, selector: string, listener: (this: HTMLElement, ev: HTMLElementEventMap[K], delegateTarget: HTMLElement) => unknown, options?: AddEventListenerOptions | boolean): void; /** * Adds an event listener to the element. * * @typeParam K - The type of the event to listen for. * @param this - The element to add the event listener to. * @param type - The type of event to listen for. * @param selector - The selector of the event target. * @param listener - The listener to call when the event is triggered. * @param options - The options of the event listener. * @example * ```ts * document.body.on('click', 'div', (ev) => { * console.log(ev); * }); * ``` * @official */ on(this: HTMLElement, type: K, selector: string, listener: (this: HTMLElement, ev: HTMLElementEventMap[K], delegateTarget: HTMLElement) => unknown, options?: AddEventListenerOptions | boolean): void; /** * Adds a click event listener to the element. * * @param this - The element to add the event listener to. * @param listener - The listener to call when the click event is triggered. * @param options - The options of the click event listener. * @example * ```ts * document.body.onClickEvent((ev) => { * console.log(ev); * }); * ``` * @official */ onClickEvent(this: HTMLElement, listener: (this: HTMLElement, ev: MouseEvent) => unknown, options?: AddEventListenerOptions | boolean): void; /** * Adds an event listener to the element when it is inserted into the DOM. * * @param listener - the callback to call when this node is inserted into the DOM. * @param once - if `true`, this will only fire once and then unhook itself. * @returns destroy - a function to remove the event handler to avoid memory leaks. * @example * ```ts * document.body.onNodeInserted(() => { * console.log('node inserted'); * }); * ``` * @official */ onNodeInserted(this: HTMLElement, listener: () => unknown, once?: boolean): () => void; /** * Adds an event listener to the element when it is migrated to another window. * * @param listener - the callback to call when this node has been migrated to another window. * @returns destroy - a function to remove the event handler to avoid memory leaks. * @example * ```ts * document.body.onWindowMigrated((win) => { * console.log('window migrated'); * }); * @official */ onWindowMigrated(this: HTMLElement, listener: (win: Window) => unknown): () => void; /** * Sets the CSS properties of the element. * * @param props - The properties to set. * @example * ```ts * const element = document.body.createEl('p'); * element.setCssProps({ color: 'red', 'font-size': '16px' }); * ``` * @official */ setCssProps(props: Record): void; /** * Sets the CSS styles of the element. * * @param styles - The styles to set. * @example * ```ts * const element = document.body.createEl('p'); * element.setCssStyles({ color: 'red', fontSize: '16px' }); * ``` * @official */ setCssStyles(styles: Partial): void; /** * Shows the element using css `display` property. * * @example * ```ts * document.body.show(); * ``` * @official */ show(): void; /** * Toggles the visibility of the element using css `display` property. * * @param show - Whether to show the element. * @example * ```ts * document.body.toggle(true); * document.body.toggle(false); * ``` * @official */ toggle(show: boolean): void; /** * Toggles the visibility of the element using css `visibility` property. * * @param visible - Whether to show the element. * @example * ```ts * document.body.toggleVisibility(true); * document.body.toggleVisibility(false); * ``` * @official */ toggleVisibility(visible: boolean): void; /** * Triggers an event on the element. * * @param eventType - the type of event to trigger. * @example * ```ts * document.body.trigger('click'); * ``` * @official */ trigger(eventType: string): void; } } declare global { /** * Augments the built-in {@link Math} interface. */ interface Math { /** * Clamps a value between a minimum and maximum. * * @param value - The value to clamp. * @param min - The minimum value. * @param max - The maximum value. * @returns The clamped value. * @example * ```ts * console.log(Math.clamp(10, 0, 5)); // 5 * console.log(Math.clamp(-10, 0, 5)); // 0 * console.log(Math.clamp(3, 0, 5)); // 3 * ``` * @official */ clamp(value: number, min: number, max: number): number; /** * Returns the square of a number. * * @param value - The number to square. * @returns The square of the number. * @example * ```ts * console.log(Math.square(2)); // 4 * console.log(Math.square(-2)); // 4 * ``` * @official */ square(value: number): number; } } declare global { /** * Augments the built-in {@link Node} interface. */ interface Node { /** * Global window object. * * @official */ constructorWin: Window; /** * The document this node belongs to, or the global document. * * @official */ doc: Document; /** * The window object this node belongs to, or the global window. * * @official */ win: Window; /** * Appends a text node to the node. * * @param val - The text to append. * @example * ```ts * const parent = createEl('p'); * parent.createEl('strong', { text: 'foo' }); * parent.appendText('bar'); * console.log(parent); //

foobar

* ``` * @official */ appendText(val: string): void; /** * Creates a new `
` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * document.body.createDiv({ text: 'foo' }, (div) => { * div.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createDiv(o?: DomElementInfo | string, callback?: (el: HTMLDivElement) => void): HTMLDivElement; /** * Create an element and append it to this node. * * @typeParam K - The type of the element to create. * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * document.body.createEl('p', { text: 'foo' }, (div) => { * div.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createEl(tag: K, o?: DomElementInfo | string, callback?: (el: HTMLElementTagNameMap[K]) => void): HTMLElementTagNameMap[K]; /** * Creates a new `` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * document.body.createSpan({ text: 'foo' }, (span) => { * span.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createSpan(o?: DomElementInfo | string, callback?: (el: HTMLSpanElement) => void): HTMLSpanElement; /** * Creates a new svg element such as ``, ``, ``, etc. * * @typeParam K - The type of the element to create. * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * document.body.createSvg('svg', { cls: 'foo bar' }, (svg) => { * svg.createSvg('circle'); * }); * @official */ createSvg(tag: K, o?: string | SvgElementInfo, callback?: (el: SVGElementTagNameMap[K]) => void): SVGElementTagNameMap[K]; /** * Detaches the node from the DOM. * * @example * ```ts * const node = document.body.createEl('p'); * console.log(document.body.contains(node)); // true * node.detach(); * console.log(document.body.contains(node)); // false * ``` * @official */ detach(): void; /** * Empties the node. * * @example * ```ts * const parent = createEl('p'); * parent.createEl('strong'); * console.log(parent.childNodes.length); // 1 * parent.empty(); * console.log(parent.childNodes.length); // 0 * ``` * @official */ empty(): void; /** * Returns the index of the node or `-1` if the node is not found. * * @param other - The node to find. * @returns The index of the node or `-1` if the node is not found. * @official */ indexOf(other: Node): number; /** * Inserts a child node after the current node. * * @typeParam T - The type of the node to insert. * @param node - The node to insert. * @param child - The child node to insert after. * @returns The inserted node. * @example * ```ts * const parent = createEl('p'); * const child1 = parent.createEl('strong', { text: '1' }); * const child2 = parent.createEl('strong', { text: '2' }); * const child3 = parent.createEl('strong', { text: '3' }); * const newNode = createEl('em', { text: '4' }); * parent.insertAfter(newNode, child2); * console.log(parent); //

1243

* ``` * @official */ insertAfter(node: T, child: Node | null): T; /** * Cross-window capable instanceof check, a drop-in replacement * for instanceof checks on DOM Nodes. Remember to also check * for nulls when necessary. * * @typeParam T - The type of the instance. * @param type - The type to check. * @returns `true` if the node is of the given type, `false` otherwise. * @example * ```ts * const node = createEl('p'); * console.log(node.instanceOf(HTMLParagraphElement)); // true * console.log(node.instanceOf(HTMLSpanElement)); // false * ``` * @official */ instanceOf(type: NodeConstructor): this is T; /** * Sets the children of the node. * * @param children - The children to set. * @example * ```ts * const parent = createEl('p'); * const child1 = parent.createEl('strong', { text: '1' }); * const child2 = parent.createEl('strong', { text: '2' }); * const child3 = createEl('strong', { text: '3' }); * parent.setChildrenInPlace([child1, child3]); * console.log(parent); //

13

* ``` * @official */ setChildrenInPlace(children: Node[]): void; } } declare global { /** * Augments the built-in {@link NumberConstructor} interface. */ interface NumberConstructor { /** * Type guard to check if a value is a number. * * @param obj - The value to check. * @returns `true` if the value is a number, `false` otherwise. * @example * ```ts * console.log(Number.isNumber(123)); // true * console.log(Number.isNumber('123')); // false * console.log(Number.isNumber(NaN)); // true * console.log(Number.isNumber(Infinity)); // true * console.log(Number.isNumber(-Infinity)); // true * ``` * @remarks Regarding `NaN` see: {@link https://forum.obsidian.md/t/bug-number-isnumber-definition/98104}. * @official */ isNumber(obj: unknown): obj is number; } } declare global { /** * Augments the built-in {@link ObjectConstructor} interface. */ interface ObjectConstructor { /** * Check if all properties in an object satisfy a condition. * * @typeParam T - The type of the properties in the object. * @param object - The object to check. * @param callback - The condition to check. * @param context - The context passed as `this` to the `callback`. * @returns `true` if all properties satisfy the condition, `false` otherwise. * @example * ```ts * console.log(Object.each({ a: 1, b: 2 }, function(value) { return value > this.min }, { min: 0 })); // true * console.log(Object.each({ a: 1, b: 2 }, function(value) { return value > this.min }, { min: 1 }); // false * ``` * @official */ each(object: Record, callback: (value: T, key?: string) => boolean | void, context?: unknown): boolean; /** * Checks if an object is empty. * * @param object - The object to check. * @returns `true` if the object is empty, `false` otherwise. * @example * ```ts * console.log(Object.isEmpty({})); // true * console.log(Object.isEmpty({ a: 1 })); // false * ``` * @official */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required by official API for declaration merging. isEmpty(object: Record): boolean; } } declare global { /** * Augments the built-in {@link SVGElement} interface. */ interface SVGElement extends Element { /** * Sets the CSS properties of the element. * * @param props - The properties to set. * @example * ```ts * const element = document.body.createEl('svg'); * element.setCssProps({ color: 'red', 'font-size': '16px' }); * ``` * @official */ setCssProps(props: Record): void; /** * Sets the CSS styles of the element. * * @param styles - The styles to set. * @example * ```ts * const element = document.body.createEl('svg'); * element.setCssStyles({ color: 'red', fontSize: '16px' }); * ``` * @official */ setCssStyles(styles: Partial): void; } } declare global { /** * Augments the built-in {@link StringConstructor} interface. */ interface StringConstructor { /** * Type guard to check if a value is a string. * * @param obj - The value to check. * @returns `true` if the value is a string, `false` otherwise. * @example * ```ts * console.log(String.isString('foo')); // true * console.log(String.isString(123)); // false * ``` * @official */ isString(obj: unknown): obj is string; } } declare global { /** * Augments the built-in {@link String} interface. */ interface String { /** * Checks if the string contains a specific substring. * * @param target - The substring to check for. * @returns `true` if the string contains the substring, `false` otherwise. * @example * ```ts * console.log('foo'.contains('oo')); // true * console.log('foo'.contains('bar')); // false * ``` * @official */ contains(target: string): boolean; /** * Checks if the string ends with a specific substring. * * @param searchString - The substring to check for. * @param endPosition - The position to end checking at. * @returns `true` if the string ends with the substring, `false` otherwise. * @example * ```ts * console.log('foo'.endsWith('oo')); // true * console.log('foo'.endsWith('fo')); // false * console.log('foo'.endsWith('foo', 2)); // false * console.log('foo'.endsWith('fo', 2)); // true * ``` * @remarks The original version had different argument names. * See bug: {@link https://forum.obsidian.md/t/bug-string-endwith-definition/98103}. * @official */ endsWith(searchString: string, endPosition?: number): boolean; /** * Formats a string using the indexed placeholders. * * @param args - The arguments to format the string with. * @returns The formatted string. * @example * ```ts * console.log('foo {0} bar {1} baz {0}'.format('qux', 'quux')); // foo qux bar quux baz qux * ``` * @official */ format(...args: string[]): string; /** * Checks if the string starts with a specific substring. * * @param searchString - The substring to check for. * @param position - The position to start checking from. * @returns `true` if the string starts with the substring, `false` otherwise. * @example * ```ts * console.log('foo'.startsWith('fo')); // true * console.log('foo'.startsWith('oo')); // false * console.log('foo'.startsWith('foo', 1)); // false * console.log('foo'.startsWith('oo', 1)); // true * ``` * @official */ startsWith(searchString: string, position?: number): boolean; } } declare global { /** * Augments the built-in {@link Touch} interface. */ interface Touch { /** * The type of touch. * * @official */ touchType: "direct" | "stylus"; } } declare global { /** * Augments the built-in {@link UIEvent} interface. */ interface UIEvent extends Event { /** * The document of the event. * * @official */ doc: Document; /** * The target node of the event. * * @official */ targetNode: Node | null; /** * The window of the event. * * @official */ win: Window; /** * Cross-window capable instanceof check, a drop-in replacement * for instanceof checks on UIEvents. * * @typeParam T - The type to check. * @param type - The type to check. * @returns Whether the event is an instance of the type. * @example * ```ts * if (event.instanceOf(MouseEvent)) { * console.log('event is a mouse event'); * } * ``` * @official */ instanceOf(type: UIEventConstructor): this is T; } } declare global { /** * Augments the built-in {@link Window} interface. */ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage { /** * The actively focused Document object. This is usually the same as `document` but * it will be different when using popout windows. * * @official */ activeDocument: Document; /** * The actively focused Window object. This is usually the same as `window` but * it will be different when using popout windows. * * @official */ activeWindow: Window; /** * Global reference to the app. * * @unofficial * @deprecated - Prefer not to use this value directly. */ app: App; /** * Minified reference to {@link Object.hasOwnProperty}. * * @unofficial */ bl: typeof Object.hasOwnProperty; /** * Native Blink engine fetch, used to bypass patched fetch implementations. * * @unofficial */ blinkfetch: typeof fetch; /** * Native Blink engine FormData constructor. * * @unofficial */ blinkFormData: typeof FormData; /** * Native Blink engine Headers constructor. * * @unofficial */ blinkHeaders: typeof Headers; /** * Native Blink engine Request constructor. * * @unofficial */ blinkRequest: typeof Request; /** * Native Blink engine Response constructor. * * @unofficial */ blinkResponse: typeof Response; /** * Capacitor runtime for accessing native device APIs on mobile. * * @unofficial */ Capacitor: CapacitorGlobal; /** * Registry of available Capacitor platform implementations. * * @unofficial */ CapacitorPlatforms: CapacitorPlatformsGlobal; /** * Minified reference to {@link Object.getOwnPropertyDescriptors}. * * @unofficial */ Cf: typeof Object.getOwnPropertyDescriptors; /** * Global CodeMirror 5 instance. * * @unofficial */ CodeMirror: CodeMirrorModule; /** * CodeMirror adapter providing CM5-compatible API over CM6. * * @unofficial */ CodeMirrorAdapter: CodeMirrorAdapterEx; /** * DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. * * @unofficial */ DOMPurify: DOMPurify; /** * Minified reference to {@link Object.propertyIsEnumerable}. * * @unofficial */ El: typeof Object.propertyIsEnumerable; /** * Electron module for desktop platform APIs. * * @unofficial */ electron: ElectronModule; /** * Electron BrowserWindow instance for the current window. * * @unofficial */ electronWindow: ElectronWindow; /** * DOM elements and helpers for the app frame/window chrome. * * @unofficial */ frameDom: FrameDom; /** * Constructor for the Capacitor file system adapter. * * @unofficial */ FS: ExtractConstructor; /** * Global i18next internationalization framework instance. * * @unofficial */ i18next: I18n; /** * MathJax instance for rendering mathematical notation. * * @unofficial */ MathJax?: MathJaxEx; /** * Mermaid library instance for rendering diagrams and charts. * * @unofficial */ mermaid?: Mermaid; /** * Parse, validate, manipulate, and display dates in javascript. * * @unofficial */ moment: typeof momentInstance; /** * Minified reference to {@link Object.getOwnPropertySymbols}. * * @unofficial */ mr: typeof Object.getOwnPropertySymbols; /** * Notification component. Use to present timely, high-value information. * * @unofficial */ Notice: typeof NoticeInstance; /** * Invoke obsidian protocol action. * * @unofficial */ OBS_ACT: ObsidianProtocolHandler; /** * Default internationalization strings bundled with Obsidian. * * @unofficial */ OBSIDIAN_DEFAULT_I18N: Localization; /** * PDF.js library for parsing and rendering PDF documents. * * @unofficial */ pdfjsLib?: PdfJsModule; /** * Testing utilities for PDF.js. * * @unofficial */ pdfjsTestingUtils: PdfJsTestingUtils; /** * PixiJS library for 2D rendering (used for canvas views). * * @unofficial */ PIXI: PixiModule; /** * Prism.js syntax highlighting library instance. * * @unofficial */ Prism?: PrismModule; /** * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions. * * Returns the text value of the response. * * @unofficial */ request: typeof requestInstance; /** * Similar to `fetch()`, request a URL using HTTP/HTTPS, without any CORS restrictions. * * @unofficial */ requestUrl: typeof requestUrlInstance; /** * Scrypt key derivation function library for password-based encryption. * * @unofficial */ scrypt: typeof scrypt; /** * Minified reference to {@link Object.defineProperties}. * * @unofficial */ Sf: typeof Object.defineProperties; /** * Temporary reference to the WebSQL database `changeVersion` method. * * @unofficial */ temp1: Database["changeVersion"]; /** * The style of the window title bar (e.g., "hidden", "default"). * * @unofficial */ titlebarStyle: string; /** * TurndownService for converting HTML to Markdown. * * @unofficial */ TurndownService: TurndownService; /** * Electron WebView tag for embedding external web content. * * @unofficial */ WebView: ElectronWebviewTag; /** * Minified reference to {@link Object.defineProperty}. * * @unofficial */ wf: typeof Object.defineProperty; /** * Sends an AJAX request. * * @param options - The options for the AJAX request. * @example * ```ts * ajax({ * url: 'https://example.com', * success: (response) => { * console.log(response); * }, * error: (error) => { * console.error(error); * } * }); * ``` * @official */ ajax(options: AjaxOptions): void; /** * Sends an AJAX request and returns a promise. * * @param options - The options for the AJAX request. * @returns A promise that resolves to the response. * @example * ```ts * const response = await ajaxPromise({ url: 'https://example.com' }); * console.log(response); * ``` * @official */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required by official API for declaration merging. ajaxPromise(options: AjaxOptions): Promise; /** * Creates a new `
` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createDiv({ text: 'foo' }, (div) => { * div.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createDiv(o?: DomElementInfo | string, callback?: (el: HTMLDivElement) => void): HTMLDivElement; /** * Creates a new element. * * @typeParam K - The type of the element to create. * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createEl('p', { text: 'foo' }, (p) => { * p.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createEl(tag: K, o?: DomElementInfo | string, callback?: (el: HTMLElementTagNameMap[K]) => void): HTMLElementTagNameMap[K]; /** * Creates a new document fragment. * * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createFragment((fragment) => { * fragment.createEl('p', { text: 'foo' }); * }); * ``` * @official */ createFragment(callback?: (el: DocumentFragment) => void): DocumentFragment; /** * Creates a new `` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createSpan({ text: 'foo' }, (span) => { * span.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ createSpan(o?: DomElementInfo | string, callback?: (el: HTMLSpanElement) => void): HTMLSpanElement; /** * Creates a new svg element such as ``, ``, ``, etc. * * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createSvg('svg', { cls: 'foo bar' }, (svg) => { * svg.createSvg('circle'); * }); * ``` * @official */ createSvg(tag: K, o?: string | SvgElementInfo, callback?: (el: SVGElementTagNameMap[K]) => void): SVGElementTagNameMap[K]; /** * Finds the first element that matches the selector. * * @param selector - The selector to find the element with. * @returns The first element that matches the selector, or `null` if no match is found. * @example * ```ts * const element = document.body.createEl('p'); * element.createEl('strong', { cls: 'foo' }); * console.log(fish('.foo')); // * console.log(fish('.bar')); // null * ``` * @official */ fish(selector: string): HTMLElement | null; /** * Finds all elements that match the selector. * * @param selector - The selector to find the elements with. * @returns An array of all elements that match the selector. * @example * ```ts * const element = document.body.createEl('p'); * element.createEl('strong', { cls: 'foo' }); * element.createEl('strong', { cls: 'foo' }); * console.log(fishAll('.foo')); // [, ] * console.log(fishAll('.bar')); // [] * ``` * @official */ fishAll(selector: string): HTMLElement[]; /** * Apply global DOM enhancements and polyfills used by Obsidian. * * @unofficial */ globalEnhance(): void; /** * `vim.js` based on {@link https://github.com/codemirror/CodeMirror/commit/793c9e65e09ec7fba3f4f5aaf366b3d36e1a709e} (2021-12-04) * * Modified from {@link https://github.com/nightwing/cm6-vim-mode-experiment/blob/master/src/vim.js} 103a9b5 2021-12-03 * * CodeMirror, copyright (c) by Marijn Haverbeke and others * * Distributed under an MIT license: {@link https://codemirror.net/5/LICENSE} * * Supported keybindings: * * Too many to list. Refer to defaultKeymap below. * * Supported Ex commands: * * Refer to defaultExCommandMap below. * * Registers: `unnamed`, `-`, `.`, `:`, `/`, `_`, `a-z`, `A-Z`, `0-9`. * * (Does not respect the special case for number registers when delete * operator is made with these commands: `%`, `(`, `)`, ` `, `/`, `?`, `n`, `N`, `{`, `}`). * * TODO: Implement the remaining registers. * * Marks: `a-z`, `A-Z`, and `0-9`. * * TODO: Implement the remaining special marks. They have more complex behavior. * * Events: * * `vim-mode-change` - raised on the editor anytime the current mode changes. * * Event object: `{mode: "visual", subMode: "linewise"}`. * * Code structure: * * 1. Default keymap. * * 2. Variable declarations and short basic helpers. * * 3. Instance (External API) implementation. * * 4. Internal state tracking objects (input state, counter) implementation and instantiation. * * 5. Key handler (the main command dispatcher) implementation. * * 6. Motion, operator, and action implementations. * * 7. Helper functions for the key handler, motions, operators, and actions. * * 8. Set up Vim to work as a keymap for CodeMirror. * * 9. Ex command implementations. * * @param CodeMirror - The CodeMirror adapter instance. * @returns The Vim API instance. * @unofficial */ initVimMode(CodeMirror: CodeMirrorAdapterEx): VimApi; /** * Checks if the given object is a boolean. * * @param obj - The object to check. * @returns `true` if the object is a boolean, `false` otherwise. * @example * ```ts * console.log(isBoolean(false)); // true * console.log(isBoolean('not a boolean')); // false * ``` * @official */ isBoolean(obj: unknown): obj is boolean; /** * Minified helper to copy properties from source to target object. * * @param target - The target object to copy properties to. * @param source - The source object to copy properties from. * @returns The target object with copied properties. * @unofficial */ li(target: object, source: object): object; /** * Minified helper to omit specified properties from an object. * * @param target - The source object to omit properties from. * @param propertyNames - The names of the properties to exclude. * @returns A new object without the specified properties. * @unofficial */ mo(target: object, propertyNames: string[]): object; /** * Waits for the next frame. * * @returns A promise that resolves after the next frame. * @example * ```ts * await nextFrame(); * ``` * @official */ nextFrame(): Promise; /** * Open or create a WebSQL database. * * @param name - The name of the database. * @param version - The version of the database. * @param displayName - The display name of the database. * @param estimatedSize - The estimated size of the database in bytes. * @param creationCallback - Optional callback invoked when the database is created. * @returns The opened or created database. * @unofficial */ openDatabase(name: string, version: string, displayName: string, estimatedSize: number, creationCallback?: (database: Database) => void): Database; /** * Executes a function when the DOM is ready. * * @param fn - The function to execute when the DOM is ready. * @example * ```ts * ready(() => { * console.log('DOM is ready'); * }); * @official */ ready(fn: () => unknown): void; /** * Select a language file location. * * @unofficial */ selectLanguageFileLocation(): void; /** * Sleeps for a given number of milliseconds. * * @param ms - The number of milliseconds to sleep. * @returns A promise that resolves after the given number of milliseconds. * @example * ```ts * await sleep(1000); * ``` * @official */ sleep(ms: number): Promise; /** * Minified helper to merge source properties into target object. * * @param target - The target object to merge properties into. * @param source - The source object to merge properties from. * @returns The target object with merged properties. * @unofficial */ St(target: object, source: object | undefined): object; /** * Minified helper to set a property on an object. * * @param target - The object to set the property on. * @param propertyName - The name of the property. * @param propertyValue - The value to set. * @returns The set property value. * @unofficial */ Tl(target: object, propertyName: string, propertyValue: unknown): unknown; } } declare global { /** * Checks if the given object is a boolean. * * @param obj - The object to check. * @returns `true` if the object is a boolean, `false` otherwise. * @example * ```ts * console.log(isBoolean(false)); // true * console.log(isBoolean('not a boolean')); // false * ``` * @official */ function isBoolean(obj: unknown): obj is boolean; } declare global { /** * CodeMirror adapter providing CM5-compatible API over CM6. * * @unofficial */ var CodeMirrorAdapter: CodeMirrorAdapterEx; } declare global { /** * Constructor for the Capacitor file system adapter. * * @unofficial */ var FS: ExtractConstructor; } declare global { /** * Creates a new `
` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createDiv({ text: 'foo' }, (div) => { * div.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ function createDiv(o?: DomElementInfo | string, callback?: (el: HTMLDivElement) => void): HTMLDivElement; } declare global { /** * Creates a new `` element. * * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createSpan({ text: 'foo' }, (span) => { * span.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ function createSpan(o?: DomElementInfo | string, callback?: (el: HTMLSpanElement) => void): HTMLSpanElement; } declare global { /** * Creates a new document fragment. * * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createFragment((fragment) => { * fragment.createEl('p', { text: 'foo' }); * }); * ``` * @official */ function createFragment(callback?: (el: DocumentFragment) => void): DocumentFragment; } declare global { /** * Creates a new element. * * @typeParam K - The type of the element to create. * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createEl('p', { text: 'foo' }, (p) => { * p.createEl('strong', { text: 'bar' }); * }); * ``` * @official */ function createEl(tag: K, o?: DomElementInfo | string, callback?: (el: HTMLElementTagNameMap[K]) => void): HTMLElementTagNameMap[K]; } declare global { /** * Creates a new svg element such as ``, ``, ``, etc. * * @param tag - The tag name of the element to create. * @param o - The options object. * @param callback - A callback function to be called when the element is created. * @returns The created element. * @example * ```ts * createSvg('svg', { cls: 'foo bar' }, (svg) => { * svg.createSvg('circle'); * }); * ``` * @official */ function createSvg(tag: K, o?: string | SvgElementInfo, callback?: (el: SVGElementTagNameMap[K]) => void): SVGElementTagNameMap[K]; } declare global { /** * DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. * * @unofficial * @deprecated - Added only for typing purposes. Use {@link DOMPurify} instead. */ var DOMPurify__: DOMPurify; } declare global { /** * Default internationalization strings bundled with Obsidian. * * @unofficial */ var OBSIDIAN_DEFAULT_I18N: Localization; } declare global { /** * Electron BrowserWindow instance for the current window. * * @unofficial */ var electronWindow: ElectronWindow; } declare global { /** * Electron BrowserWindow instance for the current window. * * @unofficial */ var frameDom: FrameDom; } declare global { /** * Electron WebView tag for embedding external web content. * * @unofficial */ var WebView: ElectronWebviewTag; } declare global { /** * Electron module for desktop platform APIs. * * @unofficial */ var electron: ElectronModule; } declare global { /** * Executes a function when the DOM is ready. * * @param fn - The function to execute when the DOM is ready. * @example * ```ts * ready(() => { * console.log('DOM is ready'); * }); * @official */ function ready(fn: () => unknown): void; } declare global { /** * Finds all elements that match the selector. * * @param selector - The selector to find the elements with. * @returns An array of all elements that match the selector. * @example * ```ts * function element = document.body.createEl('p'); * element.createEl('strong', { cls: 'foo' }); * element.createEl('strong', { cls: 'foo' }); * console.log(fishAll('.foo')); // [, ] * console.log(fishAll('.bar')); // [] * ``` * @official */ function fishAll(selector: string): HTMLElement[]; } declare global { /** * Finds the first element that matches the selector. * * @param selector - The selector to find the element with. * @returns The first element that matches the selector, or `null` if no match is found. * @example * ```ts * function element = document.body.createEl('p'); * element.createEl('strong', { cls: 'foo' }); * console.log(fish('.foo')); // * console.log(fish('.bar')); // null * ``` * @official */ function fish(selector: string): HTMLElement | null; } declare global { /** * Global CodeMirror 5 instance. * * @unofficial * @deprecated - Added only for typing purposes. Use {@link CodeMirror} instead. */ var CodeMirror__: CodeMirrorModule; } declare global { /** * Global reference to the app. * * @unofficial * @deprecated - Prefer not to use this value directly. */ var app: App; } declare global { /** * Information about HTMLElement event listener. */ interface EventListenerInfo { /** * Wrapper function of the event listener. * * @official */ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- No other way. callback: Function; /** * The listener of the event. * * @official */ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- No other way. listener: Function; /** * The options of the event listener. * * @official */ options?: AddEventListenerOptions | boolean; /** * The selector of the event target. * * @official */ selector: string; } } declare global { /** * Invoke obsidian protocol action. * * @unofficial */ var OBS_ACT__: ObsidianProtocolHandler; } declare global { /** * MathJax instance for rendering mathematical notation. * * @unofficial */ var MathJax: MathJaxEx; } declare global { /** * Mermaid library instance for rendering diagrams and charts. * * @unofficial */ var mermaid: Mermaid; } declare global { /** * Minified helper to copy properties from source to target object. * * @param target - The target object to copy properties to. * @param source - The source object to copy properties from. * @returns The target object with copied properties. * @unofficial */ function li(target: object, source: object): object; } declare global { /** * Minified helper to merge source properties into target object. * * @param target - The target object to merge properties into. * @param source - The source object to merge properties from. * @returns The target object with merged properties. * @unofficial */ function St(target: object, source: object | undefined): object; } declare global { /** * Minified helper to omit specified properties from an object. * * @param target - The source object to omit properties from. * @param propertyNames - The names of the properties to exclude. * @returns A new object without the specified properties. * @unofficial */ function mo(target: object, propertyNames: string[]): object; } declare global { /** * Minified helper to set a property on an object. * * @param target - The object to set the property on. * @param propertyName - The name of the property. * @param propertyValue - The value to set. * @returns The set property value. * @unofficial */ function Tl(target: object, propertyName: string, propertyValue: unknown): unknown; } declare global { /** * Minified reference to {@link Object.defineProperties}. * * @unofficial */ var Sf: typeof Object.defineProperties; } declare global { /** * Minified reference to {@link Object.defineProperty}. * * @unofficial */ var i18next: I18n; } declare global { /** * Minified reference to {@link Object.defineProperty}. * * @unofficial */ var wf: typeof Object.defineProperty; } declare global { /** * Minified reference to {@link Object.getOwnPropertyDescriptors}. * * @unofficial */ var Cf: typeof Object.getOwnPropertyDescriptors; } declare global { /** * Minified reference to {@link Object.getOwnPropertySymbols}. * * @unofficial */ var mr: typeof Object.getOwnPropertySymbols; } declare global { /** * Minified reference to {@link Object.hasOwnProperty}. * * @unofficial */ var bl: typeof Object.hasOwnProperty; } declare global { /** * Minified reference to {@link Object.propertyIsEnumerable}. * * @unofficial */ var El: typeof Object.propertyIsEnumerable; } declare global { /** * Native Blink engine FormData constructor. * * @unofficial */ var blinkFormData: typeof FormData; } declare global { /** * Native Blink engine Headers constructor. * * @unofficial */ var blinkHeaders: typeof Headers; } declare global { /** * Native Blink engine Request constructor. * * @unofficial */ var blinkRequest: typeof Request; } declare global { /** * Native Blink engine Response constructor. * * @unofficial */ var blinkResponse: typeof Response; } declare global { /** * Native Blink engine fetch, used to bypass patched fetch implementations. * * @unofficial */ var blinkfetch: typeof fetch; } declare global { /** * Notification component. Use to present timely, high-value information. * * @unofficial */ var Notice: typeof NoticeInstance; } declare global { /** * Open or create a WebSQL database. * * @param name - The name of the database. * @param version - The version of the database. * @param displayName - The display name of the database. * @param estimatedSize - The estimated size of the database in bytes. * @param creationCallback - Optional callback invoked when the database is created. * @returns The opened or created database. * @unofficial */ function openDatabase(name: string, version: string, displayName: string, estimatedSize: number, creationCallback?: (database: Database) => void): Database; } declare global { /** * Options for an {@link ajax} request. */ interface AjaxOptions { /** * The data of the AJAX request. * * @official */ data?: ArrayBuffer | object | string; /** * The headers of the AJAX request. * * @official */ headers?: Record; /** * The method of the AJAX request. * * @official */ method?: "GET" | "POST"; /** * The XMLHttpRequest object. * * @official */ req?: XMLHttpRequest; /** * The URL of the AJAX request. * * @official */ url: string; /** * Whether to send credentials with the AJAX request. * * @official */ withCredentials?: boolean; /** * The error callback of the AJAX request. * * @official * @deprecated - Added only for typing purposes. Use {@link error} instead. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required by official API for declaration merging. error__?(error: any, req: XMLHttpRequest): any; /** * The success callback of the AJAX request. * * @official * @deprecated - Added only for typing purposes. Use {@link success} instead. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required by official API for declaration merging. success__?(response: any, req: XMLHttpRequest): any; } } declare global { /** * Options object passed to {@link createEl}. */ interface DomElementInfo { /** * HTML attributes to be added. * * @example * ```ts * createEl('p', { attr: { id: 'foo', 'data-bar': 'baz' } }); * ``` * @official */ attr?: Record; /** * The class to be assigned. Can be a space-separated string or an array of strings. * * @example * ```ts * createEl('p', { cls: 'foo bar' }); * createEl('p', { cls: ['foo', 'bar'] }); * ``` * @official */ cls?: string | string[]; /** * The href to be assigned. Applies to ``, ``, and `` elements. * * @example * ```ts * createEl('a', { href: 'https://example.com' }); * ``` * @official */ href?: string; /** * The parent element to be assigned to. * * @example * ```ts * createEl('strong', { parent: document.body }); * ``` * @official */ parent?: Node; /** * The placeholder to be assigned. Applies to `` elements. * * @example * ```ts * createEl('input', { placeholder: 'foo' }); * ``` * @official */ placeholder?: string; /** * Whether to prepend the element to the parent. * If `true`, the element will be inserted before the first child of the parent. * If `false` or omitted, the element will be inserted after the last child of the parent. * * @example * ```ts * createEl('input', { prepend: true }); * ``` * @official */ prepend?: boolean; /** * The textContent to be assigned. * * @example * ```ts * createEl('p', { text: 'foo' }); * const fragment = createFragment(); * fragment.createEl('strong', { text: 'bar' }); * createEl('p', { text: fragment }); * ``` * @official */ text?: DocumentFragment | string; /** * HTML title (for hover tooltip). * * @example * ```ts * createEl('p', { title: 'foo' }); * ``` * @official */ title?: string; /** * The type to be assigned. Applies to `` and `