// Type declarations for packages without built-in types declare module 'bidi-js' { interface BidiInstance { getEmbeddingLevels( text: string, direction?: string, ): { levels: Uint8Array; paragraphs: Array<{ start: number; end: number; level: number }> } getReorderSegments( text: string, explicitDirection?: string, ): Array<{ start: number; end: number; level: number }> getMirroredCharacter(char: string): string | null getMirroredCharactersMap( text: string, levels: Uint8Array, start?: number, end?: number, ): Map } function bidiFactory(): BidiInstance export default bidiFactory } declare module 'react-reconciler' { import type { ReactNode } from 'react' interface FiberRoot { current: unknown containerInfo: unknown pendingChildren: unknown [key: string]: unknown } interface Reconciler { createContainer( containerInfo: Container, tag: number, hydrationCallbacks: null, isStrictMode: boolean, concurrentUpdatesByDefaultOverride: null, identifierPrefix: string, onUncaughtError: (...args: unknown[]) => void, onCaughtError: (...args: unknown[]) => void, onRecoverableError: (...args: unknown[]) => void, onDefaultTransitionIndicator: (...args: unknown[]) => void, ): FiberRoot updateContainer( element: ReactNode | null, container: FiberRoot, parentComponent: null, callback?: (() => void) | null, ): void updateContainerSync( element: ReactNode | null, container: FiberRoot, parentComponent: null, callback?: (() => void) | null, ): void flushSync(fn: () => R): R flushSyncWork(): void flushSyncFromReconciler(): void discreteUpdates(fn: (a: A, b: B, c: C, d: D) => R, a: A, b: B, c: C, d: D): R getPublicRootInstance(container: FiberRoot): unknown injectIntoDevTools(devToolsConfig: { bundleType: number version: string rendererPackageName: string }): boolean } function createReconciler< Type, Props, Container, Instance, TextInstance, SuspenseInstance, HydratableInstance, PublicInstance, HostContext, UpdatePayload, TimeoutHandle, NoTimeout, TransitionStatus, FormState = unknown, >(hostConfig: Record): Reconciler export type { FiberRoot, Reconciler } export default createReconciler } declare module 'react-reconciler/constants.js' { export const ContinuousEventPriority: number export const DefaultEventPriority: number export const DiscreteEventPriority: number export const NoEventPriority: number export const ConcurrentRoot: number export const LegacyRoot: number } // Note: `declare const Bun: any` is intentionally NOT declared globally here. // Each file that uses Bun APIs declares it locally alongside its fallback code. // This ensures any new Bun-specific usage without a fallback produces a TS error. // See: src/internal/string-width.ts, src/core/wrapAnsi.ts