Home / Class/ BeforeEvent Class — astro Architecture

BeforeEvent Class — astro Architecture

Architecture documentation for the BeforeEvent class in events.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  5c388325_26b8_6a86_e240_8941b364ae29["BeforeEvent"]
  75c59a6f_ee5d_6669_2750_97d28d913e90["events.ts"]
  5c388325_26b8_6a86_e240_8941b364ae29 -->|defined in| 75c59a6f_ee5d_6669_2750_97d28d913e90
  7284f264_729e_57c9_cea7_29a63bed9592["constructor()"]
  5c388325_26b8_6a86_e240_8941b364ae29 -->|method| 7284f264_729e_57c9_cea7_29a63bed9592

Relationship Graph

Source Code

packages/astro/src/transitions/events.ts lines 25–68

class BeforeEvent extends Event {
	readonly from: URL;
	to: URL;
	direction: Direction | string;
	readonly navigationType: NavigationTypeString;
	readonly sourceElement: Element | undefined;
	readonly info: any;
	newDocument: Document;
	readonly signal: AbortSignal;

	constructor(
		type: string,
		eventInitDict: EventInit | undefined,
		from: URL,
		to: URL,
		direction: Direction | string,
		navigationType: NavigationTypeString,
		sourceElement: Element | undefined,
		info: any,
		newDocument: Document,
		signal: AbortSignal,
	) {
		super(type, eventInitDict);
		this.from = from;
		this.to = to;
		this.direction = direction;
		this.navigationType = navigationType;
		this.sourceElement = sourceElement;
		this.info = info;
		this.newDocument = newDocument;
		this.signal = signal;

		Object.defineProperties(this, {
			from: { enumerable: true },
			to: { enumerable: true, writable: true },
			direction: { enumerable: true, writable: true },
			navigationType: { enumerable: true },
			sourceElement: { enumerable: true },
			info: { enumerable: true },
			newDocument: { enumerable: true, writable: true },
			signal: { enumerable: true },
		});
	}
}

Domain

Frequently Asked Questions

What is the BeforeEvent class?
BeforeEvent is a class in the astro codebase, defined in packages/astro/src/transitions/events.ts.
Where is BeforeEvent defined?
BeforeEvent is defined in packages/astro/src/transitions/events.ts at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free