feat: fix types and add type checking plus lazybundle on launch andddd dev flag

This commit is contained in:
Brooklyn Nicholson 2026-04-11 14:42:28 -05:00
parent 5e5e65f6d5
commit 32302c37dd
34 changed files with 1807 additions and 977 deletions

View file

@ -32,7 +32,7 @@ type Props = PropsWithChildren<{
* from scrolling content) and so signal-exit cleanup can exit the alt
* screen if the component's own unmount doesn't run.
*/
export function AlternateScreen(t0) {
export function AlternateScreen(t0: Props) {
const $ = _c(7)
const { children, mouseTracking: t1 } = t0

View file

@ -1,6 +1,6 @@
import '../global.d.ts'
import React, { type Ref } from 'react'
import React, { type ReactNode, type Ref } from 'react'
import { c as _c } from 'react/compiler-runtime'
import type { Except } from 'type-fest'
@ -11,6 +11,7 @@ import type { KeyboardEvent } from '../events/keyboard-event.js'
import type { Styles } from '../styles.js'
import * as warn from '../warn.js'
export type Props = Except<Styles, 'textWrap'> & {
children?: ReactNode
ref?: Ref<DOMElement>
/**
* Tab order index. Nodes with `tabIndex >= 0` participate in
@ -50,7 +51,7 @@ export type Props = Except<Styles, 'textWrap'> & {
/**
* `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
*/
function Box(t0) {
function Box(t0: Props) {
const $ = _c(42)
let autoFocus
let children

View file

@ -1,4 +1,4 @@
import React, { createContext, useEffect, useState } from 'react'
import React, { createContext, type ReactNode, useEffect, useState } from 'react'
import { c as _c } from 'react/compiler-runtime'
import { BLURRED_FRAME_INTERVAL_MS, FRAME_INTERVAL_MS } from '../constants.js'
@ -87,7 +87,7 @@ export const ClockContext = createContext<Clock | null>(null)
// Own component so App.tsx doesn't re-render when the clock is created.
// The clock value is stable (created once via useState), so the provider
// never causes consumer re-renders on its own.
export function ClockProvider(t0) {
export function ClockProvider(t0: { readonly children: ReactNode }) {
const $ = _c(7)
const { children } = t0

View file

@ -11,7 +11,7 @@ export type Props = {
readonly fallback?: ReactNode
}
export default function Link(t0) {
export default function Link(t0: Props) {
const $ = _c(5)
const { children, url, fallback } = t0

View file

@ -12,7 +12,7 @@ export type Props = {
/**
* Adds one or more newline (\n) characters. Must be used within <Text> components.
*/
export default function Newline(t0) {
export default function Newline(t0: Props) {
const $ = _c(4)
const { count: t1 } = t0

View file

@ -33,7 +33,7 @@ type Props = Omit<BoxProps, 'noSelect'> & {
* tracking). No-op in the main-screen scrollback render where the
* terminal's native selection is used instead.
*/
export function NoSelect(t0) {
export function NoSelect(t0: Props) {
const $ = _c(8)
let boxProps
let children

View file

@ -25,7 +25,7 @@ type Props = {
* (width × lines.length) and hands the joined string straight to output.write(),
* which already splits on '\n' and parses ANSI into the screen buffer.
*/
export function RawAnsi(t0) {
export function RawAnsi(t0: Props) {
const $ = _c(6)
const { lines, width } = t0

View file

@ -252,7 +252,7 @@ function ScrollBox({ children, ref, stickyScroll, ...style }: PropsWithChildren<
// commit, which is too late for the first frame.
return (
<ink-box
ref={el => {
ref={(el: DOMElement | null) => {
domRef.current = el
if (el) {

View file

@ -1,4 +1,4 @@
import React, { createContext, useSyncExternalStore } from 'react'
import React, { createContext, type ReactNode, useSyncExternalStore } from 'react'
import { c as _c } from 'react/compiler-runtime'
import {
@ -23,7 +23,7 @@ TerminalFocusContext.displayName = 'TerminalFocusContext'
// Separate component so App.tsx doesn't re-render on focus changes.
// Children are a stable prop reference, so they don't re-render either —
// only components that consume the context will re-render.
export function TerminalFocusProvider(t0) {
export function TerminalFocusProvider(t0: { readonly children: ReactNode }) {
const $ = _c(6)
const { children } = t0

View file

@ -116,7 +116,7 @@ const memoizedStylesForWrap: Record<NonNullable<Styles['textWrap']>, Styles> = {
/**
* This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
*/
export default function Text(t0) {
export default function Text(t0: Props) {
const $ = _c(29)
const {