Skip to content

Commit

Permalink
feat: export tex parse & compare functions
Browse files Browse the repository at this point in the history
  • Loading branch information
esp10mm committed Mar 1, 2024
1 parent adfba22 commit 1acaf4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion packages/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
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) => { expr: unknown };
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";
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 1acaf4e

Please sign in to comment.