react-inlinesvg 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -19
- package/esm/helpers.d.ts +6 -1
- package/esm/helpers.js +28 -8
- package/esm/helpers.js.map +1 -1
- package/esm/index.d.ts +9 -7
- package/esm/index.js +79 -95
- package/esm/index.js.map +1 -1
- package/esm/types.d.ts +2 -3
- package/lib/helpers.d.ts +6 -1
- package/lib/helpers.js +31 -10
- package/lib/helpers.js.map +1 -1
- package/lib/index.d.ts +9 -7
- package/lib/index.js +96 -107
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +2 -3
- package/package.json +57 -57
- package/src/helpers.ts +35 -7
- package/src/index.tsx +152 -160
- package/src/types.ts +2 -3
package/src/types.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type Callback = (...args: any[]) => void;
|
|
4
|
-
|
|
5
3
|
export type ErrorCallback = (error: Error | FetchError) => void;
|
|
6
4
|
export type LoadCallback = (src: string, isCached: boolean) => void;
|
|
5
|
+
export type PlainObject<T = unknown> = Record<string | number | symbol, T>;
|
|
7
6
|
export type PreProcessorCallback = (code: string) => string;
|
|
8
7
|
|
|
9
8
|
export interface Props extends Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> {
|
|
@@ -11,6 +10,7 @@ export interface Props extends Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onEr
|
|
|
11
10
|
cacheRequests?: boolean;
|
|
12
11
|
children?: React.ReactNode;
|
|
13
12
|
description?: string;
|
|
13
|
+
fetchOptions?: RequestInit;
|
|
14
14
|
innerRef?: React.Ref<SVGElement>;
|
|
15
15
|
loader?: React.ReactNode;
|
|
16
16
|
onError?: ErrorCallback;
|
|
@@ -38,6 +38,5 @@ export interface FetchError extends Error {
|
|
|
38
38
|
|
|
39
39
|
export interface StorageItem {
|
|
40
40
|
content: string;
|
|
41
|
-
queue: Callback[];
|
|
42
41
|
status: string;
|
|
43
42
|
}
|