Something went wrong. Try again.
Fork of github.com/ccmdi/propsec
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041import { App } from "obsidian";import { QueryIndex } from "./index";
/** * Global query context */class QueryContext { private _index: QueryIndex | null = null;
/** * Initialize the context with app and plugin info * Must be called once during plugin load */ initialize(app: App, pluginId: string): void { this._index = new QueryIndex(app, pluginId); }
/** * Get the query index instance * Throws if accessed before initialization */ get index(): QueryIndex { if (!this._index) { throw new Error("QueryContext not initialized - call initialize() first"); } return this._index; }
/** * Check if the context has been initialized */ get isInitialized(): boolean { return this._index !== null; }}
// Singleton instanceexport const queryContext = new QueryContext();