Skip to content

Commit

Permalink
jsdoc: Further improvements to QueryContext docs
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Oct 29, 2023
1 parent d457dea commit 051ed8a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Scripting/QueryContext.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { TasksFile } from './TasksFile';

/**
* This interface is part of the implementation of placeholders.
* Use {@link makeQueryContext} to make a QueryContext.
* This interface is part of the implementation of placeholders and scripting.
*
* QueryContext is a 'view' to pass in to {@link expandPlaceholders}.
* - Use {@link makeQueryContext} to make a {@link QueryContext}.
* - Or more commonly, if you have a {@link SearchInfo}, use {@link SearchInfo.queryContext}
*
* QueryContext is a 'view' to pass in to {@link expandPlaceholders} and
* to various methods of {@link TaskExpression}.
*
* It provides the following:
* `queryContext.query.file` - where query.file is a {@link TasksFile} object.
* So it supplies `query.file.path`, `query.file.folder`.
* - `queryContext.query.file` - where `query.file` is a {@link TasksFile} object.
* So it supplies `query.file.path`, `query.file.folder`.
*
* @see SearchInfo
*/
export interface QueryContext {
query: {
Expand All @@ -19,6 +24,8 @@ export interface QueryContext {
/**
* Create a {@link QueryContext} to represent a query in note at the give path.
* @param path
*
* @see SearchInfo.queryContext
*/
export function makeQueryContext(path: string): QueryContext {
const tasksFile = new TasksFile(path);
Expand Down

0 comments on commit 051ed8a

Please sign in to comment.