mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add types for react-native-scaled-image (#29397)
* Add types for react-native-scaled-image * Lint fixes
This commit is contained in:
committed by
Wesley Wigham
parent
353934d836
commit
e29dafe1b2
17
types/react-native-scaled-image/index.d.ts
vendored
Normal file
17
types/react-native-scaled-image/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for react-native-scaled-image 0.0
|
||||
// Project: https://github.com/nanlabs/react-native-scaled-image
|
||||
// Definitions by: Matt Jaeger <https://github.com/Jaeger25>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import { ImageSourcePropType, StyleProp, ImageStyle } from 'react-native';
|
||||
|
||||
export interface ScaledImageProps {
|
||||
source: ImageSourcePropType;
|
||||
height?: number;
|
||||
width?: number;
|
||||
style?: StyleProp<ImageStyle>;
|
||||
}
|
||||
|
||||
export default class ScaledImage extends React.Component<ScaledImageProps> {}
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import ScaledImage from 'react-native-scaled-image';
|
||||
|
||||
class Example extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ScaledImage
|
||||
source={require('image.png')}
|
||||
style={{ resizeMode: 'contain' }}
|
||||
width={360} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Example;
|
||||
17
types/react-native-scaled-image/tsconfig.json
Normal file
17
types/react-native-scaled-image/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"jsx": "react-native",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "react-native-scaled-image-tests.tsx"]
|
||||
}
|
||||
1
types/react-native-scaled-image/tslint.json
Normal file
1
types/react-native-scaled-image/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user