diff --git a/types/react-native-svg-uri/index.d.ts b/types/react-native-svg-uri/index.d.ts new file mode 100644 index 0000000000..60347a78f2 --- /dev/null +++ b/types/react-native-svg-uri/index.d.ts @@ -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 +// 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 { } diff --git a/types/react-native-svg-uri/react-native-svg-uri-tests.tsx b/types/react-native-svg-uri/react-native-svg-uri-tests.tsx new file mode 100644 index 0000000000..21ee0784a5 --- /dev/null +++ b/types/react-native-svg-uri/react-native-svg-uri-tests.tsx @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { View } from 'react-native'; +import SvgUri from 'react-native-svg-uri'; + +const TestSvgUri = () => ( + + + +); diff --git a/types/react-native-svg-uri/tsconfig.json b/types/react-native-svg-uri/tsconfig.json new file mode 100644 index 0000000000..1dd27f80ff --- /dev/null +++ b/types/react-native-svg-uri/tsconfig.json @@ -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" + ] +} diff --git a/types/react-native-svg-uri/tslint.json b/types/react-native-svg-uri/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-svg-uri/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }