Skip to content

packages/core/src/jsx-runtime.ts

Read as Markdown

This is the source snapshot used to build these API details. View this revision on GitHub.

Back to reference

1 import type {
2   PibblElement,
3   PibblElementType,
4   PibblKey,
5   PibblPrimitiveComponent,
6   PrimitiveInputOf,
7 } from './lib/element/types.js';
8 
9 export { Fragment, jsx, jsxs } from './lib/element/jsx-runtime.js';
10 
11 /**
12  * Compiler-facing Pibbl JSX types; authored elements use the branded Pibbl element protocol.
13  *
14  * @see {@link PibblElement}
15  * @see {@link PibblElementType}
16  * @see {@link PibblKey}
17  * @see {@link PibblPrimitiveComponent}
18  * @see {@link PrimitiveInputOf}
19  */
20 export namespace JSX {
21   /** The branded element value recognized as valid Pibbl JSX output. See {@link JSX}. */
22   export type Element = PibblElement;
23   /** The synchronous component types accepted in Pibbl JSX. See {@link JSX}. */
24   export type ElementType = PibblElementType;
25   /** Identifies children as the JSX child-content prop. See {@link JSX}. */
26   export interface ElementChildrenAttribute {
27     /** Descendant content or the callback that supplies it. See {@link JSX}. */
28     children: unknown;
29   }
30   /** Compiler-owned JSX attributes, including stable element keys. See {@link JSX}. */
31   export interface IntrinsicAttributes {
32     /** Stable identity used by the containing protocol. See {@link PibblKey}. */
33     key?: PibblKey;
34   }
35   /** Pibbl has no lowercase intrinsic JSX vocabulary. See {@link JSX}. */
36   export interface IntrinsicElements {}
37   /**
38    * Maps branded primitive components to their authored inputs and rejects reserved key props. See
39    * {@link JSX}.
40    */
41   export type LibraryManagedAttributes<C, P> =
42     C extends PibblPrimitiveComponent<any, any>
43       ? PrimitiveInputOf<C>
44       : 'key' extends keyof P
45         ? never
46         : P;
47 }
48 

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.