react-code-canvas
Version:
Package to run and preview React code with live editing capabilities in a browser.
14 lines (13 loc) • 563 B
TypeScript
import { UseRunnerProps } from './useRunner';
import { UseRunnerReturn } from './useRunner';
export type UseLiveRunnerProps = Omit<UseRunnerProps, 'code'> & {
/** initial code for the live runner */
initialCode?: string;
/** transform the code before transpiling */
transformCode?: (code: string) => string;
};
export type UseLiveRunnerRetrun = UseRunnerReturn & {
code: string;
onChange: (value: string) => void;
};
export declare const useLiveRunner: ({ initialCode, transformCode, ...rest }: UseLiveRunnerProps) => UseLiveRunnerRetrun;