1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

chore: Export types for reusable props for Elements

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2023-04-17 11:55:06 +03:00
parent a608ab08ab
commit 934784c588
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -1,5 +1,10 @@
import { ElementFor } from "./element";
import type React from "react";
type PropsByElement<T> = T extends React.ComponentType<infer I> ? I : never;
export const Div = ElementFor<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>("div");
export type DivProps = PropsByElement<typeof Div>;
export const Span = ElementFor<HTMLSpanElement, React.HTMLAttributes<HTMLSpanElement>>("span");
export type SpanProps = PropsByElement<typeof Span>;