forked from Khan/perseus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export tex parse & compare functions
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters