import type { ReactNode } from "react"; import type { UseFormSetValue, UseFormWatch } from "react-hook-form"; import { z } from "zod/v4"; import type { useLegalUiMessagesOrDefault } from "../i18n/index.js"; import { type LegalContractScope } from "../i18n/messages.js"; import type { LegalContractRecord } from "../index.js"; type ContractDialogMessages = ReturnType["contractDialog"]; export declare const contractFormSchema: z.ZodObject<{ scope: z.ZodEnum<{ other: "other"; customer: "customer"; supplier: "supplier"; partner: "partner"; channel: "channel"; }>; title: z.ZodString; contractNumber: z.ZodOptional; language: z.ZodOptional; templateVersionId: z.ZodOptional; seriesId: z.ZodOptional; personId: z.ZodOptional; organizationId: z.ZodOptional; supplierId: z.ZodOptional; channelId: z.ZodOptional; expiresAt: z.ZodOptional; templateVariables: z.ZodArray; example: z.ZodOptional; required: z.ZodDefault; value: z.ZodOptional; booleanValue: z.ZodDefault; includeBooleanValue: z.ZodDefault; }, z.core.$strip>>; additionalVariables: z.ZodArray; value: z.ZodOptional; }, z.core.$strip>>; metadataEntries: z.ZodArray; value: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type FormValues = z.input; export type FormOutput = z.output; export type TemplateVariableRow = FormValues["templateVariables"][number]; export interface LinkedRecordPickerProps { value: string | undefined; onChange: (id: string | undefined) => void; scope: LegalContractScope; } export interface ContractDialogProps { open: boolean; onOpenChange: (open: boolean) => void; contract?: LegalContractRecord; onSuccess: () => void; renderPersonPicker?: (props: LinkedRecordPickerProps) => ReactNode; renderOrganizationPicker?: (props: LinkedRecordPickerProps) => ReactNode; renderSupplierPicker?: (props: LinkedRecordPickerProps) => ReactNode; renderChannelPicker?: (props: LinkedRecordPickerProps) => ReactNode; } export type ComboboxOption = { value: string; label: string; description?: string; }; export declare const languageOptions: ComboboxOption[]; export declare function mergeUniqueOptions(...groups: Array): ComboboxOption[]; export declare function objectToEntries(record: Record | null | undefined): { key: string; value: string; }[]; export declare function parseLooseValue(value: string): any; export declare function buildRecordFromPairs(entries: Array<{ key?: string; value?: string; }>): Record | undefined; export declare function buildVariablesPayload(rows: TemplateVariableRow[], additional: Array<{ key?: string; value?: string; }>): Record | undefined; export declare function clearedOptionalValue(value: string | undefined, isEditing: boolean): string | null | undefined; export declare function parseBooleanFormValue(value: string | undefined): boolean | undefined; export declare function inferTemplateVariableKeys(body: string | null | undefined, requiredKeys: string[]): Set; export declare function SearchableSelect({ value, onChange, options, placeholder, searchPlaceholder, emptyLabel, loadingLabel, loading, disabled, onSearchChange, }: { value: string | null | undefined; onChange: (value: string | null) => void; options: ComboboxOption[]; placeholder: string; searchPlaceholder?: string; emptyLabel: string; loadingLabel: string; loading?: boolean; disabled?: boolean; onSearchChange?: (value: string) => void; }): import("react").JSX.Element; export declare function VariableValueField({ row, index, setValue, watch, messages, }: { row: TemplateVariableRow; index: number; setValue: UseFormSetValue; watch: UseFormWatch; messages: ContractDialogMessages; }): import("react").JSX.Element; export declare function LinkedRecordField({ label, value, scope, onChange, renderPicker, }: { label: string; value: string | null; scope: LegalContractScope; onChange: (id: string | undefined) => void; renderPicker?: (props: LinkedRecordPickerProps) => ReactNode; }): import("react").JSX.Element | null; export {};