mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #17596 from iRoachie/master
Added definitions for react-native-svg-uri
This commit is contained in:
40
types/react-native-svg-uri/index.d.ts
vendored
Normal file
40
types/react-native-svg-uri/index.d.ts
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// Type definitions for react-native-svg-uri 1.2
|
||||
// Project: https://github.com/matiascba/react-native-svg-uri#readme
|
||||
// Definitions by: Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from 'react';
|
||||
import { ImageURISource } from 'react-native';
|
||||
|
||||
export interface SvgUriProps {
|
||||
/**
|
||||
* The width of the rendered svg
|
||||
*/
|
||||
width?: number | string;
|
||||
|
||||
/**
|
||||
* The height of the rendered svg
|
||||
*/
|
||||
height?: number | string;
|
||||
|
||||
/**
|
||||
* Source path for the .svg file
|
||||
* Expects a require('path') to the file or object with uri.
|
||||
* e.g. source={require('my-path')}
|
||||
* e.g. source={{ur: 'my-path'}}
|
||||
*/
|
||||
source?: ImageURISource;
|
||||
|
||||
/**
|
||||
* Direct svg code to render. Similar to inline svg
|
||||
*/
|
||||
svgXmlData?: string;
|
||||
|
||||
/**
|
||||
* Fill color for the svg object
|
||||
*/
|
||||
fill?: string;
|
||||
}
|
||||
|
||||
export default class SvgUri extends React.Component<SvgUriProps, {}> { }
|
||||
13
types/react-native-svg-uri/react-native-svg-uri-tests.tsx
Normal file
13
types/react-native-svg-uri/react-native-svg-uri-tests.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import SvgUri from 'react-native-svg-uri';
|
||||
|
||||
const TestSvgUri = () => (
|
||||
<View>
|
||||
<SvgUri
|
||||
width="200"
|
||||
height="200"
|
||||
source={{ uri: 'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg' }}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
23
types/react-native-svg-uri/tsconfig.json
Normal file
23
types/react-native-svg-uri/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react-native"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-svg-uri-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-native-svg-uri/tslint.json
Normal file
1
types/react-native-svg-uri/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user