UNPKG

849 BTypeScriptView Raw
1import { SFC, ComponentType as CT } from 'react';
2import { Entry } from '../state';
3export interface PlaygroundProps {
4 className?: string;
5 style?: any;
6 wrapper?: CT<any>;
7 components: ComponentsMap;
8 component: JSX.Element;
9 position: number;
10 code: string;
11 scope: Record<string, any>;
12 language?: string;
13 showLivePreview?: boolean;
14 useScoping?: boolean;
15}
16export interface LayoutProps {
17 doc: Entry;
18 [key: string]: any;
19}
20export interface ComponentsMap {
21 notFound?: CT;
22 layout?: CT<LayoutProps>;
23 playground?: CT<PlaygroundProps>;
24 [key: string]: any;
25}
26export interface ComponentsProviderProps {
27 components: ComponentsMap;
28}
29export declare const ComponentsProvider: SFC<ComponentsProviderProps>;
30export declare const useComponents: () => ComponentsMap;