diff --git a/obsidian.d.ts b/obsidian.d.ts index 7b07150..7cb13d0 100644 --- a/obsidian.d.ts +++ b/obsidian.d.ts @@ -313,7 +313,8 @@ export abstract class AbstractInputSuggest extends PopoverSuggest { /** @public */ protected abstract getSuggestions(query: string): T[] | Promise; - + /** @public */ + selectSuggestion(value: T, evt: MouseEvent | KeyboardEvent): void; /** * Registers a callback to handle when a suggestion is selected by the user. * @public @@ -528,6 +529,10 @@ export interface CachedMetadata { * @public */ headings?: HeadingCache[]; + /** + * @public + */ + footnotes?: FootnoteCache[]; /** * Sections are root level markdown blocks, which can be used to divide the document up. * @public @@ -567,7 +572,10 @@ export interface CacheItem { } -/** @public */ +/** + * A closeable component that can get dismissed via the Android 'back' button. + * @public + */ export interface CloseableComponent { /** @public */ close(): any; @@ -1224,6 +1232,7 @@ export interface EditorSelectionOrCaret { /** @public */ export abstract class EditorSuggest extends PopoverSuggest { + /** * Current suggestion context, containing the result of `onTrigger`. * This will be null any time the EditorSuggest is not supposed to run. @@ -1408,6 +1417,13 @@ export class FileManager { */ renameFile(file: TAbstractFile, newPath: string): Promise; + /** + * Remove a file or a folder from the vault according the user's preferred 'trash' + * options (either moving the file to .trash/ or the OS trash bin). + * @param file + * @public + */ + trashFile(file: TAbstractFile): Promise; /** * Generate a markdown link based on the user's preferences. * @param file - the file to link to. @@ -1639,6 +1655,17 @@ export abstract class FileView extends ItemView { */ export function finishRenderMath(): Promise; +/** + * @public + */ +export interface FootnoteCache extends CacheItem { + /** + * @public + */ + id: string; +} + + /** * @public */ @@ -2669,6 +2696,7 @@ export class Modal implements CloseableComponent { * @public */ modalEl: HTMLElement; + /** * @public */ @@ -2691,6 +2719,7 @@ export class Modal implements CloseableComponent { * @public */ open(): void; + /** * @public */ @@ -3652,6 +3681,11 @@ export class SliderComponent extends ValueComponent { * @public */ setDisabled(disabled: boolean): this; + /** + * @param instant whether or not the value should get updated while the slider is dragging + * @public + */ + setInstant(instant: boolean): this; /** * @public */ @@ -3764,6 +3798,7 @@ export abstract class SuggestModal extends Modal implements ISuggestOwner * @public */ resultContainerEl: HTMLElement; + /** * @public */ @@ -4216,6 +4251,12 @@ export class Vault extends Events { * @public */ getAllLoadedFiles(): TAbstractFile[]; + /** + * Get all folders in the vault. + * @param includeRoot - Should the root folder (`/`) be returned + * @public + */ + getAllFolders(includeRoot?: boolean): TFolder[]; /** * @public @@ -4641,6 +4682,7 @@ export class Workspace extends Events { * @public */ on(name: 'resize', callback: () => any, ctx?: any): EventRef; + /** * @public */ @@ -4742,6 +4784,12 @@ export class WorkspaceFloating extends WorkspaceParent { */ export abstract class WorkspaceItem extends Events { + /** + * The direct parent of the leaf. + * @public + */ + abstract parent: WorkspaceParent; + /** * @public */ @@ -4761,6 +4809,18 @@ export abstract class WorkspaceItem extends Events { */ export class WorkspaceLeaf extends WorkspaceItem { + /** + * The direct parent of the leaf. + * + * On desktop, a leaf is always a child of a `WorkspaceTabs` component. + * On mobile, a leaf might be a child of a `WorkspaceMobileDrawer`. + * Perform an `instanceof` check before making an assumption about the + * `parent`. + * + * @public + */ + parent: WorkspaceTabs | WorkspaceMobileDrawer; + /** * @public */ @@ -4932,6 +4992,10 @@ export class WorkspaceWindow extends WorkspaceContainer { * @public */ export interface WorkspaceWindowInitData { + /** @public */ + x?: number; + /** @public */ + y?: number; /** * The suggested size @@ -4947,16 +5011,5 @@ export interface WorkspaceWindowInitData { export { } -/** @public */ -declare global { - /** - * Global reference to the app. - * @public - * @deprecated - Prefer not to use this value directly. - */ - var app: App; -} - /** @public */ export type IconName = string; - diff --git a/package.json b/package.json index 2f6bf37..e7779c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian", - "version": "1.5.7", + "version": "1.6.6", "description": "Type definitions for the latest Obsidian API (https://obsidian.md)", "keywords": ["obsdmd"], "homepage": "https://obsidian.md",