Home / Type/ EventDispatcher Type — svelte Architecture

EventDispatcher Type — svelte Architecture

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/svelte/types/index.d.ts lines 301–312

	export interface EventDispatcher<EventMap extends Record<string, any>> {
		// Implementation notes:
		// - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode
		// - | null | undefined is added for convenience, as they are equivalent for the custom event constructor (both result in a null detail)
		<Type extends keyof EventMap>(
			...args: null extends EventMap[Type]
				? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
				: undefined extends EventMap[Type]
					? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
					: [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
		): boolean;
	}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free