tex2typst 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/convert.d.ts +9 -3
- package/dist/generic.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2278 -2145
- package/dist/tex-parser.d.ts +1 -1
- package/dist/tex-tokenizer.d.ts +1 -1
- package/dist/tex-types.d.ts +107 -0
- package/dist/tex-writer.d.ts +1 -2
- package/dist/tex2typst.min.js +13 -13
- package/dist/typst-parser.d.ts +6 -4
- package/dist/typst-tokenizer.d.ts +1 -1
- package/dist/typst-types.d.ts +97 -0
- package/dist/typst-writer.d.ts +4 -2
- package/package.json +1 -1
- package/src/convert.ts +538 -446
- package/src/generic.ts +28 -2
- package/src/index.ts +1 -1
- package/src/map.ts +5 -0
- package/src/tex-parser.ts +49 -63
- package/src/tex-tokenizer.ts +4 -3
- package/src/tex-types.ts +369 -0
- package/src/tex-writer.ts +3 -51
- package/src/typst-parser.ts +83 -65
- package/src/typst-tokenizer.ts +86 -85
- package/src/typst-types.ts +229 -0
- package/src/typst-writer.ts +143 -129
- package/src/util.ts +1 -1
- package/dist/types.d.ts +0 -109
- package/src/types.ts +0 -414
package/dist/convert.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { TexNode,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { TexNode, Tex2TypstOptions, TexToken } from "./tex-types";
|
|
2
|
+
import { TypstNode } from "./typst-types";
|
|
3
|
+
import { TypstToken } from "./typst-types";
|
|
4
|
+
export declare class ConverterError extends Error {
|
|
5
|
+
node: TexNode | TypstNode | TexToken | TypstToken | null;
|
|
6
|
+
constructor(message: string, node?: TexNode | TypstNode | TexToken | TypstToken | null);
|
|
7
|
+
}
|
|
8
|
+
export declare function convert_tex_node_to_typst(abstractNode: TexNode, options?: Tex2TypstOptions): TypstNode;
|
|
9
|
+
export declare function convert_typst_node_to_tex(abstractNode: TypstNode): TexNode;
|
package/dist/generic.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface IEquatable {
|
|
2
2
|
eq(other: IEquatable): boolean;
|
|
3
3
|
}
|
|
4
|
+
export declare function array_equal<T extends IEquatable>(a: T[], b: T[]): boolean;
|
|
4
5
|
export declare function array_find<T extends IEquatable>(array: T[], item: T, start?: number): number;
|
|
5
6
|
export declare function array_includes<T extends IEquatable>(array: T[], item: T): boolean;
|
|
6
7
|
export declare function array_split<T extends IEquatable>(array: T[], sep: T): T[][];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tex2TypstOptions } from "./types";
|
|
1
|
+
import type { Tex2TypstOptions } from "./tex-types";
|
|
2
2
|
import { symbolMap } from "./map";
|
|
3
3
|
import { shorthandMap } from "./typst-shorthands";
|
|
4
4
|
export declare function tex2typst(tex: string, options?: Tex2TypstOptions): string;
|