@llml-browser/types
Version:
TypeScript types and schemas for the @llml-browser API
67 lines (65 loc) • 3.03 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/services/html-cleaning/index.ts
var html_cleaning_exports = {};
__export(html_cleaning_exports, {
ElementPatternSchema: () => ElementPatternSchema,
HTMLCleaningMetricsSchema: () => HTMLCleaningMetricsSchema,
HTMLCleaningOptionsSchema: () => HTMLCleaningOptionsSchema,
HTMLCleaningResultSchema: () => HTMLCleaningResultSchema
});
module.exports = __toCommonJS(html_cleaning_exports);
// src/services/html-cleaning/types.ts
var import_zod = require("zod");
var HTMLCleaningOptionsSchema = import_zod.z.object({
allowedHTMLTags: import_zod.z.array(import_zod.z.string()).optional(),
disallowedHTMLTags: import_zod.z.array(import_zod.z.string()).optional(),
extractMainContent: import_zod.z.boolean().optional().default(true),
/* Deprecated property, will be removed in future. add baseUrl to HTMLCleaning as a required parameter instead*/
documentBaseUrl: import_zod.z.string().optional(),
removeBase64Images: import_zod.z.boolean().optional().default(true)
}).strict();
var ElementPatternSchema = import_zod.z.object({
tag: import_zod.z.union([import_zod.z.string(), import_zod.z.instanceof(RegExp)]).optional(),
attributes: import_zod.z.array(
import_zod.z.object({
name: import_zod.z.union([import_zod.z.string(), import_zod.z.instanceof(RegExp)]),
value: import_zod.z.union([import_zod.z.string(), import_zod.z.instanceof(RegExp)]).optional()
}).strict()
).optional(),
classNames: import_zod.z.array(import_zod.z.union([import_zod.z.string(), import_zod.z.instanceof(RegExp)])).optional(),
ids: import_zod.z.array(import_zod.z.union([import_zod.z.string(), import_zod.z.instanceof(RegExp)])).optional()
}).strict();
var HTMLCleaningMetricsSchema = import_zod.z.object({
inputSize: import_zod.z.number(),
outputSize: import_zod.z.number(),
compressionRatio: import_zod.z.number()
});
var HTMLCleaningResultSchema = import_zod.z.object({
cleanedHtml: import_zod.z.string(),
metrics: HTMLCleaningMetricsSchema.optional()
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ElementPatternSchema,
HTMLCleaningMetricsSchema,
HTMLCleaningOptionsSchema,
HTMLCleaningResultSchema
});
//# sourceMappingURL=html-cleaning.js.map