mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Adding type definitions for react-medium-image-zoom (#33911)
* Added type definitions for react-medium-image-zoom * fixes for react-medium-image-zoom * fixes for react-medium-image-zoom
This commit is contained in:
parent
d6a5af9170
commit
ea24e64a67
43
types/react-medium-image-zoom/index.d.ts
vendored
Normal file
43
types/react-medium-image-zoom/index.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
// Type definitions for react-medium-image-zoom 3.0
|
||||
// Project: https://github.com/rpearce/react-medium-image-zoom#readme
|
||||
// Definitions by: James Bellamy <https://github.com/james-ff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.3
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
export interface ImageZoom_Image {
|
||||
src: string;
|
||||
alt?: string;
|
||||
className?: string;
|
||||
style?: object;
|
||||
}
|
||||
|
||||
export interface ImageZoom_ZoomImage {
|
||||
src?: string;
|
||||
alt?: string;
|
||||
className?: string;
|
||||
style?: object;
|
||||
}
|
||||
|
||||
export interface ImageZoomDefaultStyles {
|
||||
zoomContainer?: object;
|
||||
overlay?: object;
|
||||
image?: object;
|
||||
zoomImage?: object;
|
||||
}
|
||||
|
||||
export interface ImageZoomProps {
|
||||
image: ImageZoom_Image;
|
||||
zoomImage?: ImageZoom_ZoomImage;
|
||||
zoomMargin?: number;
|
||||
isZoomed?: boolean;
|
||||
shouldHandleZoom?: () => boolean;
|
||||
shouldReplaceImage?: boolean;
|
||||
shouldRespectMaxDimension?: boolean;
|
||||
defaultStyles?: ImageZoomDefaultStyles;
|
||||
onZoom?: () => object;
|
||||
onUnzoom?: () => object;
|
||||
}
|
||||
|
||||
export default class ImageZoom extends React.Component<ImageZoomProps, any> {}
|
||||
@ -0,0 +1,23 @@
|
||||
import * as React from "react";
|
||||
import ImageZoom from "react-medium-image-zoom";
|
||||
|
||||
const component: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
<ImageZoom
|
||||
image={{
|
||||
src: "https://raw.githubusercontent.com/rpearce/react-medium-image-zoom/master/docs/bridge.jpg",
|
||||
alt: "Golden Gate Bridge",
|
||||
className: "img"
|
||||
}}
|
||||
zoomImage={{
|
||||
src: "https://raw.githubusercontent.com/rpearce/react-medium-image-zoom/master/docs/bridge-big.jpg",
|
||||
alt: "Golden Gate Bridge",
|
||||
className: "img--zoomed"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default component;
|
||||
25
types/react-medium-image-zoom/tsconfig.json
Normal file
25
types/react-medium-image-zoom/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-medium-image-zoom-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-medium-image-zoom/tslint.json
Normal file
1
types/react-medium-image-zoom/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user