import { type ReactNode } from 'react'; /** * Creates a Pierre highlighting worker. Apps own this because the URL has to be * resolved by their own bundler; Vite uses * `import WorkerUrl from '@pierre/diffs/worker/worker.js?worker&url'`. */ export type PierreWorkerFactory = () => Worker; /** * Shiki tokenization is the expensive part of rendering a diff and runs on the * main thread unless a worker pool is provided. Two workers cover the common * case (a handful of files in one tool card) without paying for a full Shiki * grammar/theme runtime per core; the cap keeps memory bounded on big * machines and the floor keeps low-core devices working. */ export declare function resolvePoolSize(hardwareConcurrency?: number): number; interface PierreDiffProviderProps { children: ReactNode; /** Defer config reads until the host has configured its API client. */ configEnabled?: boolean; /** * Omit to keep main-thread highlighting (used by tests/SSR and by any * consumer whose bundler cannot emit a worker chunk). */ workerFactory?: PierreWorkerFactory; } /** * Mounts the shared Pierre worker pool once, at the app root, so every diff * surface (inline tool cards and the full Git/session panes) offloads Shiki * highlighting and shares one AST cache. * * The pool is a module-level singleton inside `@pierre/diffs`; keeping this * provider mounted for the app's lifetime means collapsing a card never tears * the workers down. If worker start-up fails, `WorkerPoolManager` marks itself * as failed and the renderers fall back to main-thread highlighting on their * own, so a diff never ends up stuck as plain text. */ export declare function PierreDiffProvider({ children, configEnabled, workerFactory, }: PierreDiffProviderProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=PierreWorkerProvider.d.ts.map