0.1.0-alpha.7

zerolith/jsx-runtime

Import from zerolith/jsx-runtime. Generated from the source; every signature below is what the published types declare.

Functions

jsx

function jsx(): never

Reached only when JSX was not lowered; throws a diagnostic.

Source: packages/zerolith/src/jsx-runtime.ts:43

jsxs

function jsxs(): never

The same as jsx.

Source: packages/zerolith/src/jsx-runtime.ts:49

jsxDEV

function jsxDEV(): never

The same as jsx.

Source: packages/zerolith/src/jsx-runtime.ts:52

Types

ElementAttributes

type ElementAttributes = { readonly children?: unknown; readonly ref?: unknown; readonly [attribute: string]: unknown; readonly [property: `prop:${string}`]: unknown; readonly [event: `on:${string}`]: unknown; readonly [flag: `bool:${string}`]: unknown }

Attribute names an element accepts: plain attributes, and the prop:, on:, bool:, and attr: namespaces that select the other binding forms.

Source: packages/zerolith/src/jsx-runtime.ts:11

Constants

Fragment

const Fragment: unique symbol

Fragments lower to a template with no root element; the marker exists only for the types.

Source: packages/zerolith/src/jsx-runtime.ts:40

Namespaces

JSX

namespace JSX

The JSX namespace TypeScript reads.

  • type Element = View: The type TypeScript gives every JSX expression and checks a function component's return type against: a View, which the lowered html call returns.
  • interface ElementChildrenAttribute { children: unknown }: Names the prop that carries children; TypeScript reads only the property's name, children, and checks the content between an element's tags against that prop.
  • interface IntrinsicAttributes { ref?: unknown }: Props TypeScript accepts on every component element on top of the component's own: ref, which the lowering passes to the component as an ordinary prop.
  • type IntrinsicElements = { readonly [tag in keyof HTMLElementTagNameMap]: ElementAttributes } & { readonly [tag: string]: ElementAttributes }: Maps each intrinsic tag, a name such as div or my-card, to the attributes TypeScript checks on it: ElementAttributes for every tag.

Source: packages/zerolith/src/jsx-runtime.ts:21