import { d as FieldType, w as PdfStream } from "./pdfForm-Ca86NDWn.mjs"; //#region src/form/fieldAppearance.d.ts /** * A typed function that generates an appearance stream for a specific * field type. Use this as a callback type when providing custom * appearance generators. * * ```ts * const myTextProvider: AppearanceProviderFor<'text'> = (opts) => { * // custom rendering logic * return myStream; * }; * ``` */ type AppearanceProviderFor = T extends "text" ? (options: TextAppearanceOptions) => PdfStream : T extends "checkbox" ? (options: CheckboxAppearanceOptions) => PdfStream : T extends "radio" ? (options: RadioAppearanceOptions) => PdfStream : T extends "dropdown" ? (options: DropdownAppearanceOptions) => PdfStream : T extends "listbox" ? (options: ListboxAppearanceOptions) => PdfStream : T extends "button" ? (options: ButtonAppearanceOptions) => PdfStream : T extends "signature" ? (options: SignatureAppearanceOptions) => PdfStream : never; /** Options for generating a text field appearance. */ interface TextAppearanceOptions { /** The text value to render. */ value: string; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; /** Font name to use (e.g. "Helv"). Default: "Helv". */ fontName?: string | undefined; /** Font size in points. 0 means auto-size. Default: 0. */ fontSize?: number | undefined; /** Text alignment: 0=left, 1=center, 2=right. Default: 0. */ alignment?: number | undefined; /** Whether the field is multiline. Default: false. */ multiline?: boolean | undefined; /** Border width in points. Default: 1. */ borderWidth?: number | undefined; } /** * Generate the appearance stream for a text field. * * The stream renders the text value within the widget rectangle, * using Tf/Td/Tj operators. Handles single-line and multiline, * alignment (quadding), and auto font-size calculation. */ declare function generateTextAppearance(options: TextAppearanceOptions): PdfStream; /** Options for generating a checkbox appearance. */ interface CheckboxAppearanceOptions { /** Whether the checkbox is checked. */ checked: boolean; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; } /** * Generate the appearance stream for a checkbox — checked state. * * Renders a checkmark (a simple cross/tick path) inside the widget * rectangle when checked, or an empty box when unchecked. */ declare function generateCheckboxAppearance(options: CheckboxAppearanceOptions): PdfStream; /** Options for generating a radio button appearance. */ interface RadioAppearanceOptions { /** Whether this radio option is selected. */ selected: boolean; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; } /** * Generate the appearance stream for a radio button option. * * Selected: filled circle inside the widget. * Unselected: empty circle (border only). */ declare function generateRadioAppearance(options: RadioAppearanceOptions): PdfStream; /** Options for generating a dropdown field appearance. */ interface DropdownAppearanceOptions { /** The selected value text. */ value: string; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; /** Font name. Default: "Helv". */ fontName?: string | undefined; /** Font size. 0 means auto. Default: 0. */ fontSize?: number | undefined; } /** * Generate the appearance stream for a dropdown (combo box). * Renders the selected value text, similar to a text field. */ declare function generateDropdownAppearance(options: DropdownAppearanceOptions): PdfStream; /** Options for generating a listbox field appearance. */ interface ListboxAppearanceOptions { /** All option strings. */ options: string[]; /** Currently selected option strings. */ selected: string[]; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; /** Font name. Default: "Helv". */ fontName?: string | undefined; /** Font size. Default: 10. */ fontSize?: number | undefined; } /** * Generate the appearance stream for a listbox. * Renders visible options with highlighting for selected items. */ declare function generateListboxAppearance(options: ListboxAppearanceOptions): PdfStream; /** Options for generating a button field appearance. */ interface ButtonAppearanceOptions { /** The button caption text. */ caption: string; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; /** Font name. Default: "Helv". */ fontName?: string | undefined; /** Font size. Default: 0 (auto). */ fontSize?: number | undefined; } /** * Generate the appearance stream for a pushbutton. * Renders a 3D-ish raised button with centered caption text. */ declare function generateButtonAppearance(options: ButtonAppearanceOptions): PdfStream; /** Options for generating a signature field appearance. */ interface SignatureAppearanceOptions { /** Whether the field has been signed. */ signed: boolean; /** The widget rectangle [x1, y1, x2, y2]. */ rect: [number, number, number, number]; } /** * Generate the appearance stream for a signature field. * * Unsigned: dashed border rectangle. * Signed: "Signed" text with a line through it. */ declare function generateSignatureAppearance(options: SignatureAppearanceOptions): PdfStream; //#endregion export { ListboxAppearanceOptions as a, TextAppearanceOptions as c, generateDropdownAppearance as d, generateListboxAppearance as f, generateTextAppearance as h, DropdownAppearanceOptions as i, generateButtonAppearance as l, generateSignatureAppearance as m, ButtonAppearanceOptions as n, RadioAppearanceOptions as o, generateRadioAppearance as p, CheckboxAppearanceOptions as r, SignatureAppearanceOptions as s, AppearanceProviderFor as t, generateCheckboxAppearance as u }; //# sourceMappingURL=fieldAppearance-_CZdoUCD.d.mts.map