import type * as Extend from "../index"; /** * Schema definition for a field to edit in a PDF. This is a union type that supports: * * `EditStringJSONSchema` - type: ["string", "null"], field_type: "text" | "signature" * * `EditNumberJSONSchema` - type: ["number", "null"], field_type: "text" * * `EditIntegerJSONSchema` - type: ["integer", "null"], field_type: "text" * * `EditBooleanJSONSchema` - type: ["boolean", "null"], field_type: "checkbox" | "radio" * * `EditArrayJSONSchema` - type: "array", field_type: "text" | "table" * * `EditEnumJSONSchema` - has enum property (no type field), field_type: "radio" | "optionList" | "dropdown" * * `EditObjectJSON` - type: "object", field_type: "signature" * * All variants share common `extend_edit:*` properties for positioning and styling. */ export interface EditJson { /** * The JSON schema type of the field. Can be: * * A string: "array" or "object" * * A nullable tuple array: ["string", "null"], ["number", "null"], ["integer", "null"], ["boolean", "null"] * * Omitted for enum fields (use enum property instead) */ type?: unknown; /** Description of the field */ description?: string; /** * The PDF field type to edit. Allowed values depend on the schema type: * * `["string", "null"]` → `text`, `signature` * * `["number", "null"]` → `text` * * `["integer", "null"]` → `text` * * `["boolean", "null"]` → `checkbox`, `radio` * * `"array"` → `text`, `table` * * `"object"` → `signature` * * enum fields (no type) → `radio`, `optionList`, `dropdown` */ "extend_edit:field_type"?: Extend.EditJsonExtendEditFieldType; "extend_edit:bbox"?: Extend.EditBoundingBox; /** Array of bounding boxes for radio enums. Enum at index i corresponds to bbox at index i. */ "extend_edit:bboxes"?: Extend.EditBoundingBox[]; /** Zero-based page index where the field should be placed */ "extend_edit:page_index"?: number; "extend_edit:text_edit_options"?: Extend.EditTextOptions; /** Width of the column as a percentage (for table fields) */ "extend_edit:column_width"?: number; /** The value to fill into this field. Can be any type. This will force the value at this field to be filled with this value. If a value is not provided, we will attempt to generate or infer one based on the instructions. */ "extend_edit:value"?: unknown; /** Image fill for signature fields. Only PNG and JPEG image URLs are supported. */ "extend_edit:image"?: Extend.EditJsonExtendEditImage; /** Array of row height percentages for array/table fields (e.g. [0.25, 0.50, 0.25]) */ "extend_edit:row_heights"?: number[]; /** Schema for array items (when type is "array"). Must be an EditObjectJSON. */ items?: Extend.EditObjectJson; /** Nested properties for object types. Each property follows the EditJSON structure. */ properties?: Record; /** Allowed values for enum/dropdown/radio fields */ enum?: string[]; /** Maximum number of rows for array/table fields */ maxItems?: number; /** List of required property names (for object types) */ required?: string[]; /** Whether additional properties are allowed (for object types) */ additionalProperties?: boolean; }