Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 8268ce9

Browse files
committed
fn docu
1 parent 7463cb1 commit 8268ce9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/cdm/ModulesFnModel.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,53 @@ import { Literal } from "obsidian-dataview"
22
import { DateTime, DurationLikeObject } from "luxon";
33

44
type NumbersFnType = {
5+
/**
6+
* Summatory of the list of values
7+
* @param values
8+
* @returns
9+
*/
510
sum: (values: Literal[]) => number;
11+
/**
12+
* Obtains the minimum value of the list of values
13+
* @param values
14+
* @returns
15+
*/
616
min: (values: Literal[]) => number;
17+
/**
18+
* Obtains the maximum value of the list of values
19+
* @param values
20+
* @returns
21+
*/
722
max: (values: Literal[]) => number;
823
[key: string]: unknown
924
}
1025

1126
type LuxonFnType = {
27+
/**
28+
* Returns the earliest date in the list of values
29+
* @param values
30+
* @returns
31+
*/
1232
earliest: (values: Literal[]) => DateTime;
33+
/**
34+
* Returns the latest date in the list of values
35+
* @param values
36+
* @returns
37+
*/
1338
latest: (values: Literal[]) => DateTime;
39+
/**
40+
* Returns the duration between the earliest and latest dates in the list of values
41+
* @param values
42+
* @param dl - Duration like object key. "days" by default. See https://www.jsdocs.io/package/@types/luxon#DurationLikeObject
43+
* @returns
44+
*/
1445
range: (values: Literal[], dl?: keyof DurationLikeObject) => number;
1546
[key: string]: unknown
1647
}
1748

49+
/**
50+
* Exposed functionalities under the `db` variable of Formulas
51+
*/
1852
export type DatabaseFnType = {
1953
numbers: NumbersFnType;
2054
luxon: LuxonFnType;

0 commit comments

Comments
 (0)