typescript work in progress

This commit is contained in:
Umur Ozkul 2022-06-09 15:27:51 +02:00
parent 710756bc50
commit afffdd8559
2 changed files with 14 additions and 2 deletions

View File

@ -187,5 +187,7 @@ function createTsExport(
return tag("lambdaDeclaration", x.value); return tag("lambdaDeclaration", x.value);
case "EvTypeIdentifier": case "EvTypeIdentifier":
return tag("typeIdentifier", x.value); return tag("typeIdentifier", x.value);
case "EvModule":
return tag("module", x.value);
} }
} }

View File

@ -73,7 +73,11 @@ export type rescriptExport =
| { | {
TAG: 13; // EvTypeIdentifier TAG: 13; // EvTypeIdentifier
_0: string; _0: string;
}; }
| {
TAG: 14; // EvModule
_0: { [key: string]: rescriptExport };
};
type rescriptDist = type rescriptDist =
| { TAG: 0; _0: rescriptPointSetDist } | { TAG: 0; _0: rescriptPointSetDist }
@ -125,7 +129,8 @@ export type squiggleExpression =
| tagged<"timeDuration", number> | tagged<"timeDuration", number>
| tagged<"lambdaDeclaration", lambdaDeclaration> | tagged<"lambdaDeclaration", lambdaDeclaration>
| tagged<"record", { [key: string]: squiggleExpression }> | tagged<"record", { [key: string]: squiggleExpression }>
| tagged<"typeIdentifier", string>; | tagged<"typeIdentifier", string>
| tagged<"module", { [key: string]: squiggleExpression }>;
export { lambdaValue }; export { lambdaValue };
@ -177,6 +182,11 @@ export function convertRawToTypescript(
}); });
case 13: // EvSymbol case 13: // EvSymbol
return tag("typeIdentifier", result._0); return tag("typeIdentifier", result._0);
case 14: // EvModule
return tag(
"module",
_.mapValues(result._0, (x) => convertRawToTypescript(x, environment))
);
} }
} }