Replace typedefs with externs

Since the compiler leaves externs untouched and learns the used
properties from object literals, this replaces the otherwise
required typedefs just fine.
Merge pull request #1971 from ahocevar/externs-instead-of-typedefs

"Cannot read property 'AttributionOptions' of undefined" error