Skip to main content

Module: core/core

This module defines the core interfaces for AI.JSX.

See: https://ai-jsx.com for more details.

Interfaces

Type Aliases

Component

Ƭ Component<P>: (props: P, context: ComponentContext) => Renderable

Type parameters

Name
P

Type declaration

▸ (props, context): Renderable

Represents a single AI.JSX component.

Parameters
NameType
propsP
contextComponentContext
Returns

Renderable

Defined in

packages/ai-jsx/src/core/core.ts:19


Literal

Ƭ Literal: string | number | null | undefined | boolean

A Literal represents a literal value.

Defined in

packages/ai-jsx/src/core/core.ts:24


Node

Ƭ Node: Element<any> | Literal | Node[] | IndirectNode

A Node represents an element of an AI.JSX component tree.

Defined in

packages/ai-jsx/src/core/core.ts:58


Renderable

Ƭ Renderable: Node | PromiseLike<Renderable> | RenderableStream

A Renderable represents a value that can be rendered to a string.

Defined in

packages/ai-jsx/src/core/core.ts:73

Variables

AppendOnlyStream

Const AppendOnlyStream: typeof AppendOnlyStream

A value that can be yielded by a component to indicate that each yielded value should be appended to, rather than replace, the previously yielded values.

Defined in

packages/ai-jsx/src/core/core.ts:30

Functions

createRenderContext

createRenderContext(opts?): RenderContext

Creates a new RenderContext with the provided logger.

Parameters

NameType
opts?Object
opts.logger?LogImplementation

Returns

RenderContext

A new RenderContext.

Defined in

packages/ai-jsx/src/core/core.ts:445