Home / Type/ Component Type — svelte Architecture

Component Type — svelte Architecture

Architecture documentation for the Component type/interface in index.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  6e8f07f6_caad_241d_57d3_605d62812984["Component"]
  6bd9d090_a582_e05c_669e_d53d4e7245f2["index.d.ts"]
  6e8f07f6_caad_241d_57d3_605d62812984 -->|defined in| 6bd9d090_a582_e05c_669e_d53d4e7245f2
  style 6e8f07f6_caad_241d_57d3_605d62812984 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/types/index.d.ts lines 140–171

	export interface Component<
		Props extends Record<string, any> = {},
		Exports extends Record<string, any> = {},
		Bindings extends keyof Props | '' = string
	> {
		/**
		 * @param internal An internal object used by Svelte. Do not use or modify.
		 * @param props The props passed to the component.
		 */
		(
			this: void,
			internals: ComponentInternals,
			props: Props
		): {
			/**
			 * @deprecated This method only exists when using one of the legacy compatibility helpers, which
			 * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
			 * for more info.
			 */
			$on?(type: string, callback: (e: any) => void): () => void;
			/**
			 * @deprecated This method only exists when using one of the legacy compatibility helpers, which
			 * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
			 * for more info.
			 */
			$set?(props: Partial<Props>): void;
		} & Exports;
		/** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
		element?: typeof HTMLElement;
		/** Does not exist at runtime, for typing capabilities only. DO NOT USE */
		z_$$bindings?: Bindings;
	}

Frequently Asked Questions

What is the Component type?
Component is a type/interface in the svelte codebase, defined in packages/svelte/types/index.d.ts.
Where is Component defined?
Component is defined in packages/svelte/types/index.d.ts at line 140.

Analyze Your Own Codebase

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

Try Supermodel Free