mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
react-inlinesvg: Provides its own types (#39511)
This commit is contained in:
committed by
Jesse Trinity
parent
5506a0641c
commit
acc059b488
@@ -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",
|
||||
|
||||
Vendored
-40
@@ -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>;
|
||||
@@ -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 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user