/** * Twoslash support for code fences that opt in with ```ts twoslash. * * Twoslash runs the snippet through the TypeScript compiler and annotates it * with the real inferred types, which is what makes a hover show `string` * rather than a guess. The cost is that it **throws** on anything that does not * typecheck: a missing import, a type error, an incomplete fragment. * * That strictness is the point, but it must not be able to take a whole site * down. {@link highlightWithTwoslash} therefore falls back to an ordinary * highlight and warns, naming the file, rather than failing the build over one * bad snippet. * * The packages are optional peer dependencies, loaded only when a fence asks * for them, so sites that never use Twoslash pay nothing for it. */ import type { ShikiTransformer } from 'shiki'; type Loaded = { transformer: ShikiTransformer; } | { error: string; }; export declare function twoslashTransformer(): Promise; /** One-line reason a snippet could not be annotated, for the build warning. */ export declare function twoslashFailure(error: unknown): string; export {};