@nakafa/aksara-contracts 8.1.0 → 8.2.0
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/visual/biology.d.ts +16 -16
- package/dist/visual/biology.js +2 -2
- package/dist/visual/catalog.d.ts +646 -28
- package/dist/visual/catalog.js +22 -0
- package/dist/visual/chemistry/atom.d.ts +2 -2
- package/dist/visual/chemistry/atom.js +2 -2
- package/dist/visual/mathematics/function.d.ts +4 -4
- package/dist/visual/mathematics/function.js +4 -4
- package/dist/visual/mathematics/geometry.d.ts +1 -1
- package/dist/visual/mathematics/geometry.js +1 -1
- package/dist/visual/physics/circuit.d.ts +75 -0
- package/dist/visual/physics/circuit.js +86 -0
- package/dist/visual/physics/dynamics.d.ts +110 -0
- package/dist/visual/physics/dynamics.js +134 -0
- package/dist/visual/physics/electronics.d.ts +59 -0
- package/dist/visual/physics/electronics.js +71 -0
- package/dist/visual/physics/field.d.ts +48 -0
- package/dist/visual/physics/field.js +60 -0
- package/dist/visual/physics/fluid.d.ts +68 -0
- package/dist/visual/physics/fluid.js +83 -0
- package/dist/visual/physics/gravity.d.ts +38 -0
- package/dist/visual/physics/gravity.js +47 -0
- package/dist/visual/physics/heat.d.ts +54 -0
- package/dist/visual/physics/heat.js +66 -0
- package/dist/visual/physics/light.d.ts +75 -0
- package/dist/visual/physics/light.js +90 -0
- package/dist/visual/physics/nuclear.d.ts +57 -0
- package/dist/visual/physics/nuclear.js +69 -0
- package/dist/visual/physics/parabolic.d.ts +2 -2
- package/dist/visual/physics/parabolic.js +2 -2
- package/dist/visual/physics/reading.d.ts +52 -0
- package/dist/visual/physics/reading.js +61 -0
- package/dist/visual/physics/wave.d.ts +70 -0
- package/dist/visual/physics/wave.js +85 -0
- package/dist/visual/politics.d.ts +1 -1
- package/dist/visual/politics.js +1 -1
- package/package.json +1 -1
package/dist/visual/catalog.js
CHANGED
|
@@ -26,23 +26,34 @@ import { chartVisuals } from "#contracts/visual/mathematics/charts";
|
|
|
26
26
|
import { functionVisuals } from "#contracts/visual/mathematics/function";
|
|
27
27
|
import { geometryVisuals } from "#contracts/visual/mathematics/geometry";
|
|
28
28
|
import { brakingVisuals } from "#contracts/visual/physics/braking";
|
|
29
|
+
import { circuitVisuals } from "#contracts/visual/physics/circuit";
|
|
29
30
|
import { circularVisuals } from "#contracts/visual/physics/circular";
|
|
31
|
+
import { dynamicsVisuals } from "#contracts/visual/physics/dynamics";
|
|
30
32
|
import { efficiencyVisuals } from "#contracts/visual/physics/efficiency";
|
|
33
|
+
import { electronicsVisuals } from "#contracts/visual/physics/electronics";
|
|
31
34
|
import { fallingVisuals } from "#contracts/visual/physics/falling";
|
|
35
|
+
import { fieldVisuals } from "#contracts/visual/physics/field";
|
|
36
|
+
import { fluidVisuals } from "#contracts/visual/physics/fluid";
|
|
32
37
|
import { forceVisuals } from "#contracts/visual/physics/force";
|
|
38
|
+
import { gravityVisuals } from "#contracts/visual/physics/gravity";
|
|
39
|
+
import { heatVisuals } from "#contracts/visual/physics/heat";
|
|
33
40
|
import { instrumentVisuals } from "#contracts/visual/physics/instrument";
|
|
41
|
+
import { lightVisuals } from "#contracts/visual/physics/light";
|
|
34
42
|
import { measurementVisuals } from "#contracts/visual/physics/measurement";
|
|
35
43
|
import { motionVisuals } from "#contracts/visual/physics/motion";
|
|
44
|
+
import { nuclearVisuals } from "#contracts/visual/physics/nuclear";
|
|
36
45
|
import { parabolicVisuals } from "#contracts/visual/physics/parabolic";
|
|
37
46
|
import { positionVisuals } from "#contracts/visual/physics/position";
|
|
38
47
|
import { powerVisuals } from "#contracts/visual/physics/power";
|
|
39
48
|
import { precisionVisuals } from "#contracts/visual/physics/precision";
|
|
40
49
|
import { productVisuals } from "#contracts/visual/physics/product";
|
|
50
|
+
import { readingVisuals } from "#contracts/visual/physics/reading";
|
|
41
51
|
import { recordVisuals } from "#contracts/visual/physics/record";
|
|
42
52
|
import { relativeVisuals } from "#contracts/visual/physics/relative";
|
|
43
53
|
import { solarVisuals } from "#contracts/visual/physics/solar";
|
|
44
54
|
import { vectorVisuals } from "#contracts/visual/physics/vector";
|
|
45
55
|
import { velocityVisuals } from "#contracts/visual/physics/velocity";
|
|
56
|
+
import { waveVisuals } from "#contracts/visual/physics/wave";
|
|
46
57
|
import { politicsVisuals } from "#contracts/visual/politics";
|
|
47
58
|
/**
|
|
48
59
|
* The Visual Catalog: every component Nakafa's renderer draws, each with the
|
|
@@ -98,6 +109,17 @@ export function visualCatalog(rich) {
|
|
|
98
109
|
...relativeVisuals(rich),
|
|
99
110
|
...solarVisuals(rich),
|
|
100
111
|
...vectorVisuals(rich),
|
|
112
|
+
...circuitVisuals(rich),
|
|
113
|
+
...dynamicsVisuals(rich),
|
|
114
|
+
...electronicsVisuals(rich),
|
|
115
|
+
...fieldVisuals(rich),
|
|
116
|
+
...fluidVisuals(rich),
|
|
117
|
+
...gravityVisuals(rich),
|
|
118
|
+
...heatVisuals(rich),
|
|
119
|
+
...lightVisuals(rich),
|
|
120
|
+
...nuclearVisuals(rich),
|
|
121
|
+
...readingVisuals(rich),
|
|
122
|
+
...waveVisuals(rich),
|
|
101
123
|
...politicsVisuals(rich),
|
|
102
124
|
};
|
|
103
125
|
}
|
|
@@ -24,7 +24,7 @@ export declare function atomVisuals<E>(rich: RichSlot<E>): {
|
|
|
24
24
|
}>, "figure">;
|
|
25
25
|
AtomShellLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
26
26
|
readonly defaultSampleId: Schema.optionalKey<Schema.Literals<readonly ["neon", "magnesium", "chlorine", "argon", "potassium", "calcium"]>>;
|
|
27
|
-
readonly description:
|
|
27
|
+
readonly description: RichSlot<E>;
|
|
28
28
|
readonly labels: Schema.Struct<{
|
|
29
29
|
readonly atomicNumber: Schema.Trimmed;
|
|
30
30
|
readonly chooseAtom: Schema.Trimmed;
|
|
@@ -38,7 +38,7 @@ export declare function atomVisuals<E>(rich: RichSlot<E>): {
|
|
|
38
38
|
readonly tab: Schema.Trimmed;
|
|
39
39
|
}>>;
|
|
40
40
|
}>;
|
|
41
|
-
readonly title:
|
|
41
|
+
readonly title: RichSlot<E>;
|
|
42
42
|
}>, "figure">;
|
|
43
43
|
AtomSymbolLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
44
44
|
readonly description: RichSlot<E>;
|
|
@@ -44,7 +44,7 @@ function ancientAtomLab(rich) {
|
|
|
44
44
|
function atomShellLab(rich) {
|
|
45
45
|
return figure(Schema.Struct({
|
|
46
46
|
defaultSampleId: Schema.optionalKey(Schema.Literals(SHELL_SAMPLES)),
|
|
47
|
-
description:
|
|
47
|
+
description: rich,
|
|
48
48
|
labels: Schema.Struct({
|
|
49
49
|
atomicNumber: TextSchema,
|
|
50
50
|
chooseAtom: TextSchema,
|
|
@@ -58,7 +58,7 @@ function atomShellLab(rich) {
|
|
|
58
58
|
tab: TextSchema,
|
|
59
59
|
})),
|
|
60
60
|
}),
|
|
61
|
-
title:
|
|
61
|
+
title: rich,
|
|
62
62
|
}), answerAt(["labels", "samples", "*", "note"]));
|
|
63
63
|
}
|
|
64
64
|
/** Props of `AtomSymbolLab`: reading the particles of a nuclide from its symbol. */
|
|
@@ -10,11 +10,11 @@ export declare function functionVisuals<E>(rich: RichSlot<E>): {
|
|
|
10
10
|
BacterialGrowth: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
11
11
|
readonly formulaType: Schema.optionalKey<Schema.Literals<readonly ["geometric", "exponential"]>>;
|
|
12
12
|
readonly initialCount: Schema.optionalKey<Schema.Finite>;
|
|
13
|
-
readonly labels: Schema.
|
|
13
|
+
readonly labels: Schema.Struct<{
|
|
14
14
|
readonly bacterial: Schema.optionalKey<Schema.Trimmed>;
|
|
15
|
-
readonly description:
|
|
16
|
-
readonly title:
|
|
17
|
-
}
|
|
15
|
+
readonly description: RichSlot<E>;
|
|
16
|
+
readonly title: RichSlot<E>;
|
|
17
|
+
}>;
|
|
18
18
|
readonly maxGenerations: Schema.optionalKey<Schema.Int>;
|
|
19
19
|
readonly ratio: Schema.optionalKey<Schema.Finite>;
|
|
20
20
|
readonly timeInterval: Schema.optionalKey<Schema.Finite>;
|
|
@@ -57,11 +57,11 @@ function bacterialGrowth(rich) {
|
|
|
57
57
|
return figure(Schema.Struct({
|
|
58
58
|
formulaType: Schema.optionalKey(Schema.Literals(GROWTH_FORMULAS)),
|
|
59
59
|
initialCount: Schema.optionalKey(Schema.Finite),
|
|
60
|
-
labels: Schema.
|
|
60
|
+
labels: Schema.Struct({
|
|
61
61
|
bacterial: Schema.optionalKey(TextSchema),
|
|
62
|
-
description:
|
|
63
|
-
title:
|
|
64
|
-
})
|
|
62
|
+
description: rich,
|
|
63
|
+
title: rich,
|
|
64
|
+
}),
|
|
65
65
|
maxGenerations: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
66
66
|
ratio: Schema.optionalKey(Schema.Finite),
|
|
67
67
|
timeInterval: Schema.optionalKey(Schema.Finite),
|
|
@@ -6,7 +6,7 @@ import type { RichSlot } from "#contracts/visual/card";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function geometryVisuals<E>(rich: RichSlot<E>): {
|
|
8
8
|
QuadraticEquationReadingRoomProblem: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
-
readonly description:
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
10
|
readonly heightLabel: RichSlot<E>;
|
|
11
11
|
readonly widthLabel: RichSlot<E>;
|
|
12
12
|
}>, "figure">;
|
|
@@ -3,7 +3,7 @@ import { figure } from "#contracts/visual/entry";
|
|
|
3
3
|
/** Props of `QuadraticEquationReadingRoomProblem`: a room whose sides are unknown. */
|
|
4
4
|
function readingRoom(rich) {
|
|
5
5
|
return figure(Schema.Struct({
|
|
6
|
-
description:
|
|
6
|
+
description: rich,
|
|
7
7
|
heightLabel: rich,
|
|
8
8
|
widthLabel: rich,
|
|
9
9
|
}));
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the electricity labs. Each prop is a value from the item the lab
|
|
5
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function circuitVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
BulbNetworkLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly emf: Schema.Finite;
|
|
12
|
+
readonly group: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Finite, Schema.Finite]>, readonly [Schema.Finite]>;
|
|
13
|
+
readonly labels: Schema.Struct<{
|
|
14
|
+
readonly broken: RichSlot<E>;
|
|
15
|
+
readonly intact: RichSlot<E>;
|
|
16
|
+
readonly state: Schema.Trimmed;
|
|
17
|
+
readonly viewLabel: Schema.Trimmed;
|
|
18
|
+
}>;
|
|
19
|
+
readonly series: Schema.Finite;
|
|
20
|
+
}>, "figure">;
|
|
21
|
+
InternalResistanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
22
|
+
readonly description: RichSlot<E>;
|
|
23
|
+
readonly title: RichSlot<E>;
|
|
24
|
+
readonly labels: Schema.Struct<{
|
|
25
|
+
readonly current: RichSlot<E>;
|
|
26
|
+
readonly emf: RichSlot<E>;
|
|
27
|
+
readonly internal: RichSlot<E>;
|
|
28
|
+
readonly resistor: Schema.Trimmed;
|
|
29
|
+
readonly terminal: RichSlot<E>;
|
|
30
|
+
readonly viewLabel: Schema.Trimmed;
|
|
31
|
+
}>;
|
|
32
|
+
readonly readings: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
|
|
33
|
+
readonly resistance: Schema.Finite;
|
|
34
|
+
readonly voltage: Schema.Finite;
|
|
35
|
+
}>, Schema.Struct<{
|
|
36
|
+
readonly resistance: Schema.Finite;
|
|
37
|
+
readonly voltage: Schema.Finite;
|
|
38
|
+
}>]>, readonly [Schema.Struct<{
|
|
39
|
+
readonly resistance: Schema.Finite;
|
|
40
|
+
readonly voltage: Schema.Finite;
|
|
41
|
+
}>]>;
|
|
42
|
+
readonly trial: Schema.Finite;
|
|
43
|
+
}>, "figure">;
|
|
44
|
+
HeaterSupplyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
45
|
+
readonly description: RichSlot<E>;
|
|
46
|
+
readonly title: RichSlot<E>;
|
|
47
|
+
readonly hours: Schema.Finite;
|
|
48
|
+
readonly labels: Schema.Struct<{
|
|
49
|
+
readonly energy: RichSlot<E>;
|
|
50
|
+
readonly power: RichSlot<E>;
|
|
51
|
+
readonly resistance: RichSlot<E>;
|
|
52
|
+
readonly supply: RichSlot<E>;
|
|
53
|
+
readonly supplyName: Schema.Trimmed;
|
|
54
|
+
readonly viewLabel: Schema.Trimmed;
|
|
55
|
+
}>;
|
|
56
|
+
readonly ratedPower: Schema.Finite;
|
|
57
|
+
readonly ratedVoltage: Schema.Finite;
|
|
58
|
+
readonly supplyVoltage: Schema.Finite;
|
|
59
|
+
}>, "figure">;
|
|
60
|
+
WireResistanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
61
|
+
readonly description: RichSlot<E>;
|
|
62
|
+
readonly title: RichSlot<E>;
|
|
63
|
+
readonly diameterRatio: Schema.Finite;
|
|
64
|
+
readonly labels: Schema.Struct<{
|
|
65
|
+
readonly diameter: RichSlot<E>;
|
|
66
|
+
readonly diameterName: Schema.Trimmed;
|
|
67
|
+
readonly length: RichSlot<E>;
|
|
68
|
+
readonly lengthName: Schema.Trimmed;
|
|
69
|
+
readonly power: RichSlot<E>;
|
|
70
|
+
readonly resistance: RichSlot<E>;
|
|
71
|
+
readonly viewLabel: Schema.Trimmed;
|
|
72
|
+
}>;
|
|
73
|
+
readonly lengthRatio: Schema.Finite;
|
|
74
|
+
}>, "figure">;
|
|
75
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** One measured reading of a cell: the external resistance in ohms and the terminal voltage in volts. */
|
|
5
|
+
const ReadingSchema = Schema.Struct({
|
|
6
|
+
resistance: Schema.Finite,
|
|
7
|
+
voltage: Schema.Finite,
|
|
8
|
+
});
|
|
9
|
+
/** Props of `BulbNetworkLab`: a battery lights one bulb in series with a group of bulbs in parallel, each glowing with its own power on a wooden board. */
|
|
10
|
+
function bulbNetworkLab(rich) {
|
|
11
|
+
return figure(Schema.Struct({
|
|
12
|
+
...cardFields(rich),
|
|
13
|
+
emf: Schema.Finite,
|
|
14
|
+
group: Schema.TupleWithRest(Schema.Tuple([Schema.Finite, Schema.Finite]), [Schema.Finite]),
|
|
15
|
+
labels: Schema.Struct({
|
|
16
|
+
broken: rich,
|
|
17
|
+
intact: rich,
|
|
18
|
+
state: TextSchema,
|
|
19
|
+
viewLabel: TextSchema,
|
|
20
|
+
}),
|
|
21
|
+
series: Schema.Finite,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
/** Props of `InternalResistanceLab`: a dry cell with a voltmeter across its terminals drives one resistor at a time. */
|
|
25
|
+
function internalResistanceLab(rich) {
|
|
26
|
+
return figure(Schema.Struct({
|
|
27
|
+
...cardFields(rich),
|
|
28
|
+
labels: Schema.Struct({
|
|
29
|
+
current: rich,
|
|
30
|
+
emf: rich,
|
|
31
|
+
internal: rich,
|
|
32
|
+
resistor: TextSchema,
|
|
33
|
+
terminal: rich,
|
|
34
|
+
viewLabel: TextSchema,
|
|
35
|
+
}),
|
|
36
|
+
readings: Schema.TupleWithRest(Schema.Tuple([ReadingSchema, ReadingSchema]), [ReadingSchema]),
|
|
37
|
+
trial: Schema.Finite,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
/** Props of `HeaterSupplyLab`: a heater whose label gives its voltage and power, plugged into a supply of another voltage. */
|
|
41
|
+
function heaterSupplyLab(rich) {
|
|
42
|
+
return figure(Schema.Struct({
|
|
43
|
+
...cardFields(rich),
|
|
44
|
+
hours: Schema.Finite,
|
|
45
|
+
labels: Schema.Struct({
|
|
46
|
+
energy: rich,
|
|
47
|
+
power: rich,
|
|
48
|
+
resistance: rich,
|
|
49
|
+
supply: rich,
|
|
50
|
+
supplyName: TextSchema,
|
|
51
|
+
viewLabel: TextSchema,
|
|
52
|
+
}),
|
|
53
|
+
ratedPower: Schema.Finite,
|
|
54
|
+
ratedVoltage: Schema.Finite,
|
|
55
|
+
supplyVoltage: Schema.Finite,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
/** Props of `WireResistanceLab`: two nichrome wires on the same fixed voltage, drawn to scale. */
|
|
59
|
+
function wireResistanceLab(rich) {
|
|
60
|
+
return figure(Schema.Struct({
|
|
61
|
+
...cardFields(rich),
|
|
62
|
+
diameterRatio: Schema.Finite,
|
|
63
|
+
labels: Schema.Struct({
|
|
64
|
+
diameter: rich,
|
|
65
|
+
diameterName: TextSchema,
|
|
66
|
+
length: rich,
|
|
67
|
+
lengthName: TextSchema,
|
|
68
|
+
power: rich,
|
|
69
|
+
resistance: rich,
|
|
70
|
+
viewLabel: TextSchema,
|
|
71
|
+
}),
|
|
72
|
+
lengthRatio: Schema.Finite,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The props of the electricity labs. Each prop is a value from the item the lab
|
|
77
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
78
|
+
*/
|
|
79
|
+
export function circuitVisuals(rich) {
|
|
80
|
+
return {
|
|
81
|
+
BulbNetworkLab: bulbNetworkLab(rich),
|
|
82
|
+
InternalResistanceLab: internalResistanceLab(rich),
|
|
83
|
+
HeaterSupplyLab: heaterSupplyLab(rich),
|
|
84
|
+
WireResistanceLab: wireResistanceLab(rich),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the forces and motion labs. Each prop is a value from the item the lab
|
|
5
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function dynamicsVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
ConnectedBlocksLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly back: Schema.Finite;
|
|
12
|
+
readonly friction: Schema.Finite;
|
|
13
|
+
readonly front: Schema.Finite;
|
|
14
|
+
readonly labels: Schema.Struct<{
|
|
15
|
+
readonly acceleration: RichSlot<E>;
|
|
16
|
+
readonly pull: RichSlot<E>;
|
|
17
|
+
readonly pullName: Schema.Trimmed;
|
|
18
|
+
readonly tension: RichSlot<E>;
|
|
19
|
+
readonly viewLabel: Schema.Trimmed;
|
|
20
|
+
}>;
|
|
21
|
+
readonly pull: Schema.Finite;
|
|
22
|
+
}>, "figure">;
|
|
23
|
+
BulletBlockLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
24
|
+
readonly description: RichSlot<E>;
|
|
25
|
+
readonly title: RichSlot<E>;
|
|
26
|
+
readonly blockMass: Schema.Finite;
|
|
27
|
+
readonly bulletMass: Schema.Finite;
|
|
28
|
+
readonly friction: Schema.Finite;
|
|
29
|
+
readonly labels: Schema.Struct<{
|
|
30
|
+
readonly deceleration: RichSlot<E>;
|
|
31
|
+
readonly distance: RichSlot<E>;
|
|
32
|
+
readonly lost: RichSlot<E>;
|
|
33
|
+
readonly velocity: RichSlot<E>;
|
|
34
|
+
readonly viewLabel: Schema.Trimmed;
|
|
35
|
+
}>;
|
|
36
|
+
readonly speed: Schema.Finite;
|
|
37
|
+
}>, "figure">;
|
|
38
|
+
CliffThrowLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
39
|
+
readonly description: RichSlot<E>;
|
|
40
|
+
readonly title: RichSlot<E>;
|
|
41
|
+
readonly delay: Schema.Finite;
|
|
42
|
+
readonly gravity: Schema.Finite;
|
|
43
|
+
readonly height: Schema.Finite;
|
|
44
|
+
readonly labels: Schema.Struct<{
|
|
45
|
+
readonly first: RichSlot<E>;
|
|
46
|
+
readonly gap: RichSlot<E>;
|
|
47
|
+
readonly second: RichSlot<E>;
|
|
48
|
+
readonly viewLabel: Schema.Trimmed;
|
|
49
|
+
}>;
|
|
50
|
+
readonly speed: Schema.Finite;
|
|
51
|
+
}>, "figure">;
|
|
52
|
+
InclineSlideLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
53
|
+
readonly description: RichSlot<E>;
|
|
54
|
+
readonly title: RichSlot<E>;
|
|
55
|
+
readonly angle: Schema.Finite;
|
|
56
|
+
readonly friction: Schema.Finite;
|
|
57
|
+
readonly gravity: Schema.Finite;
|
|
58
|
+
readonly labels: Schema.Struct<{
|
|
59
|
+
readonly along: RichSlot<E>;
|
|
60
|
+
readonly deceleration: RichSlot<E>;
|
|
61
|
+
readonly distance: RichSlot<E>;
|
|
62
|
+
readonly viewLabel: Schema.Trimmed;
|
|
63
|
+
}>;
|
|
64
|
+
readonly mass: Schema.Finite;
|
|
65
|
+
readonly speed: Schema.Finite;
|
|
66
|
+
}>, "figure">;
|
|
67
|
+
LiftScaleLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
68
|
+
readonly description: RichSlot<E>;
|
|
69
|
+
readonly title: RichSlot<E>;
|
|
70
|
+
readonly gravity: Schema.Finite;
|
|
71
|
+
readonly labels: Schema.Struct<{
|
|
72
|
+
readonly acceleration: RichSlot<E>;
|
|
73
|
+
readonly cases: Schema.$Record<Schema.Literals<readonly ["upFaster", "upSlower", "downFaster", "downSlower"]>, RichSlot<E>>;
|
|
74
|
+
readonly motion: Schema.Trimmed;
|
|
75
|
+
readonly reading: RichSlot<E>;
|
|
76
|
+
readonly viewLabel: Schema.Trimmed;
|
|
77
|
+
}>;
|
|
78
|
+
readonly mass: Schema.Finite;
|
|
79
|
+
readonly reading: Schema.Finite;
|
|
80
|
+
}>, "figure">;
|
|
81
|
+
RecoilLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
82
|
+
readonly description: RichSlot<E>;
|
|
83
|
+
readonly title: RichSlot<E>;
|
|
84
|
+
readonly bulletMass: Schema.Finite;
|
|
85
|
+
readonly labels: Schema.Struct<{
|
|
86
|
+
readonly energy: RichSlot<E>;
|
|
87
|
+
readonly force: RichSlot<E>;
|
|
88
|
+
readonly momentum: RichSlot<E>;
|
|
89
|
+
readonly velocity: RichSlot<E>;
|
|
90
|
+
readonly viewLabel: Schema.Trimmed;
|
|
91
|
+
}>;
|
|
92
|
+
readonly rifleMass: Schema.Finite;
|
|
93
|
+
readonly speed: Schema.Finite;
|
|
94
|
+
readonly stop: Schema.Finite;
|
|
95
|
+
}>, "figure">;
|
|
96
|
+
SpringChainLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
97
|
+
readonly description: RichSlot<E>;
|
|
98
|
+
readonly title: RichSlot<E>;
|
|
99
|
+
readonly labels: Schema.Struct<{
|
|
100
|
+
readonly load: RichSlot<E>;
|
|
101
|
+
readonly loadName: Schema.Trimmed;
|
|
102
|
+
readonly pair: RichSlot<E>;
|
|
103
|
+
readonly top: RichSlot<E>;
|
|
104
|
+
readonly total: RichSlot<E>;
|
|
105
|
+
readonly viewLabel: Schema.Trimmed;
|
|
106
|
+
}>;
|
|
107
|
+
readonly load: Schema.Finite;
|
|
108
|
+
readonly stiffness: Schema.Finite;
|
|
109
|
+
}>, "figure">;
|
|
110
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** Props of `ConnectedBlocksLab`: two blocks joined by a light string are pulled across the floor from the front. */
|
|
5
|
+
function connectedBlocksLab(rich) {
|
|
6
|
+
return figure(Schema.Struct({
|
|
7
|
+
...cardFields(rich),
|
|
8
|
+
back: Schema.Finite,
|
|
9
|
+
friction: Schema.Finite,
|
|
10
|
+
front: Schema.Finite,
|
|
11
|
+
labels: Schema.Struct({
|
|
12
|
+
acceleration: rich,
|
|
13
|
+
pull: rich,
|
|
14
|
+
pullName: TextSchema,
|
|
15
|
+
tension: rich,
|
|
16
|
+
viewLabel: TextSchema,
|
|
17
|
+
}),
|
|
18
|
+
pull: Schema.Finite,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** Props of `BulletBlockLab`: a bullet embeds in a wooden block resting on the floor, and the block slides to a stop. */
|
|
22
|
+
function bulletBlockLab(rich) {
|
|
23
|
+
return figure(Schema.Struct({
|
|
24
|
+
...cardFields(rich),
|
|
25
|
+
blockMass: Schema.Finite,
|
|
26
|
+
bulletMass: Schema.Finite,
|
|
27
|
+
friction: Schema.Finite,
|
|
28
|
+
labels: Schema.Struct({
|
|
29
|
+
deceleration: rich,
|
|
30
|
+
distance: rich,
|
|
31
|
+
lost: rich,
|
|
32
|
+
velocity: rich,
|
|
33
|
+
viewLabel: TextSchema,
|
|
34
|
+
}),
|
|
35
|
+
speed: Schema.Finite,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/** Props of `CliffThrowLab`: two balls leave a cliff edge above the sea: A thrown straight up, B dropped from rest a little later. */
|
|
39
|
+
function cliffThrowLab(rich) {
|
|
40
|
+
return figure(Schema.Struct({
|
|
41
|
+
...cardFields(rich),
|
|
42
|
+
delay: Schema.Finite,
|
|
43
|
+
gravity: Schema.Finite,
|
|
44
|
+
height: Schema.Finite,
|
|
45
|
+
labels: Schema.Struct({
|
|
46
|
+
first: rich,
|
|
47
|
+
gap: rich,
|
|
48
|
+
second: rich,
|
|
49
|
+
viewLabel: TextSchema,
|
|
50
|
+
}),
|
|
51
|
+
speed: Schema.Finite,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
/** Props of `InclineSlideLab`: a block released while moving up an inclined plane slides up and stops. */
|
|
55
|
+
function inclineSlideLab(rich) {
|
|
56
|
+
return figure(Schema.Struct({
|
|
57
|
+
...cardFields(rich),
|
|
58
|
+
angle: Schema.Finite,
|
|
59
|
+
friction: Schema.Finite,
|
|
60
|
+
gravity: Schema.Finite,
|
|
61
|
+
labels: Schema.Struct({
|
|
62
|
+
along: rich,
|
|
63
|
+
deceleration: rich,
|
|
64
|
+
distance: rich,
|
|
65
|
+
viewLabel: TextSchema,
|
|
66
|
+
}),
|
|
67
|
+
mass: Schema.Finite,
|
|
68
|
+
speed: Schema.Finite,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
/** Props of `LiftScaleLab`: a student stands on scales in a lift. */
|
|
72
|
+
function liftScaleLab(rich) {
|
|
73
|
+
return figure(Schema.Struct({
|
|
74
|
+
...cardFields(rich),
|
|
75
|
+
gravity: Schema.Finite,
|
|
76
|
+
labels: Schema.Struct({
|
|
77
|
+
acceleration: rich,
|
|
78
|
+
cases: byIds(["upFaster", "upSlower", "downFaster", "downSlower"], rich),
|
|
79
|
+
motion: TextSchema,
|
|
80
|
+
reading: rich,
|
|
81
|
+
viewLabel: TextSchema,
|
|
82
|
+
}),
|
|
83
|
+
mass: Schema.Finite,
|
|
84
|
+
reading: Schema.Finite,
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
/** Props of `RecoilLab`: a rifle fires a bullet. */
|
|
88
|
+
function recoilLab(rich) {
|
|
89
|
+
return figure(Schema.Struct({
|
|
90
|
+
...cardFields(rich),
|
|
91
|
+
bulletMass: Schema.Finite,
|
|
92
|
+
labels: Schema.Struct({
|
|
93
|
+
energy: rich,
|
|
94
|
+
force: rich,
|
|
95
|
+
momentum: rich,
|
|
96
|
+
velocity: rich,
|
|
97
|
+
viewLabel: TextSchema,
|
|
98
|
+
}),
|
|
99
|
+
rifleMass: Schema.Finite,
|
|
100
|
+
speed: Schema.Finite,
|
|
101
|
+
stop: Schema.Finite,
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
/** Props of `SpringChainLab`: spring P hangs from the ceiling and carries springs Q and R side by side, which carry the load. */
|
|
105
|
+
function springChainLab(rich) {
|
|
106
|
+
return figure(Schema.Struct({
|
|
107
|
+
...cardFields(rich),
|
|
108
|
+
labels: Schema.Struct({
|
|
109
|
+
load: rich,
|
|
110
|
+
loadName: TextSchema,
|
|
111
|
+
pair: rich,
|
|
112
|
+
top: rich,
|
|
113
|
+
total: rich,
|
|
114
|
+
viewLabel: TextSchema,
|
|
115
|
+
}),
|
|
116
|
+
load: Schema.Finite,
|
|
117
|
+
stiffness: Schema.Finite,
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The props of the forces and motion labs. Each prop is a value from the item the lab
|
|
122
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
123
|
+
*/
|
|
124
|
+
export function dynamicsVisuals(rich) {
|
|
125
|
+
return {
|
|
126
|
+
ConnectedBlocksLab: connectedBlocksLab(rich),
|
|
127
|
+
BulletBlockLab: bulletBlockLab(rich),
|
|
128
|
+
CliffThrowLab: cliffThrowLab(rich),
|
|
129
|
+
InclineSlideLab: inclineSlideLab(rich),
|
|
130
|
+
LiftScaleLab: liftScaleLab(rich),
|
|
131
|
+
RecoilLab: recoilLab(rich),
|
|
132
|
+
SpringChainLab: springChainLab(rich),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the electronics labs. Each prop is a value from the item the lab
|
|
5
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function electronicsVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
TransistorBiasLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly base: Schema.Finite;
|
|
12
|
+
readonly baseSupply: Schema.Finite;
|
|
13
|
+
readonly collector: Schema.Finite;
|
|
14
|
+
readonly collectorSupply: Schema.Finite;
|
|
15
|
+
readonly gain: Schema.Finite;
|
|
16
|
+
readonly labels: Schema.Struct<{
|
|
17
|
+
readonly base: RichSlot<E>;
|
|
18
|
+
readonly baseCurrent: RichSlot<E>;
|
|
19
|
+
readonly baseName: Schema.Trimmed;
|
|
20
|
+
readonly collectorCurrent: RichSlot<E>;
|
|
21
|
+
readonly collectorEmitter: RichSlot<E>;
|
|
22
|
+
readonly viewLabel: Schema.Trimmed;
|
|
23
|
+
}>;
|
|
24
|
+
readonly threshold: Schema.Finite;
|
|
25
|
+
}>, "figure">;
|
|
26
|
+
LogicGateLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
27
|
+
readonly description: RichSlot<E>;
|
|
28
|
+
readonly title: RichSlot<E>;
|
|
29
|
+
readonly gate: Schema.Literals<readonly ["AND", "OR", "NAND", "NOR", "XOR"]>;
|
|
30
|
+
readonly labels: Schema.Struct<{
|
|
31
|
+
readonly gate: Schema.Trimmed;
|
|
32
|
+
readonly matches: RichSlot<E>;
|
|
33
|
+
readonly viewLabel: Schema.Trimmed;
|
|
34
|
+
}>;
|
|
35
|
+
readonly rows: Schema.$Array<Schema.Struct<{
|
|
36
|
+
readonly a: Schema.Finite;
|
|
37
|
+
readonly b: Schema.Finite;
|
|
38
|
+
readonly c: Schema.Finite;
|
|
39
|
+
readonly q: Schema.Finite;
|
|
40
|
+
}>>;
|
|
41
|
+
}>, "figure">;
|
|
42
|
+
TransistorSwitchLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
43
|
+
readonly description: RichSlot<E>;
|
|
44
|
+
readonly title: RichSlot<E>;
|
|
45
|
+
readonly labels: Schema.Struct<{
|
|
46
|
+
readonly base: RichSlot<E>;
|
|
47
|
+
readonly ldr: RichSlot<E>;
|
|
48
|
+
readonly light: RichSlot<E>;
|
|
49
|
+
readonly lightName: Schema.Trimmed;
|
|
50
|
+
readonly resistor: RichSlot<E>;
|
|
51
|
+
readonly resistorName: Schema.Trimmed;
|
|
52
|
+
readonly switching: RichSlot<E>;
|
|
53
|
+
readonly viewLabel: Schema.Trimmed;
|
|
54
|
+
}>;
|
|
55
|
+
readonly resistor: Schema.Finite;
|
|
56
|
+
readonly supply: Schema.Finite;
|
|
57
|
+
readonly threshold: Schema.Finite;
|
|
58
|
+
}>, "figure">;
|
|
59
|
+
};
|