UNPKG

@ironsoftware/ironpdf

Version:

IronPDF for Node

88 lines 3.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.chromePdfRenderOptionsSchema = exports.httpLoginCredentialsSchema = exports.waitForSchema = exports.waitForHtmlQuerySelectorSchema = exports.waitForPageLoadSchema = exports.waitForNetworkIdle2Schema = exports.waitForNetworkIdle0Schema = exports.waitForNetworkIdleNSchema = exports.waitForJavaScriptSchema = exports.waitForRenderDelaySchema = exports.waitForTypeSchema = void 0; const zod_1 = require("zod"); const render_1 = require("../../public/render"); const typeSchema_1 = require("./typeSchema"); const paperSchema_1 = require("./paperSchema"); const affixSchema_1 = require("./affixSchema"); exports.waitForTypeSchema = zod_1.z.nativeEnum(render_1.WaitForType); exports.waitForRenderDelaySchema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.RenderDelay), delay: zod_1.z .number() .optional() }); exports.waitForJavaScriptSchema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.JavaScript), maxWaitTime: zod_1.z .number() .optional() }); exports.waitForNetworkIdleNSchema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.NetworkIdleN), networkIdleDuration: zod_1.z.number().optional(), maxNumAllowedInflight: zod_1.z.number().optional(), maxWaitTime: zod_1.z.number().optional() }); exports.waitForNetworkIdle0Schema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.NetworkIdle0), maxWaitTime: zod_1.z .number() .optional() }); exports.waitForNetworkIdle2Schema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.NetworkIdle2), maxWaitTime: zod_1.z .number() .optional() }); exports.waitForPageLoadSchema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.PageLoad) }); exports.waitForHtmlQuerySelectorSchema = zod_1.z.object({ type: zod_1.z.literal(render_1.WaitForType.HtmlElement), htmlQueryStr: zod_1.z.string(), maxWaitTime: zod_1.z .number() .optional() }); exports.waitForSchema = zod_1.z.union([ exports.waitForRenderDelaySchema, exports.waitForPageLoadSchema, exports.waitForJavaScriptSchema, exports.waitForNetworkIdleNSchema, exports.waitForNetworkIdle0Schema, exports.waitForNetworkIdle2Schema, exports.waitForHtmlQuerySelectorSchema ]); exports.httpLoginCredentialsSchema = zod_1.z.object({ custom_cookies: zod_1.z.map(zod_1.z.string(), zod_1.z.string()).optional(), enable_cookies: zod_1.z.boolean().optional(), network_password: zod_1.z.string().optional(), network_username: zod_1.z.string().optional() }); exports.chromePdfRenderOptionsSchema = zod_1.z.object({ createPdfFormsFromHtml: zod_1.z.boolean().optional(), customCssUrl: zod_1.z.string().optional(), enableJavaScript: zod_1.z.boolean().optional(), fitToPaperMode: typeSchema_1.fitToPaperModesSchema.optional(), grayScale: zod_1.z.boolean().optional(), margin: typeSchema_1.marginConfigSchema.optional(), paperOrientation: paperSchema_1.pdfPaperOrientationSchema.optional(), paperSize: paperSchema_1.pdfPaperSizeSchema.optional(), printHtmlBackgrounds: zod_1.z.boolean().optional(), timeout: zod_1.z.number().positive().optional(), waitFor: exports.waitForSchema.optional(), title: zod_1.z.string().optional(), inputEncoding: zod_1.z.string().optional(), cssMediaType: typeSchema_1.cssMediaTypeSchema.optional(), javascript: zod_1.z.string().optional(), firstPageNumber: zod_1.z.number().optional(), htmlHeader: affixSchema_1.htmlAffixSchema.optional(), htmlFooter: affixSchema_1.htmlAffixSchema.optional(), textHeader: affixSchema_1.textAffixSchema.optional(), textFooter: affixSchema_1.textAffixSchema.optional(), useMarginsOnHeaderAndFooter: typeSchema_1.useMarginsSchema.optional() }); //# sourceMappingURL=renderSchema.js.map