Created
February 10, 2022 09:40
-
-
Save stefanopascazi/e7e37f1671034e406b197a15ce2e3c39 to your computer and use it in GitHub Desktop.
Declaration file for React web components created by stencil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JSX as LocalJSX } from "@stencil/core"; | |
import { DetailedHTMLProps, HTMLAttributes } from 'react'; | |
type StencilProps<T> = { | |
[P in keyof T]?: Omit<T[P], 'ref'>; | |
}; | |
type ReactProps<T> = { | |
[P in keyof T]?: DetailedHTMLProps<HTMLAttributes<T[P]>, T[P]>; | |
}; | |
type StencilToReact<T = LocalJSX.IntrinsicElements, U = HTMLElementTagNameMap> = StencilProps<T> & | |
ReactProps<U>; | |
declare global { | |
export namespace JSX { | |
interface IntrinsicElements extends StencilToReact {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment