UNPKG

@rtdui/code-highlight

Version:

React code highlight component based on refractor

43 lines (42 loc) 973 B
export interface CodeHighlightProps { /** Code to highlight */ code: string; /** * Code language * @default tsx */ language?: string; /** * Determines whether copy button should be displayed * @default true */ withCopyButton?: boolean; /** * Copy tooltip label * @default 'Copy code' */ copyLabel?: string; /** * Copied tooltip label * @default 'Copied' */ copiedLabel?: string; /** * 是否启用diff形式 */ diff?: boolean; /** * 是否显示行号 * @default false */ showLineNumbers?: boolean; /** 字符串范围表示的需要突出显示的行 * 如: {1,3-4} */ highlingtLines?: string; /** 坏的范例 * @default false */ bad?: boolean; } export declare const CodeHighlight: import("react").ForwardRefExoticComponent<CodeHighlightProps & import("react").RefAttributes<HTMLDivElement>>;