Home / Function/ constructor() — astro Function Reference

constructor() — astro Function Reference

Architecture documentation for the constructor() function in events.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  fb3fec80_31a2_8b88_6da0_348863d0cf20["constructor()"]
  8207345b_afa6_dd08_ab18_8b35a756d317["TransitionBeforeSwapEvent"]
  fb3fec80_31a2_8b88_6da0_348863d0cf20 -->|defined in| 8207345b_afa6_dd08_ab18_8b35a756d317
  7284f264_729e_57c9_cea7_29a63bed9592["constructor()"]
  fb3fec80_31a2_8b88_6da0_348863d0cf20 -->|calls| 7284f264_729e_57c9_cea7_29a63bed9592
  style fb3fec80_31a2_8b88_6da0_348863d0cf20 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/transitions/events.ts lines 125–147

	constructor(afterPreparation: BeforeEvent, viewTransition: ViewTransition) {
		super(
			TRANSITION_BEFORE_SWAP,
			undefined,
			afterPreparation.from,
			afterPreparation.to,
			afterPreparation.direction,
			afterPreparation.navigationType,
			afterPreparation.sourceElement,
			afterPreparation.info,
			afterPreparation.newDocument,
			afterPreparation.signal,
		);
		this.direction = afterPreparation.direction;
		this.viewTransition = viewTransition;
		this.swap = () => swap(this.newDocument);

		Object.defineProperties(this, {
			direction: { enumerable: true },
			viewTransition: { enumerable: true },
			swap: { enumerable: true, writable: true },
		});
	}

Domain

Subdomains

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the astro codebase, defined in packages/astro/src/transitions/events.ts.
Where is constructor() defined?
constructor() is defined in packages/astro/src/transitions/events.ts at line 125.
What does constructor() call?
constructor() calls 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free