import { ERROR_TYPES } from '../../errors'; import { Field, FieldGetValue, FieldId, FieldsHookApi, FieldType, OptionsVisibility } from './field-api'; import { ValidationError, MultipleAppsConflict, UnregisteredFieldError } from './errors'; import { ScreenTab, ScreenTabId, ScreenTabsHookApi } from './screen-tab-api'; export declare type HookApi = FieldsHookApi & Partial; export interface ReceivedFieldData { value: FIELD_VALUE; description: string; fieldId: FieldId; fieldType: FieldType; fieldName: string; isVisible: boolean; isReadOnly: boolean; isRequired: boolean; optionsVisibility?: OptionsVisibility; } export declare type ReceivedFormData = Record>; export interface ReceivedScreenTabData { id: ScreenTabId; isVisible: boolean; isActive: boolean; } export declare type ReceivedScreenTabsData = ReceivedScreenTabData[]; export interface FieldChanges { description?: string; fieldName?: string; isVisible?: boolean; isRequired?: boolean; value?: unknown; isReadOnly?: boolean; optionsVisibility?: OptionsVisibility; } export interface ScreenTabChanges { id: ScreenTabId; isVisible: boolean; isActive: boolean; } export declare type FormChanges = Partial>; export declare type ScreenTabsChanges = ScreenTabChanges[]; export declare type UiModification = { id: string; data?: string; }; export declare type UniqueId = string; export declare type SubscribeToChangesCallbackPayload = { changedFieldId: FieldId; changeId: UniqueId; currentFormState: ReceivedFormData; currentScreenTabsState?: ReceivedScreenTabsData; uiModifications: UiModification[]; }; export declare type GetOnInitData = { currentFormState: ReceivedFormData; currentScreenTabsState?: ReceivedScreenTabsData; }; declare type BridgeError = (typeof ERROR_TYPES)[number]; export declare type SubscribeToErrorsCallbackPayload = { errors: (ValidationError | UnregisteredFieldError | MultipleAppsConflict)[]; }; export declare type ErrorCallback = (payload: SubscribeToErrorsCallbackPayload) => void; export declare type PublicFeatureFlags = Record; export interface UiModificationsInternalAPI { data: { onInitChangeId: UniqueId; uiModifications: UiModification[]; }; actions: { getOnInitData: () => Promise; submit: (payload: { fieldsChanges: FormChanges; screenTabsChanges: ScreenTabsChanges; changeId: UniqueId; }) => Promise; registerFields: (payload: { fields: Array; changeId: UniqueId; }) => Promise; subscribeToChanges: (callback: (payload: SubscribeToChangesCallbackPayload) => void) => Promise; onBridgeError?: (payload: { error: BridgeError; changeId?: UniqueId; cause: unknown; }) => void; subscribeToErrors?: (callback: ErrorCallback) => void; }; } export { FieldId, Field, FieldType, ScreenTabId, ScreenTab }; //# sourceMappingURL=index.d.ts.map