react-inlinesvg: Provides its own types (#39511)

This commit is contained in:
Alexander T
2019-10-28 10:12:43 -07:00
committed by Jesse Trinity
parent 5506a0641c
commit acc059b488
5 changed files with 6 additions and 85 deletions
+6
View File
@@ -3090,6 +3090,12 @@
"sourceRepoURL": "https://www.npmjs.com/package/react-icons",
"asOfVersion": "3.0.0"
},
{
"libraryName": "react-inlinesvg",
"typingsPackageName": "react-inlinesvg",
"sourceRepoURL": "https://github.com/gilbarbara/react-inlinesvg#readme",
"asOfVersion": "1.0.0"
},
{
"libraryName": "react-intl",
"typingsPackageName": "react-intl",
-40
View File
@@ -1,40 +0,0 @@
// Type definitions for react-inlinesvg 0.8
// Project: https://github.com/gilbarbara/react-inlinesvg#readme
// Definitions by: MyCrypto <https://github.com/MyCryptoHQ>, Nick <https://github.com/nickmccurdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { ComponentType, ReactNode } from 'react';
export interface RequestError extends Error {
isHttpError: boolean;
status: number;
}
export interface InlineSVGError extends Error {
name: 'InlineSVGError';
isSupportedBrowser: boolean;
isConfigurationError: boolean;
isUnsupportedBrowserError: boolean;
message: string;
}
export interface Props {
baseURL?: string;
cacheGetRequests?: boolean;
children?: ReactNode;
className?: string;
preloader?: ReactNode;
src: URL | string;
style?: object;
uniqueHash?: string;
uniquifyIDs?: boolean;
onError?(error: RequestError | InlineSVGError): void;
onLoad?(src: URL | string, isCached: boolean): void;
processSVG?(svgText: string): string;
supportTest?(): void;
wrapper?(): ReactNode;
}
declare const InlineSVG: ComponentType<Props>;
export default InlineSVG;
@@ -1,19 +0,0 @@
import * as React from "react";
import SVG from 'react-inlinesvg';
function Loader() {
return null;
}
function myOnLoadHandler(src: string | URL) {
}
<SVG
src="/path/to/myfile.svg"
preloader={<Loader />}
onLoad={(src) => {
myOnLoadHandler(src);
}}
>
<img src="/path/to/myfile.png" />
</SVG>;
-25
View File
@@ -1,25 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"react-inlinesvg-tests.tsx"
]
}
-1
View File
@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }