import type * as React from 'react'; export const elementMarker = Symbol.for('react-email.element'); export interface ResolvedTailwind { style: React.CSSProperties; className: string | undefined; classProperties: Record; } export interface ElementOptions { resolveTailwind?: (props: Props, resolved: ResolvedTailwind) => Props; } export const markAsElement = ( component: unknown, options: ElementOptions = {}, ) => { (component as Record>)[elementMarker] = options; }; export const getElementOptions = ( type: unknown, ): ElementOptions | undefined => { if (typeof type !== 'function' && typeof type !== 'object') return undefined; if (type === null) return undefined; return (type as Record)[elementMarker]; };