2022-09-11 15:22:07 +00:00
|
|
|
import { environment } from "../rescript/ForTS/ForTS__Types.gen";
|
2022-08-28 16:19:44 +00:00
|
|
|
import { SqProject } from "./SqProject";
|
|
|
|
import { SqValue, SqValueTag } from "./SqValue";
|
2022-08-29 21:51:44 +00:00
|
|
|
export { SqValueLocation } from "./SqValueLocation";
|
2022-08-27 17:46:43 +00:00
|
|
|
export { result } from "../rescript/ForTS/ForTS_Result_tag";
|
2022-08-28 16:19:44 +00:00
|
|
|
export { SqDistribution, SqDistributionTag } from "./SqDistribution";
|
|
|
|
export { SqDistributionError } from "./SqDistributionError";
|
|
|
|
export { SqRecord } from "./SqRecord";
|
|
|
|
export { SqLambda } from "./SqLambda";
|
|
|
|
export { SqProject };
|
|
|
|
export { SqValue, SqValueTag };
|
2022-08-27 17:46:43 +00:00
|
|
|
export {
|
2022-04-29 18:41:30 +00:00
|
|
|
environment,
|
2022-04-29 22:51:00 +00:00
|
|
|
defaultEnvironment,
|
2022-08-27 17:46:43 +00:00
|
|
|
} from "../rescript/ForTS/ForTS_Distribution/ForTS_Distribution.gen";
|
2022-08-28 16:19:44 +00:00
|
|
|
export { SqError } from "./SqError";
|
|
|
|
export { SqShape } from "./SqPointSetDist";
|
2022-04-28 18:59:15 +00:00
|
|
|
|
2022-08-28 16:19:44 +00:00
|
|
|
export { resultMap } from "./types";
|
2022-08-19 16:28:19 +00:00
|
|
|
|
2022-08-27 17:46:43 +00:00
|
|
|
export const run = (
|
|
|
|
code: string,
|
|
|
|
options?: {
|
|
|
|
environment?: environment;
|
|
|
|
}
|
|
|
|
) => {
|
2022-08-28 16:19:44 +00:00
|
|
|
const project = SqProject.create();
|
2022-08-27 17:46:43 +00:00
|
|
|
project.setSource("main", code);
|
|
|
|
if (options?.environment) {
|
|
|
|
project.setEnvironment(options.environment);
|
|
|
|
}
|
|
|
|
project.run("main");
|
|
|
|
const result = project.getResult("main");
|
|
|
|
const bindings = project.getBindings("main");
|
|
|
|
return { result, bindings };
|
|
|
|
};
|