@nesso-how/types 0.1.0-alpha.19 → 0.1.0-alpha.21
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/LICENSE +21 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -0
- package/package.json +8 -9
- package/src/index.ts +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Omar Desogus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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.21",
|
|
4
4
|
"description": "Nesso shared TypeScript types — graph, node, edge, settings, FSRS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
"import": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsc",
|
|
18
|
-
"prepublishOnly": "pnpm build",
|
|
19
|
-
"dev": "tsc --watch"
|
|
20
|
-
},
|
|
21
16
|
"dependencies": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
17
|
+
"ts-fsrs": "^5.3.2",
|
|
18
|
+
"@nesso-how/relation-types": "0.1.0-alpha.21"
|
|
24
19
|
},
|
|
25
20
|
"devDependencies": {
|
|
26
21
|
"typescript": "~5.8.3"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"dev": "tsc --watch"
|
|
27
26
|
}
|
|
28
|
-
}
|
|
27
|
+
}
|
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
|
}
|