@rspress/plugin-preview 1.40.2 → 1.41.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/dist/index.d.ts CHANGED
@@ -1,67 +1,68 @@
1
- import { RspressPlugin } from '@rspress/shared';
2
- import { RsbuildConfig } from '@rsbuild/core';
3
-
4
- type Options = {
5
- /**
6
- * @deprecated Use previewMode instead.
7
- * true = 'iframe'
8
- * false = 'internal'
9
- */
10
- isMobile?: boolean;
11
- /**
12
- * @deprecated Use iframeOptions.position instead.
13
- */
14
- iframePosition?: 'fixed' | 'follow';
15
- /**
16
- * internal mode: component will be rendered inside the documentation, only support react.
17
- *
18
- * iframe mode: component will be rendered in iframe, note that aside will hide.
19
- * @default 'internal'
20
- */
21
- previewMode?: 'internal' | 'iframe';
22
- /**
23
- * enable when preview mode is iframe.
24
- */
25
- iframeOptions?: IframeOptions;
26
- /**
27
- * determine how to handle a internal code block without meta
28
- * @default 'preview'
29
- */
30
- defaultRenderMode?: 'pure' | 'preview';
31
- /**
32
- * Supported languages to be previewed
33
- */
34
- previewLanguages?: string[];
35
- /**
36
- * Transform previewed code in custom way
37
- */
38
- previewCodeTransform?: (codeInfo: {
39
- language: string;
40
- code: string;
41
- }) => string;
42
- };
43
- type IframeOptions = {
44
- /**
45
- * framework in the iframe
46
- * @default 'react'
47
- */
48
- framework?: 'react' | 'solid';
49
- /**
50
- * position of the iframe
51
- * @default 'follow'
52
- */
53
- position?: 'fixed' | 'follow';
54
- /**
55
- * dev server port for the iframe
56
- * @default 7890
57
- */
58
- devPort?: number;
59
- builderConfig?: RsbuildConfig;
60
- };
61
-
62
- /**
63
- * The plugin is used to preview component.
64
- */
65
- declare function pluginPreview(options?: Options): RspressPlugin;
66
-
67
- export { type Options, pluginPreview };
1
+ import type { RsbuildConfig } from '@rsbuild/core';
2
+ import { RspressPlugin } from '@rspress/shared';
3
+
4
+ declare type IframeOptions = {
5
+ /**
6
+ * framework in the iframe
7
+ * @default 'react'
8
+ */
9
+ framework?: 'react' | 'solid';
10
+ /**
11
+ * position of the iframe
12
+ * @default 'follow'
13
+ */
14
+ position?: 'fixed' | 'follow';
15
+ /**
16
+ * dev server port for the iframe
17
+ * @default 7890
18
+ */
19
+ devPort?: number;
20
+ builderConfig?: RsbuildConfig;
21
+ };
22
+
23
+ export declare type Options = {
24
+ /**
25
+ * @deprecated Use previewMode instead.
26
+ * true = 'iframe'
27
+ * false = 'internal'
28
+ */
29
+ isMobile?: boolean;
30
+ /**
31
+ * @deprecated Use iframeOptions.position instead.
32
+ */
33
+ iframePosition?: 'fixed' | 'follow';
34
+ /**
35
+ * internal mode: component will be rendered inside the documentation, only support react.
36
+ *
37
+ * iframe mode: component will be rendered in iframe, note that aside will hide.
38
+ * @default 'internal'
39
+ */
40
+ previewMode?: 'internal' | 'iframe';
41
+ /**
42
+ * enable when preview mode is iframe.
43
+ */
44
+ iframeOptions?: IframeOptions;
45
+ /**
46
+ * determine how to handle a internal code block without meta
47
+ * @default 'preview'
48
+ */
49
+ defaultRenderMode?: 'pure' | 'preview';
50
+ /**
51
+ * Supported languages to be previewed
52
+ */
53
+ previewLanguages?: string[];
54
+ /**
55
+ * Transform previewed code in custom way
56
+ */
57
+ previewCodeTransform?: (codeInfo: {
58
+ language: string;
59
+ code: string;
60
+ }) => string;
61
+ };
62
+
63
+ /**
64
+ * The plugin is used to preview component.
65
+ */
66
+ export declare function pluginPreview(options?: Options): RspressPlugin;
67
+
68
+ export { }