codice
Version:
Codice is a slim React components suite for code editing and displaying story. It provides an editor component and a code block component with syntax highlighting. Styling customization is enabled through CSS variables and HTML attributes.
35 lines (31 loc) • 1.18 kB
TypeScript
import * as react from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
declare const Editor: react.ForwardRefExoticComponent<{
title?: string;
value?: string;
controls?: boolean;
lineNumbers?: boolean;
lineNumbersWidth?: string;
padding?: string;
extension?: string;
onChangeTitle?: (title: string) => void;
onChange?: (code: string) => void;
} & {
fontSize?: string | number;
fontFamily?: string;
} & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
declare function Code({ children: code, title, controls, fontSize, highlightLines, preformatted, lineNumbers, lineNumbersWidth, padding, asMarkup, extension, ...props }: {
children: string;
/** Whether to use a preformatted block <pre><code> */
preformatted?: boolean;
fontSize?: string | number;
highlightLines?: ([number, number] | number)[];
title?: string;
controls?: boolean;
lineNumbers?: boolean;
lineNumbersWidth?: string;
padding?: string;
asMarkup?: boolean;
extension?: string;
} & React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
export { Code, Editor };