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 4, 2024
1 parent adfba22 commit 63e7693
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion packages/index.ts
Original file line number Diff line number Diff line change
@@ -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";
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 63e7693

Please sign in to comment.