import { FormTypes } from '@oneblink/types'; type FormElementWithEditability = FormTypes.FormElement | FormTypes.LookupFormElement; export declare function checkIsFormElementIdEditable(element: FormElementWithEditability, editableFormElementIds?: string[]): boolean; /** * Returns the editable ids to provide while rendering or validating a nested * form. Nested forms get their own whitelist so an id reused by the parent form * cannot unlock a nested element (or vice versa). * * Selecting the nested form itself makes all of its descendants editable. */ export declare function getNestedEditableFormElementIds(formElement: FormTypes.FormFormElement, editableFormElementIds: string[] | undefined): string[] | undefined; /** * Expands a whitelist to cover the elements a lookup has injected into the * form. An element naming an editable id in `injectedByElementId` becomes * editable, as do its descendants, so an approver can correct answers that only * appeared after a lookup they are allowed to re-run. A dynamic element is * included whenever the element it was generated from is editable, since it * sits beside that element rather than within it. * * Only applies to the root whitelist; ids inside a nested form are scoped by * `getNestedEditableFormElementIds`. Returns `undefined` when no whitelist was * provided, matching the “everything is editable” convention used by the rest * of these helpers. */ export declare function expandEditableFormElementIds(editableFormElementIds: string[] | undefined, formElements: FormTypes.FormElement[]): string[] | undefined; /** * Whether this element, or anything nested inside it, can be changed. * * When `editableFormElementIds` is omitted, every element is treated as * editable. When it is provided, only listed ids and containers that wrap them * are editable. Used to skip validating what the user has no way to correct. */ export declare function checkIsFormElementEditable(element: FormElementWithEditability, editableFormElementIds?: string[]): boolean; /** * Whether a form element’s own controls should be locked. * * An id in `editableFormElementIds` always wins. When that list is provided, * every other element is locked (whitelist). Otherwise the whole-form read-only * flag and the element’s own `readOnly` apply. */ export declare function checkIsFormElementReadOnly(element: FormElementWithEditability, { isFormReadOnly, isInheritedReadOnly, editableFormElementIds, }?: { isFormReadOnly?: boolean; isInheritedReadOnly?: boolean; editableFormElementIds?: string[]; }): boolean; /** * Whether lookups (and reverse geocode) must not run for this element. * * Definition `readOnly` and inherited container locks still allow submitter * lookups from prefills, defaults, and chained lookup buttons. Lookups are * blocked on a read-only form, or when a whitelist is provided and this id is * not on it (an approver must not re-run a lookup that could overwrite * persisted answers). An id in the whitelist always wins. */ export declare function checkAreLookupsDisallowed(element: FormElementWithEditability, { isFormReadOnly, editableFormElementIds, }?: { isFormReadOnly?: boolean; editableFormElementIds?: string[]; }): boolean; export {};