You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type used by the polyfill is not compatible with DOMRectReadOnly that is in TypeScript so you can use this this type. (the error when using this type is that toJSON is missing). So the types should use native implementation or export that interface.
I've needed to add type when creating abstract class:
exportabstractclassAbstractResizedBaseimplementsOnInit,OnDestroy{privateobserver: ResizeObserver;constructor(protectedreadonlyelement: ElementRef){}// I need to add type here for param so I've needed to copy paste the interface into my fileprotectedabstractonResize(rect: DOMRectReadOnly): void;publicngOnInit(): void{this.observer=newResizeObserver((entries: ResizeObserverEntry[])=>{const[entry]=entries;this.onResize(entry.contentRect);});this.observer.observe(this.element.nativeElement);}publicngOnDestroy(): void{this.observer.disconnect();}}
The text was updated successfully, but these errors were encountered:
jonastieppo
added a commit
to jonastieppo/resize-observer-polyfill
that referenced
this issue
Jan 27, 2023
This unique line solves the following error when updating for newer TS versions:
Error: node_modules/resize-observer-polyfill/src/index.d.ts:19:18 - error TS2717: Subsequent property declarations must have the same type. Property 'contentRect' must be of type 'DOMRectReadOnly', but here has type 'DOMRectReadOnly'.
It is related with issues que-etc#80, que-etc#53 and que-etc#73.
Type used by the polyfill is not compatible with DOMRectReadOnly that is in TypeScript so you can use this this type. (the error when using this type is that toJSON is missing). So the types should use native implementation or export that interface.
I've needed to add type when creating abstract class:
The text was updated successfully, but these errors were encountered: