@llml-browser/types
Version:
TypeScript types and schemas for the @llml-browser API
73 lines (71 loc) • 1.66 kB
JavaScript
import {
HTMLCleaningOptionsSchema
} from "./chunk-54IS4CR5.mjs";
import {
MetadataOptionsSchema
} from "./chunk-5RX3GYMK.mjs";
// src/routers/read/index.ts
import z from "zod";
var readOptionsSchema = z.object({
/**
* The URL to scrape.
* Must be a valid URL string.
*/
url: z.string(),
/**
* Whether to extract metadata from the page.
* Default: true
*/
// default true if not set
metadata: z.preprocess(
(val) => val !== "false" && val !== false,
z.boolean().optional()
),
/**
* Whether to extract markdown from the page.
* Default: true
*/
// default true if not set
markdown: z.preprocess(
(val) => val !== "false" && val !== false,
z.boolean().optional()
),
/**
* Whether to return cleaned HTML.
* Default: true
*/
cleanedHtml: z.preprocess(
(val) => val !== "false" && val !== false,
z.boolean().optional()
),
/**
* Whether to fetch and parse robots.txt.
* Default: false
*/
robots: z.preprocess(
(val) => val === "true" || val === true,
z.boolean().optional()
),
/**
* Whether to return raw HTML.
* Default: false
*/
rawHtml: z.preprocess(
(val) => val !== "false" && val !== false,
z.boolean().optional()
),
/**
* Options for metadata extraction.
* Controls how metadata like title, description, etc. are extracted.
*/
metadataOptions: MetadataOptionsSchema.optional(),
/**
* Options for HTML cleaning.
* Controls how HTML is sanitized and cleaned.
*/
cleanedHtmlOptions: HTMLCleaningOptionsSchema.optional()
});
export {
readOptionsSchema
};
//# sourceMappingURL=chunk-2ECDDLAY.mjs.map