obsidian-typings 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/obsidian-ex.d.ts +92 -26
  2. package/package.json +5 -5
package/obsidian-ex.d.ts CHANGED
@@ -4,30 +4,36 @@ import { IpcRenderer } from "electron";
4
4
  import * as fs from "fs";
5
5
  import * as fsPromises from "fs/promises";
6
6
  import {
7
- CachedMetadata,
8
- Command,
9
- Component,
10
- EditorPosition,
11
- EditorRange,
12
- EditorRangeOrCaret,
13
- EditorSuggest,
14
- Events,
15
- HoverPopover,
16
- KeymapInfo,
17
- Loc,
18
- MarkdownFileInfo,
19
- MarkdownSubView,
20
- MarkdownViewModeType,
21
- Plugin,
22
- Reference,
23
- SearchResult,
24
- SplitDirection,
25
- TFolder,
26
- ViewState,
7
+ CachedMetadata, CacheItem,
8
+ Command,
9
+ Component,
10
+ EditorPosition,
11
+ EditorRange,
12
+ EditorRangeOrCaret,
13
+ EditorSuggest,
14
+ Events,
15
+ HoverPopover,
16
+ KeymapInfo,
17
+ Loc,
18
+ MarkdownFileInfo,
19
+ MarkdownSubView,
20
+ MarkdownViewModeType,
21
+ Plugin,
22
+ Reference,
23
+ SearchResult,
24
+ SplitDirection,
25
+ TFolder,
26
+ ViewState,
27
27
  } from "obsidian";
28
28
  import * as path from "path";
29
29
  export * from "obsidian";
30
30
 
31
+ declare global {
32
+ interface DomElementInfo {
33
+ [eventName: `on${string}`]: EventListenerOrEventListenerObject;
34
+ }
35
+ }
36
+
31
37
  declare module "@codemirror/view" {
32
38
  /** @todo Documentation incomplete */
33
39
  interface EditorView {
@@ -116,6 +122,7 @@ declare module "obsidian" {
116
122
  | "showLineNumber"
117
123
  | "showUnsupportedFiles"
118
124
  | "showViewHeader"
125
+ | "showRibbon"
119
126
  | "smartIndentList"
120
127
  | "spellcheck"
121
128
  | "spellcheckLanguages"
@@ -182,8 +189,14 @@ declare module "obsidian" {
182
189
 
183
190
  /** @todo Documentation incomplete */
184
191
  type TreeItem<T> = TreeNode<T> & {
185
- collapseEl: HTMLElement;
186
- collapsed: boolean;
192
+ collapseEl: HTMLElement;
193
+ /**
194
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
195
+ */
196
+ collapsed: boolean;
197
+ /**
198
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
199
+ */
187
200
  collapsible: boolean;
188
201
  coverEl: HTMLElement;
189
202
  innerEl: HTMLElement;
@@ -383,7 +396,7 @@ declare module "obsidian" {
383
396
  * @remark Will be true if `app.emulateMobile()` was enabled
384
397
  */
385
398
  isMobile: boolean;
386
- /** @internal */
399
+ /** @deprecated Made inaccessible in 1.6.0, this object can be recreated using Notices */
387
400
  loadProgress: LoadProgress;
388
401
  /**
389
402
  * Manages the gathering and updating of metadata for all files in the vault
@@ -782,6 +795,10 @@ declare module "obsidian" {
782
795
  * Editor > Show line numbers
783
796
  */
784
797
  showLineNumber?: false | boolean;
798
+ /**
799
+ * Appearance > Show ribbon
800
+ */
801
+ showRibbon?: true | boolean;
785
802
  /**
786
803
  * Files & Links > Detect all file extensions
787
804
  */
@@ -954,6 +971,10 @@ declare module "obsidian" {
954
971
  /** @internal */
955
972
  cache: unknown;
956
973
  }
974
+
975
+ interface CachedMetadata {
976
+ footnotes?: FootnoteCache[];
977
+ }
957
978
 
958
979
  interface CanvasConnection {}
959
980
 
@@ -1865,6 +1886,10 @@ declare module "obsidian" {
1865
1886
 
1866
1887
  /** @todo Documentation incomplete */
1867
1888
  interface FileExplorerPlugin extends InternalPlugin {
1889
+ /** @internal */
1890
+ attachDropHandler(x: unknown, y: unknown, z: unknown): unknown;
1891
+ /** @internal Get a sorted list of the tree items for a specific folder) */
1892
+ getSortedFolderItems(folder: TFolder): FileTreeItem[];
1868
1893
  /**
1869
1894
  * Reveals a file or folder in the file explorer view, opens the view if it is not already
1870
1895
  * open/visible
@@ -2092,6 +2117,10 @@ declare module "obsidian" {
2092
2117
  * Get suggestions for file heading query
2093
2118
  */
2094
2119
  getHeadingSuggestions(runner: Runnable, file: TFile, text: string): Promise<SearchResult[]>;
2120
+ /**
2121
+ * @internal Generate instructions for specific actions in suggestion manager (e.g. accept, select, ...)
2122
+ */
2123
+ getInstructions(): [{command: "string", purpose: "string"}];
2095
2124
  /**
2096
2125
  * Get suggestions for current input text
2097
2126
  *
@@ -2136,6 +2165,13 @@ declare module "obsidian" {
2136
2165
  interface FoldManager {
2137
2166
  }
2138
2167
 
2168
+ /**
2169
+ * Cache item containing a notes footnotes metadata
2170
+ */
2171
+ interface FootnoteCache extends CacheItem {
2172
+ identifier: string;
2173
+ }
2174
+
2139
2175
  /** @todo Documentation incomplete */
2140
2176
  interface GlobalSearchLeaf extends WorkspaceLeaf {}
2141
2177
 
@@ -2189,6 +2225,10 @@ declare module "obsidian" {
2189
2225
  getHotkeys(command: string): KeymapInfo[];
2190
2226
  /** @internal Load hotkeys from storage */
2191
2227
  load(): void;
2228
+ /** @internal */
2229
+ onConfigFileChanged(): void;
2230
+ /** @internal */
2231
+ onRaw(e: unknown): void;
2192
2232
  /**
2193
2233
  * Trigger a command by keyboard event
2194
2234
  *
@@ -2202,6 +2242,8 @@ declare module "obsidian" {
2202
2242
  * @param command
2203
2243
  */
2204
2244
  printHotkeyForCommand(command: string): string;
2245
+ /** @internal */
2246
+ registerListeners(): void;
2205
2247
  /**
2206
2248
  * Remove a hotkey from the default hotkeys
2207
2249
  *
@@ -2244,6 +2286,12 @@ declare module "obsidian" {
2244
2286
  display: string;
2245
2287
  }
2246
2288
 
2289
+ /** @todo Documentation incomplete */
2290
+ interface HoverPopover {
2291
+ /** @internal */
2292
+ watchResize(): void;
2293
+ }
2294
+
2247
2295
  class IFramedMarkdownEditor extends MarkdownScrollableEditView {
2248
2296
  constructor(context: WidgetEditorView);
2249
2297
  /**
@@ -2319,6 +2367,11 @@ declare module "obsidian" {
2319
2367
  interface InternalPlugin extends Plugin {
2320
2368
  disable(): void;
2321
2369
  enable(): void;
2370
+ instance: InternalPluginInstance<this>;
2371
+ }
2372
+
2373
+ interface InternalPluginInstance<TPlugin> {
2374
+ plugin: TPlugin;
2322
2375
  }
2323
2376
 
2324
2377
  interface InternalPlugins extends Events {
@@ -2350,9 +2403,9 @@ declare module "obsidian" {
2350
2403
  *
2351
2404
  * @param id - ID of the plugin to get
2352
2405
  */
2353
- getEnabledPluginById(id: InternalPluginName): InternalPlugin | null;
2354
- getEnabledPluginById(id: "file-explorer"): FileExplorerPlugin | null;
2355
- getEnabledPluginById(id: "global-search"): GlobalSearchPlugin | null;
2406
+ getEnabledPluginById(id: InternalPluginName): InternalPluginInstance<InternalPlugin> | null;
2407
+ getEnabledPluginById(id: "file-explorer"): InternalPluginInstance<FileExplorerPlugin> | null;
2408
+ getEnabledPluginById(id: "global-search"): InternalPluginInstance<GlobalSearchPlugin> | null;
2356
2409
  /**
2357
2410
  * Get all enabled internal plugins
2358
2411
  */
@@ -2979,6 +3032,7 @@ declare module "obsidian" {
2979
3032
  /**
2980
3033
  * Add property to inline metadata editor or properties plugin
2981
3034
  *
3035
+ * @deprecated Removed in 1.6.0
2982
3036
  * @remark Parameter is not used
2983
3037
  */
2984
3038
  addProperty(unused: undefined): void;
@@ -3012,6 +3066,8 @@ declare module "obsidian" {
3012
3066
  * Get the file attached to the view
3013
3067
  */
3014
3068
  getFile(): TFile | null;
3069
+ /** @internal Get the current mode of the editor */
3070
+ getHoverSource(): string;
3015
3071
  /**
3016
3072
  * Get the current mode of the editor
3017
3073
  */
@@ -3776,6 +3832,10 @@ declare module "obsidian" {
3776
3832
  getTypes(): string[];
3777
3833
  /** @internal Load property types from config */
3778
3834
  loadData(): Promise<void>;
3835
+ /** @internal */
3836
+ onRaw(e: unknown): void;
3837
+ /** @internal */
3838
+ registerListeners(): void;
3779
3839
  /** @internal Save property types to config */
3780
3840
  save(): Promise<void>;
3781
3841
  /** @internal Get all properties from metadata cache */
@@ -4529,6 +4589,12 @@ declare module "obsidian" {
4529
4589
  */
4530
4590
  useSelectedItem(event: Event): boolean;
4531
4591
  }
4592
+
4593
+ /** @todo Documentation incomplete */
4594
+ interface SuggestModal<T> {
4595
+ /** @internal */
4596
+ clearButtonEl: HTMLButtonElement;
4597
+ }
4532
4598
 
4533
4599
  /** @todo Documentation incomplete */
4534
4600
  interface TableCell {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-typings",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Extended type definitions for the Obsidian API (https://obsidian.md)",
5
5
  "main": "",
6
6
  "types": "obsidian-ex.d.ts",
@@ -20,12 +20,12 @@
20
20
  "url": "https://github.com/Fevol/obsidian-typings/issues"
21
21
  },
22
22
  "homepage": "https://github.com/Fevol/obsidian-typings#readme",
23
- "dependencies": {
24
- "obsidian": "^1.4.11"
25
- },
26
- "devDependencies": {
23
+ "peerDependencies": {
27
24
  "@types/node": "^20.10.7",
28
25
  "@types/electron": "npm:@ophidian/electron-types",
26
+ "obsidian": "^1.5.7-1"
27
+ },
28
+ "devDependencies": {
29
29
  "dprint": "^0.45.1",
30
30
  "ts-morph": "^22.0.0"
31
31
  },