@llml-browser/types
TypeScript types and schemas for the @llml-browser API.
Installation
npm install @llml-browser/types
yarn add @llml-browser/types
pnpm add @llml-browser/types
bun add @llml-browser/types
Usage
Path-Specific Imports (Recommended)
import type { LinksOptions, LinksTree(or Tree) } from "@llml-browser/types/links";
import type { ExtractedLinks } from "@llml-browser/types/services/link";
import type { HTMLCleaningOptions } from "@llml-browser/types/services/html-cleaning";
import type { PageMetadata } from "@llml-browser/types/services/metadata";
import type { ScrapedData } from "@llml-browser/types/services/cheerio";
Root Imports (All Types)
import type {
LinksOptions,
LinksTree,
ExtractedLinks,
HTMLCleaningOptions,
PageMetadata,
ScrapedData,
} from "@llml-browser/types";
Runtime Validation with Zod Schemas
import { LinksOptionsSchema } from "@llml-browser/types/links";
import { HTMLCleaningOptionsSchema } from "@llml-browser/types/services/html-cleaning";
const options = {
url: "https://example.com",
metadata: true,
cleanedHtml: true,
rawHtml: false,
};
const validated = LinksOptionsSchema.parse(options);
Available Types
Links Types
LinksOptions - Configuration options for link extraction
LinksTree - Tree structure of extracted links
Service Types
HTML Cleaning
HTMLCleaningOptions - Configuration for HTML cleaning process
LinkExtractionOptions - Options for extracting links from HTML
ExtractedLinks - Result of link extraction process
Metadata
MetadataOptions - Options for metadata extraction
PageMetadata - Extracted metadata from a page
Cheerio
ScrapedData - Data scraped using Cheerio
Package Structure
src/
├── index.ts
├── links/
│ ├── index.ts
│ └── types.ts
└── services/
├── cheerio/
│ ├── index.ts
│ └── types.ts
├── html-cleaning/
│ ├── index.ts
│ └── types.ts
├── link/
│ ├── index.ts
│ └── types.ts
└── metadata/
├── index.ts
└── types.ts
Development
pnpm install
pnpm build
pnpm dev
pnpm typecheck
pnpm fix
License
MIT