Comments (7)
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.
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.
@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.
@FabianDever It worked for me too. I did exactly like you said. Thank you.
from ngx-pinch-zoom.
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.
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.
@olafvanv update to angular 15 please :)
from ngx-pinch-zoom.
Related Issues (20)
- dynamically changing image size and/or window resizing does not adjust zoom level restriction on ivy-pinch-pro-1.4.0 HOT 1
- ngOnDestroy() needs the disabled property check HOT 1
- Trying to purchase pro but the Gumroad link is not working HOT 1
- Alternatives to ngx-pinch-zoom? HOT 4
- Angular 15 ? HOT 1
- Iam using angular 16, Then Not install my project,Why HOT 3
- Fullscreen image HOT 1
- Possible disable the drag?
- Zooming in big screens (iPad Pro Retina or similars) HOT 1
- Listener property usage HOT 2
- Event zoom-in and zoom out not working HOT 3
- Angular 11 compatibility HOT 5
- Draggable feature with natural (parent div direction)or image direction HOT 1
- when zooming in to pdf the picture quality is poor
- Angular 12 HOT 14
- Pinching doesn't work with svgs HOT 1
- `npm run build` fails
- the professional version about setZoom method HOT 1
- [limitZoom]="number" not working ivy-pinch-pro-1.4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-pinch-zoom.