ResourceLockComponent.lockForPath method
ResourceLockComponent › lockForPath
Locks the note at the given path on behalf of this plugin, making it read-only in every current and futureMarkdownView until the lock is released. Reference-counted: balance each call with a dispose of the returned Disposable (ideally via using) or unlockForPath.Signature:
lockForPath(params: ResourceLockComponentLockForPathParams): DisposableParameters:
| Parameter | Type | Description |
|---|---|---|
| params | ResourceLockComponentLockForPathParams | Locking parameters. Its {@link ResourceLockComponentLockForPathParams.pathOrFile} and {@link ResourceLockComponentLockForPathParams.operationName} are required (the latter is shown in the unlock confirmation). Pass an {@link ResourceLockComponentLockForPathParams.abortController} to make the lock cancelable via a lock indicator's "unlock" menu, the "Unlock active note" command, or {@link requestResourceUnlockForPath}. |
Returns: Disposable — A Disposable that releases this lock when disposed. Disposing more than once is a no-op.