react-svg
Version:
A React component that injects SVG into the DOM.
29 lines • 1.05 kB
text/typescript
import * as React from "react";
import { BeforeEach, EvalScripts } from "@tanem/svg-injector";
//#region src/types.d.ts
interface BaseProps {
afterInjection?: (svg: SVGSVGElement) => void;
beforeInjection?: BeforeEach;
desc?: string;
evalScripts?: EvalScripts;
fallback?: React.ElementType;
httpRequestWithCredentials?: boolean;
loading?: React.ElementType;
loadingDelay?: number;
onError?: (error: unknown) => void;
renumerateIRIElements?: boolean;
src: string;
title?: string;
useRequestCache?: boolean;
wrapper?: 'div' | 'span' | 'svg';
}
type HTMLWrapperType = HTMLSpanElement | HTMLDivElement;
type SVGWrapperType = SVGSVGElement;
type WrapperType = HTMLWrapperType | SVGWrapperType;
type Props = BaseProps & React.HTMLAttributes<HTMLWrapperType> & React.SVGAttributes<SVGWrapperType>;
//#endregion
//#region src/ReactSVG.d.ts
declare const ReactSVG: React.ForwardRefExoticComponent<Props & React.RefAttributes<WrapperType>>;
//#endregion
export { Props, ReactSVG, WrapperType };
//# sourceMappingURL=react-svg.d.cts.map