defuddle 0.3.0 → 0.3.2

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.
@@ -0,0 +1,9 @@
1
+ export interface MathData {
2
+ mathml: string;
3
+ latex: string | null;
4
+ isBlock: boolean;
5
+ }
6
+ export declare const getMathMLFromElement: (el: Element) => MathData | null;
7
+ export declare const getBasicLatexFromElement: (el: Element) => string | null;
8
+ export declare const isBlockDisplay: (el: Element) => boolean;
9
+ export declare const mathSelectors: string;
@@ -0,0 +1,7 @@
1
+ import { MathData } from './math.base';
2
+ export declare const createCleanMathEl: (mathData: MathData | null, latex: string | null, isBlock: boolean) => Element;
3
+ export declare const mathStandardizationRules: {
4
+ selector: string;
5
+ element: string;
6
+ transform: (el: Element) => Element;
7
+ }[];
package/dist/math.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- export interface MathData {
2
- mathml: string;
3
- latex: string | null;
4
- isBlock: boolean;
5
- }
6
- export declare const getMathMLFromElement: (el: Element) => MathData | null;
7
- export declare const getLatexFromElement: (el: Element) => string | null;
8
- export declare const isBlockDisplay: (el: Element) => boolean;
9
- export declare const createCleanMathEl: (mathData: MathData | null, latex: string | null, isBlock: boolean) => Element;
10
- export declare const mathStandardizationRules: {
11
- selector: string;
12
- element: string;
13
- transform: (el: Element) => Element;
14
- }[];
1
+ export type { MathData } from './math.base';
2
+ export { mathStandardizationRules, createCleanMathEl } from './math.core';
@@ -0,0 +1,8 @@
1
+ import { MathData } from './math.base';
2
+ export declare const getLatexFromElement: (el: Element) => string | null;
3
+ export declare const createCleanMathEl: (mathData: MathData | null, latex: string | null, isBlock: boolean) => Element;
4
+ export declare const mathStandardizationRules: {
5
+ selector: string;
6
+ element: string;
7
+ transform: (el: Element) => Element;
8
+ }[];
package/package.json CHANGED
@@ -1,10 +1,28 @@
1
1
  {
2
2
  "name": "defuddle",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Extract article content and metadata from web pages.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "typesVersions": {
9
+ "*": {
10
+ "*": ["dist/index.d.ts"],
11
+ "full": ["dist/index.full.d.ts"]
12
+ }
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.js",
18
+ "types": "./dist/index.d.ts"
19
+ },
20
+ "./full": {
21
+ "import": "./dist/index.full.js",
22
+ "require": "./dist/index.full.js",
23
+ "types": "./dist/index.full.d.ts"
24
+ }
25
+ },
8
26
  "scripts": {
9
27
  "clean": "rm -rf dist",
10
28
  "build:types": "tsc --project tsconfig.declarations.json",
@@ -35,13 +53,14 @@
35
53
  "url": "https://github.com/kepano/defuddle/issues"
36
54
  },
37
55
  "homepage": "https://github.com/kepano/defuddle",
38
- "dependencies": {
56
+ "optionalDependencies": {
39
57
  "mathml-to-latex": "^1.4.3",
40
58
  "temml": "^0.11.2"
41
59
  },
42
60
  "devDependencies": {
43
61
  "@types/node": "^20.0.0",
44
62
  "concurrently": "^8.2.2",
63
+ "terser-webpack-plugin": "^5.3.14",
45
64
  "ts-loader": "^9.5.1",
46
65
  "typescript": "^5.3.3",
47
66
  "undici-types": "^5.0.0",