/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { Field } from '@byline/core'; /** * Returns a change handler for the given field that runs through the * field-hook pipeline before committing the value: * * 1. `clearFieldError(path)` * 2. `field.hooks.beforeValidate(ctx)` — advisory: may set an error on * the field but the value is **always** committed (user can keep typing) * 3. `field.hooks.beforeChange(ctx)` — may return `{ value }` to replace * or `{ error }` to block the change entirely * 4. `setFieldValue(path, finalValue)` * * When the field has no hooks the function is a zero-overhead pass-through * to `setFieldValue` (no promises, no extra allocations). */ export declare function useFieldChangeHandler(field: Field, path: string): (value: any) => void;