esm,doc: fix custom loader hook snippet typings
Prior to this commit, the type annotations on these hooks were invalid. This has been corrected and is ensured to be compatible with both the TypeScript and Closure type systems.
Checklist
-
tests and/or benchmarks are included (out of band) -
documentation is changed or added -
commit message follows commit guidelines