import { ObjectManager } from "../../ObjectManager"; import { Field, type FieldBaseProperties } from "./Field"; import { type PdfPage } from "../PdfPage"; import { type WidgetAnnotation, type WidgetProperties } from "../Annotations/WidgetAnnotation"; import { type Rect } from "../../Types"; import { CheckStyle } from "../../Enums"; import { BorderStyle } from "../../Enums"; /** * Defines properties of a {@link RadioButtonField}. */ export type RadioButtonFieldProperties = FieldBaseProperties & { type: "radiobutton"; /** * The style of check mark. * * Note: the 'checkStyle' specified for individual widgets in the 'widgets' property * takes precedence and will override this property. */ checkStyle?: CheckStyle; /** * Contains widget objects that represent the selectable options for this radio button. * * Each widget in this list corresponds to one choice in the radio button group, * typically displaying with a distinct visual appearance when selected vs. unselected. */ widgets?: (WidgetAnnotation | WidgetProperties)[]; /** * Indicating whether a group of radio buttons within a radio button field * that use the same value for the on state will turn on and off in unison; * that is if one is checked, they are all checked. * If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons). */ radiosInUnison?: boolean; }; /** * Represents group of radio buttons. */ export declare class RadioButtonField extends Field { /** * Creates a new {@link RadioButtonField}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link RadioButtonField}. */ constructor(om: ObjectManager); /** * Creates a new {@link RadioButtonField}. */ constructor(); /** * Gets or sets an array of strings containing one entry for each widget annotation, * defining export values for its constituent radio buttons. * See the PDF spec for details. */ get opt(): string[] | null; /** * Gets or sets an array of strings containing one entry for each widget annotation, * defining export values for its constituent radio buttons. * See the PDF spec for details. */ set opt(value: string[] | null); /** * Gets or sets a value indicating whether a group of radio buttons within a radio button field * that use the same value for the on state will turn on and off in unison; * that is if one is checked, they are all checked. * If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons). */ get radiosInUnison(): boolean; /** * Gets or sets a value indicating whether a group of radio buttons within a radio button field * that use the same value for the on state will turn on and off in unison; * that is if one is checked, they are all checked. * If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons). */ set radiosInUnison(value: boolean); /** * Creates a new {@link WidgetAnnotation} and adds it to the {@link Field#widgets} collection. * * @param page - The page on which the new {@link WidgetAnnotation} will be placed. * @param bounds - The bounds of the new {@link WidgetAnnotation} on "page". * @param checkStyle - The check mark style. * @param borderStyle - The border style. * @returns Returns the created {@link WidgetAnnotation} object. */ addItem(page: PdfPage, bounds: Rect, checkStyle?: CheckStyle, borderStyle?: BorderStyle): WidgetAnnotation; }