diff --git a/packages/index.ts b/packages/index.ts index 64c82f815b..7f98d3b058 100644 --- a/packages/index.ts +++ b/packages/index.ts @@ -1,12 +1,42 @@ +import {parse, compare} from "./kas/src"; import {init, Widgets, Renderer} from "./perseus/src"; + import GraphUtils from "./perseus/src/util/graphie"; +export interface TexOptions { + functions?: string[]; + simplify?: boolean; + form?: boolean; + times?: boolean; +} + export interface PerseusCore { init: typeof init; Widgets: typeof Widgets; Renderer: typeof Renderer; GraphUtils: typeof GraphUtils; + parseTex: ( + tex: string, + options?: TexOptions, + ) => { + parsed: boolean; + expr: unknown; + error?: string; + }; + compareTex: ( + ans: unknown, + solution: unknown, + options?: TexOptions, + ) => {equal: boolean; message: string}; } -export {init, Widgets, Renderer, GraphUtils}; + +export { + init, + Widgets, + Renderer, + parse as parseTex, + compare as compareTex, + GraphUtils, +}; export type {WidgetExports} from "./perseus/src"; diff --git a/packages/package.json b/packages/package.json index 5d5891205b..8a4bc94767 100644 --- a/packages/package.json +++ b/packages/package.json @@ -1,6 +1,6 @@ { "name": "@junyiacademy/perseus-core", - "version": "1.0.21", + "version": "1.0.22", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT",