react-exe
Version:
A powerful React component executor that renders code with external dependencies and custom styling
26 lines (25 loc) • 762 B
TypeScript
import React from "react";
export interface CodeFile {
name: string;
content: string;
isEntry?: boolean;
}
export interface CodeExecutorConfig {
dependencies?: Record<string, any>;
containerClassName?: string;
containerStyle?: React.CSSProperties;
errorClassName?: string;
errorStyle?: React.CSSProperties;
securityPatterns?: RegExp[];
onError?: (error: Error) => void;
enableTailwind?: boolean;
autoResolvePackage?: boolean;
sandbox?: boolean;
}
export interface CodeExecutorProps {
code: string | CodeFile[];
config?: CodeExecutorConfig;
}
export declare const CodeExecutor: React.FC<CodeExecutorProps>;
declare const _default: React.NamedExoticComponent<CodeExecutorProps>;
export default _default;