fix(types): support beforeload listener signature in TypeScript defs (#1149)