obsidian-typings 4.88.0 → 4.89.0

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.
package/README.md CHANGED
@@ -70,7 +70,7 @@ To make it easier to adapt to these differences, this package provides typings f
70
70
  Typings for each `Obsidian` version can be found in their own git branches: namely `release/obsidian-public/*` and `release/obsidian-catalyst/*`:
71
71
 
72
72
  - Latest `public` release: [`release/obsidian-public/1.10.6`](https://github.com/Fevol/obsidian-typings/tree/release/obsidian-public/1.10.6)
73
- - Latest `catalyst` release: [`release/obsidian-catalyst/1.11.1`](https://github.com/Fevol/obsidian-typings/tree/release/obsidian-catalyst/1.11.1)
73
+ - Latest `catalyst` release: [`release/obsidian-catalyst/1.11.4`](https://github.com/Fevol/obsidian-typings/tree/release/obsidian-catalyst/1.11.4)
74
74
 
75
75
  Older versions of the package are available, but support for them is limited.
76
76
  In most cases, we recommend to always use the latest release.
@@ -5082,6 +5082,7 @@ declare module "obsidian" {
5082
5082
  * Add warning styling to the menu item.
5083
5083
  *
5084
5084
  * @param warning - Whether the menu item should be styled as a warning.
5085
+ * If set to `true` the MenuItem's title and icon will become red. Or whatever color is applied to the class 'is-warning' by a theme.
5085
5086
  * @unofficial
5086
5087
  * @since 0.15.0
5087
5088
  */
@@ -5458,6 +5459,46 @@ declare module "obsidian" {
5458
5459
  score: number;
5459
5460
  }
5460
5461
  }
5462
+ declare module "obsidian" {
5463
+ /**
5464
+ * A secret storage.
5465
+ * @since 1.11.4
5466
+ */
5467
+ interface SecretStorage {
5468
+ /**
5469
+ * @official
5470
+ * @since 1.11.4
5471
+ */
5472
+ loadSecrets: unknown;
5473
+ /**
5474
+ * Gets a secret from storage
5475
+ *
5476
+ * @param id - the secret ID
5477
+ * @returns the secret value or null if not found
5478
+ * @official
5479
+ * @since 1.11.4
5480
+ */
5481
+ getSecret(id: string): string | null;
5482
+ /**
5483
+ * Lists all secrets in storage
5484
+ *
5485
+ * @returns array of secret IDs
5486
+ * @official
5487
+ * @since 1.11.4
5488
+ */
5489
+ listSecrets(): string[];
5490
+ /**
5491
+ * Sets a secret in the storage.
5492
+ *
5493
+ * @param id - lowercase alphanumeric ID with optional dashes
5494
+ * @param secret - the secret value to store
5495
+ * @throws Error if ID is invalid
5496
+ * @official
5497
+ * @since 1.11.4
5498
+ */
5499
+ setSecret(id: string, secret: string): void;
5500
+ }
5501
+ }
5461
5502
  declare module "obsidian" {
5462
5503
  /**
5463
5504
  * A separator for the menu.
@@ -10461,6 +10502,46 @@ declare module "obsidian" {
10461
10502
  setValueRgb(rgb: RGB): this;
10462
10503
  }
10463
10504
  }
10505
+ declare module "obsidian" {
10506
+ /**
10507
+ * Component for a secret input.
10508
+ *
10509
+ * @since 1.11.1
10510
+ */
10511
+ interface SecretComponent extends BaseComponent {
10512
+ /**
10513
+ * Creates a new secret component.
10514
+ *
10515
+ * @param app - the application instance.
10516
+ * @param containerEl - the container element.
10517
+ * @returns the secret component instance.
10518
+ * @official
10519
+ * @since 1.11.1
10520
+ * @deprecated - Added only for typing purposes. Use {@link constructor} instead.
10521
+ */
10522
+ constructor__(app: App, containerEl: HTMLElement): this;
10523
+ /**
10524
+ * Sets the callback function to be called when the value of the secret component changes.
10525
+ *
10526
+ * @param cb - the callback function.
10527
+ * @returns the secret component instance.
10528
+ * @public
10529
+ * @since 1.11.4
10530
+ * @unofficial ERROR: Missing `@unofficial` or `@official` tag
10531
+ */
10532
+ onChange(cb: (value: string) => unknown): this;
10533
+ /**
10534
+ * Sets the value of the secret component.
10535
+ *
10536
+ * @param value - the value to set.
10537
+ * @returns the secret component instance.
10538
+ * @public
10539
+ * @since 1.11.4
10540
+ * @unofficial ERROR: Missing `@unofficial` or `@official` tag
10541
+ */
10542
+ setValue(value: string): this;
10543
+ }
10544
+ }
10464
10545
  declare module "obsidian" {
10465
10546
  /**
10466
10547
  * Component for a text input or text area.
@@ -13518,6 +13599,25 @@ declare module "obsidian" {
13518
13599
  * @since 1.11.0
13519
13600
  */
13520
13601
  addClass(cls: string): this;
13602
+ /**
13603
+ * Add an extra button to the setting group.
13604
+ *
13605
+ * @param cb - the callback function.
13606
+ * @returns the setting group.
13607
+ * @official
13608
+ * @since 1.11.0
13609
+ */
13610
+ addExtraButton(cb: (component: ExtraButtonComponent) => any): this;
13611
+ /**
13612
+ * Add a search input at the beginning of the setting group. Useful for filtering
13613
+ * results or adding an input for quick entry.
13614
+ *
13615
+ * @param cb - the callback function.
13616
+ * @returns the setting group.
13617
+ * @official
13618
+ * @since 1.11.0
13619
+ */
13620
+ addSearch(cb: (component: SearchComponent) => any): this;
13521
13621
  /**
13522
13622
  * Add a setting to the setting group.
13523
13623
  *
@@ -14634,6 +14734,14 @@ declare module "obsidian" {
14634
14734
  * @since 0.9.7
14635
14735
  */
14636
14736
  scope: Scope;
14737
+ /**
14738
+ * The secret storage.
14739
+ *
14740
+ * @public
14741
+ * @since 1.11.4
14742
+ * @unofficial ERROR: Missing `@unofficial` or `@official` tag
14743
+ */
14744
+ secretStorage: SecretStorage;
14637
14745
  /**
14638
14746
  * Manages the settings modal and its tabs.
14639
14747
  *
@@ -15833,7 +15941,7 @@ declare module "obsidian" {
15833
15941
  * @official
15834
15942
  * @deprecated - Added only for typing purposes. Use {@link livePreviewState} instead.
15835
15943
  */
15836
- const livePreviewState__: ViewPlugin<LivePreviewStateType>;
15944
+ const livePreviewState__: ViewPlugin<LivePreviewStateType, undefined>;
15837
15945
  /**
15838
15946
  * An instance of `Moment.js` library.
15839
15947
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-typings",
3
- "version": "4.88.0",
3
+ "version": "4.89.0",
4
4
  "description": "Extended type definitions for the Obsidian API (https://obsidian.md)",
5
5
  "main": "",
6
6
  "module": "",
@@ -126,6 +126,7 @@
126
126
  "build:extract-api": "api-extractor run --local",
127
127
  "commit": "cz",
128
128
  "format": "bun run scripts/sort-interfaces.ts ./src/ && bun dprint fmt",
129
+ "format:fast": "bun run scripts/format-fast.ts",
129
130
  "postinstall": "node scripts/postinstall.mjs",
130
131
  "prepare": "husky",
131
132
  "release": "git show origin/main:workflow-scripts/release.ts | bun -",