staskstate meta data

This commit is contained in:
Zef Hemel
2023-10-13 17:10:57 +02:00
parent 72453bac88
commit cc5c2ee316
3 changed files with 31 additions and 14 deletions
+7
View File
@@ -25,6 +25,13 @@ export const builtins: Record<string, Record<string, string>> = {
pos: "number",
tags: "array",
},
taskstate: {
ref: "string",
tags: "array",
state: "string",
count: "number",
page: "string",
},
tag: {
ref: "string",
name: "string",
+12 -14
View File
@@ -20,24 +20,22 @@ import { rewritePageRefs } from "$sb/lib/resolve.ts";
import { ObjectValue } from "$sb/types.ts";
import { indexObjects, queryObjects } from "../index/plug_api.ts";
export type TaskObject = {
ref: string;
tags: string[];
page: string;
pos: number;
name: string;
done: boolean;
state: string;
deadline?: string;
} & Record<string, any>;
export type TaskObject = ObjectValue<
{
page: string;
pos: number;
name: string;
done: boolean;
state: string;
deadline?: string;
} & Record<string, any>
>;
export type TaskStateObject = {
ref: string;
tags: string[];
export type TaskStateObject = ObjectValue<{
state: string;
count: number;
page: string;
};
}>;
function getDeadline(deadlineNode: ParseTree): string {
return deadlineNode.children![0].text!.replace(/📅\s*/, "");