twoslash-python
Version:
Twoslash generator for Python - Enhance your Python documentation with TypeScript-like type information
24 lines • 1.28 kB
TypeScript
/**
* This file is the core of the @shikijs/twoslash package,
* Decoupled from twoslash's implementation and allowing to introduce custom implementation or cache system.
*/
import type { CodeToHastOptions, ShikiTransformer } from '@shikijs/types';
import type { TwoslashExecuteOptions } from 'twoslash';
import type { TransformerTwoslashOptions, TwoslashRenderer } from '@shikijs/twoslash/core';
import { type TwoslashShikiFunctionPython } from './twoslasher.js';
export declare function defaultTwoslashOptions(): TwoslashExecuteOptions;
interface TransformerTwoslashPythonOptions {
langs?: string[];
langAlias?: Record<string, string>;
twoslasher: TwoslashShikiFunctionPython;
explicitTrigger?: boolean | RegExp;
disableTriggers?: string[];
renderer?: TwoslashRenderer;
throws?: boolean;
onTwoslashError?: (error: Error, code: string, lang: string, options: TransformerTwoslashOptions) => void;
onShikiError?: (error: Error, source: string, lang: string) => void;
filter?: (lang: string | undefined, code: string, options: CodeToHastOptions<string, string>) => boolean;
}
export declare function transformerTwoslashPython(options: TransformerTwoslashPythonOptions): ShikiTransformer;
export {};
//# sourceMappingURL=transformer.d.ts.map