ContextId<_Context>
A typed context identifier for persisting non-serializable values across evalInObsidian calls.
The context is a persistent object stored on window in the Obsidian process. All calls sharing the same ContextId share the same context object, allowing non-serializable values (e.g. TFile, Editor) to survive across calls.
Implements AsyncDisposable for use with await using.
Import:
import { ContextId } from 'obsidian-integration-testing';Signature:
export class ContextId<_Context> implements AsyncDisposableImplements: AsyncDisposable
Constructor
new ContextId()Creates a new context id.
Methods
| Method | Returns | Description |
|---|---|---|
| [Symbol.asyncDispose]() | Promise<void> | Disposes this context id. |
| dispose(vaultPath?) | Promise<void> | Removes this context from the Obsidian process. |
| toJSON() | string | Returns the JSON representation of the context id. |
| toString() | string | Returns the string representation of the context id. |
Links to this page: