UNPKG

1.68 kBTypeScriptView Raw
1import 'react';
2import { Interpolation } from "./@emotion-react-node_modules-@emotion-serialize-types-index";
3import { Theme } from "./@emotion-react-types-index";
4type WithConditionalCSSProp<P> = 'className' extends keyof P ? string extends P['className' & keyof P] ? {
5 css?: Interpolation<Theme>;
6} : {} : {};
7// unpack all here to avoid infinite self-referencing when defining our own JSX namespace
8type ReactJSXElement = JSX.Element;
9type ReactJSXElementClass = JSX.ElementClass;
10type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
11type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
12type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
13type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
14type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
15type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
16export namespace EmotionJSX {
17 interface Element extends ReactJSXElement {
18 }
19 interface ElementClass extends ReactJSXElementClass {
20 }
21 interface ElementAttributesProperty extends ReactJSXElementAttributesProperty {
22 }
23 interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {
24 }
25 type LibraryManagedAttributes<C, P> = WithConditionalCSSProp<P> & ReactJSXLibraryManagedAttributes<C, P>;
26 interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {
27 }
28 interface IntrinsicClassAttributes<T> extends ReactJSXIntrinsicClassAttributes<T> {
29 }
30 type IntrinsicElements = {
31 [K in keyof ReactJSXIntrinsicElements]: ReactJSXIntrinsicElements[K] & {
32 css?: Interpolation<Theme>;
33 };
34 };
35}
\No newline at end of file