From 57e5bde53cfb7b1b3779260601fe827b46ce5f27 Mon Sep 17 00:00:00 2001 From: Michael Naumov Date: Wed, 11 Sep 2024 06:37:28 -0600 Subject: [PATCH] chore: apply sorting --- src/obsidian/augmentations/MetadataCache.d.ts | 8 +- src/obsidian/augmentations/Setting.d.ts | 2 +- src/obsidian/augmentations/Workspace.d.ts | 90 +++++++++---------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/obsidian/augmentations/MetadataCache.d.ts b/src/obsidian/augmentations/MetadataCache.d.ts index 4e8682ff..c0a8a2a8 100644 --- a/src/obsidian/augmentations/MetadataCache.d.ts +++ b/src/obsidian/augmentations/MetadataCache.d.ts @@ -108,16 +108,16 @@ declare module "obsidian" { iterateReferences(callback: (path: string) => void): void; /** @internal */ linkResolver(): void; + /** + * Called whenever the metadatacache has finished updating + */ + on(name: "finished", callback: () => void): EventRef; /** * Called whenever the metadatacache is fully loaded in * * @remark 'finished' is also emitted when the cache is initialized */ on(name: "initialized", callback: () => void): EventRef; - /** - * Called whenever the metadatacache has finished updating - */ - on(name: "finished", callback: () => void): EventRef; /** @internal Execute onCleanCache callbacks if cache is clean */ onCleanCache(): void; /** @internal On creation of the cache: update metadata cache */ diff --git a/src/obsidian/augmentations/Setting.d.ts b/src/obsidian/augmentations/Setting.d.ts index dd5ffd90..bc503424 100644 --- a/src/obsidian/augmentations/Setting.d.ts +++ b/src/obsidian/augmentations/Setting.d.ts @@ -48,13 +48,13 @@ declare module "obsidian" { * @internal Open a specific tab by tab reference */ openTab(tab: SettingTab): void; + openTabById(id: "hotkeys"): HotkeysSettingTab; /** * Open a specific tab by ID * * @param id ID of the tab to open */ openTabById(id: string): SettingTab; - openTabById(id: "hotkeys"): HotkeysSettingTab; /** * @param tab Tab to remove * @internal Remove a plugin tab from the settings modal diff --git a/src/obsidian/augmentations/Workspace.d.ts b/src/obsidian/augmentations/Workspace.d.ts index c31fa663..ad27b58e 100644 --- a/src/obsidian/augmentations/Workspace.d.ts +++ b/src/obsidian/augmentations/Workspace.d.ts @@ -167,46 +167,13 @@ declare module "obsidian" { /** @internal Load workspace from disk and initialize */ loadLayout(): Promise; /** - * @internal Triggers when user hovers over any note link element (file explorer, editor, ...) - * @remark Used for preparing (Ctrl) hover previews - */ - on(name: "hover-link", callback: (event: HoverLinkEvent) => void, ctx?: unknown): EventRef; - /** @internal Called whenever user opens tab group menu (contains e.g. stacked tabs button) */ - on(name: "tab-group-menu", callback: (tabMenu: Menu, tabsLeaf: WorkspaceTabs) => void, ctx?: unknown): EventRef; - /** @internal Triggers when user swipes open left/right sidebar */ - on(name: "swipe", callback: (touchEvents: ObsidianTouchEvent[]) => void, ctx?: unknown): EventRef; - /** - * Triggers when workspace layout is loaded - * - * @remark Prefer usage of onLayoutReady instead - */ - on(name: "layout-ready", callback: () => void, ctx?: unknown): EventRef; - /** @internal Triggers when user right-clicks on external URL in editor */ - on(name: "url-menu", callback: (menu: Menu, url: string) => void, ctx?: unknown): EventRef; - /** - * Triggers when user clicks on 'N results' button in search view - */ - on( - name: "search:results-menu", - callback: (menu: Menu, search: GlobalSearchLeaf) => void, - ctx?: unknown - ): EventRef; - /** @internal Called when user shares text on mobile */ - on(name: "receive-text-menu", callback: (menu: Menu, x: unknown) => void, ctx?: unknown): EventRef; - /** @internal Called when user shares files on mobile */ - on(name: "receive-files-menu", callback: (menu: Menu, x: unknown) => void, ctx?: unknown): EventRef; - /** - * Triggers when the user opens a context menu on a selection of multiple nodes in the canvas + * Triggers when the user opens a context menu on a connection in the canvas */ on( - name: "canvas:selection-menu", - callback: (menu: Menu, canvasView: CanvasView) => void, + name: "canvas:edge-menu", + callback: (menu: Menu, connection: CanvasConnection) => void, ctx?: unknown ): EventRef; - /** - * Triggers when the user opens a context menu on a single node in the canvas - */ - on(name: "canvas:node-menu", callback: (menu: Menu, node: CanvasNode) => void, ctx?: unknown): EventRef; /** * Triggers when the user drops edge connection to empty space in the canvas */ @@ -216,11 +183,11 @@ declare module "obsidian" { ctx?: unknown ): EventRef; /** - * Triggers when the user opens a context menu on a connection in the canvas + * Triggers when the user opens a context menu on a selection of multiple nodes in the canvas */ on( - name: "canvas:edge-menu", - callback: (menu: Menu, connection: CanvasConnection) => void, + name: "canvas:selection-menu", + callback: (menu: Menu, canvasView: CanvasView) => void, ctx?: unknown ): EventRef; /** @@ -250,14 +217,37 @@ declare module "obsidian" { ctx?: unknown ): EventRef; /** - * Triggers when the markdown scroll event is fired. + * Triggers when user clicks on 'N results' button in search view + */ + on( + name: "search:results-menu", + callback: (menu: Menu, search: GlobalSearchLeaf) => void, + ctx?: unknown + ): EventRef; + /** + * Triggers when the browser history is updated. * - * @param name - "markdown-scroll" + * @param name - "browser:update-history" * @param callback - Callback function * @param ctx - Context * @returns Event reference */ - on(name: "markdown-scroll", callback: (view: MarkdownScrollableEditView) => unknown, ctx?: unknown): EventRef; + on(name: "browser:update-history", callback: () => unknown, ctx?: unknown): EventRef; + /** + * Triggers when the user opens a context menu on a single node in the canvas + */ + on(name: "canvas:node-menu", callback: (menu: Menu, node: CanvasNode) => void, ctx?: unknown): EventRef; + /** + * @internal Triggers when user hovers over any note link element (file explorer, editor, ...) + * @remark Used for preparing (Ctrl) hover previews + */ + on(name: "hover-link", callback: (event: HoverLinkEvent) => void, ctx?: unknown): EventRef; + /** + * Triggers when workspace layout is loaded + * + * @remark Prefer usage of onLayoutReady instead + */ + on(name: "layout-ready", callback: () => void, ctx?: unknown): EventRef; /** * Triggers when the leaf menu is opened. * @@ -268,14 +258,24 @@ declare module "obsidian" { */ on(name: "leaf-menu", callback: (menu: Menu, leaf: WorkspaceLeaf) => unknown, ctx?: unknown): EventRef; /** - * Triggers when the browser history is updated. + * Triggers when the markdown scroll event is fired. * - * @param name - "browser:update-history" + * @param name - "markdown-scroll" * @param callback - Callback function * @param ctx - Context * @returns Event reference */ - on(name: "browser:update-history", callback: () => unknown, ctx?: unknown): EventRef; + on(name: "markdown-scroll", callback: (view: MarkdownScrollableEditView) => unknown, ctx?: unknown): EventRef; + /** @internal Called when user shares files on mobile */ + on(name: "receive-files-menu", callback: (menu: Menu, x: unknown) => void, ctx?: unknown): EventRef; + /** @internal Called when user shares text on mobile */ + on(name: "receive-text-menu", callback: (menu: Menu, x: unknown) => void, ctx?: unknown): EventRef; + /** @internal Triggers when user swipes open left/right sidebar */ + on(name: "swipe", callback: (touchEvents: ObsidianTouchEvent[]) => void, ctx?: unknown): EventRef; + /** @internal Called whenever user opens tab group menu (contains e.g. stacked tabs button) */ + on(name: "tab-group-menu", callback: (tabMenu: Menu, tabsLeaf: WorkspaceTabs) => void, ctx?: unknown): EventRef; + /** @internal Triggers when user right-clicks on external URL in editor */ + on(name: "url-menu", callback: (menu: Menu, url: string) => void, ctx?: unknown): EventRef; /** @internal Handles drag event on leaf */ onDragLeaf(e: DragEvent, leaf: WorkspaceLeaf): void; /** @internal Handles layout change and saves layout to disk */