ExternalFileMonitor
Unofficial
Watches one external file without retaining the file object.
Import:
import type { ExternalFileMonitor } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface ExternalFileMonitorProperties
| Property | Type | Description | |
|---|---|---|---|
| file | null | TExternalFile | The current file, or null after its weak reference expires. | |
| fileref | WeakRef<TExternalFile> | Weak reference to the file. | |
| inode | number | Last observed inode, used to restart monitoring on non-Windows platforms. | |
| manager | ExternalFileManager | The owning manager. | |
| watcher | FSWatcher | null | Active filesystem watcher, or null when stopped. | |
| watchpath | string | Physical path currently being watched, or an empty string when stopped. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| isWatching() | boolean | Checks whether monitoring is active. | |
| onFileChanged() | Promise<void> | Refreshes file statistics, clears stale caches and emits modify or delete events. | |
| start(stat?) | void | Starts monitoring if the file still exists and can be watched. | |
| stop() | void | Stops monitoring and resets the watched path and inode. |
Links to this page: