1 | import * as React from 'react';
|
2 | declare type Callback = (...args: any[]) => void;
|
3 | export declare type ErrorCallback = (error: Error | FetchError) => void;
|
4 | export declare type LoadCallback = (src: string, isCached: boolean) => void;
|
5 | export declare type PlainObject<T = unknown> = Record<string | number | symbol, T>;
|
6 | export declare type PreProcessorCallback = (code: string) => string;
|
7 | export interface Props extends Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> {
|
8 | baseURL?: string;
|
9 | cacheRequests?: boolean;
|
10 | children?: React.ReactNode;
|
11 | description?: string;
|
12 | fetchOptions?: RequestInit;
|
13 | innerRef?: React.Ref<SVGElement>;
|
14 | loader?: React.ReactNode;
|
15 | onError?: ErrorCallback;
|
16 | onLoad?: LoadCallback;
|
17 | preProcessor?: PreProcessorCallback;
|
18 | src: string;
|
19 | title?: string;
|
20 | uniqueHash?: string;
|
21 | uniquifyIDs?: boolean;
|
22 | }
|
23 | export interface State {
|
24 | content: string;
|
25 | element: React.ReactNode;
|
26 | hasCache: boolean;
|
27 | status: string;
|
28 | }
|
29 | export interface FetchError extends Error {
|
30 | code: string;
|
31 | errno: string;
|
32 | message: string;
|
33 | type: string;
|
34 | }
|
35 | export interface StorageItem {
|
36 | content: string;
|
37 | queue: Callback[];
|
38 | status: string;
|
39 | }
|
40 | export {};
|