UNPKG

931 BTypeScriptView Raw
1import { BeforeEach, EvalScripts } from '@tanem/svg-injector';
2import * as React from 'react';
3interface BaseProps {
4 afterInjection?: (svg: SVGSVGElement) => void;
5 beforeInjection?: BeforeEach;
6 desc?: string;
7 evalScripts?: EvalScripts;
8 fallback?: React.ElementType;
9 httpRequestWithCredentials?: boolean;
10 loading?: React.ElementType;
11 onError?: (error: unknown) => void;
12 renumerateIRIElements?: boolean;
13 src: string;
14 title?: string;
15 useRequestCache?: boolean;
16 wrapper?: 'div' | 'span' | 'svg';
17}
18type HTMLWrapperType = HTMLSpanElement | HTMLDivElement;
19type SVGWrapperType = SVGSVGElement;
20export type WrapperType = HTMLWrapperType | SVGWrapperType;
21export type Props = BaseProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLWrapperType>, HTMLWrapperType> & React.SVGProps<SVGWrapperType>;
22export interface State {
23 hasError: boolean;
24 isLoading: boolean;
25}
26export {};