@nakafa/aksara-contracts 8.1.0 → 8.4.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/math/boundary.d.ts +9 -0
- package/dist/math/boundary.js +81 -0
- package/dist/math/curve.d.ts +1 -0
- package/dist/math/curve.js +4 -2
- package/dist/math/formula/affine.d.ts +22 -0
- package/dist/math/formula/affine.js +79 -0
- package/dist/math/formula/contour.js +27 -12
- package/dist/math/object.d.ts +12 -0
- package/dist/math/object.js +11 -0
- package/dist/math/plane.d.ts +10 -0
- package/dist/math/plane.js +7 -1
- package/dist/math/space.d.ts +8 -0
- package/dist/math/space.js +5 -1
- package/dist/math/visual.d.ts +239 -212
- package/dist/visual/base/math.d.ts +78 -0
- package/dist/visual/base/math.js +31 -3
- package/dist/visual/base/media.d.ts +67 -0
- package/dist/visual/biology/bacteria.d.ts +268 -0
- package/dist/visual/biology/cell.d.ts +201 -0
- package/dist/visual/biology/climate.d.ts +201 -0
- package/dist/visual/biology/ecology.d.ts +268 -0
- package/dist/visual/biology/physiology.d.ts +201 -0
- package/dist/visual/biology/plant.d.ts +335 -0
- package/dist/visual/biology.d.ts +16 -16
- package/dist/visual/biology.js +2 -2
- package/dist/visual/card.d.ts +79 -1
- package/dist/visual/card.js +18 -2
- package/dist/visual/catalog.d.ts +14808 -28
- package/dist/visual/catalog.js +26 -0
- package/dist/visual/chemistry/atom.d.ts +203 -2
- package/dist/visual/chemistry/atom.js +2 -2
- package/dist/visual/chemistry/balance.d.ts +335 -0
- package/dist/visual/chemistry/bonding.d.ts +335 -0
- package/dist/visual/chemistry/discovery.d.ts +469 -0
- package/dist/visual/chemistry/electrochemistry.d.ts +134 -0
- package/dist/visual/chemistry/electron.d.ts +134 -0
- package/dist/visual/chemistry/laws.d.ts +268 -0
- package/dist/visual/chemistry/particles.d.ts +335 -0
- package/dist/visual/chemistry/periodic.d.ts +134 -0
- package/dist/visual/chemistry/rate.d.ts +67 -0
- package/dist/visual/chemistry/reaction.d.ts +201 -0
- package/dist/visual/chemistry/titration.d.ts +67 -0
- package/dist/visual/length.d.ts +79 -0
- package/dist/visual/length.js +37 -0
- package/dist/visual/mathematics/chance.d.ts +258 -0
- package/dist/visual/mathematics/chance.js +117 -0
- package/dist/visual/mathematics/chart.d.ts +67 -0
- package/dist/visual/mathematics/charts.d.ts +335 -0
- package/dist/visual/mathematics/function.d.ts +205 -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/mathematics/numeral.d.ts +170 -0
- package/dist/visual/mathematics/numeral.js +85 -0
- package/dist/visual/physics/braking.d.ts +268 -0
- package/dist/visual/physics/circuit.d.ts +343 -0
- package/dist/visual/physics/circuit.js +86 -0
- package/dist/visual/physics/circular.d.ts +134 -0
- package/dist/visual/physics/dynamics.d.ts +579 -0
- package/dist/visual/physics/dynamics.js +134 -0
- package/dist/visual/physics/efficiency.d.ts +402 -0
- package/dist/visual/physics/electronics.d.ts +260 -0
- package/dist/visual/physics/electronics.js +71 -0
- package/dist/visual/physics/falling.d.ts +268 -0
- package/dist/visual/physics/field.d.ts +249 -0
- package/dist/visual/physics/field.js +60 -0
- package/dist/visual/physics/fluid.d.ts +336 -0
- package/dist/visual/physics/fluid.js +83 -0
- package/dist/visual/physics/force.d.ts +335 -0
- package/dist/visual/physics/gravity.d.ts +172 -0
- package/dist/visual/physics/gravity.js +47 -0
- package/dist/visual/physics/heat.d.ts +255 -0
- package/dist/visual/physics/heat.js +66 -0
- package/dist/visual/physics/instrument.d.ts +469 -0
- package/dist/visual/physics/light.d.ts +343 -0
- package/dist/visual/physics/light.js +90 -0
- package/dist/visual/physics/measurement.d.ts +268 -0
- package/dist/visual/physics/motion.d.ts +402 -0
- package/dist/visual/physics/nuclear.d.ts +258 -0
- package/dist/visual/physics/nuclear.js +69 -0
- package/dist/visual/physics/parabolic.d.ts +69 -2
- package/dist/visual/physics/parabolic.js +2 -2
- package/dist/visual/physics/position.d.ts +402 -0
- package/dist/visual/physics/power.d.ts +536 -0
- package/dist/visual/physics/precision.d.ts +469 -0
- package/dist/visual/physics/product.d.ts +268 -0
- package/dist/visual/physics/reading.d.ts +253 -0
- package/dist/visual/physics/reading.js +61 -0
- package/dist/visual/physics/record.d.ts +134 -0
- package/dist/visual/physics/relative.d.ts +201 -0
- package/dist/visual/physics/solar.d.ts +402 -0
- package/dist/visual/physics/vector.d.ts +335 -0
- package/dist/visual/physics/velocity.d.ts +469 -0
- package/dist/visual/physics/wave.d.ts +338 -0
- package/dist/visual/physics/wave.js +85 -0
- package/dist/visual/politics.d.ts +403 -1
- package/dist/visual/politics.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -7,6 +7,73 @@ import { type RichSlot } from "#contracts/visual/card";
|
|
|
7
7
|
export declare function circularVisuals<E>(rich: RichSlot<E>): {
|
|
8
8
|
SatelliteOrbitCircularLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
9
|
readonly description: RichSlot<E>;
|
|
10
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly latex: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "mathInline";
|
|
15
|
+
} | {
|
|
16
|
+
readonly marks?: readonly [{
|
|
17
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
18
|
+
} | {
|
|
19
|
+
readonly attrs: {
|
|
20
|
+
readonly href: string;
|
|
21
|
+
};
|
|
22
|
+
readonly type: "link";
|
|
23
|
+
} | {
|
|
24
|
+
readonly attrs: {
|
|
25
|
+
readonly variant: "success" | "warning" | null;
|
|
26
|
+
};
|
|
27
|
+
readonly type: "highlight";
|
|
28
|
+
}, ...({
|
|
29
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
30
|
+
} | {
|
|
31
|
+
readonly attrs: {
|
|
32
|
+
readonly href: string;
|
|
33
|
+
};
|
|
34
|
+
readonly type: "link";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly variant: "success" | "warning" | null;
|
|
38
|
+
};
|
|
39
|
+
readonly type: "highlight";
|
|
40
|
+
})[]];
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly type: "text";
|
|
43
|
+
}, ...({
|
|
44
|
+
readonly attrs: {
|
|
45
|
+
readonly latex: string;
|
|
46
|
+
};
|
|
47
|
+
readonly type: "mathInline";
|
|
48
|
+
} | {
|
|
49
|
+
readonly marks?: readonly [{
|
|
50
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
51
|
+
} | {
|
|
52
|
+
readonly attrs: {
|
|
53
|
+
readonly href: string;
|
|
54
|
+
};
|
|
55
|
+
readonly type: "link";
|
|
56
|
+
} | {
|
|
57
|
+
readonly attrs: {
|
|
58
|
+
readonly variant: "success" | "warning" | null;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "highlight";
|
|
61
|
+
}, ...({
|
|
62
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
63
|
+
} | {
|
|
64
|
+
readonly attrs: {
|
|
65
|
+
readonly href: string;
|
|
66
|
+
};
|
|
67
|
+
readonly type: "link";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly variant: "success" | "warning" | null;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "highlight";
|
|
73
|
+
})[]];
|
|
74
|
+
readonly text: string;
|
|
75
|
+
readonly type: "text";
|
|
76
|
+
})[]], E, never, never>>;
|
|
10
77
|
readonly title: RichSlot<E>;
|
|
11
78
|
readonly labels: Schema.Struct<{
|
|
12
79
|
readonly acceleration: RichSlot<E>;
|
|
@@ -20,6 +87,73 @@ export declare function circularVisuals<E>(rich: RichSlot<E>): {
|
|
|
20
87
|
}>, "figure">;
|
|
21
88
|
StringWhirlReleaseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
22
89
|
readonly description: RichSlot<E>;
|
|
90
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
91
|
+
readonly attrs: {
|
|
92
|
+
readonly latex: string;
|
|
93
|
+
};
|
|
94
|
+
readonly type: "mathInline";
|
|
95
|
+
} | {
|
|
96
|
+
readonly marks?: readonly [{
|
|
97
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
98
|
+
} | {
|
|
99
|
+
readonly attrs: {
|
|
100
|
+
readonly href: string;
|
|
101
|
+
};
|
|
102
|
+
readonly type: "link";
|
|
103
|
+
} | {
|
|
104
|
+
readonly attrs: {
|
|
105
|
+
readonly variant: "success" | "warning" | null;
|
|
106
|
+
};
|
|
107
|
+
readonly type: "highlight";
|
|
108
|
+
}, ...({
|
|
109
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
110
|
+
} | {
|
|
111
|
+
readonly attrs: {
|
|
112
|
+
readonly href: string;
|
|
113
|
+
};
|
|
114
|
+
readonly type: "link";
|
|
115
|
+
} | {
|
|
116
|
+
readonly attrs: {
|
|
117
|
+
readonly variant: "success" | "warning" | null;
|
|
118
|
+
};
|
|
119
|
+
readonly type: "highlight";
|
|
120
|
+
})[]];
|
|
121
|
+
readonly text: string;
|
|
122
|
+
readonly type: "text";
|
|
123
|
+
}, ...({
|
|
124
|
+
readonly attrs: {
|
|
125
|
+
readonly latex: string;
|
|
126
|
+
};
|
|
127
|
+
readonly type: "mathInline";
|
|
128
|
+
} | {
|
|
129
|
+
readonly marks?: readonly [{
|
|
130
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
131
|
+
} | {
|
|
132
|
+
readonly attrs: {
|
|
133
|
+
readonly href: string;
|
|
134
|
+
};
|
|
135
|
+
readonly type: "link";
|
|
136
|
+
} | {
|
|
137
|
+
readonly attrs: {
|
|
138
|
+
readonly variant: "success" | "warning" | null;
|
|
139
|
+
};
|
|
140
|
+
readonly type: "highlight";
|
|
141
|
+
}, ...({
|
|
142
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
143
|
+
} | {
|
|
144
|
+
readonly attrs: {
|
|
145
|
+
readonly href: string;
|
|
146
|
+
};
|
|
147
|
+
readonly type: "link";
|
|
148
|
+
} | {
|
|
149
|
+
readonly attrs: {
|
|
150
|
+
readonly variant: "success" | "warning" | null;
|
|
151
|
+
};
|
|
152
|
+
readonly type: "highlight";
|
|
153
|
+
})[]];
|
|
154
|
+
readonly text: string;
|
|
155
|
+
readonly type: "text";
|
|
156
|
+
})[]], E, never, never>>;
|
|
23
157
|
readonly title: RichSlot<E>;
|
|
24
158
|
readonly labels: Schema.Struct<{
|
|
25
159
|
readonly acceleration: RichSlot<E>;
|