@depup/react-live 4.1.8-depup.0 → 5.0.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -11
- package/changes.json +3 -12
- package/dist/index.d.mts +166 -0
- package/dist/index.d.ts +152 -103
- package/dist/index.js +270 -381
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +244 -345
- package/dist/index.mjs.map +1 -1
- package/package.json +68 -92
package/README.md
CHANGED
|
@@ -13,17 +13,10 @@ npm install @depup/react-live
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [react-live](https://www.npmjs.com/package/react-live) @
|
|
17
|
-
| Processed | 2026-
|
|
18
|
-
| Smoke test |
|
|
19
|
-
| Deps updated |
|
|
20
|
-
|
|
21
|
-
## Dependency Changes
|
|
22
|
-
|
|
23
|
-
| Dependency | From | To |
|
|
24
|
-
|------------|------|-----|
|
|
25
|
-
| prism-react-renderer | ^2.4.0 | ^2.4.1 |
|
|
26
|
-
| sucrase | ^3.35.0 | ^3.35.1 |
|
|
16
|
+
| Original | [react-live](https://www.npmjs.com/package/react-live) @ 5.0.0 |
|
|
17
|
+
| Processed | 2026-09-27 |
|
|
18
|
+
| Smoke test | passed |
|
|
19
|
+
| Deps updated | 0 |
|
|
27
20
|
|
|
28
21
|
---
|
|
29
22
|
|
package/changes.json
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bumped": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"to": "^2.4.1"
|
|
6
|
-
},
|
|
7
|
-
"sucrase": {
|
|
8
|
-
"from": "^3.35.0",
|
|
9
|
-
"to": "^3.35.1"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"timestamp": "2026-03-18T23:30:47.259Z",
|
|
13
|
-
"totalUpdated": 2
|
|
2
|
+
"bumped": {},
|
|
3
|
+
"timestamp": "2026-09-27T01:02:02.585Z",
|
|
4
|
+
"totalUpdated": 0
|
|
14
5
|
}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Prism, themes } from "prism-react-renderer";
|
|
2
|
+
import React, { CSSProperties, ComponentType, PropsWithChildren } from "react";
|
|
3
|
+
//#region src/components/Editor/index.d.ts
|
|
4
|
+
type Props$3 = {
|
|
5
|
+
className?: string;
|
|
6
|
+
code: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
language: string;
|
|
9
|
+
prism?: typeof Prism;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
tabMode?: "focus" | "indentation";
|
|
12
|
+
theme?: typeof themes.nightOwl;
|
|
13
|
+
onChange?(value: string): void;
|
|
14
|
+
};
|
|
15
|
+
declare const CodeEditor: (props: Props$3) => import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/Live/LiveProvider.d.ts
|
|
18
|
+
type Props$2 = {
|
|
19
|
+
code?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
enableTypeScript?: boolean;
|
|
22
|
+
language?: string;
|
|
23
|
+
noInline?: boolean;
|
|
24
|
+
scope?: Record<string, unknown>;
|
|
25
|
+
theme?: typeof themes.nightOwl;
|
|
26
|
+
transformCode?(code: string): void;
|
|
27
|
+
};
|
|
28
|
+
declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline }: PropsWithChildren<Props$2>): import("react").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/Live/LiveEditor.d.ts
|
|
31
|
+
declare function LiveEditor(props: Partial<Props$3>): React.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/Live/LiveError.d.ts
|
|
34
|
+
declare function LiveError<T extends Record<string, unknown>>(props: T): React.JSX.Element | null;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/Live/LivePreview.d.ts
|
|
37
|
+
type Props$1<T extends React.ElementType = React.ElementType> = {
|
|
38
|
+
Component?: T;
|
|
39
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
40
|
+
declare function LivePreview<T extends keyof React.JSX.IntrinsicElements>(props: Props$1<T>): React.JSX.Element;
|
|
41
|
+
declare function LivePreview<T extends React.ElementType>(props: Props$1<T>): React.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/Live/LiveContext.d.ts
|
|
44
|
+
type LiveContextValue = {
|
|
45
|
+
error?: string;
|
|
46
|
+
element?: ComponentType | null;
|
|
47
|
+
code: string;
|
|
48
|
+
newCode?: string;
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
language: string;
|
|
51
|
+
theme?: typeof themes.nightOwl;
|
|
52
|
+
onError(error: Error): void;
|
|
53
|
+
onChange(value: string): void;
|
|
54
|
+
};
|
|
55
|
+
declare const LiveContext: import("react").Context<LiveContextValue>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/hoc/withLive.d.ts
|
|
58
|
+
type Props = {
|
|
59
|
+
live: LiveContextValue;
|
|
60
|
+
};
|
|
61
|
+
declare function withLive<T>(WrappedComponent: ComponentType<T & Props>): {
|
|
62
|
+
(props: T): React.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/utils/transpile/index.d.ts
|
|
67
|
+
type GenerateOptions = {
|
|
68
|
+
code: string;
|
|
69
|
+
scope?: Record<string, unknown>;
|
|
70
|
+
enableTypeScript: boolean;
|
|
71
|
+
};
|
|
72
|
+
export declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
|
|
73
|
+
new (props: Record<string, never>): {
|
|
74
|
+
state: {
|
|
75
|
+
hasError: boolean;
|
|
76
|
+
};
|
|
77
|
+
componentDidCatch(error: Error): void;
|
|
78
|
+
render(): React.JSX.Element | null;
|
|
79
|
+
context: unknown;
|
|
80
|
+
setState<K extends "hasError">(state: Pick<{
|
|
81
|
+
hasError: boolean;
|
|
82
|
+
}, K> | ((prevState: Readonly<{
|
|
83
|
+
hasError: boolean;
|
|
84
|
+
}>, props: Readonly<Record<string, never>>) => Pick<{
|
|
85
|
+
hasError: boolean;
|
|
86
|
+
}, K> | {
|
|
87
|
+
hasError: boolean;
|
|
88
|
+
} | null) | {
|
|
89
|
+
hasError: boolean;
|
|
90
|
+
} | null, callback?: (() => void) | undefined): void;
|
|
91
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
92
|
+
readonly props: Readonly<Record<string, never>>;
|
|
93
|
+
componentDidMount?(): void;
|
|
94
|
+
shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
95
|
+
hasError: boolean;
|
|
96
|
+
}>, nextContext: any): boolean;
|
|
97
|
+
componentWillUnmount?(): void;
|
|
98
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
99
|
+
hasError: boolean;
|
|
100
|
+
}>): any;
|
|
101
|
+
componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
102
|
+
hasError: boolean;
|
|
103
|
+
}>, snapshot?: any): void;
|
|
104
|
+
componentWillMount?(): void;
|
|
105
|
+
UNSAFE_componentWillMount?(): void;
|
|
106
|
+
componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
107
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
108
|
+
componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
109
|
+
hasError: boolean;
|
|
110
|
+
}>, nextContext: any): void;
|
|
111
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
112
|
+
hasError: boolean;
|
|
113
|
+
}>, nextContext: any): void;
|
|
114
|
+
};
|
|
115
|
+
new (props: Record<string, never>, context: any): {
|
|
116
|
+
state: {
|
|
117
|
+
hasError: boolean;
|
|
118
|
+
};
|
|
119
|
+
componentDidCatch(error: Error): void;
|
|
120
|
+
render(): React.JSX.Element | null;
|
|
121
|
+
context: unknown;
|
|
122
|
+
setState<K extends "hasError">(state: Pick<{
|
|
123
|
+
hasError: boolean;
|
|
124
|
+
}, K> | ((prevState: Readonly<{
|
|
125
|
+
hasError: boolean;
|
|
126
|
+
}>, props: Readonly<Record<string, never>>) => Pick<{
|
|
127
|
+
hasError: boolean;
|
|
128
|
+
}, K> | {
|
|
129
|
+
hasError: boolean;
|
|
130
|
+
} | null) | {
|
|
131
|
+
hasError: boolean;
|
|
132
|
+
} | null, callback?: (() => void) | undefined): void;
|
|
133
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
134
|
+
readonly props: Readonly<Record<string, never>>;
|
|
135
|
+
componentDidMount?(): void;
|
|
136
|
+
shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
137
|
+
hasError: boolean;
|
|
138
|
+
}>, nextContext: any): boolean;
|
|
139
|
+
componentWillUnmount?(): void;
|
|
140
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
141
|
+
hasError: boolean;
|
|
142
|
+
}>): any;
|
|
143
|
+
componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
144
|
+
hasError: boolean;
|
|
145
|
+
}>, snapshot?: any): void;
|
|
146
|
+
componentWillMount?(): void;
|
|
147
|
+
UNSAFE_componentWillMount?(): void;
|
|
148
|
+
componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
149
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
150
|
+
componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
151
|
+
hasError: boolean;
|
|
152
|
+
}>, nextContext: any): void;
|
|
153
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
154
|
+
hasError: boolean;
|
|
155
|
+
}>, nextContext: any): void;
|
|
156
|
+
};
|
|
157
|
+
getDerivedStateFromError(): {
|
|
158
|
+
hasError: boolean;
|
|
159
|
+
};
|
|
160
|
+
contextType?: React.Context<any> | undefined;
|
|
161
|
+
propTypes?: any;
|
|
162
|
+
};
|
|
163
|
+
export declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
|
|
164
|
+
//#endregion
|
|
165
|
+
export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider, withLive };
|
|
166
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,117 +1,166 @@
|
|
|
1
|
-
import { Prism, themes } from
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Prism, themes } from "prism-react-renderer";
|
|
2
|
+
import React, { CSSProperties, ComponentType, PropsWithChildren } from "react";
|
|
3
|
+
//#region src/components/Editor/index.d.ts
|
|
5
4
|
type Props$3 = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
className?: string;
|
|
6
|
+
code: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
language: string;
|
|
9
|
+
prism?: typeof Prism;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
tabMode?: "focus" | "indentation";
|
|
12
|
+
theme?: typeof themes.nightOwl;
|
|
13
|
+
onChange?(value: string): void;
|
|
15
14
|
};
|
|
16
|
-
declare const CodeEditor: (props: Props$3) => JSX.Element;
|
|
17
|
-
|
|
15
|
+
declare const CodeEditor: (props: Props$3) => import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/Live/LiveProvider.d.ts
|
|
18
18
|
type Props$2 = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
code?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
enableTypeScript?: boolean;
|
|
22
|
+
language?: string;
|
|
23
|
+
noInline?: boolean;
|
|
24
|
+
scope?: Record<string, unknown>;
|
|
25
|
+
theme?: typeof themes.nightOwl;
|
|
26
|
+
transformCode?(code: string): void;
|
|
27
27
|
};
|
|
28
|
-
declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
declare function LiveProvider({ children, code, language, theme, enableTypeScript, disabled, scope, transformCode, noInline }: PropsWithChildren<Props$2>): import("react").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/Live/LiveEditor.d.ts
|
|
31
|
+
declare function LiveEditor(props: Partial<Props$3>): React.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/Live/LiveError.d.ts
|
|
34
|
+
declare function LiveError<T extends Record<string, unknown>>(props: T): React.JSX.Element | null;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/Live/LivePreview.d.ts
|
|
37
|
+
type Props$1<T extends React.ElementType = React.ElementType> = {
|
|
38
|
+
Component?: T;
|
|
39
|
+
} & React.ComponentPropsWithoutRef<T>;
|
|
40
|
+
declare function LivePreview<T extends keyof React.JSX.IntrinsicElements>(props: Props$1<T>): React.JSX.Element;
|
|
41
|
+
declare function LivePreview<T extends React.ElementType>(props: Props$1<T>): React.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/Live/LiveContext.d.ts
|
|
44
|
+
type LiveContextValue = {
|
|
45
|
+
error?: string;
|
|
46
|
+
element?: ComponentType | null;
|
|
47
|
+
code: string;
|
|
48
|
+
newCode?: string;
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
language: string;
|
|
51
|
+
theme?: typeof themes.nightOwl;
|
|
52
|
+
onError(error: Error): void;
|
|
53
|
+
onChange(value: string): void;
|
|
50
54
|
};
|
|
51
|
-
declare const LiveContext:
|
|
52
|
-
|
|
55
|
+
declare const LiveContext: import("react").Context<LiveContextValue>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/hoc/withLive.d.ts
|
|
53
58
|
type Props = {
|
|
54
|
-
|
|
59
|
+
live: LiveContextValue;
|
|
55
60
|
};
|
|
56
61
|
declare function withLive<T>(WrappedComponent: ComponentType<T & Props>): {
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
(props: T): React.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
59
64
|
};
|
|
60
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/utils/transpile/index.d.ts
|
|
61
67
|
type GenerateOptions = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
code: string;
|
|
69
|
+
scope?: Record<string, unknown>;
|
|
70
|
+
enableTypeScript: boolean;
|
|
65
71
|
};
|
|
66
|
-
declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
context: unknown;
|
|
71
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
72
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
73
|
-
readonly props: Readonly<{}>;
|
|
74
|
-
state: Readonly<{}>;
|
|
75
|
-
refs: {
|
|
76
|
-
[key: string]: React__default.ReactInstance;
|
|
77
|
-
};
|
|
78
|
-
componentDidMount?(): void;
|
|
79
|
-
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
80
|
-
componentWillUnmount?(): void;
|
|
81
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
82
|
-
componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
83
|
-
componentWillMount?(): void;
|
|
84
|
-
UNSAFE_componentWillMount?(): void;
|
|
85
|
-
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
86
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
87
|
-
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
88
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
72
|
+
export declare const generateElement: ({ code, scope, enableTypeScript }: GenerateOptions, errorCallback: (error: Error) => void) => {
|
|
73
|
+
new (props: Record<string, never>): {
|
|
74
|
+
state: {
|
|
75
|
+
hasError: boolean;
|
|
89
76
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
77
|
+
componentDidCatch(error: Error): void;
|
|
78
|
+
render(): React.JSX.Element | null;
|
|
79
|
+
context: unknown;
|
|
80
|
+
setState<K extends "hasError">(state: Pick<{
|
|
81
|
+
hasError: boolean;
|
|
82
|
+
}, K> | ((prevState: Readonly<{
|
|
83
|
+
hasError: boolean;
|
|
84
|
+
}>, props: Readonly<Record<string, never>>) => Pick<{
|
|
85
|
+
hasError: boolean;
|
|
86
|
+
}, K> | {
|
|
87
|
+
hasError: boolean;
|
|
88
|
+
} | null) | {
|
|
89
|
+
hasError: boolean;
|
|
90
|
+
} | null, callback?: (() => void) | undefined): void;
|
|
91
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
92
|
+
readonly props: Readonly<Record<string, never>>;
|
|
93
|
+
componentDidMount?(): void;
|
|
94
|
+
shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
95
|
+
hasError: boolean;
|
|
96
|
+
}>, nextContext: any): boolean;
|
|
97
|
+
componentWillUnmount?(): void;
|
|
98
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
99
|
+
hasError: boolean;
|
|
100
|
+
}>): any;
|
|
101
|
+
componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
102
|
+
hasError: boolean;
|
|
103
|
+
}>, snapshot?: any): void;
|
|
104
|
+
componentWillMount?(): void;
|
|
105
|
+
UNSAFE_componentWillMount?(): void;
|
|
106
|
+
componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
107
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
108
|
+
componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
109
|
+
hasError: boolean;
|
|
110
|
+
}>, nextContext: any): void;
|
|
111
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
112
|
+
hasError: boolean;
|
|
113
|
+
}>, nextContext: any): void;
|
|
114
|
+
};
|
|
115
|
+
new (props: Record<string, never>, context: any): {
|
|
116
|
+
state: {
|
|
117
|
+
hasError: boolean;
|
|
112
118
|
};
|
|
113
|
-
|
|
119
|
+
componentDidCatch(error: Error): void;
|
|
120
|
+
render(): React.JSX.Element | null;
|
|
121
|
+
context: unknown;
|
|
122
|
+
setState<K extends "hasError">(state: Pick<{
|
|
123
|
+
hasError: boolean;
|
|
124
|
+
}, K> | ((prevState: Readonly<{
|
|
125
|
+
hasError: boolean;
|
|
126
|
+
}>, props: Readonly<Record<string, never>>) => Pick<{
|
|
127
|
+
hasError: boolean;
|
|
128
|
+
}, K> | {
|
|
129
|
+
hasError: boolean;
|
|
130
|
+
} | null) | {
|
|
131
|
+
hasError: boolean;
|
|
132
|
+
} | null, callback?: (() => void) | undefined): void;
|
|
133
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
134
|
+
readonly props: Readonly<Record<string, never>>;
|
|
135
|
+
componentDidMount?(): void;
|
|
136
|
+
shouldComponentUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
137
|
+
hasError: boolean;
|
|
138
|
+
}>, nextContext: any): boolean;
|
|
139
|
+
componentWillUnmount?(): void;
|
|
140
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
141
|
+
hasError: boolean;
|
|
142
|
+
}>): any;
|
|
143
|
+
componentDidUpdate?(prevProps: Readonly<Record<string, never>>, prevState: Readonly<{
|
|
144
|
+
hasError: boolean;
|
|
145
|
+
}>, snapshot?: any): void;
|
|
146
|
+
componentWillMount?(): void;
|
|
147
|
+
UNSAFE_componentWillMount?(): void;
|
|
148
|
+
componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
149
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Record<string, never>>, nextContext: any): void;
|
|
150
|
+
componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
151
|
+
hasError: boolean;
|
|
152
|
+
}>, nextContext: any): void;
|
|
153
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Record<string, never>>, nextState: Readonly<{
|
|
154
|
+
hasError: boolean;
|
|
155
|
+
}>, nextContext: any): void;
|
|
156
|
+
};
|
|
157
|
+
getDerivedStateFromError(): {
|
|
158
|
+
hasError: boolean;
|
|
159
|
+
};
|
|
160
|
+
contextType?: React.Context<any> | undefined;
|
|
161
|
+
propTypes?: any;
|
|
114
162
|
};
|
|
115
|
-
declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
|
|
116
|
-
|
|
117
|
-
export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider,
|
|
163
|
+
export declare const renderElementAsync: ({ code, scope, enableTypeScript }: GenerateOptions, resultCallback: (sender: ComponentType) => void, errorCallback: (error: Error) => void) => void;
|
|
164
|
+
//#endregion
|
|
165
|
+
export { CodeEditor as Editor, LiveContext, LiveEditor, LiveError, LivePreview, LiveProvider, withLive };
|
|
166
|
+
//# sourceMappingURL=index.d.ts.map
|