Skip to content

Commit ac60c42

Browse files
committed
doc: Update README.md
1 parent 8bba107 commit ac60c42

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Demo extends React.Component {
5454
### Props
5555

5656
```typescript
57-
export interface ICodePreviewProps extends SplitProps {
57+
interface CodePreviewProps extends SplitProps {
5858
prefixCls?: string;
5959
style?: React.CSSProperties;
6060
/**
@@ -103,8 +103,15 @@ export interface ICodePreviewProps extends SplitProps {
103103
/**
104104
* Dependent component
105105
*/
106-
dependencies?: { [key: string]: any };
107-
codePenOption?: ICodePenOption;
106+
dependencies?: Record<string, any>;
107+
codePenOption?: CodepenProps & {
108+
/**
109+
* Packages that do not require comments.
110+
* @example ['uiw']
111+
*/
112+
includeModule?: string[];
113+
};
114+
codeSandboxOption?: CodeSandboxProps;
108115
/** @default 'Code' */
109116
btnText?: string;
110117
/** @default 'Hide Editor' */
@@ -113,7 +120,7 @@ export interface ICodePreviewProps extends SplitProps {
113120
```
114121

115122
```typescript
116-
interface ICodePenOption {
123+
type CodePenOption = {
117124
title?: string;
118125
html?: string;
119126
js?: string;
@@ -122,6 +129,33 @@ interface ICodePenOption {
122129
css_external?: string;
123130
js_external?: string;
124131
js_pre_processor?: string;
132+
};
133+
type CodepenProps = CodePenOption & React.FormHTMLAttributes<HTMLFormElement>;
134+
```
135+
136+
```typescript
137+
type CodeSandboxProps = React.FormHTMLAttributes<HTMLFormElement> & {
138+
/**
139+
* Whether we should redirect to the embed instead of the editor.
140+
*/
141+
embed?: boolean;
142+
/**
143+
* The query that will be used in the redirect url. `embed` must be equal to `true`, `embed=true`.
144+
* [CodeSandbox Embed Options](https://codesandbox.io/docs/embedding#embed-options)
145+
* @example `view=preview&runonclick=1`
146+
*/
147+
query?: string;
148+
/**
149+
* Instead of redirecting we will send a JSON reponse with `{"sandbox_id": sandboxId}`.
150+
*/
151+
json?: boolean;
152+
/**
153+
* Parameters used to define how the sandbox should be created.
154+
*/
155+
files?: Record<string, {
156+
content?: string | Record<string, any>;
157+
isBinary?: boolean;
158+
}>;
125159
}
126160
```
127161

0 commit comments

Comments
 (0)