@importcsv/react 0.2.10 → 0.2.11
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.
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// TypeScript type shim to bridge Preact and React types
|
|
2
|
+
// This allows Preact code to use React type definitions
|
|
3
|
+
// Based on HelloCSV's approach: https://github.com/HelloCSV/HelloCSV
|
|
4
|
+
|
|
5
|
+
// Declare that Preact modules export React types
|
|
6
|
+
declare module '../../react' {
|
|
7
|
+
export * from 'react';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module './react-hooks-shim.js' {
|
|
11
|
+
export * from 'react';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module './react-compat-shim.js' {
|
|
15
|
+
export * from 'react';
|
|
16
|
+
export { createPortal } from 'react-dom';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '../../react/jsx-runtime' {
|
|
20
|
+
export * from 'react/jsx-runtime';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare module '../../react/jsx-dev-runtime' {
|
|
24
|
+
export * from 'react/jsx-dev-runtime';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Type augmentations to handle Preact-specific types
|
|
28
|
+
declare module '../../react' {
|
|
29
|
+
import type { ReactNode, ReactElement } from 'react';
|
|
30
|
+
|
|
31
|
+
// Map Preact's ComponentChildren to React's ReactNode
|
|
32
|
+
export interface ComponentChildren extends ReactNode {}
|
|
33
|
+
|
|
34
|
+
// Ensure VNode is compatible with ReactElement
|
|
35
|
+
export interface VNode extends ReactElement {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Extend global JSX namespace to include React types
|
|
39
|
+
declare global {
|
|
40
|
+
namespace JSX {
|
|
41
|
+
// Import React's JSX types
|
|
42
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
43
|
+
interface Element extends React.ReactElement {}
|
|
44
|
+
interface ElementClass extends React.Component<any> {}
|
|
45
|
+
interface ElementAttributesProperty extends React.Component<any> {}
|
|
46
|
+
interface ElementChildrenAttribute extends React.Component<any> {}
|
|
47
|
+
|
|
48
|
+
// HTML attribute interfaces
|
|
49
|
+
interface HTMLAttributes<T> extends React.HTMLAttributes<T> {}
|
|
50
|
+
interface SVGAttributes<T> extends React.SVGAttributes<T> {}
|
|
51
|
+
interface DOMAttributes<T> extends React.DOMAttributes<T> {}
|
|
52
|
+
interface CSSProperties extends React.CSSProperties {}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Make common React types globally available for files that use them without imports
|
|
57
|
+
declare global {
|
|
58
|
+
type ReactElement = React.ReactElement;
|
|
59
|
+
type ReactNode = React.ReactNode;
|
|
60
|
+
type PropsWithChildren<P = {}> = P & { children?: React.ReactNode };
|
|
61
|
+
type ComponentChildren = React.ReactNode;
|
|
62
|
+
type FunctionComponent<P = {}> = React.FC<P>;
|
|
63
|
+
type FC<P = {}> = React.FC<P>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Export to make this a module
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Treat CSS Modules as class maps
|
|
2
|
+
declare module '*.module.css' {
|
|
3
|
+
const classes: { readonly [className: string]: string };
|
|
4
|
+
export default classes;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Non-module styles are plain strings
|
|
8
|
+
declare module '*.css' {
|
|
9
|
+
const content: string;
|
|
10
|
+
export default content;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@importcsv/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "AI-powered CSV importer for React. Smart column mapping with OpenAI, natural language transformations. Self-hosted.",
|
|
5
5
|
"main": "build/react/index.js",
|
|
6
6
|
"module": "build/react/index.esm.js",
|