@nesso-how/types 0.1.0-alpha.20 → 0.1.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -0
- package/package.json +2 -2
- package/src/index.ts +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @nesso-how/types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types for [Nesso](https://nesso.how) — nodes, edges, settings, FSRS fields.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @nesso-how/types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import type { ConceptNodeData, NessoSettings } from "@nesso-how/types";
|
|
15
|
+
import { defaultConceptReviewFields, nodeToCard } from "@nesso-how/types";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface ConceptNodeData extends Record<string, unknown> {
|
|
|
21
21
|
lastRating: number;
|
|
22
22
|
elaboration?: ConceptElaboration;
|
|
23
23
|
}
|
|
24
|
+
/** Fresh FSRS fields for a new or shared-import concept (no personal review history). */
|
|
25
|
+
export declare function defaultConceptReviewFields(): Pick<ConceptNodeData, 'stability' | 'difficulty' | 'reps' | 'lapses' | 'fsrsState' | 'due' | 'lastReview' | 'lastRating'>;
|
|
24
26
|
export declare function nodeToCard(data: ConceptNodeData): Card;
|
|
25
27
|
export type EdgeEncoding = 'full' | 'category' | 'minimal';
|
|
26
28
|
export type CurveStyle = 'arc' | 'straight';
|
|
@@ -59,4 +61,6 @@ export interface NessoSettings {
|
|
|
59
61
|
maximumInterval: number;
|
|
60
62
|
inspectorExamplesOpen: boolean;
|
|
61
63
|
inspectorRelationsOpen: boolean;
|
|
64
|
+
/** Desktop: custom folder for graph .json files; null = default app data graphs folder. */
|
|
65
|
+
graphWorkspacePath: string | null;
|
|
62
66
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/** Fresh FSRS fields for a new or shared-import concept (no personal review history). */
|
|
2
|
+
export function defaultConceptReviewFields() {
|
|
3
|
+
return {
|
|
4
|
+
stability: 0,
|
|
5
|
+
difficulty: 0,
|
|
6
|
+
reps: 0,
|
|
7
|
+
lapses: 0,
|
|
8
|
+
fsrsState: 0,
|
|
9
|
+
due: 0,
|
|
10
|
+
lastReview: 0,
|
|
11
|
+
lastRating: 0,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
1
14
|
export function nodeToCard(data) {
|
|
2
15
|
return {
|
|
3
16
|
due: new Date(data.due || Date.now()),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nesso-how/types",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.22",
|
|
4
4
|
"description": "Nesso shared TypeScript types — graph, node, edge, settings, FSRS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"ts-fsrs": "^5.3.2",
|
|
18
|
-
"@nesso-how/relation-types": "0.1.0-alpha.
|
|
18
|
+
"@nesso-how/relation-types": "0.1.0-alpha.22"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"typescript": "~5.8.3"
|
package/src/index.ts
CHANGED
|
@@ -25,6 +25,30 @@ export interface ConceptNodeData extends Record<string, unknown> {
|
|
|
25
25
|
elaboration?: ConceptElaboration
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/** Fresh FSRS fields for a new or shared-import concept (no personal review history). */
|
|
29
|
+
export function defaultConceptReviewFields(): Pick<
|
|
30
|
+
ConceptNodeData,
|
|
31
|
+
| 'stability'
|
|
32
|
+
| 'difficulty'
|
|
33
|
+
| 'reps'
|
|
34
|
+
| 'lapses'
|
|
35
|
+
| 'fsrsState'
|
|
36
|
+
| 'due'
|
|
37
|
+
| 'lastReview'
|
|
38
|
+
| 'lastRating'
|
|
39
|
+
> {
|
|
40
|
+
return {
|
|
41
|
+
stability: 0,
|
|
42
|
+
difficulty: 0,
|
|
43
|
+
reps: 0,
|
|
44
|
+
lapses: 0,
|
|
45
|
+
fsrsState: 0,
|
|
46
|
+
due: 0,
|
|
47
|
+
lastReview: 0,
|
|
48
|
+
lastRating: 0,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
28
52
|
export function nodeToCard(data: ConceptNodeData): Card {
|
|
29
53
|
return {
|
|
30
54
|
due: new Date(data.due || Date.now()),
|
|
@@ -105,4 +129,6 @@ export interface NessoSettings {
|
|
|
105
129
|
maximumInterval: number
|
|
106
130
|
inspectorExamplesOpen: boolean
|
|
107
131
|
inspectorRelationsOpen: boolean
|
|
132
|
+
/** Desktop: custom folder for graph .json files; null = default app data graphs folder. */
|
|
133
|
+
graphWorkspacePath: string | null
|
|
108
134
|
}
|