/** * Hook to generate or use a stable field ID. * Prefers the provided ID, falling back to a generated one that remains * consistent across re-renders. * * This implementation uses a global counter with `useEffect` for SSR safety: * - Ensures no hydration mismatches between server and client * - Returns undefined during SSR (before useEffect runs) * - Generates stable IDs on the client side using the prefix format * * The hook ensures the ID is only generated once per component instance, * preventing issues with form field associations and accessibility. * * @param providedId - Optional ID provided by the component props * @param prefix - Prefix for the generated ID (e.g., 'rbui-input-field') * @returns A stable field ID string (may be undefined during SSR) * * @example * ```tsx * function MyField({ id, ...props }) { * const controlId = useFieldId(id, 'rbui-my-field'); * * return ( * <> * * * * ); * } * ``` */ export declare function useFieldId(providedId: string | undefined, prefix: string): string | undefined; /** * Reset the global ID counter. Useful for testing environments * where you need predictable IDs across test runs. * * @internal */ export declare function resetIdCounter(): void;