Home / File/ svelte-html.d.ts — svelte Source File

svelte-html.d.ts — svelte Source File

Architecture documentation for svelte-html.d.ts, a typescript file in the svelte codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  4db9d6b2_d27d_5e64_13ca_7ed2d60439bd["svelte-html.d.ts"]
  86d18ff9_eb96_6ab4_09fe_11c75e2a0056["./elements.js"]
  4db9d6b2_d27d_5e64_13ca_7ed2d60439bd --> 86d18ff9_eb96_6ab4_09fe_11c75e2a0056
  style 4db9d6b2_d27d_5e64_13ca_7ed2d60439bd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/// <reference lib="dom" />
// This file is deliberately not exposed through the exports map.
// It's meant to be loaded directly by the Svelte language server
/* eslint-disable @typescript-eslint/no-empty-interface */

import * as svelteElements from './elements.js';

/**
 * @internal do not use
 */
type HTMLProps<Property extends string, Override> = Omit<
	import('./elements.js').SvelteHTMLElements[Property],
	keyof Override
> &
	Override;

declare global {
	/**
	 * This namespace does not exist in the runtime, it is only used for typings
	 */
	namespace svelteHTML {
		// Every namespace eligible for use needs to implement the following two functions
		/**
		 * @internal do not use
		 */
		function mapElementTag<K extends keyof ElementTagNameMap>(tag: K): ElementTagNameMap[K];
		function mapElementTag<K extends keyof SVGElementTagNameMap>(tag: K): SVGElementTagNameMap[K];
		function mapElementTag(tag: any): any; // needs to be any because used in context of <svelte:element>

		/**
		 * @internal do not use
		 */
		function createElement<Elements extends IntrinsicElements, Key extends keyof Elements>(
			// "undefined | null" because of <svelte:element>
			element: Key | undefined | null,
			attrs: string extends Key ? svelteElements.HTMLAttributes<any> : Elements[Key]
		): Key extends keyof ElementTagNameMap
			? ElementTagNameMap[Key]
			: Key extends keyof SVGElementTagNameMap
				? SVGElementTagNameMap[Key]
				: any;
		function createElement<Elements extends IntrinsicElements, Key extends keyof Elements, T>(
			// "undefined | null" because of <svelte:element>
			element: Key | undefined | null,
			attrsEnhancers: T,
			attrs: (string extends Key ? svelteElements.HTMLAttributes<any> : Elements[Key]) & T
		): Key extends keyof ElementTagNameMap
			? ElementTagNameMap[Key]
			: Key extends keyof SVGElementTagNameMap
				? SVGElementTagNameMap[Key]
				: any;

		// TODO remove HTMLAttributes/SVGAttributes/IntrinsicElements in Svelte 6
		// For backwards-compatibility and ease-of-use, in case someone enhanced the typings from import('svelte/elements').HTMLAttributes/SVGAttributes
		// eslint-disable-next-line @typescript-eslint/no-unused-vars
		interface HTMLAttributes<T extends EventTarget = any> {}
		// eslint-disable-next-line @typescript-eslint/no-unused-vars
		interface SVGAttributes<T extends EventTarget = any> {}

		/**
// ... (186 more lines)

Domain

Subdomains

Classes

Dependencies

  • ./elements.js

Frequently Asked Questions

What does svelte-html.d.ts do?
svelte-html.d.ts is a source file in the svelte codebase, written in typescript. It belongs to the BuildSystem domain, QualityControl subdomain.
What does svelte-html.d.ts depend on?
svelte-html.d.ts imports 1 module(s): ./elements.js.
Where is svelte-html.d.ts in the architecture?
svelte-html.d.ts is located at packages/svelte/svelte-html.d.ts (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free