obsidian-typings 6.47.0 → 6.48.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +16 -0
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 6.48.0
4
+
5
+ - Now resolves to `@obsidian-typings/obsidian-public-latest` `^6.48.0`, which resolves to `@obsidian-typings/obsidian-public-1.14.4` `^1.11.0`. See [its release notes](https://github.com/obsidian-typings/obsidian-typings/releases/tag/obsidian-public-1.14.4-v1.11.0).
6
+
7
+ ### Breaking changes in that release
8
+
9
+ - fix(result-dom): widen ResultProperty.subkey to (number | string)[]
10
+ - fix(types): make every ResultDomResult member optional, and add the search match keys
11
+ - fix(types): let App.changeTheme take 'system', and drop App.setTheme's parameter
12
+
3
13
  ## 6.47.0
4
14
 
5
15
  - Now resolves to `@obsidian-typings/obsidian-public-latest` `^6.47.0`, which resolves to `@obsidian-typings/obsidian-public-1.14.4` `^1.10.0`. See [its release notes](https://github.com/obsidian-typings/obsidian-typings/releases/tag/obsidian-public-1.14.4-v1.10.0).
package/README.md CHANGED
@@ -89,6 +89,9 @@ Add the package to the `types` array of your `tsconfig.json` to make all extende
89
89
  > ]
90
90
  > }
91
91
  > }
92
+ > ```
93
+
94
+ The package ships a CommonJS copy and an ES-module copy of its declarations. With `"moduleResolution": "node16"` or `"nodenext"`, TypeScript resolves a `types` entry under the `require` condition even in a `"type": "module"` project, so it always loads the CommonJS copy. That matters when you [extend the typings](#extend-with-your-own-typings).
92
95
 
93
96
  ### 3. Importing explicitly (alternative)
94
97
 
@@ -98,6 +101,8 @@ Instead of adding the package to your `types`, you can also import it directly:
98
101
  import type {} from '@obsidian-typings/obsidian-public-latest';
99
102
  ```
100
103
 
104
+ An import resolves in the format of the file it is written in. In an ES-module project it loads the ES-module copy, which keeps the typings in the same format as your own code.
105
+
101
106
  ## Usage
102
107
 
103
108
  ### `obsidian` module internals
@@ -153,6 +158,17 @@ declare module '@obsidian-typings/obsidian-public-latest' {
153
158
  }
154
159
  ```
155
160
 
161
+ The augmentation has to target the copy of the package that your project loaded. A module augmentation does not load the file it targets, so an augmentation aimed at the other copy compiles without an error and changes nothing. `app.plugins.plugins['my-plugin-id']` then stays a plain `Plugin`.
162
+
163
+ | Your project | How the package is loaded | Where to write the augmentation |
164
+ | --- | --- | --- |
165
+ | CommonJS (no `"type": "module"`) | `types` or an import | any `.d.ts` / `.ts` file |
166
+ | `"moduleResolution": "bundler"` | `types` or an import | any `.d.ts` / `.ts` file |
167
+ | `"type": "module"` + `node16` / `nodenext` | an import (step 3) | any `.d.ts` / `.ts` file |
168
+ | `"type": "module"` + `node16` / `nodenext` | `types` (step 2) | a `.d.cts` file |
169
+
170
+ In the last row, a `types` entry loads the CommonJS copy. A `.d.cts` file is CommonJS in any project, so its `declare module` block reaches that copy. The same block in a `.d.ts` or `.ts` file of an ES-module project targets the ES-module copy, which is never loaded.
171
+
156
172
  ## Disclaimer
157
173
 
158
174
  > [!WARNING]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@obsidian-typings/obsidian-public-latest": "^6.47.0"
3
+ "@obsidian-typings/obsidian-public-latest": "^6.48.0"
4
4
  },
5
5
  "description": "TypeScript type definitions for Obsidian's internal/unofficial APIs. Wrapper for @obsidian-typings/obsidian-public-latest.",
6
6
  "exports": {
@@ -32,5 +32,5 @@
32
32
  },
33
33
  "type": "module",
34
34
  "types": "./types.d.cts",
35
- "version": "6.47.0"
35
+ "version": "6.48.0"
36
36
  }