EnsureReleaseAssetParams
Parameters for ensureReleaseAsset.
Import:
import type { EnsureReleaseAssetParams } from '@mnaoumov/obsidian-lib/release-asset';Signature:
export interface EnsureReleaseAssetParamsProperties
| Property | Type | Description |
|---|---|---|
| abortSignal? | AbortSignal | undefined | Aborts the operation. Pass the plugin's abort signal, so an unload stops it. |
| app | App | The Obsidian application instance. |
| cacheFolderPath | string | The vault-relative folder that holds the cached file, typically ${plugin.manifest.dir}/assets.A folder inside the config folder is not synced, so each device downloads the asset once. |
| fileName | string | The name of the cached file. It must not contain a path separator. |
| sha256 | string | The expected SHA-256 of the asset, as 64 hexadecimal digits. |
| shouldDownload? | ((request: ReleaseAssetConsentRequest) => Promise<boolean>) | undefined | Asks the user whether to download the asset. Defaults to a confirmation modal. Pass () => Promise.resolve(true) when the user has already agreed, for example through a setting. |
| sizeInBytes? | number | undefined | The size of the asset in bytes, shown to the user when asking. |
| timeoutInMilliseconds? | number | undefined | The download timeout in milliseconds. |
| url | string | The URL to download the asset from. Only http: and https: URLs are accepted. |
Links to this page: