From 3c1a49e44de8122e60ccd2ee9105177714eeada0 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 19 Aug 2022 18:28:19 +0200 Subject: [PATCH] index.ts --- packages/squiggle-lang/src/js/index.ts | 29 ++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index c27d5058..15346d67 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -1,14 +1,32 @@ +/* Some of the types have moved to ForTS__Types. +Needs to be reimported here if necessary and distribution related + +We only need distribution related extras for back compatibility. Umur + +Instead of a global function namespace we should use modules under ForTS directly maybe renaming them for ease. + +.e.g. Project.run(project) +.e.g. Distribution.makeSampleSetDist + +*/ + + import * as _ from "lodash"; import type { environment, + expressionValue, externalBindings, errorValue, } from "../rescript/TypescriptInterface.gen"; import { defaultEnvironment, + evaluatePartialUsingExternalBindings, + evaluateUsingOptions, + foreignFunctionInterface, } from "../rescript/TypescriptInterface.gen"; export { makeSampleSetDist, + errorValueToString, distributionErrorToString, } from "../rescript/TypescriptInterface.gen"; export type { @@ -18,7 +36,12 @@ export type { } from "../rescript/TypescriptInterface.gen"; export type { errorValue, externalBindings as bindings, jsImports }; import { + jsValueToBinding, + jsValueToExpressionValue, + jsValue, + rescriptExport, squiggleExpression, + convertRawToTypescript, lambdaValue, } from "./rescript_interop"; import { result, resultMap, tag, tagged } from "./types"; @@ -35,9 +58,8 @@ export let defaultSamplingInputs: environment = { }; -/* - All those functions below are invalid since the introduction of ReducerProject -*/ +/* Umur: All the functions below are invalid. ForTS_Reducer project is the new way to do this. */ + // export function run( // squiggleString: string, // bindings?: externalBindings, @@ -72,7 +94,6 @@ export let defaultSamplingInputs: environment = { // ); // } -// jsValueToExpressionValue is invalid // export function runForeign( // fn: lambdaValue, // args: jsValue[],