Home / Class/ ComponentConstructorOptions Class — svelte Architecture

ComponentConstructorOptions Class — svelte Architecture

Architecture documentation for the ComponentConstructorOptions class in index.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd["ComponentConstructorOptions"]
  6bd9d090_a582_e05c_669e_d53d4e7245f2["index.d.ts"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|defined in| 6bd9d090_a582_e05c_669e_d53d4e7245f2
  3eb84197_62c0_e39a_8365_6da9b835ebf2["createClassComponent()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 3eb84197_62c0_e39a_8365_6da9b835ebf2
  6633f703_1470_235d_688c_be582bad4302["asClassComponent()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 6633f703_1470_235d_688c_be582bad4302
  a863e40b_816f_9c74_27ce_f1c41648b6a6["run()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| a863e40b_816f_9c74_27ce_f1c41648b6a6
  db3768fc_fac6_c717_3ead_74d91bbd5a75["handlers()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| db3768fc_fac6_c717_3ead_74d91bbd5a75
  b5b32665_f9ef_9848_0167_304add9915cb["createBubbler()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| b5b32665_f9ef_9848_0167_304add9915cb
  ee832062_cd7b_03a4_3078_515961f08582["o()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| ee832062_cd7b_03a4_3078_515961f08582
  0e1e04b2_ce68_e71d_86ab_e1935b29e423["args()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 0e1e04b2_ce68_e71d_86ab_e1935b29e423
  1bee5c67_a78e_7eb7_5bc2_c0f20fac1404["trusted()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 1bee5c67_a78e_7eb7_5bc2_c0f20fac1404
  4f290735_0be0_90d9_3a68_75b317530cda["self()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 4f290735_0be0_90d9_3a68_75b317530cda
  0e08765a_1c41_359e_0606_0f1072f329fd["stopPropagation()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 0e08765a_1c41_359e_0606_0f1072f329fd
  02d3f69d_5590_84b2_6391_bce264ce0c72["once()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 02d3f69d_5590_84b2_6391_bce264ce0c72
  68347f81_5ac6_21c6_9b4e_d598c2b41ad1["stopImmediatePropagation()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 68347f81_5ac6_21c6_9b4e_d598c2b41ad1
  4d7bc105_562e_c851_bdd0_9003ae26a039["preventDefault()"]
  52771123_d3d9_6270_1bfc_1e4e34d9d0cd -->|method| 4d7bc105_562e_c851_bdd0_9003ae26a039

Relationship Graph

Source Code

packages/svelte/types/index.d.ts lines 1902–1985

declare module 'svelte/legacy' {
	import type { ComponentConstructorOptions, SvelteComponent, ComponentType, Component } from 'svelte';
	/**
	 * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
	 *
	 * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
	 *
	 * */
	export function createClassComponent<Props extends Record<string, any>, Exports extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>>(options: ComponentConstructorOptions<Props> & {
		component: ComponentType<SvelteComponent<Props, Events, Slots>> | Component<Props>;
	}): SvelteComponent<Props, Events, Slots> & Exports;
	/**
	 * Takes the component function and returns a Svelte 4 compatible component constructor.
	 *
	 * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
	 *
	 * */
	export function asClassComponent<Props extends Record<string, any>, Exports extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>>(component: SvelteComponent<Props, Events, Slots> | Component<Props>): ComponentType<SvelteComponent<Props, Events, Slots> & Exports>;
	/**
	 * Runs the given function once immediately on the server, and works like `$effect.pre` on the client.
	 *
	 * @deprecated Use this only as a temporary solution to migrate your component code to Svelte 5.
	 * */
	export function run(fn: () => void | (() => void)): void;
	/**
	 * Function to mimic the multiple listeners available in svelte 4
	 * @deprecated
	 * */
	export function handlers(...handlers: EventListener[]): EventListener;
	/**
	 * Function to create a `bubble` function that mimic the behavior of `on:click` without handler available in svelte 4.
	 * @deprecated Use this only as a temporary solution to migrate your automatically delegated events in Svelte 5.
	 */
	export function createBubbler(): (type: string) => (event: Event) => boolean;
	/**
	 * Support using the component as both a class and function during the transition period
	 */
	export type LegacyComponentType = {
		new (o: ComponentConstructorOptions): SvelteComponent;
		(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;
	};
	/**
	 * Substitute for the `trusted` event modifier
	 * @deprecated
	 * */
	export function trusted(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `self` event modifier
	 * @deprecated
	 * */
	export function self(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `stopPropagation` event modifier
	 * @deprecated
	 * */
	export function stopPropagation(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `once` event modifier
	 * @deprecated
	 * */
	export function once(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `stopImmediatePropagation` event modifier
	 * @deprecated
	 * */
	export function stopImmediatePropagation(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `preventDefault` event modifier
	 * @deprecated
	 * */
	export function preventDefault(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
	/**
	 * Substitute for the `passive` event modifier, implemented as an action
	 * @deprecated
	 * */
	export function passive(node: HTMLElement, [event, handler]: [event: string, handler: () => EventListener]): void;
	/**
	 * Substitute for the `nonpassive` event modifier, implemented as an action
	 * @deprecated
	 * */
	export function nonpassive(node: HTMLElement, [event, handler]: [event: string, handler: () => EventListener]): void;

Frequently Asked Questions

What is the ComponentConstructorOptions class?
ComponentConstructorOptions is a class in the svelte codebase, defined in packages/svelte/types/index.d.ts.
Where is ComponentConstructorOptions defined?
ComponentConstructorOptions is defined in packages/svelte/types/index.d.ts at line 1902.

Analyze Your Own Codebase

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

Try Supermodel Free