import { PdfDictionary } from '../../core/objects/pdf-dictionary.js'; import { PdfArray } from '../../core/objects/pdf-array.js'; import { PdfString } from '../../core/objects/pdf-string.js'; import { PdfObjectReference } from '../../core/objects/pdf-object-reference.js'; import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js'; import { PdfFont } from '../../fonts/pdf-font.js'; import type { FontFamily } from '../../fonts/font-family.js'; import { PdfStream } from '../../core/objects/pdf-stream.js'; import { PdfWidgetAnnotation } from '../../annotations/pdf-widget-annotation.js'; import type { PdfFieldType } from './types.js'; import { PdfFormFieldFlags } from './pdf-form-field-flags.js'; import { PdfDefaultResourcesDictionary } from '../../annotations/pdf-default-resources.js'; import type { PdfAcroForm } from '../pdf-acro-form.js'; import { PdfFieldActions } from '../js/pdf-field-actions.js'; import { PdfJavaScriptAction } from '../js/pdf-javascript-action.js'; /** * Abstract base form field class. Extends PdfWidgetAnnotation with form-specific properties: * FT, V, DA, Ff, T (name), field hierarchy (parent/children/siblings). * Subclasses must implement generateAppearance(). */ export declare abstract class PdfFormField extends PdfWidgetAnnotation { defaultGenerateAppearance: boolean; /** Raw markdown string set by markdownValue; cleared by setRawValue. */ protected _markdownValue?: string; private _fontFamily?; /** @internal */ _form?: PdfAcroForm; constructor(other?: PdfIndirectObject | { form?: PdfAcroForm; }); set form(f: PdfAcroForm); static getFieldType(other: PdfIndirectObject): 'Btn' | 'Sig' | 'Tx' | 'Ch' | null; static create(other?: PdfIndirectObject): PdfFormField; get parent(): PdfFormField | undefined; set parent(field: PdfFormField | PdfIndirectObject | undefined); get children(): PdfFormField[]; set children(fields: PdfFormField[]); get siblings(): PdfFormField[]; get font(): PdfFont | null; get defaultResources(): PdfDefaultResourcesDictionary | null; set defaultResources(resources: PdfDefaultResourcesDictionary | null); /** * Builds a Resources dictionary containing the font entry for `fontName`, * resolved from DR (handling indirect references) or from a loaded font. * Returns undefined if neither source provides the font. */ buildFontResources(fontName: string): PdfDictionary | undefined; /** * Like buildFontResources but includes multiple font names (regular + * variant fonts) in a single Resources/Font dictionary. Falls through to * buildFontResources when only one name is provided. */ buildAllFontResources(fontNames: string[]): PdfDictionary | undefined; get fieldType(): PdfFieldType | null; set fieldType(type: PdfFieldType | null); get name(): string; set name(name: string); get defaultValue(): string; set defaultValue(val: string); get onStates(): string[]; get onState(): string | null; set onState(state: string); get value(): string; protected setRawValue(val: string | PdfString): void; updateAppearance(cache?: Set): void; set value(val: string | PdfString); get markdownValue(): string | undefined; set markdownValue(val: string); get fontSize(): number | null; set fontSize(size: number); get fontName(): string | null; set fontName(fontName: string); set font(font: PdfFont | null); private _embedFontInDR; get fontFamily(): FontFamily | null; set fontFamily(family: FontFamily | null); get fontVariantNames(): { bold?: string; italic?: string; boldItalic?: string; }; protected get resolvedVariantFonts(): { bold?: PdfFont; italic?: PdfFont; boldItalic?: PdfFont; }; get flags(): PdfFormFieldFlags; set flags(v: PdfFormFieldFlags); get readOnly(): boolean; set readOnly(v: boolean); get required(): boolean; set required(v: boolean); get multiline(): boolean; set multiline(v: boolean); get password(): boolean; set password(v: boolean); get comb(): boolean; get combField(): boolean; set combField(v: boolean); get combo(): boolean; set combo(v: boolean); get radio(): boolean; set radio(v: boolean); get noToggleToOff(): boolean; set noToggleToOff(v: boolean); get noExport(): boolean; set noExport(v: boolean); get pushButton(): boolean; set pushButton(v: boolean); get edit(): boolean; set edit(v: boolean); get sort(): boolean; set sort(v: boolean); get multiSelect(): boolean; set multiSelect(v: boolean); get doNotSpellCheck(): boolean; set doNotSpellCheck(v: boolean); get doNotScroll(): boolean; set doNotScroll(v: boolean); get commitOnSelChange(): boolean; set commitOnSelChange(v: boolean); get quadding(): number; set quadding(q: number); get defaultAppearance(): string | null; set defaultAppearance(da: string); get maxLen(): number | null; set maxLen(maxLen: number | null); get kids(): PdfArray | undefined; set kids(kids: PdfObjectReference[]); private _resolveActionDict; get actions(): PdfFieldActions | null; get activateAction(): PdfJavaScriptAction | null; abstract generateAppearance(options?: { makeReadOnly?: boolean; textYOffset?: number; onStateName?: string; }): boolean; set appearanceStream(stream: PdfIndirectObject | { [key: string]: PdfIndirectObject; }); set downAppearanceStream(stream: PdfIndirectObject | { [key: string]: PdfIndirectObject; }); get appearanceState(): string | null; set appearanceState(state: string | null); /** * Returns the list of appearance state names from the normal appearance * dictionary (e.g. ["Yes", "Off"] for a checkbox). */ get appearanceStates(): ReadonlyArray; getAppearanceStream(setting?: string): PdfIndirectObject | null; hasAppearanceStream(setting: string): boolean; private static _fallbackCtor?; private static _registry; static registerFieldType(ft: 'Sig' | 'Btn' | 'Tx' | 'Ch', ctor: new (other?: PdfIndirectObject) => PdfFormField, options?: { fallback?: boolean; }): void; } /** Backward compatible alias */ export { PdfFormField as PdfAcroFormField };