How to implement validation for custom plugin fields?

In GitHub, I can see that Kirby internally uses an invalid event to validate:

However, I can’t seem to figure out how it works. There’s a thread about that by @timoetting but it appears to cover back-end validation. I’m asking about front-end one? The brand new cookbook recipe by @texnixe regarding custom fields doesn’t seem to cover it as well.

Is there official documentation for how custom field validation should be implemented? My end goal is to add validation for my Link Field and fix this issue.