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
  752f8d9c_a30f_a72a_2392_c2e29b4ff90b["EventDispatcher"]
  d5f75cc7_4dc4_5b53_55c5_43ee635d6602["index.d.ts"]
  752f8d9c_a30f_a72a_2392_c2e29b4ff90b -->|defined in| d5f75cc7_4dc4_5b53_55c5_43ee635d6602
  style 752f8d9c_a30f_a72a_2392_c2e29b4ff90b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/index.d.ts lines 302–313

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/src/index.d.ts.
Where is EventDispatcher defined?
EventDispatcher is defined in packages/svelte/src/index.d.ts at line 302.

Analyze Your Own Codebase

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

Try Supermodel Free