Skip to content

Commit

Permalink
jsdoc: Document current behaviour of TasksFile
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Jan 20, 2025
1 parent fe1330f commit de9cbd7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Scripting/TasksFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export class TasksFile {
* See [FrontMatterCache](https://docs.obsidian.md/Reference/TypeScript+API/FrontMatterCache).
* But prefer using {@link frontmatter} where possible.
*
* @note This is currently only populated for Task objects when read in the Obsidian plugin.
* It's not populated for queries in the plugin, nor in most unit tests.
* @note This is currently only populated for Task objects when read in the Obsidian plugin,
* and queries in the plugin.
* It's not populated in most unit tests.
* If not available, it returns an empty object, {}.
*
* @see frontmatter, which provides a cleaned-up version of the raw frontmatter.
Expand Down Expand Up @@ -167,6 +168,11 @@ export class TasksFile {
return this.withoutExtension(this.filename);
}

/**
* This is documented for users and so must not be changed.
* https://publish.obsidian.md/tasks/Getting+Started/Obsidian+Properties#How+does+Tasks+treat+Obsidian+Properties%3F
* @param key
*/
public hasProperty(key: string): boolean {
const foundKey = this.findKeyInFrontmatter(key);
if (foundKey === undefined) {
Expand All @@ -185,6 +191,11 @@ export class TasksFile {
return true;
}

/**
* This is documented for users and so must not be changed.
* https://publish.obsidian.md/tasks/Getting+Started/Obsidian+Properties#How+does+Tasks+treat+Obsidian+Properties%3F
* @param key
*/
public property(key: string): any {
const foundKey = this.findKeyInFrontmatter(key);
if (foundKey === undefined) {
Expand Down

0 comments on commit de9cbd7

Please sign in to comment.