Skip to content

Commit b79b2da

Browse files
committed
类型定义修复
1 parent 826bf06 commit b79b2da

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/editor/inputs/inputs.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
}
2323

24-
& > .fold {
24+
& > .fold-shell {
2525
margin: -8px -15px 0 -15px;
2626
}
2727
s-divider {

src/types/data.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ export namespace PrivateDataTypes {
1010
hidden: boolean;
1111
};
1212
type Function = Global & {
13-
skipTip: boolean;
14-
nSamples: number | undefined;
1513
closed: boolean;
16-
range: [number, number];
1714
};
1815

1916
export const allowedGraphTypes = {
@@ -46,6 +43,9 @@ export namespace PrivateDataTypes {
4643
fn: string;
4744
secants: LinearPart.Secant[];
4845
derivative: undefined | LinearPart.Derivative;
46+
range: [number, number];
47+
nSamples: number | undefined;
48+
skipTip: boolean;
4949
};
5050
/** Implicit functions: F(x,y)=0 */
5151
export type Implicit = Function & {
@@ -59,12 +59,16 @@ export namespace PrivateDataTypes {
5959
graphType: (typeof allowedGraphTypes)["parametric"][number];
6060
x: string;
6161
y: string;
62+
range: [number, number];
63+
nSamples: number | undefined;
6264
};
6365
/** Polar functions: r=f(t) */
6466
export type Polar = Function & {
6567
fnType: "polar";
6668
graphType: (typeof allowedGraphTypes)["polar"][number];
6769
r: string;
70+
range: [number, number];
71+
nSamples: number | undefined;
6872
};
6973
/** Points */
7074
export type Points = Global & {
@@ -178,10 +182,7 @@ export function toPrivateData(input: Object) {
178182
});
179183
const getFunctionGlobals = () => ({
180184
...getGlobals(),
181-
skipTip: false,
182185
closed: false,
183-
nSamples: undefined,
184-
range: () => [-Infinity, Infinity] as [number, number],
185186
});
186187
switch (data.fnType) {
187188
case "text":
@@ -219,6 +220,9 @@ export function toPrivateData(input: Object) {
219220
x0: 0,
220221
updateOnMouseMove: false,
221222
}),
223+
skipTip: false,
224+
nSamples: undefined,
225+
range: () => [-Infinity, Infinity] as [number, number],
222226
...getFunctionGlobals(),
223227
}
224228
);
@@ -234,6 +238,8 @@ export function toPrivateData(input: Object) {
234238
fnType: "polar",
235239
graphType: "polyline",
236240
r: "",
241+
nSamples: undefined,
242+
range: () => [-Infinity, Infinity] as [number, number],
237243
...getFunctionGlobals(),
238244
});
239245
case "parametric":
@@ -242,6 +248,8 @@ export function toPrivateData(input: Object) {
242248
graphType: "polyline",
243249
x: "",
244250
y: "",
251+
nSamples: undefined,
252+
range: () => [-Infinity, Infinity] as [number, number],
245253
...getFunctionGlobals(),
246254
});
247255
case "points":

0 commit comments

Comments
 (0)