Comparing version 1.6.6 to 1.7.2
# Changelog | ||
This CHANGELOG details any breaking changes to the API or new additions that require additional context. The versions listed below correspond to the versions of the Obsidian app. There may not be a corresponding package version for the version listed below. | ||
## v1.7.2 (Insider) | ||
### Workspace changes | ||
- New function `Plugin#onUserEnable` gives you a place to performance one-time initialize after the user installs and enables your plugin. If your plugin has a custom view, this is a good place to initialize it rather than recreating the view in `Plugin#onload`. | ||
- `Workspace#ensureSideLeaf` is now public. This function is a shorthand way to create a leaf in the sidebar if one does not already exist. | ||
- Added `WorkspaceLeaf#isDeferred` and `WorkspaceLeaf#loadIfDeferred`. As of Obsidian v1.7.2, Obsidian will now defer tabs by default. We are publishing a guide on how to handle deferred views in the developer docs. | ||
### Housekeeping | ||
- Removed `prepareQuery`, `fuzzySearch`, and `PreparedQuery` from the API. If your plugin is using one of these functions, you should migrate to `prepareFuzzySearch`. | ||
- We've updated the API to prefer `unknown` to `any`. Using `any` causes Typescript to disable typechecking entirely on the returned value, so this change could uncover some hidden typing issues. | ||
### Misc | ||
- New `Plugin#removeCommand` is now available if your plugin needs to dynamically remove commands (for example, if your plugin allows for user-created commands). | ||
- `SuggestModal#selectActiveSuggestion` is now public. This is useful to provide an alternative hotkey to your SuggestModal that still triggers the selected item. | ||
## v1.7.0 (Insider) | ||
- Fixed `FileSystemAdapter#rmdir(dirPath, false)` always throwing an error when attempting to delete an empty directory. | ||
- Added a `data-type` to the Markdown embed container using subpath type. | ||
## v1.5.11 | ||
@@ -9,9 +34,9 @@ | ||
## v.1.5.7 | ||
## v1.5.7 | ||
### `Plugin.onExternalSettingsChange` | ||
### `Plugin#onExternalSettingsChange` | ||
There's a new callback function for plugins to react to when plugin settings (`data.json`) get changed on disk. This callback can be used to reload settings when they are updated by an external application or when the settings get synced using a file syncing service like Obsidian Sync. | ||
### New `Vault.getFileByPath` and `Vault.getFolderByPath` utility functions | ||
### New `Vault#getFileByPath` and `Vault#getFolderByPath` utility functions | ||
@@ -32,3 +57,3 @@ The `getAbstractFileByPath` has long been a point of confusion with plugin developers. More often than not, | ||
### `FileManager.getAvailablePathForAttachment` | ||
### `FileManager#getAvailablePathForAttachment` | ||
@@ -42,3 +67,3 @@ If your plugin saves attachments to the vault, you should be using `getAvailablePathForAttachment`. It will generate a safe path for you to use that respects the user's settings for file attachments. | ||
The `FileManager.processFrontMatter` function now also exposes the DataWriteOptions argument to be consistent with the other `process` and `write` functions. | ||
The `FileManager#processFrontMatter` function now also exposes the DataWriteOptions argument to be consistent with the other `process` and `write` functions. | ||
@@ -45,0 +70,0 @@ ## v1.4.0 |
{ | ||
"name": "obsidian", | ||
"version": "1.6.6", | ||
"version": "1.7.2", | ||
"description": "Type definitions for the latest Obsidian API (https://obsidian.md)", | ||
@@ -5,0 +5,0 @@ "keywords": ["obsdmd"], |
@@ -339,3 +339,3 @@ | ||
* Registers an interval (from setInterval) to be cancelled when unloading | ||
* Use {@link window.setInterval} instead of {@link setInterval} to avoid TypeScript confusing between NodeJS vs Browser API | ||
* Use {@link window#setInterval} instead of {@link setInterval} to avoid TypeScript confusing between NodeJS vs Browser API | ||
* @public | ||
@@ -361,7 +361,7 @@ */ | ||
*/ | ||
on(name: string, callback: (...data: any) => any, ctx?: any): EventRef; | ||
on(name: string, callback: (...data: unknown[]) => unknown, ctx?: any): EventRef; | ||
/** | ||
* @public | ||
*/ | ||
off(name: string, callback: (...data: any) => any): void; | ||
off(name: string, callback: (...data: unknown[]) => unknown): void; | ||
/** | ||
@@ -374,7 +374,7 @@ * @public | ||
*/ | ||
trigger(name: string, ...data: any[]): void; | ||
trigger(name: string, ...data: unknown[]): void; | ||
/** | ||
* @public | ||
*/ | ||
tryTrigger(evt: EventRef, args: any[]): void; | ||
tryTrigger(evt: EventRef, args: unknown[]): void; | ||
} | ||
@@ -412,3 +412,6 @@ | ||
docId: string; | ||
/** @public */ | ||
/** | ||
* The path to the associated file. Any links are assumed to be relative to the `sourcePath`. | ||
* @public | ||
*/ | ||
sourcePath: string; | ||
@@ -465,4 +468,4 @@ /** @public */ | ||
* @param containerEl - This HTMLElement will be used to test whether this component is still alive. | ||
* It should be a child of the markdown preview sections, and when it's no longer attached | ||
* (for example, when it is replaced with a new version because the user edited the markdown source code), | ||
* It should be a child of the Markdown preview sections, and when it's no longer attached | ||
* (for example, when it is replaced with a new version because the user edited the Markdown source code), | ||
* this component will be unloaded. | ||
@@ -495,3 +498,3 @@ * @public | ||
* Register a special post processor that handles fenced code given a language and a handler. | ||
* This special post processor takes care of removing the <pre><code> and create a <div> that | ||
* This special post processor takes care of removing the `<pre><code>` and create a `<div>` that | ||
* will be passed to your handler, and is expected to be filled with your custom elements. | ||
@@ -510,3 +513,3 @@ * @public | ||
declare global { | ||
/** | ||
/** | ||
* Global reference to the publish instance. | ||
@@ -513,0 +516,0 @@ * @public |
@@ -9,4 +9,8 @@ ## Obsidian API | ||
For an example on how to create Obsidian plugins, use the template at https://github.com/obsidianmd/obsidian-sample-plugin | ||
For an example on how to create Obsidian plugins, use the template at https://github.com/obsidianmd/obsidian-sample-plugin | ||
### Issues and API requests | ||
For issues with the API, or to make requests for new APIs, please go to our forum: https://forum.obsidian.md/c/developers-api/14 | ||
### Plugin structure | ||
@@ -13,0 +17,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169614
5345
70
7