UNPKG

@podlite/to-jsx

Version:

Render Podlite markup as React JSX components

56 lines (55 loc) 1.78 kB
import * as React from 'react'; import { PodNode, PodliteExport } from '@podlite/schema'; export type CreateElement = typeof React.createElement; export declare class BlockBoundary extends React.Component<{ blockName?: string; children?: React.ReactNode; }, { failed: boolean; }> { state: { failed: boolean; }; static getDerivedStateFromError(): { failed: boolean; }; componentDidCatch(error: Error): void; render(): React.ReactNode; } export interface WrapElement { (node: PodNode, children: React.ReactNode[] | React.ReactNode, ctx: any): JSX.Element; } export declare const Podlite: React.FC<{ [key: string]: any; children?: string; file?: string; plugins?: any; wrapElement?: WrapElement; tree?: PodliteExport; mode?: 'pod' | 'md'; includeReader?: IncludeReader; includeBaseDir?: string; expandPaths?: ExpandPaths; imageSrc?: ImageSrcResolver; imageBaseDir?: string; renderMode?: 'production' | 'draft'; }>; type IncludeReader = (path: string, baseDir?: string) => string | null; type ExpandPaths = (pattern: string, baseDir?: string) => string[]; export type ImageSrcResolver = (src: string, baseDir?: string) => string | Promise<string>; export declare const HookedImage: React.FC<{ src: string; alt?: string; hook: ImageSrcResolver; baseDir?: string; render?: (resolved: string) => React.ReactElement; }>; export declare const TestPodlite: ({ children, ...options }: { [x: string]: any; children: any; }) => React.JSX.Element; export declare const makeTestPodlite: (podlite?: import("@podlite/schema").Podlite) => ({ children, ...options }: { [x: string]: any; children: any; }) => React.JSX.Element; export default Podlite;