songstress/ui/jsx-runtime
What a .tsx file's JSX compiles to, with jsxImportSource songstress/ui, and the JSX types of client code.
A .tsx file whose jsxImportSource is songstress/ui (the starter's tsconfig.json says so, and
songstress build assumes it with no tsconfig.json at all) compiles each element to jsx from this entry. Its
JSX namespace is the types of client code: a tag is one of songstress/ui's
components or one of your own, never a lower-case name, and a handler may be a function. You never import this
entry yourself; the compiler and the bundler do.
songstress/ui/jsx-dev-runtime is what a development build (Vitest, an editor's preview) imports in its place, with
the same elements.
Fragment
Groups children without a node of its own.
export declare const Fragment: (props: {
children?: UiNode;
}) => UiElement;JSX
The JSX of client code: a tag is a component, never a lower-case name; a handler may be a function.
export declare namespace JSX {
type Element = UiElement;
type ElementType = (props: never) => UiNode | Screen | PanelContent | StatusContent;
interface ElementChildrenAttribute {
children: unknown;
}
interface IntrinsicAttributes {
key?: string | number;
}
interface IntrinsicElements {
}
}Refers to UiElement, UiNode, Screen, PanelContent, StatusContent.
jsx
The JSX factory: what a .tsx file compiles each element to, with jsxImportSource songstress/ui (or songstress/ui/server for server code). A tag is a component of songstress/ui or one of the author's own, never a lower-case name.
export declare function jsx(type: unknown, props: Record<string, unknown> | null, key?: string | number): UiElement;| Parameter | Type | Description |
|---|---|---|
type | unknown | The component. |
props | Record<string, unknown> | null | Its props, children among them. |
key? | string | number | Its JSX key: the node's key on the wire. |
Returns UiElement.
import { jsx } from 'songstress/ui/jsx-runtime'
import { Text } from 'songstress/ui'
// What `<Text style="title">Played lately</Text>` compiles to.
const title = jsx(Text, { style: 'title', children: 'Played lately' })Refers to UiElement.
jsxs
The JSX factory of an element with several children, which a compiler tells apart from jsx: here they are one function.
export declare const jsxs: typeof jsx;Refers to jsx.
It also exports, as the modules that declare them document them: Fragment, JSX.
jsxDEV
The JSX factory of a development build: jsx, with what such a build adds about where the element was written left aside.
export declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number): UiElement;| Parameter | Type | Description |
|---|---|---|
type | unknown | The component. |
props | Record<string, unknown> | null | Its props, children among them. |
key? | string | number | Its JSX key. |
Returns UiElement.
import { jsxDEV } from 'songstress/ui/jsx-dev-runtime'
import { Text } from 'songstress/ui'
const title = jsxDEV(Text, { children: 'Played lately' })Refers to UiElement.
songstress/ui/reader
The reader alone, as the apps take it: what songstress/ui exports of the tree reader, its caps, the named steps and the protocol of a mounted target.
songstress/ui/server/jsx-runtime
The JSX of server code, which a file asks for with @jsxImportSource songstress/ui/server, where a handler is an action.