obsidian-typings 1.1.4 → 1.1.5

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 +89 -86
  2. package/package.json +6 -3
package/obsidian-ex.d.ts CHANGED
@@ -4,26 +4,27 @@ import { IpcRenderer } from "electron";
4
4
  import * as fs from "fs";
5
5
  import * as fsPromises from "fs/promises";
6
6
  import {
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,
7
+ CachedMetadata,
8
+ CacheItem,
9
+ Command,
10
+ Component,
11
+ EditorPosition,
12
+ EditorRange,
13
+ EditorRangeOrCaret,
14
+ EditorSuggest,
15
+ Events,
16
+ HoverPopover,
17
+ KeymapInfo,
18
+ Loc,
19
+ MarkdownFileInfo,
20
+ MarkdownSubView,
21
+ MarkdownViewModeType,
22
+ Plugin,
23
+ Reference,
24
+ SearchResult,
25
+ SplitDirection,
26
+ TFolder,
27
+ ViewState,
27
28
  } from "obsidian";
28
29
  import * as path from "path";
29
30
  export * from "obsidian";
@@ -122,7 +123,7 @@ declare module "obsidian" {
122
123
  | "showLineNumber"
123
124
  | "showUnsupportedFiles"
124
125
  | "showViewHeader"
125
- | "showRibbon"
126
+ | "showRibbon"
126
127
  | "smartIndentList"
127
128
  | "spellcheck"
128
129
  | "spellcheckLanguages"
@@ -189,14 +190,14 @@ declare module "obsidian" {
189
190
 
190
191
  /** @todo Documentation incomplete */
191
192
  type TreeItem<T> = TreeNode<T> & {
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
- */
193
+ collapseEl: HTMLElement;
194
+ /**
195
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
196
+ */
197
+ collapsed: boolean;
198
+ /**
199
+ * @deprecated Potentially removed in 1.6.0 for some tree-likes
200
+ */
200
201
  collapsible: boolean;
201
202
  coverEl: HTMLElement;
202
203
  innerEl: HTMLElement;
@@ -336,8 +337,10 @@ declare module "obsidian" {
336
337
  interface App {
337
338
  /**
338
339
  * The account signed in to Obsidian
340
+ *
341
+ * @deprecated Property is now undefined, removed pre-1.6.0
339
342
  */
340
- account: Account;
343
+ account: Account | undefined;
341
344
  /**
342
345
  * ID that uniquely identifies the vault
343
346
  *
@@ -392,6 +395,7 @@ declare module "obsidian" {
392
395
  /**
393
396
  * Whether the application is currently running on mobile
394
397
  *
398
+ * @deprecated Will be inaccessible in a future version, prefer using `Platform.isMobile`
395
399
  * @remark Prefer usage of `Platform.isMobile`
396
400
  * @remark Will be true if `app.emulateMobile()` was enabled
397
401
  */
@@ -795,10 +799,10 @@ declare module "obsidian" {
795
799
  * Editor > Show line numbers
796
800
  */
797
801
  showLineNumber?: false | boolean;
798
- /**
799
- * Appearance > Show ribbon
800
- */
801
- showRibbon?: true | boolean;
802
+ /**
803
+ * Appearance > Show ribbon
804
+ */
805
+ showRibbon?: true | boolean;
802
806
  /**
803
807
  * Files & Links > Detect all file extensions
804
808
  */
@@ -868,14 +872,14 @@ declare module "obsidian" {
868
872
  vimMode?: false | boolean;
869
873
  }
870
874
 
871
- /**
872
- * @remark `BaseEditor` is never used in the Obsidian codebase, but is exposed in the Obsidian module as `Editor`.
873
- * However, most editor components actually make use of the extended `Editor`, so this interface is purposely
874
- * named to `BaseEditor` to not require any casting for most purposes (or overriding the `editor` property type
875
- * for all components).
876
- * @todo Potential risk of confusion when `Editor` is constructed from the Obsidian module, as it only has the
877
- * methods from `BaseEditor`, *not* `Editor`
878
- */
875
+ /**
876
+ * @remark `BaseEditor` is never used in the Obsidian codebase, but is exposed in the Obsidian module as `Editor`.
877
+ * However, most editor components actually make use of the extended `Editor`, so this interface is purposely
878
+ * named to `BaseEditor` to not require any casting for most purposes (or overriding the `editor` property type
879
+ * for all components).
880
+ * @todo Potential risk of confusion when `Editor` is constructed from the Obsidian module, as it only has the
881
+ * methods from `BaseEditor`, *not* `Editor`
882
+ */
879
883
  interface BaseEditor {
880
884
  /**
881
885
  * CodeMirror editor instance
@@ -971,10 +975,10 @@ declare module "obsidian" {
971
975
  /** @internal */
972
976
  cache: unknown;
973
977
  }
974
-
975
- interface CachedMetadata {
976
- footnotes?: FootnoteCache[];
977
- }
978
+
979
+ interface CachedMetadata {
980
+ footnotes?: FootnoteCache[];
981
+ }
978
982
 
979
983
  interface CanvasConnection {}
980
984
 
@@ -1886,10 +1890,10 @@ declare module "obsidian" {
1886
1890
 
1887
1891
  /** @todo Documentation incomplete */
1888
1892
  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[];
1893
+ /** @internal */
1894
+ attachDropHandler(x: unknown, y: unknown, z: unknown): unknown;
1895
+ /** @internal Get a sorted list of the tree items for a specific folder) */
1896
+ getSortedFolderItems(folder: TFolder): FileTreeItem[];
1893
1897
  /**
1894
1898
  * Reveals a file or folder in the file explorer view, opens the view if it is not already
1895
1899
  * open/visible
@@ -2117,10 +2121,8 @@ declare module "obsidian" {
2117
2121
  * Get suggestions for file heading query
2118
2122
  */
2119
2123
  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"}];
2124
+ /** @internal Generate instructions for specific actions in suggestion manager (e.g. accept, select, ...) */
2125
+ getInstructions(): [{ command: "string"; purpose: "string" }];
2124
2126
  /**
2125
2127
  * Get suggestions for current input text
2126
2128
  *
@@ -2165,12 +2167,12 @@ declare module "obsidian" {
2165
2167
  interface FoldManager {
2166
2168
  }
2167
2169
 
2168
- /**
2169
- * Cache item containing a notes footnotes metadata
2170
- */
2171
- interface FootnoteCache extends CacheItem {
2172
- identifier: string;
2173
- }
2170
+ /**
2171
+ * Cache item containing a notes footnotes metadata
2172
+ */
2173
+ interface FootnoteCache extends CacheItem {
2174
+ identifier: string;
2175
+ }
2174
2176
 
2175
2177
  /** @todo Documentation incomplete */
2176
2178
  interface GlobalSearchLeaf extends WorkspaceLeaf {}
@@ -2225,10 +2227,10 @@ declare module "obsidian" {
2225
2227
  getHotkeys(command: string): KeymapInfo[];
2226
2228
  /** @internal Load hotkeys from storage */
2227
2229
  load(): void;
2228
- /** @internal */
2229
- onConfigFileChanged(): void;
2230
- /** @internal */
2231
- onRaw(e: unknown): void;
2230
+ /** @internal */
2231
+ onConfigFileChanged(): void;
2232
+ /** @internal */
2233
+ onRaw(e: unknown): void;
2232
2234
  /**
2233
2235
  * Trigger a command by keyboard event
2234
2236
  *
@@ -2242,8 +2244,8 @@ declare module "obsidian" {
2242
2244
  * @param command
2243
2245
  */
2244
2246
  printHotkeyForCommand(command: string): string;
2245
- /** @internal */
2246
- registerListeners(): void;
2247
+ /** @internal */
2248
+ registerListeners(): void;
2247
2249
  /**
2248
2250
  * Remove a hotkey from the default hotkeys
2249
2251
  *
@@ -2286,11 +2288,11 @@ declare module "obsidian" {
2286
2288
  display: string;
2287
2289
  }
2288
2290
 
2289
- /** @todo Documentation incomplete */
2290
- interface HoverPopover {
2291
- /** @internal */
2292
- watchResize(): void;
2293
- }
2291
+ /** @todo Documentation incomplete */
2292
+ interface HoverPopover {
2293
+ /** @internal */
2294
+ watchResize(): void;
2295
+ }
2294
2296
 
2295
2297
  class IFramedMarkdownEditor extends MarkdownScrollableEditView {
2296
2298
  constructor(context: WidgetEditorView);
@@ -2365,9 +2367,10 @@ declare module "obsidian" {
2365
2367
 
2366
2368
  /** @todo Documentation incomplete */
2367
2369
  interface InternalPlugin extends Plugin {
2370
+ instance: InternalPluginInstance<this>;
2371
+
2368
2372
  disable(): void;
2369
2373
  enable(): void;
2370
- instance: InternalPluginInstance<this>;
2371
2374
  }
2372
2375
 
2373
2376
  interface InternalPluginInstance<TPlugin> {
@@ -3032,7 +3035,7 @@ declare module "obsidian" {
3032
3035
  /**
3033
3036
  * Add property to inline metadata editor or properties plugin
3034
3037
  *
3035
- * @deprecated Removed in 1.6.0
3038
+ * @deprecated Removed in 1.6.0
3036
3039
  * @remark Parameter is not used
3037
3040
  */
3038
3041
  addProperty(unused: undefined): void;
@@ -3066,8 +3069,8 @@ declare module "obsidian" {
3066
3069
  * Get the file attached to the view
3067
3070
  */
3068
3071
  getFile(): TFile | null;
3069
- /** @internal Get the current mode of the editor */
3070
- getHoverSource(): string;
3072
+ /** @internal Get the current mode of the editor */
3073
+ getHoverSource(): string;
3071
3074
  /**
3072
3075
  * Get the current mode of the editor
3073
3076
  */
@@ -3454,7 +3457,7 @@ declare module "obsidian" {
3454
3457
  /**
3455
3458
  * Get an entry from the file cache
3456
3459
  */
3457
- getFileInfo(path: string): FileCacheEntry;
3460
+ getFileInfo(path: string): FileCacheEntry | undefined;
3458
3461
  /**
3459
3462
  * Get property values for frontmatter property key
3460
3463
  */
@@ -3832,10 +3835,10 @@ declare module "obsidian" {
3832
3835
  getTypes(): string[];
3833
3836
  /** @internal Load property types from config */
3834
3837
  loadData(): Promise<void>;
3835
- /** @internal */
3836
- onRaw(e: unknown): void;
3837
- /** @internal */
3838
- registerListeners(): void;
3838
+ /** @internal */
3839
+ onRaw(e: unknown): void;
3840
+ /** @internal */
3841
+ registerListeners(): void;
3839
3842
  /** @internal Save property types to config */
3840
3843
  save(): Promise<void>;
3841
3844
  /** @internal Get all properties from metadata cache */
@@ -4589,12 +4592,12 @@ declare module "obsidian" {
4589
4592
  */
4590
4593
  useSelectedItem(event: Event): boolean;
4591
4594
  }
4592
-
4593
- /** @todo Documentation incomplete */
4594
- interface SuggestModal<T> {
4595
- /** @internal */
4596
- clearButtonEl: HTMLButtonElement;
4597
- }
4595
+
4596
+ /** @todo Documentation incomplete */
4597
+ interface SuggestModal<T> {
4598
+ /** @internal */
4599
+ clearButtonEl: HTMLButtonElement;
4600
+ }
4598
4601
 
4599
4602
  /** @todo Documentation incomplete */
4600
4603
  interface TableCell {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-typings",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Extended type definitions for the Obsidian API (https://obsidian.md)",
5
5
  "main": "",
6
6
  "types": "obsidian-ex.d.ts",
@@ -31,6 +31,9 @@
31
31
  },
32
32
  "scripts": {
33
33
  "build": "tsc --build --force",
34
- "format": "bun run sort-interfaces.ts obsidian-ex.d.ts && bun dprint fmt obsidian-ex.d.ts"
34
+ "format": "bun run scripts/sort-interfaces.ts obsidian-ex.d.ts && bun dprint fmt obsidian-ex.d.ts",
35
+ "release-patch": "bun run scripts/bump-version.ts patch",
36
+ "release-minor": "bun run scripts/bump-version.ts minor",
37
+ "release-major": "bun run scripts/bump-version.ts major"
35
38
  }
36
- }
39
+ }