Giter Club home page Giter Club logo

Comments (7)

ssergdev avatar ssergdev commented on September 15, 2024 1

It relates to breaking changes in Typescript 4.6: VisibilityState was renamed to a DocumentVisibilityState. microsoft/TypeScript#47908
As a workaround, you can declare a proxy type somewhere in the custom *.d.ts file:

type VisibilityState = DocumentVisibilityState;

As long as you have "include": ["src/**/*.d.ts"] in your tsconfig.app.json, it will be applied.

from ngx-pinch-zoom.

Myrmex avatar Myrmex commented on September 15, 2024

Thank you, unfortunately I'm using the library in an Angular library project inside my Angular workspace. So I get a compile error while building the library, even before building the main app. I tried to add this to its tsconfig.lib.json:

"include": [
  "src/**/*.d.ts"
]

and then I added typings.d.ts to its src folder with this content:

type VisibilityState = DocumentVisibilityState;

Yet, when I build it I still get TS2304 cannot find VisibilityState.

from ngx-pinch-zoom.

FabianDever avatar FabianDever commented on September 15, 2024

@Myrmex For me it worked, when I put in the folder of the root module (in most cases app/).

edit: I also named the file custom.d.ts

from ngx-pinch-zoom.

prasantht96 avatar prasantht96 commented on September 15, 2024

@FabianDever It worked for me too. I did exactly like you said. Thank you.

from ngx-pinch-zoom.

driiftkiing avatar driiftkiing commented on September 15, 2024

or use this patch:

diff --git a/lib/pinch-zoom.component.d.ts b/lib/pinch-zoom.component.d.ts
index c8fa3f1e46b297d3e6ba7b007aaa83c453fd7350..91c21606d3343d483c90cefe554bcc72eac0cfe9 100644
--- a/lib/pinch-zoom.component.d.ts
+++ b/lib/pinch-zoom.component.d.ts
@@ -50,7 +50,7 @@ export declare class PinchZoomComponent implements OnDestroy {
     autoHeight: boolean;
     wheelZoomFactor: number;
     draggableImage: boolean;
-    get hostOverflow(): VisibilityState;
+    get hostOverflow(): DocumentVisibilityState;
     get hostBackgroundColor(): string;
     get isTouchScreen(): boolean;
     get isDragging(): any;
@@ -76,7 +76,7 @@ export declare class PinchZoomComponent implements OnDestroy {
     getPropertiesValue(propertyName: PropertyName): any;
     getDefaultComponentProperties(): {
         disabled?: boolean;
-        overflow?: VisibilityState;
+        overflow?: DocumentVisibilityState;
         disableZoomControl?: "auto" | "disable" | "never";
         backgroundColor?: string;
         element?: string;

from ngx-pinch-zoom.

olafvanv avatar olafvanv commented on September 15, 2024

I forked the project and published an Angular 14 version of this library on npm, for me this works fine. Feel free to use it, but I'm not gonna maintain the project itself. So use it on your own risk :)

https://www.npmjs.com/package/@olafvv/ngx-pinch-zoom

from ngx-pinch-zoom.

CrackerakiUA avatar CrackerakiUA commented on September 15, 2024

@olafvanv update to angular 15 please :)

from ngx-pinch-zoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.