mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 05:20:24 +08:00
react-native-photo-view initial commit (#24812)
This commit is contained in:
committed by
Mohamed Hegazy
parent
6a9edddf73
commit
6fda8a5f9d
30
types/react-native-photo-view/index.d.ts
vendored
Normal file
30
types/react-native-photo-view/index.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// Type definitions for react-native-photo-view 1.5
|
||||
// Project: https://github.com/alwx/react-native-photo-view
|
||||
// Definitions by: Christian Chown <https://github.com/christianchown>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from 'react';
|
||||
import { ImagePropertiesSourceOptions, ViewProperties } from 'react-native';
|
||||
|
||||
export interface ReactNativePhotoViewProps {
|
||||
source?: ImagePropertiesSourceOptions;
|
||||
loadingIndicatorSource?: ImagePropertiesSourceOptions;
|
||||
fadeDuration?: number;
|
||||
minimumZoomScale?: number;
|
||||
maximumZoomScale?: number;
|
||||
showsHorizontalScrollIndicator?: boolean;
|
||||
showsVerticalScrollIndicator?: boolean;
|
||||
scale?: number;
|
||||
androidZoomTransitionDuration?: number;
|
||||
androidScaleType?: 'center' | 'centerCrop' | 'centerInside' | 'fitCenter' | 'fitStart' | 'fitEnd' | 'fitXY';
|
||||
onLoadStart?: () => void;
|
||||
onLoad?: () => void;
|
||||
onLoadEnd?: () => void;
|
||||
onProgress?: (loaded: number, total: number) => void;
|
||||
onTap?: (point: {x: number, y: number}, target?: React.ReactElement<any>) => void;
|
||||
onViewTap?: (point: {x: number, y: number}, target?: React.ReactElement<any>) => void;
|
||||
onScale?: (scale: number, target?: React.ReactElement<any>) => void;
|
||||
}
|
||||
|
||||
export default class ReactNativePhotoView extends React.Component<ReactNativePhotoViewProps & ViewProperties> {}
|
||||
@@ -0,0 +1,38 @@
|
||||
import * as React from 'react';
|
||||
import ReactNativePhotoView from 'react-native-photo-view';
|
||||
|
||||
const test: React.SFC = () => (
|
||||
<ReactNativePhotoView
|
||||
source={{uri: 'https://assets-cdn.github.com/images/modules/logos_page/GitHub-Logo.png'}}
|
||||
loadingIndicatorSource={{uri: 'https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png'}}
|
||||
fadeDuration={100}
|
||||
minimumZoomScale={0}
|
||||
maximumZoomScale={1}
|
||||
showsHorizontalScrollIndicator={true}
|
||||
showsVerticalScrollIndicator={true}
|
||||
scale={0.5}
|
||||
androidZoomTransitionDuration={1000}
|
||||
androidScaleType="center"
|
||||
onLoadStart={() => {
|
||||
console.log('onLoadStart');
|
||||
}}
|
||||
onLoad={() => {
|
||||
console.log('onLoad');
|
||||
}}
|
||||
onLoadEnd={() => {
|
||||
console.log('onLoadEnd');
|
||||
}}
|
||||
onProgress={(loaded: number, total: number) => {
|
||||
console.log(`onProgress ${loaded}/${total}`);
|
||||
}}
|
||||
onTap={(point: {x: number; y: number}, target?: React.ReactElement<any>) => {
|
||||
console.log('onTap');
|
||||
}}
|
||||
onViewTap={(point: {x: number; y: number}, target?: React.ReactElement<any>) => {
|
||||
console.log(`onViewTap ${point.x},${point.y} ${!!target ? 'targetted' : ''}`);
|
||||
}}
|
||||
onScale={(scale: number, target?: React.ReactElement<any>) => {
|
||||
console.log(`onScale ${scale} ${!!target ? 'targetted' : ''}`);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
24
types/react-native-photo-view/tsconfig.json
Normal file
24
types/react-native-photo-view/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react-native",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-photo-view-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-native-photo-view/tslint.json
Normal file
1
types/react-native-photo-view/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user