@opentui/solid
Every export of @opentui/solid in the main-branch source, from its type declarations. A version names the release that added an export after the module's first release.
Functions#
function _render(code: () => DomNode, root: DomNode): () => voidfunction createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Elementfunction createScrollbackWriter(node: SolidScrollbackNode, options?: SolidScrollbackWriterOptions): ScrollbackWriterfunction createSlot<TSlots extends SlotMap, TContext extends PluginContext = PluginContext>(registry: SlotRegistry<JSX.Element, TSlots, TContext>, options?: SolidSlotOptions): SolidSlotComponent<TSlots>function createSlotNode(): SlotRenderablefunction createSolidSlotRegistry<TSlots extends SlotMap, TContext extends PluginContext = PluginContext>(renderer: CliRenderer, context: TContext, options?: SlotRegistryOptions): SlotRegistry<JSX.Element, TSlots, TContext>function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Elementfunction extend<T extends ComponentCatalogue>(objects: T): voidfunction getComponentCatalogue(): ComponentCataloguefunction Portal(props: { mount?: DomNode; ref?: (el: {}) => void; children: JSX.Element; }): JSX.Elementfunction removeNode(parent: DomNode, node: DomNode): voidfunction Slot<TSlots extends SlotMap, TContext extends PluginContext = PluginContext, K extends keyof TSlots = keyof TSlots>(props: SolidSlotProps<TSlots, K, TContext>): JSX.Elementfunction writeSolidToScrollback(renderer: CliRenderer, node: SolidScrollbackNode, options?: SolidScrollbackWriterOptions): void
Classes#
class BoldSpanRenderable extends TextModifierRenderableconstructor BoldSpanRenderable(options: any)class ItalicSpanRenderable extends TextModifierRenderableconstructor ItalicSpanRenderable(options: any)class LayoutSlotRenderable extends Renderableconstructor LayoutSlotRenderable(id: string, parent: SlotRenderable, layoutParent: Renderable)method LayoutSlotRenderable.disposeWithoutSlotCascade(): voidmethod LayoutSlotRenderable.isCompatibleWith(layoutParent?: BaseRenderable): booleanprotected method LayoutSlotRenderable.destroySelf(): void0.6.0
class LineBreakRenderable extends SpanRenderableconstructor LineBreakRenderable(_ctx: RenderContext | null, options: TextNodeOptions)method LineBreakRenderable.add(): number
class LinkRenderable extends SpanRenderableconstructor LinkRenderable(_ctx: RenderContext | null, options: LinkOptions)class SlotRenderable extends SlotBaseRenderableconstructor SlotRenderable(id: string)method SlotRenderable.destroy(): voidmethod SlotRenderable.didDestroySlotChild(child: BaseRenderable): void0.5.15method SlotRenderable.didRemoveSlotChild(parent: BaseRenderable, child: BaseRenderable): voidmethod SlotRenderable.getSlotChild(parent: BaseRenderable): LayoutSlotRenderable | TextSlotRenderablemethod SlotRenderable.getSlotChildForRemoval(parent: BaseRenderable): BaseRenderable | undefinedprotected property SlotRenderable.destroyed: booleanreadonly property SlotRenderable.layoutNode: LayoutSlotRenderable | undefinedreadonly property SlotRenderable.textNode: TextSlotRenderable | undefined
class TextSlotRenderable extends TextNodeRenderableconstructor TextSlotRenderable(id: string, parent?: SlotRenderable)method TextSlotRenderable.destroy(): voidmethod TextSlotRenderable.destroyRecursively(): void0.6.0method TextSlotRenderable.detachFromSlot(): voidmethod TextSlotRenderable.disposeWithoutSlotCascade(): voidprotected property TextSlotRenderable.destroyed: booleanprotected property TextSlotRenderable.slotParent?: SlotRenderable
class UnderlineSpanRenderable extends TextModifierRenderableconstructor UnderlineSpanRenderable(options: any)
Interfaces#
interface LinkOptions extends TextNodeOptionsproperty LinkOptions.href: string
interface SolidScrollbackWriterOptionsproperty SolidScrollbackWriterOptions.height?: numberproperty SolidScrollbackWriterOptions.rowColumns?: numberproperty SolidScrollbackWriterOptions.startOnNewLine?: booleanproperty SolidScrollbackWriterOptions.trailingNewline?: booleanproperty SolidScrollbackWriterOptions.width?: number
interface SolidSlotOptionsproperty SolidSlotOptions.pluginFailurePlaceholder?: (failure: PluginErrorEvent) => JSX.Element
interface UseKeyboardOptionsproperty UseKeyboardOptions.release?: boolean
Types#
type AsciiFontProps = ComponentProps<ASCIIFontOptions, ASCIIFontRenderable>type BoxProps = ComponentProps<ContainerProps<BoxOptions>, BoxRenderable> & { focused?: boolean; }type CodeProps = ComponentProps<CodeOptions, CodeRenderable>type DomNode = BaseRenderabletype DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = { [K in keyof P]: P[K]; } & { component: T | undefined; }type ElementProps<TRenderable = unknown> = { ref?: Ref<TRenderable>; [eventName: `on:${string}`]: ((...args: any[]) => void) | undefined; }type ExtendedComponentProps<TConstructor extends RenderableConstructor, TOptions = ExtractRenderableOptions<TConstructor>> = TOptions & { children?: JSX.Element; style?: Partial<Omit<TOptions, GetNonStyledProperties<TConstructor>>>; } & ElementProps<ExtractRenderable<TConstructor>>type ExtendedIntrinsicElements<TComponentCatalogue extends Record<string, RenderableConstructor>> = { [TComponentName in keyof TComponentCatalogue]: ExtendedComponentProps<TComponentCatalogue[TComponentName]>; }type GetNonStyledProperties<TConstructor> = TConstructor extends RenderableConstructor<TextRenderable> ? NonStyledProps | "content" : TConstructor extends RenderableConstructor<BoxRenderable> ? NonStyledProps | "title" | "bottomTitle" : TConstructor extends RenderableConstructor<ASCIIFontRenderable> ? NonStyledProps | "text" | "selectable" : TConstructor extends RenderableConstructor<InputRenderable> ? NonStyledProps | "minLength" | "maxLength" | "placeholder" | "value" : TConstructor extends RenderableConstructor<CodeRenderable> ? NonStyledProps | "content" | "filetype" | "syntaxStyle" | "treeSitterClient" : TConstructor extends RenderableConstructor<MarkdownRenderable> ? NonStyledProps | "content" | "syntaxStyle" | "treeSitterClient" | "conceal" | "renderNode" : TConstructor extends RenderableConstructor<ImageRenderable> ? NonStyledProps | "source" : NonStyledPropstype ImageProps = ComponentProps<ImageRenderableOptions, ImageRenderable>type InputProps = ComponentProps<InputRenderableOptions, InputRenderable> & { focused?: boolean; onInput?: (value: string) => void; onChange?: (value: string) => void; onSubmit?: (value: string) => void; }type LinkProps = SpanProps & { href: string; }type MarkdownProps = ComponentProps<MarkdownOptions, MarkdownRenderable>type NonStyledProps = "id" | "buffered" | "live" | "enableLayout" | "selectable" | "renderAfter" | "renderBefore" | `on${string}`type RenderableConstructor<TRenderable extends BaseRenderable = BaseRenderable> = new (ctx: RenderContext, options: any) => TRenderabletype ScrollBoxProps = ComponentProps<ContainerProps<ScrollBoxOptions>, ScrollBoxRenderable> & { focused?: boolean; stickyScroll?: boolean; stickyStart?: "bottom" | "top" | "left" | "right"; }type SelectProps = ComponentProps<SelectRenderableOptions, SelectRenderable> & { focused?: boolean; onChange?: (index: number, option: SelectOption | null) => void; onSelect?: (index: number, option: SelectOption | null) => void; }type SolidBoundSlotProps<TSlots extends SlotMap, K extends keyof TSlots> = { name: K; mode?: SlotMode; children?: JSX.Element; } & TSlots[K]type SolidPlugin<TSlots extends SlotMap, TContext extends PluginContext = PluginContext> = Plugin<JSX.Element, TSlots, TContext>type SolidRegistrySlotComponent<TSlots extends SlotMap, TContext extends PluginContext = PluginContext> = <K extends keyof TSlots>(props: SolidSlotProps<TSlots, K, TContext>) => JSX.Elementtype SolidScrollbackNode = (ctx: ScrollbackRenderContext) => JSX.Elementtype SolidSlotComponent<TSlots extends SlotMap> = <K extends keyof TSlots>(props: SolidBoundSlotProps<TSlots, K>) => JSX.Elementtype SolidSlotProps<TSlots extends SlotMap, K extends keyof TSlots, TContext extends PluginContext = PluginContext> = { registry: SlotRegistry<JSX.Element, TSlots, TContext>; name: K; mode?: SlotMode; children?: JSX.Element; pluginFailurePlaceholder?: (failure: PluginErrorEvent) => JSX.Element; } & TSlots[K]type SpanProps = ComponentProps<{}, TextNodeRenderable> & { children?: TextChildren | Array<TextChildren>; }type TabSelectProps = ComponentProps<TabSelectRenderableOptions, TabSelectRenderable> & { focused?: boolean; onChange?: (index: number, option: TabSelectOption | null) => void; onSelect?: (index: number, option: TabSelectOption | null) => void; }type TextareaProps = ComponentProps<TextareaOptions, TextareaRenderable> & { focused?: boolean; onSubmit?: () => void; onContentChange?: (value: string) => void; onCursorChange?: (value: { line: number; visualColumn: number; }) => void; onKeyDown?: (event: KeyEvent) => void; onKeyPress?: (event: KeyEvent) => void; }type TextNodeKey = (typeof textNodeKeys)[number]type TextProps = ComponentProps<TextOptions, TextRenderable> & { children?: TextChildren | Array<TextChildren>; }type TimeToFirstDrawProps = ExtendedComponentProps<typeof TimeToFirstDrawRenderable>
Constants and variables#
const baseComponents: { box: typeof BoxRenderable; text: typeof TextRenderable; input: typeof InputRenderable; select: typeof SelectRenderable; textarea: typeof TextareaRenderable; ascii_font: typeof ASCIIFontRenderable; tab_select: typeof TabSelectRenderable; scrollbox: typeof ScrollBoxRenderable; code: typeof CodeRenderable; diff: typeof DiffRenderable; line_number: typeof LineNumberRenderable; markdown: typeof MarkdownRenderable; image: typeof ImageRenderable; span: typeof SpanRenderable; strong: typeof BoldSpanRenderable; b: typeof BoldSpanRenderable; em: typeof ItalicSpanRenderable; i: typeof ItalicSpanRenderable; u: typeof UnderlineSpanRenderable; br: typeof LineBreakRenderable; a: typeof LinkRenderable; }const componentCatalogue: ComponentCatalogueconst createComponent: <T>(Comp: (props: T) => unknown, props: T) => BaseRenderableconst createElement: (tag: string) => BaseRenderableconst createTextNode: (value: string) => BaseRenderableconst effect: <T>(fn: (prev?: T) => T, init?: T) => voidconst insert: <T>(parent: any, accessor: T | (() => T), marker?: any | null, initial?: any) => BaseRenderableconst insertNode: (parent: BaseRenderable, node: BaseRenderable, anchor?: BaseRenderable | undefined) => voidconst memo: <T>(fn: () => T, equal: boolean) => () => Tconst mergeProps: (...sources: unknown[]) => unknownconst onBlur: (callback: () => void) => voidconst onFocus: (callback: () => void) => voidconst onResize: (callback: (width: number, height: number) => void) => voidconst render: (node: () => JSX.Element, rendererOrConfig?: CliRenderer | CliRendererConfig) => Promise<void>const RenderableContext: Context<(() => RenderContext) | undefined>const RendererContext: Context<CliRenderer | undefined>const setProp: <T>(node: BaseRenderable, name: string, value: T, prev?: T | undefined) => Tconst spread: <T>(node: any, accessor: (() => T) | T, skipChildren?: boolean) => voidconst testRender: (node: () => JSX.Element, renderConfig?: TestRendererOptions) => Promise<TestRendererSetup>const textNodeKeys: readonly [ "span", "b", "strong", "i", "em", "u", "a" ]const TimeToFirstDraw: (props: TimeToFirstDrawProps) => anyconst use: <A, T>(fn: (element: BaseRenderable, arg: A) => T, element: BaseRenderable, arg: A) => Tconst useKeyboard: (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => voiddeprecated const useKeyHandler: (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => voidconst usePaste: (callback: (event: PasteEvent) => void) => voidconst useRenderer: () => CliRendererconst useSelectionHandler: (callback: (selection: Selection) => void) => voidconst useTerminalDimensions: () => Accessor<{ width: number; height: number; }>const useTimeline: (options?: TimelineOptions) => Timeline
Namespaces and re-exports#
namespace JSXinterface JSX.ElementChildrenAttributeinterface JSX.IntrinsicElements extends ExtendedIntrinsicElements<OpenTUIComponents>property JSX.ElementChildrenAttribute.children: {}property JSX.IntrinsicElements.a: LinkPropsproperty JSX.IntrinsicElements.ascii_font: AsciiFontPropsproperty JSX.IntrinsicElements.b: SpanPropsproperty JSX.IntrinsicElements.box: BoxPropsproperty JSX.IntrinsicElements.br: {}property JSX.IntrinsicElements.code: CodePropsproperty JSX.IntrinsicElements.em: SpanPropsproperty JSX.IntrinsicElements.i: SpanPropsproperty JSX.IntrinsicElements.image: ImageProps0.5.0property JSX.IntrinsicElements.input: InputPropsproperty JSX.IntrinsicElements.markdown: MarkdownPropsproperty JSX.IntrinsicElements.scrollbox: ScrollBoxPropsproperty JSX.IntrinsicElements.select: SelectPropsproperty JSX.IntrinsicElements.span: SpanPropsproperty JSX.IntrinsicElements.strong: SpanPropsproperty JSX.IntrinsicElements.tab_select: TabSelectPropsproperty JSX.IntrinsicElements.text: TextPropsproperty JSX.IntrinsicElements.textarea: TextareaPropsproperty JSX.IntrinsicElements.u: SpanPropstype JSX.Element = SolidJSX.Element
index OpenTUIComponents[componentName: string]: RenderableConstructorinterface OpenTUIComponentsproperty OpenTUIComponents.time_to_first_draw: typeof TimeToFirstDrawRenderable
reexport SlotMode from "@opentui/core"