/** * 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 { ReactNode } from 'react'; /** * Establishes one DOM id scope. `FormProvider` wraps its children in this, so a * scope exists wherever form state does and no caller has to opt in. */ export declare const FormDomScopeProvider: ({ children }: { children: ReactNode; }) => ReactNode; /** * The active scope, or `''` when rendered outside a form. Field widgets are also * composed directly by the admin user and role screens, which have no * `FormProvider`, so an absent scope degrades to the unprefixed id rather than * throwing. */ export declare function useFormDomScope(): string; /** * Scope a derived DOM id. * * A caller-supplied `id` is returned untouched: it is the author's identifier, it * may already be referenced from outside the form, and scoping it would break that * reference as well as double-prefix ids that pass through here twice. * * The result is a valid HTML id and a valid `for` / `aria-*` reference, but React's * generated scope contains characters that need escaping in a CSS selector. Resolve * these with `document.getElementById`, not `querySelector('#…')`. */ export declare function useScopedDomId(base: string, explicit?: string): string;