/** * Svelte template typings for `hb-card-video` (`SvelteHTMLElements`). * — Host attributes from `Component` (optional strings). * — Custom events from `Events`: `on` + event key, optional `capture` suffix, or quoted `'on:'` + key (same pattern as built-in DOM events in Svelte). * Generated — do not edit by hand. * Requires dependency on `svelte` (for `svelte/elements`). */ import type { HTMLAttributes } from "svelte/elements"; import type { Component, Events } from "./webcomponent.type"; /** * Keys already modeled on `HTMLAttributes` (global attrs + DOM listeners). Exclude these from * `Component` so host props stay plain strings and are not merged with unrelated DOM typings. */ type HtmlReservedAttrKeys = keyof HTMLAttributes; type HbSvelteAttrs = { [K in keyof Component as K extends HtmlReservedAttrKeys ? never : K]?: string; }; /** `detail` matches `Events[K]`; `currentTarget` is the host element. */ type HbSvelteCustomEventHandler = ( event: CustomEvent & { currentTarget: EventTarget & HTMLElement } ) => any; type HbSvelteEventAttrs = { [K in keyof Events & string as `on${K}`]?: HbSvelteCustomEventHandler; } & { [K in keyof Events & string as `on${K}capture`]?: HbSvelteCustomEventHandler; } & { [K in keyof Events & string as `on:${K}`]?: HbSvelteCustomEventHandler; }; /** * Strip keys we re-declare from Svelte’s base, then add them back: plain intersection would * merge `on*` / attrs with conflicting DOM typings (`string & EventHandler` → errors or * props treated like listeners). */ type HbSvelteHostAttributes = Omit< HTMLAttributes, keyof HbSvelteAttrs | keyof HbSvelteEventAttrs > & HbSvelteAttrs & HbSvelteEventAttrs; declare module "svelte/elements" { export interface SvelteHTMLElements { "hb-card-video": HbSvelteHostAttributes; } } export {};