obsidian-typings 4.99.0 → 4.100.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.
@@ -4772,6 +4772,14 @@ declare module "obsidian" {
4772
4772
  isRoot(): boolean;
4773
4773
  }
4774
4774
  }
4775
+ declare module "obsidian" {
4776
+ /**
4777
+ * A function that handles CLI commands.
4778
+ *
4779
+ * @deprecated - Added only for typing purposes. Use {@link CliHandler} instead.
4780
+ */
4781
+ type CliHandler__ = (params: CliData) => string | Promise<string>;
4782
+ }
4775
4783
  declare module "obsidian" {
4776
4784
  /**
4777
4785
  * A group of BasesEntry objects for a given value of the groupBy key.
@@ -4884,6 +4892,14 @@ declare module "obsidian" {
4884
4892
  watchResize(): void;
4885
4893
  }
4886
4894
  }
4895
+ declare module "obsidian" {
4896
+ /**
4897
+ * A map of CLI flags.
4898
+ *
4899
+ * @deprecated - Added only for typing purposes. Use {@link CliFlag} instead.
4900
+ */
4901
+ type CliFlags__ = Record<string, CliFlag>;
4902
+ }
4887
4903
  declare module "obsidian" {
4888
4904
  /**
4889
4905
  * A menu item.
@@ -5465,13 +5481,6 @@ declare module "obsidian" {
5465
5481
  * @since 1.11.4
5466
5482
  */
5467
5483
  interface SecretStorage {
5468
- /**
5469
- * Gets the last access timestamp for a secret key
5470
- * @param id The secret ID
5471
- * @returns Timestamp in milliseconds, or null if never accessed
5472
- * @official
5473
- */
5474
- getLastAccess(id: string): number | null;
5475
5484
  /**
5476
5485
  * Gets a secret from storage
5477
5486
  *
@@ -9609,6 +9618,20 @@ declare module "obsidian" {
9609
9618
  * @since 1.10.0
9610
9619
  */
9611
9620
  registerBasesView(viewId: string, registration: BasesViewRegistration): boolean;
9621
+ /**
9622
+ * Register a CLI handler to handle a command from the CLI.
9623
+ * Command IDs must be globally unique. Attempting to register a command that is already registered will throw an Error.
9624
+ *
9625
+ * Use the format `<plugin-id>` for your default command, and `<plugin-id>:<action>` for sub-commands and actions.
9626
+ *
9627
+ * @param command - The command ID that will be used. Use alphanumeric characters without spaces.
9628
+ * @param description - The description text to provide in the help command, and in auto-completion prompts.
9629
+ * @param flags - Command line flags that can be passed in.
9630
+ * @param handler - The callback handler to handle a CLI invocation.
9631
+ * @official
9632
+ * @since 1.12.2
9633
+ */
9634
+ registerCliHandler(command: string, description: string, flags: CliFlags | null, handler: CliHandler): void;
9612
9635
  /**
9613
9636
  * Registers a CodeMirror 6 extension.
9614
9637
  * To reconfigure cm6 extensions for a plugin on the fly, an array should be passed in, and modified dynamically.
@@ -12472,12 +12495,19 @@ declare module "obsidian" {
12472
12495
  */
12473
12496
  processFrontMatter(file: TFile, fn: (frontmatter: any) => void, options?: DataWriteOptions): Promise<void>;
12474
12497
  /**
12475
- * Prompt the user to delete a file.
12498
+ * Prompt the user to confirm they want to delete the specified file or folder.
12476
12499
  *
12477
- * @unofficial
12500
+ * @param file - the file or folder to delete.
12501
+ * @returns A promise that resolves to `true` if the prompt was confirmed or `false` if it was canceled.
12502
+ * @example
12503
+ * ```ts
12504
+ * const file = app.vault.getFileByPath('foo/bar.md');
12505
+ * await app.fileManager.promptForDeletion(file);
12506
+ * ```
12507
+ * @official
12478
12508
  * @since 0.15.0
12479
12509
  */
12480
- promptForDeletion(file: TAbstractFile): Promise<void>;
12510
+ promptForDeletion(file: TAbstractFile): Promise<boolean>;
12481
12511
  /**
12482
12512
  * Prompt the user to delete a file.
12483
12513
  *
@@ -14471,6 +14501,35 @@ declare module "obsidian" {
14471
14501
  file: TFile;
14472
14502
  }
14473
14503
  }
14504
+ declare module "obsidian" {
14505
+ /**
14506
+ * The data passed to the CLI.
14507
+ */
14508
+ export interface CliData extends Record<string, string | "true"> {
14509
+ }
14510
+ }
14511
+ declare module "obsidian" {
14512
+ /**
14513
+ * The data passed to the CLI.
14514
+ */
14515
+ export interface CliFlag {
14516
+ /**
14517
+ * Description shown in help and autocomplete
14518
+ * @official
14519
+ */
14520
+ description: string;
14521
+ /**
14522
+ * Whether this flag is required (default: false)
14523
+ * @official
14524
+ */
14525
+ required?: boolean;
14526
+ /**
14527
+ * Value placeholder (e.g., '<filename>', '<path>'). Omit for boolean flags.
14528
+ * @official
14529
+ */
14530
+ value?: string;
14531
+ }
14532
+ }
14474
14533
  declare module "obsidian" {
14475
14534
  /**
14476
14535
  * The direction of the leaf split.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-typings",
3
- "version": "4.99.0",
3
+ "version": "4.100.0",
4
4
  "description": "Extended type definitions for the Obsidian API (https://obsidian.md)",
5
5
  "main": "",
6
6
  "module": "",
@@ -74,7 +74,7 @@
74
74
  "electron": "39.2.7",
75
75
  "i18next": "25.2.1",
76
76
  "mermaid": "11.4.1",
77
- "obsidian": "1.12.0",
77
+ "obsidian": "1.12.2",
78
78
  "pdfjs-dist": "5.3.31",
79
79
  "pixi.js": "7.2.4",
80
80
  "scrypt-js": "3.0.1",