Home / File/ astro-jsx.d.ts — astro Source File

astro-jsx.d.ts — astro Source File

Architecture documentation for astro-jsx.d.ts, a typescript file in the astro codebase.

File typescript 1 classes

Entity Profile

Relationship Graph

Source Code

/// <reference lib="dom" />
/**
 * Adapted from babel-plugin-react-html-attrs's TypeScript definition from DefinitelyTyped.
 * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/babel-plugin-react-html-attrs/index.d.ts
 *
 * and
 *
 * Adapted from React’s TypeScript definition from DefinitelyTyped.
 * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts
 */
declare namespace astroHTML.JSX {
	export type Child = Node | Node[] | string | number | boolean | null | undefined | unknown;
	export type Children = Child | Child[];

	interface ElementChildrenAttribute {
		children: {};
	}

	interface IntrinsicAttributes extends AstroComponentDirectives, AstroBuiltinAttributes {
		slot?: string | undefined | null;
		children?: Children;
	}

	// biome-ignore format: bug
	type AstroComponentDirectives = import('./dist/types/public/elements.js').AstroComponentDirectives;
	type AstroBuiltinAttributes = import('./dist/types/public/elements.js').AstroBuiltinAttributes;
	// biome-ignore format: bug
	type AstroDefineVarsAttribute = import('./dist/types/public/elements.js').AstroDefineVarsAttribute;
	type AstroScriptAttributes = import('./dist/types/public/elements.js').AstroScriptAttributes &
		AstroDefineVarsAttribute;
	type AstroStyleAttributes = import('./dist/types/public/elements.js').AstroStyleAttributes &
		AstroDefineVarsAttribute;
	type AstroSlotAttributes = import('./dist/types/public/elements.js').AstroSlotAttributes;

	// This is an unfortunate use of `any`, but unfortunately we can't make a type that works for every framework
	// without importing every single framework's types (which comes with its own set of problems).
	// Using any isn't that bad here however as in Astro files the return type of a component isn't relevant in most cases
	type Element = HTMLElement | any;

	interface DOMAttributes {
		children?: Children;

		// Clipboard Events
		oncopy?: string | undefined | null;
		oncut?: string | undefined | null;
		onpaste?: string | undefined | null;

		// Composition Events
		oncompositionend?: string | undefined | null;
		oncompositionstart?: string | undefined | null;
		oncompositionupdate?: string | undefined | null;

		// Focus Events
		onfocus?: string | undefined | null;
		onfocusin?: string | undefined | null;
		onfocusout?: string | undefined | null;
		onblur?: string | undefined | null;

		// Form Events
		onchange?: string | undefined | null;
// ... (1513 more lines)

Classes

Frequently Asked Questions

What does astro-jsx.d.ts do?
astro-jsx.d.ts is a source file in the astro codebase, written in typescript.
Where is astro-jsx.d.ts in the architecture?
astro-jsx.d.ts is located at packages/astro/astro-jsx.d.ts (directory: packages/astro).

Analyze Your Own Codebase

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

Try Supermodel Free