@java-memory-playground/java-memory-playground 0.2.3 → 0.2.4
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/dist/canonical.d.ts +10 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2571 -2479
- package/dist/store.d.ts +22 -1
- package/dist/translations.d.ts +5 -0
- package/package.json +1 -1
package/dist/store.d.ts
CHANGED
|
@@ -20,6 +20,23 @@ export type StoreStep = {
|
|
|
20
20
|
nodes: CustomNodeType[];
|
|
21
21
|
edges: CustomEdgeType[];
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Where a step stands for the reader, as the strip of dots shows it.
|
|
25
|
+
*
|
|
26
|
+
* `none` is a step with nothing to do — a step of the trace, which is simply
|
|
27
|
+
* read. The other three are the life of an exercise step: `untried` until it is
|
|
28
|
+
* checked, then `correct` or `wrong` until the diagram is changed again.
|
|
29
|
+
*/
|
|
30
|
+
export type StepStatus = "none" | "untried" | "correct" | "wrong";
|
|
31
|
+
/**
|
|
32
|
+
* A check, kept with the fingerprint of the diagram it judged, so that editing
|
|
33
|
+
* the step afterwards puts it back to `untried` instead of leaving a verdict
|
|
34
|
+
* standing over a diagram nobody has checked.
|
|
35
|
+
*/
|
|
36
|
+
export type CheckedAttempt = {
|
|
37
|
+
result: ExerciseResult;
|
|
38
|
+
fingerprint: string;
|
|
39
|
+
};
|
|
23
40
|
export type GcPredictionResult = {
|
|
24
41
|
/** Unreachable objects the prediction found. */
|
|
25
42
|
found: number;
|
|
@@ -45,7 +62,8 @@ export type RFState = {
|
|
|
45
62
|
* playground so that their attempt can be compared with it.
|
|
46
63
|
*/
|
|
47
64
|
solutions: Record<number, StoreStep>;
|
|
48
|
-
|
|
65
|
+
/** The last check of each exercise step, by step index. */
|
|
66
|
+
exerciseResults: Record<number, CheckedAttempt>;
|
|
49
67
|
/** Ids of the objects a prediction has marked as unreachable, while running. */
|
|
50
68
|
gcPrediction: string[] | null;
|
|
51
69
|
gcResult: GcPredictionResult | null;
|
|
@@ -79,6 +97,9 @@ export type RFState = {
|
|
|
79
97
|
checkExercise: () => void;
|
|
80
98
|
revealSolution: () => void;
|
|
81
99
|
clearExerciseResult: () => void;
|
|
100
|
+
/** The check of the step on screen, or null if it has none or it is stale. */
|
|
101
|
+
getExerciseResult: () => ExerciseResult | null;
|
|
102
|
+
getStepStatus: (index: number) => StepStatus;
|
|
82
103
|
startGcPrediction: () => void;
|
|
83
104
|
toggleGcPrediction: (id: string) => void;
|
|
84
105
|
cancelGcPrediction: () => void;
|
package/dist/translations.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export interface Translations {
|
|
|
34
34
|
exerciseCorrect: string;
|
|
35
35
|
exerciseWrong: (wrong: string[]) => string;
|
|
36
36
|
exerciseExtra: (extra: string[]) => string;
|
|
37
|
+
stepOverview: string;
|
|
38
|
+
stepStatusNone: (step: number) => string;
|
|
39
|
+
stepStatusUntried: (step: number) => string;
|
|
40
|
+
stepStatusCorrect: (step: number) => string;
|
|
41
|
+
stepStatusWrong: (step: number) => string;
|
|
37
42
|
declareLocalVariable: string;
|
|
38
43
|
returnMethod: string;
|
|
39
44
|
returnOnlyTopOfStack: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@java-memory-playground/java-memory-playground",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"description": "React components for visualizing the Java stack and heap.",
|
|
6
6
|
"homepage": "https://github.com/openpatch/java-memory-playground#readme",
|