Closed Delagen closed 6 years ago
Commit with changes 67c7b368e6dd2b5980ea9eafa9b0944459e4eb09
Issue is present in 2.8.0 also. The commit also removes functions that exists in standard. It would be a good idea to redo a full code review on this one.
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.
git under windows produces unpredictable amount of changes, sorry for so many commits. I need to strip changelog to single line
Thanks. Sorry I don,t read carefully instriction, that describe separate process for 2 files
Also methods onbeforeprint
and onafterprint
were moved from Window
into WindowEventHandlers
which isn't related to Window
.
So it's a breaking change in 2.8.
Code
window.onbeforeprint = beforePrint;
window.onafterprint = afterPrint;
start failing to compile:
(533,11): error TS2339: Property 'onbeforeprint' does not exist on type 'Window'.
(534,11): error TS2339: Property 'onafterprint' does not exist on type 'Window'.
Please move them back into Window
.
@evil-shrike please file a new ticket for that one and will get it fixed.
Issue is still present in TypeScript 2.8.1
I use my worskpace TypeScript version which is 2.8.1 instead of VS Code's version (2.7.2).
Issue is still present in TypeScript 2.8.1
yes. the fix is scheduled to be released in 2.8.2
Thanks @mhegazy !
Thanks @mhegazy
@ps04639 You are wrong If you think that author of issue does not read TS docs
(window as any).print(); looks to get around the issue but is still not great as when it creates the js file it resolves to window.print()
I am working on the latest available TypeScript via Nuget and the issue is still present today
@simonprice33 What wrong in you answer, and what you expect?
@simonprice33 I believe at the time of posting this, the latest TS version is 2.8.3. If you are using VSCode (currently ships/updates with 2.8.1) - you can update the TS version to the latest with the command "npm install -g typescript@2.8.3". Follow the voted answer here for more information: Stack Overflow - TS Version
I'm using ts 2.9.1 and still getting this error.
Edit: Intellij is using 2.8.1 internally, which is causing the error. I don't see any way to change which version of typescript it is using internally. I've even told it to use the typescript under node_modules (which is 2.9.1) but the tab on IntelliJ still says "TypeScript 2.8.1".
That said, I am NOT having this issue in 2.9.1
I am using this code snippet to print my PowerBI embedded report using Angular7 and getting following error.
let report = powerbi.get(reportContainer);
//Trigger the print dialog for your browser. report .print() .then(function (result) { console.log(result); }) .catch(function (errors) { console.log(errors); });
Error : [ts] property 'print' does not exist on type 'Embed'
@ChamilaMaddumage try (report as any).print()
and see how you get on
TypeScript Version: 2.8.1
Search Terms:
Code
Expected behavior: No errors.
Actual behavior: TypeScript error missing property print in Window
Playground Link: https://www.typescriptlang.org/play/index.html#src=window.print() Related Issues: