webforai 0.0.13 → 0.0.15

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,2 @@
1
+ import type { Root as Hast } from "hast";
2
+ export declare const extractHast: (hast: Hast) => Hast | import("hast").Element;
@@ -0,0 +1,6 @@
1
+ import type { Root as Hast } from "hast";
2
+ export interface HtmlToMarkdownOptions {
3
+ extractHast?: false | ((hast: Hast) => Hast);
4
+ solveLinks?: string;
5
+ }
6
+ export declare const htmlToMarkdown: (html: string, options?: HtmlToMarkdownOptions) => string;
@@ -0,0 +1,6 @@
1
+ import type { Root as Hast } from "hast";
2
+ import type { Nodes as Mdast } from "mdast";
3
+ export type HtmlToMdastOptions = {
4
+ extractHast?: false | ((hast: Hast) => Hast);
5
+ };
6
+ export declare const htmlToMdast: (html: string, options?: HtmlToMdastOptions) => Mdast;
@@ -0,0 +1,4 @@
1
+ export * from "./html-to-markdown";
2
+ export * from "./md-splitter";
3
+ export * from "./html-to-mdast";
4
+ export * from "./mdast-to-markdown";
@@ -0,0 +1 @@
1
+ export declare const linkReplacer: (markdown: string, link: string) => string;
@@ -0,0 +1,2 @@
1
+ import * as playwright from "playwright";
2
+ export declare const loadHtml: (url: string, context?: playwright.BrowserContext) => Promise<string>;
@@ -0,0 +1,4 @@
1
+ import type { Nodes as Mdast, RootContent } from "mdast";
2
+ export declare const mdastSplitter: (mdast: Mdast, checker: (markdown: string) => Promise<boolean>, options?: {
3
+ signal?: AbortSignal;
4
+ }) => Promise<RootContent[][]>;
@@ -0,0 +1,2 @@
1
+ import { type Handle } from "hast-util-to-mdast";
2
+ export declare const customDivHandler: Handle;
@@ -0,0 +1,2 @@
1
+ import type { Handle } from "hast-util-to-mdast";
2
+ export declare const mathHandler: Handle;
@@ -0,0 +1,4 @@
1
+ import type { Nodes as Mdast, RootContent } from "mdast";
2
+ export declare const mdastToMarkdown: (mdast: Mdast | RootContent[], options?: {
3
+ solveLinks?: string;
4
+ }) => string;
@@ -0,0 +1 @@
1
+ export declare const chunk: <T>(array: T[], size: number) => T[][];
@@ -0,0 +1,4 @@
1
+ import type { Nodes as Mdast, RootContent } from "mdast";
2
+ export declare const unwarpRoot: (mdast: Mdast) => RootContent[];
3
+ export declare const warpRoot: (mdast: RootContent[] | Mdast) => Mdast;
4
+ export declare const internalType: (content: RootContent) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webforai",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "A library that provides a web interface for AI",
5
5
  "author": "inaridiy",
6
6
  "license": "MIT",
@@ -31,12 +31,12 @@
31
31
  "types": "./dist/index.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
- "default": "./dist/index.js",
35
- "types": "./dist/index.d.ts"
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
36
  },
37
37
  "./loaders/playwright": {
38
- "default": "./dist/loaders/playwright.js",
39
- "types": "./dist/loaders/playwright.d.ts"
38
+ "types": "./dist/loaders/playwright.d.ts",
39
+ "default": "./dist/loaders/playwright.js"
40
40
  }
41
41
  },
42
42
  "peerDependencies": {