react-web-code-editor
Version:
A Simple and code-style Customizable web code editor with React
21 lines (20 loc) • 976 B
TypeScript
import React from 'react';
import { FlattenSimpleInterpolation } from 'styled-components';
import './languages';
import themes from './themes';
import { FontWeight } from './styles';
declare type themeList = keyof typeof themes;
declare type lang = 'typescript' | 'javascript' | 'java' | 'python' | 'rust' | 'ruby' | 'swift' | 'r' | 'c' | 'cpp' | 'csharp' | 'cobol' | 'kotlin' | 'haskell' | 'arduino' | 'coffeescript' | 'clojure' | 'dart' | 'yaml' | 'markdown' | 'markup' | 'docker' | 'graphql' | 'json' | 'css' | 'sass' | 'scss';
interface CodeEditorProps {
indent?: number;
theme?: themeList | 'light' | 'dark';
language?: lang;
width?: string;
height?: string;
fontSize?: string;
fontWeight?: FontWeight;
className?: string;
interpolation?: FlattenSimpleInterpolation;
}
declare const CodeEditor: React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<HTMLTextAreaElement>>;
export default CodeEditor;