Because according to TS DOM typings, write
only exists on Document
type.
Maybe it worth updating TS version, maybe not)
There is one fast workaround:
let doc = (this.iframe.contentDocument || this.iframe.contentWindow) as Document;
Please, double check if write
method exists in case this.iframe.contentDocument === null // true