import type { HTMLTagsType } from '@intlayer/core/transpiler'; import type { Component } from 'svelte'; /** * Helper to extract specific props from the configuration value. */ type PropsFromConfig = Value extends true ? {} : Value extends object ? Value : {}; /** * Common props for all elements */ type ElementProps = Record; /** * Svelte Component type */ type SvelteComponentType

= Component

; /** * Helper: Defines the mapping for the explicitly listed keys in T. * Handles whether they are Required or Optional. */ type DefinedComponents = IsRequired extends true ? { [K in keyof T]: SvelteComponentType>; } : { [K in keyof T]?: SvelteComponentType>; }; /** * Helper: Defines the standard HTML tags NOT listed in T. * These are always optional when included. */ type RestHTMLComponents = { [K in Exclude]?: SvelteComponentType; }; /** * The supported modes for the HTMLComponents type. */ export type HTMLComponentMode = 'permissive' | 'optional' | 'inclusive' | 'strict'; /** * The main component definition with Mode support. */ export type HTMLComponents = Mode extends 'strict' ? DefinedComponents : Mode extends 'inclusive' ? // Inclusive: Keys in T are required. Rest of HTML is optional. DefinedComponents & RestHTMLComponents : Mode extends 'permissive' ? // Permissive: Keys in T optional. Rest of HTML optional. Any other string allowed. DefinedComponents & RestHTMLComponents & { [key: string]: SvelteComponentType; } : // Optional (Default): Keys in T optional. Rest of HTML optional. DefinedComponents & RestHTMLComponents; export {};