markstream-octane 0.0.56-beta.1
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 +276 -0
- package/dist/client/chunks/languageIconExtended-BZR3DrgI.js +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/workers/katexRenderer.worker.js +59 -0
- package/dist/client/workers/mermaidParser.worker.js +63 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +845 -0
- package/dist/index.px.css +2 -0
- package/dist/index.tailwind.css +2009 -0
- package/dist/server/index.js +2 -0
- package/dist/server.d.ts +661 -0
- package/dist/tailwind.cjs +4 -0
- package/dist/tailwind.d.ts +2 -0
- package/dist/tailwind.js +2 -0
- package/dist/types/components/AdmonitionNode/AdmonitionNode.d.ts +12 -0
- package/dist/types/components/BlockquoteNode/BlockquoteNode.d.ts +8 -0
- package/dist/types/components/CheckboxNode/CheckboxNode.d.ts +7 -0
- package/dist/types/components/CodeBlockNode/CodeBlockNode.d.ts +14 -0
- package/dist/types/components/CodeBlockNode/HtmlPreviewFrame.d.ts +12 -0
- package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +3 -0
- package/dist/types/components/CodeBlockNode/monaco.d.ts +2 -0
- package/dist/types/components/CodeBlockNode/monacoThemeRegistry.d.ts +8 -0
- package/dist/types/components/CodeBlockNode/monacoThemeScheduler.d.ts +5 -0
- package/dist/types/components/D2BlockNode/D2BlockNode.d.ts +3 -0
- package/dist/types/components/D2BlockNode/d2.d.ts +18 -0
- package/dist/types/components/D2BlockNode/index.d.ts +3 -0
- package/dist/types/components/DefinitionListNode/DefinitionListNode.d.ts +8 -0
- package/dist/types/components/EmojiNode/EmojiNode.d.ts +8 -0
- package/dist/types/components/EmphasisNode/EmphasisNode.d.ts +6 -0
- package/dist/types/components/FootnoteAnchorNode/FootnoteAnchorNode.d.ts +7 -0
- package/dist/types/components/FootnoteNode/FootnoteNode.d.ts +9 -0
- package/dist/types/components/FootnoteReferenceNode/FootnoteReferenceNode.d.ts +7 -0
- package/dist/types/components/HardBreakNode/HardBreakNode.d.ts +6 -0
- package/dist/types/components/HeadingNode/HeadingNode.d.ts +10 -0
- package/dist/types/components/HighlightNode/HighlightNode.d.ts +6 -0
- package/dist/types/components/HtmlBlockNode/HtmlBlockNode.d.ts +19 -0
- package/dist/types/components/HtmlInlineNode/HtmlInlineNode.d.ts +16 -0
- package/dist/types/components/ImageNode/ImageNode.d.ts +9 -0
- package/dist/types/components/InfographicBlockNode/InfographicBlockNode.d.ts +16 -0
- package/dist/types/components/InfographicBlockNode/height.d.ts +6 -0
- package/dist/types/components/InfographicBlockNode/index.d.ts +3 -0
- package/dist/types/components/InfographicBlockNode/infographic.d.ts +2 -0
- package/dist/types/components/InlineCodeNode/InlineCodeNode.d.ts +7 -0
- package/dist/types/components/InsertNode/InsertNode.d.ts +6 -0
- package/dist/types/components/LinkNode/LinkNode.d.ts +22 -0
- package/dist/types/components/ListItemNode/ListItemNode.d.ts +13 -0
- package/dist/types/components/ListNode/ListNode.d.ts +10 -0
- package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.d.ts +34 -0
- package/dist/types/components/Math/MathBlockNode.d.ts +3 -0
- package/dist/types/components/Math/MathInlineNode.d.ts +3 -0
- package/dist/types/components/Math/katex.d.ts +2 -0
- package/dist/types/components/MathBlockNode/MathBlockNode.d.ts +3 -0
- package/dist/types/components/MathInlineNode/MathInlineNode.d.ts +3 -0
- package/dist/types/components/MermaidBlockNode/MermaidBlockNode.d.ts +16 -0
- package/dist/types/components/MermaidBlockNode/height.d.ts +7 -0
- package/dist/types/components/MermaidBlockNode/index.d.ts +3 -0
- package/dist/types/components/MermaidBlockNode/mermaid.d.ts +23 -0
- package/dist/types/components/NodeRenderer/FallbackComponent.d.ts +6 -0
- package/dist/types/components/NodeRenderer/preloadMonaco.d.ts +2 -0
- package/dist/types/components/NodeRenderer.d.ts +5 -0
- package/dist/types/components/ParagraphNode/ParagraphNode.d.ts +9 -0
- package/dist/types/components/PreCodeNode/PreCodeNode.d.ts +3 -0
- package/dist/types/components/ReferenceNode/ReferenceNode.d.ts +15 -0
- package/dist/types/components/StrikethroughNode/StrikethroughNode.d.ts +6 -0
- package/dist/types/components/StrongNode/StrongNode.d.ts +6 -0
- package/dist/types/components/SubscriptNode/SubscriptNode.d.ts +6 -0
- package/dist/types/components/SuperscriptNode/SuperscriptNode.d.ts +6 -0
- package/dist/types/components/TableNode/TableNode.d.ts +10 -0
- package/dist/types/components/TextNode/TextNode.d.ts +8 -0
- package/dist/types/components/ThematicBreakNode/ThematicBreakNode.d.ts +3 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/types/components/VmrContainerNode/VmrContainerNode.d.ts +10 -0
- package/dist/types/context/smoothStreaming.d.ts +2 -0
- package/dist/types/context/streamState.d.ts +25 -0
- package/dist/types/context/viewportPriority.d.ts +18 -0
- package/dist/types/customComponents.d.ts +38 -0
- package/dist/types/hooks/useSmoothMarkdownStream.d.ts +21 -0
- package/dist/types/i18n/useSafeI18n.d.ts +11 -0
- package/dist/types/index.d.ts +71 -0
- package/dist/types/renderers/codeBlockExtraProps.d.ts +5 -0
- package/dist/types/renderers/renderChildren.d.ts +7 -0
- package/dist/types/renderers/renderNode.d.ts +5 -0
- package/dist/types/server-renderer/html.d.ts +2 -0
- package/dist/types/server-renderer/index.d.ts +176 -0
- package/dist/types/server-renderer/katex.d.ts +2 -0
- package/dist/types/server.d.ts +56 -0
- package/dist/types/tailwind-entry.d.ts +3 -0
- package/dist/types/tooltip/singletonTooltip.d.ts +8 -0
- package/dist/types/types/component-props.d.ts +234 -0
- package/dist/types/types/node-component.d.ts +15 -0
- package/dist/types/types/octane.d.ts +12 -0
- package/dist/types/types.d.ts +127 -0
- package/dist/types/utils/customHtmlTag.d.ts +18 -0
- package/dist/types/utils/devEnv.d.ts +2 -0
- package/dist/types/utils/htmlToOctane.d.ts +23 -0
- package/dist/types/utils/languageIcon.d.ts +9 -0
- package/dist/types/utils/languageIconExtended.d.ts +2 -0
- package/dist/types/utils/normalizeKaTeXRenderInput.d.ts +2 -0
- package/dist/types/utils/performanceMonitor.d.ts +79 -0
- package/dist/types/utils/safeRaf.d.ts +3 -0
- package/dist/types/utils/streamingTextState.d.ts +3 -0
- package/dist/types/workers/katexRenderer.worker.d.ts +2 -0
- package/dist/types/workers/katexWorkerClient.d.ts +32 -0
- package/dist/types/workers/mermaidParser.worker.d.ts +2 -0
- package/dist/types/workers/mermaidWorkerClient.d.ts +15 -0
- package/package.json +149 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
import * as Octane from 'octane';
|
|
2
|
+
import { OctaneNode, ComponentBody } from 'octane';
|
|
3
|
+
import * as stream_markdown_parser from 'stream-markdown-parser';
|
|
4
|
+
import { CodeBlockNode as CodeBlockNode$1, BaseNode, ParseOptions, MarkdownIt, HtmlPolicy, ParsedNode, DefinitionItemNode, ListItemNode as ListItemNode$1, TableRowNode } from 'stream-markdown-parser';
|
|
5
|
+
import { SmoothMarkdownStreamOptions, SmoothMarkdownStreamSnapshot } from 'markstream-core';
|
|
6
|
+
export { SmoothMarkdownStreamOptions, SmoothMarkdownStreamSnapshot } from 'markstream-core';
|
|
7
|
+
import * as octane_jsx_runtime from 'octane/jsx-runtime';
|
|
8
|
+
import { Octane as Octane$1 } from 'octane/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
11
|
+
|
|
12
|
+
declare function useSmoothMarkdownStream(options?: SmoothMarkdownStreamOptions): {
|
|
13
|
+
enqueue: (chunk: string) => void;
|
|
14
|
+
finish: (options?: {
|
|
15
|
+
flush?: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
flush: () => void;
|
|
18
|
+
reset: (initialMarkdown?: string) => void;
|
|
19
|
+
pause: () => void;
|
|
20
|
+
resume: () => void;
|
|
21
|
+
getSnapshot: () => SmoothMarkdownStreamSnapshot;
|
|
22
|
+
source: string;
|
|
23
|
+
visible: string;
|
|
24
|
+
done: boolean;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
pendingChars: number;
|
|
27
|
+
caughtUp: boolean;
|
|
28
|
+
final: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
32
|
+
|
|
33
|
+
type OctanePropsWithChildren<P> = P & {
|
|
34
|
+
children?: OctaneNode;
|
|
35
|
+
};
|
|
36
|
+
type OctaneStyle = Exclude<Octane$1.JSX.IntrinsicElements['div']['style'], string | undefined>;
|
|
37
|
+
|
|
38
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
39
|
+
|
|
40
|
+
interface CodeBlockMonacoThemeObject {
|
|
41
|
+
name: string;
|
|
42
|
+
base?: string;
|
|
43
|
+
inherit?: boolean;
|
|
44
|
+
colors?: Record<string, string>;
|
|
45
|
+
rules?: Array<Record<string, unknown>>;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
type CodeBlockMonacoTheme = string | CodeBlockMonacoThemeObject;
|
|
49
|
+
type CodeBlockMonacoLanguage = string | ((...args: unknown[]) => unknown);
|
|
50
|
+
interface CommonCodeBlockProps {
|
|
51
|
+
showHeader?: boolean;
|
|
52
|
+
showCopyButton?: boolean;
|
|
53
|
+
showExpandButton?: boolean;
|
|
54
|
+
}
|
|
55
|
+
interface ShikiCodeBlockProps extends CommonCodeBlockProps {
|
|
56
|
+
themes?: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Shiki language preload request forwarded to stream-markdown's registerHighlight().
|
|
59
|
+
* This is not a rendering allow-list; already available Shiki languages may still highlight.
|
|
60
|
+
*/
|
|
61
|
+
langs?: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
interface CodeBlockDiffHideUnchangedRegionsOptions {
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
contextLineCount?: number;
|
|
66
|
+
minimumLineCount?: number;
|
|
67
|
+
revealLineCount?: number;
|
|
68
|
+
}
|
|
69
|
+
type CodeBlockDiffHideUnchangedRegions = boolean | CodeBlockDiffHideUnchangedRegionsOptions;
|
|
70
|
+
type CodeBlockDiffLineStyle = 'background' | 'bar';
|
|
71
|
+
type CodeBlockDiffAppearance = 'auto' | 'light' | 'dark';
|
|
72
|
+
type CodeBlockDiffUnchangedRegionStyle = 'line-info' | 'line-info-basic' | 'metadata' | 'simple';
|
|
73
|
+
type CodeBlockDiffHunkActionKind = 'revert' | 'stage';
|
|
74
|
+
type CodeBlockDiffHunkSide = 'upper' | 'lower';
|
|
75
|
+
interface CodeBlockDiffHunkActionContext {
|
|
76
|
+
action: CodeBlockDiffHunkActionKind;
|
|
77
|
+
side: CodeBlockDiffHunkSide;
|
|
78
|
+
lineChange: unknown;
|
|
79
|
+
originalModel: unknown;
|
|
80
|
+
modifiedModel: unknown;
|
|
81
|
+
}
|
|
82
|
+
interface CodeBlockMonacoOptions {
|
|
83
|
+
MAX_HEIGHT?: number | string;
|
|
84
|
+
fontSize?: number;
|
|
85
|
+
lineHeight?: number;
|
|
86
|
+
fontFamily?: string;
|
|
87
|
+
tabSize?: number;
|
|
88
|
+
readOnly?: boolean;
|
|
89
|
+
wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded' | string;
|
|
90
|
+
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent' | string;
|
|
91
|
+
theme?: string;
|
|
92
|
+
themes?: CodeBlockMonacoTheme[];
|
|
93
|
+
languages?: CodeBlockMonacoLanguage[];
|
|
94
|
+
renderSideBySide?: boolean;
|
|
95
|
+
useInlineViewWhenSpaceIsLimited?: boolean;
|
|
96
|
+
enableSplitViewResizing?: boolean;
|
|
97
|
+
ignoreTrimWhitespace?: boolean;
|
|
98
|
+
maxComputationTime?: number;
|
|
99
|
+
diffAlgorithm?: string;
|
|
100
|
+
renderIndicators?: boolean;
|
|
101
|
+
originalEditable?: boolean;
|
|
102
|
+
revealDebounceMs?: number;
|
|
103
|
+
revealStrategy?: 'bottom' | 'centerIfOutside' | 'center';
|
|
104
|
+
revealBatchOnIdleMs?: number;
|
|
105
|
+
updateThrottleMs?: number;
|
|
106
|
+
diffUpdateThrottleMs?: number;
|
|
107
|
+
diffAutoScroll?: boolean;
|
|
108
|
+
diffHideUnchangedRegions?: CodeBlockDiffHideUnchangedRegions;
|
|
109
|
+
diffLineStyle?: CodeBlockDiffLineStyle;
|
|
110
|
+
diffAppearance?: CodeBlockDiffAppearance;
|
|
111
|
+
diffUnchangedRegionStyle?: CodeBlockDiffUnchangedRegionStyle;
|
|
112
|
+
diffHunkActionsOnHover?: boolean;
|
|
113
|
+
diffHunkHoverHideDelayMs?: number;
|
|
114
|
+
onDiffHunkAction?: (context: CodeBlockDiffHunkActionContext) => void | boolean | Promise<void | boolean>;
|
|
115
|
+
scrollbar?: Record<string, unknown>;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
}
|
|
118
|
+
interface CodeBlockNodeProps extends CommonCodeBlockProps {
|
|
119
|
+
node: CodeBlockNode$1;
|
|
120
|
+
isDark?: boolean;
|
|
121
|
+
loading?: boolean;
|
|
122
|
+
stream?: boolean;
|
|
123
|
+
darkTheme?: CodeBlockMonacoTheme;
|
|
124
|
+
lightTheme?: CodeBlockMonacoTheme;
|
|
125
|
+
isShowPreview?: boolean;
|
|
126
|
+
monacoOptions?: CodeBlockMonacoOptions;
|
|
127
|
+
enableFontSizeControl?: boolean;
|
|
128
|
+
minWidth?: string | number;
|
|
129
|
+
maxWidth?: string | number;
|
|
130
|
+
themes?: CodeBlockMonacoTheme[];
|
|
131
|
+
showPreviewButton?: boolean;
|
|
132
|
+
showCollapseButton?: boolean;
|
|
133
|
+
showFontSizeButtons?: boolean;
|
|
134
|
+
showTooltips?: boolean;
|
|
135
|
+
htmlPreviewAllowScripts?: boolean;
|
|
136
|
+
htmlPreviewSandbox?: string;
|
|
137
|
+
customId?: string;
|
|
138
|
+
}
|
|
139
|
+
interface ImageNodeProps {
|
|
140
|
+
node: {
|
|
141
|
+
type: 'image';
|
|
142
|
+
src: string;
|
|
143
|
+
alt: string;
|
|
144
|
+
title: string | null;
|
|
145
|
+
raw: string;
|
|
146
|
+
loading?: boolean;
|
|
147
|
+
};
|
|
148
|
+
fallbackSrc?: string;
|
|
149
|
+
lazy?: boolean;
|
|
150
|
+
usePlaceholder?: boolean;
|
|
151
|
+
}
|
|
152
|
+
interface LinkNodeProps {
|
|
153
|
+
node: {
|
|
154
|
+
type: 'link';
|
|
155
|
+
href: string;
|
|
156
|
+
title: string | null;
|
|
157
|
+
text: string;
|
|
158
|
+
attrs?: [string, string][];
|
|
159
|
+
children: {
|
|
160
|
+
type: string;
|
|
161
|
+
raw: string;
|
|
162
|
+
}[];
|
|
163
|
+
raw: string;
|
|
164
|
+
loading?: boolean;
|
|
165
|
+
};
|
|
166
|
+
indexKey: number | string;
|
|
167
|
+
customId?: string;
|
|
168
|
+
showTooltip?: boolean;
|
|
169
|
+
color?: string;
|
|
170
|
+
underlineHeight?: number;
|
|
171
|
+
underlineBottom?: number | string;
|
|
172
|
+
animationDuration?: number;
|
|
173
|
+
animationOpacity?: number;
|
|
174
|
+
animationTiming?: string;
|
|
175
|
+
animationIteration?: string | number;
|
|
176
|
+
}
|
|
177
|
+
interface PreCodeNodeProps {
|
|
178
|
+
node: CodeBlockNode$1;
|
|
179
|
+
className?: string;
|
|
180
|
+
style?: OctaneStyle;
|
|
181
|
+
showLineNumbers?: boolean;
|
|
182
|
+
diffInline?: boolean;
|
|
183
|
+
}
|
|
184
|
+
interface MermaidBlockNodeProps {
|
|
185
|
+
node: CodeBlockNode$1;
|
|
186
|
+
maxHeight?: string | null;
|
|
187
|
+
estimatedPreviewHeightPx?: number;
|
|
188
|
+
loading?: boolean;
|
|
189
|
+
isDark?: boolean;
|
|
190
|
+
workerTimeoutMs?: number;
|
|
191
|
+
parseTimeoutMs?: number;
|
|
192
|
+
renderTimeoutMs?: number;
|
|
193
|
+
fullRenderTimeoutMs?: number;
|
|
194
|
+
renderDebounceMs?: number;
|
|
195
|
+
contentStableDelayMs?: number;
|
|
196
|
+
previewPollDelayMs?: number;
|
|
197
|
+
previewPollMaxDelayMs?: number;
|
|
198
|
+
previewPollMaxAttempts?: number;
|
|
199
|
+
showHeader?: boolean;
|
|
200
|
+
showModeToggle?: boolean;
|
|
201
|
+
showCopyButton?: boolean;
|
|
202
|
+
showExportButton?: boolean;
|
|
203
|
+
showFullscreenButton?: boolean;
|
|
204
|
+
showCollapseButton?: boolean;
|
|
205
|
+
showZoomControls?: boolean;
|
|
206
|
+
enableWheelZoom?: boolean;
|
|
207
|
+
isStrict?: boolean;
|
|
208
|
+
enableMermaidInteractions?: boolean;
|
|
209
|
+
showTooltips?: boolean;
|
|
210
|
+
onRenderError?: (error: unknown, code: string, container: HTMLElement) => boolean | void;
|
|
211
|
+
}
|
|
212
|
+
interface CodeBlockPreviewPayload$1 {
|
|
213
|
+
node: CodeBlockNode$1;
|
|
214
|
+
artifactType: 'text/html' | 'image/svg+xml';
|
|
215
|
+
artifactTitle: string;
|
|
216
|
+
id: string;
|
|
217
|
+
}
|
|
218
|
+
interface MermaidBlockEvent<TPayload = unknown> {
|
|
219
|
+
payload?: TPayload;
|
|
220
|
+
defaultPrevented: boolean;
|
|
221
|
+
preventDefault: () => void;
|
|
222
|
+
svgElement?: SVGElement | null;
|
|
223
|
+
svgString?: string | null;
|
|
224
|
+
}
|
|
225
|
+
interface D2BlockNodeProps {
|
|
226
|
+
node: CodeBlockNode$1;
|
|
227
|
+
maxHeight?: string | null;
|
|
228
|
+
loading?: boolean;
|
|
229
|
+
isDark?: boolean;
|
|
230
|
+
progressiveRender?: boolean;
|
|
231
|
+
progressiveIntervalMs?: number;
|
|
232
|
+
themeId?: number | null;
|
|
233
|
+
darkThemeId?: number | null;
|
|
234
|
+
showHeader?: boolean;
|
|
235
|
+
showModeToggle?: boolean;
|
|
236
|
+
showCopyButton?: boolean;
|
|
237
|
+
showExportButton?: boolean;
|
|
238
|
+
showCollapseButton?: boolean;
|
|
239
|
+
}
|
|
240
|
+
interface MathBlockNodeProps {
|
|
241
|
+
node: {
|
|
242
|
+
type: 'math_block';
|
|
243
|
+
content: string;
|
|
244
|
+
raw: string;
|
|
245
|
+
loading?: boolean;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
interface MathInlineNodeProps {
|
|
249
|
+
node: {
|
|
250
|
+
type: 'math_inline';
|
|
251
|
+
content: string;
|
|
252
|
+
raw: string;
|
|
253
|
+
loading?: boolean;
|
|
254
|
+
markup?: string;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
interface InfographicBlockNodeProps {
|
|
258
|
+
node: CodeBlockNode$1;
|
|
259
|
+
maxHeight?: string | null;
|
|
260
|
+
estimatedPreviewHeightPx?: number;
|
|
261
|
+
loading?: boolean;
|
|
262
|
+
isDark?: boolean;
|
|
263
|
+
showHeader?: boolean;
|
|
264
|
+
showModeToggle?: boolean;
|
|
265
|
+
showCopyButton?: boolean;
|
|
266
|
+
showCollapseButton?: boolean;
|
|
267
|
+
showExportButton?: boolean;
|
|
268
|
+
showFullscreenButton?: boolean;
|
|
269
|
+
showZoomControls?: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
273
|
+
|
|
274
|
+
type NodeRendererCodeBlockThemes = CodeBlockNodeProps['themes'] | ShikiCodeBlockProps['themes'];
|
|
275
|
+
type NodeRendererCodeBlockProps = Partial<Omit<CodeBlockNodeProps, 'node' | 'themes'>> & Partial<Omit<ShikiCodeBlockProps, 'themes'>> & {
|
|
276
|
+
themes?: NodeRendererCodeBlockThemes;
|
|
277
|
+
} & Record<string, unknown>;
|
|
278
|
+
interface NodeRendererProps<TStreamingComponents extends Record<string, ComponentBody<any>> = StreamingComponentMap, THtmlComponents extends Record<string, any> = HtmlComponentMap> {
|
|
279
|
+
content?: string;
|
|
280
|
+
nodes?: readonly BaseNode[] | null;
|
|
281
|
+
/**
|
|
282
|
+
* Whether the input stream is complete (end-of-stream). When true, the parser
|
|
283
|
+
* can stop emitting streaming "loading" nodes for unfinished constructs.
|
|
284
|
+
*/
|
|
285
|
+
final?: boolean;
|
|
286
|
+
parseOptions?: ParseOptions;
|
|
287
|
+
customMarkdownIt?: (md: MarkdownIt) => MarkdownIt;
|
|
288
|
+
streamingComponents?: TStreamingComponents & StreamingComponentDefinitions<TStreamingComponents>;
|
|
289
|
+
htmlComponents?: THtmlComponents & HtmlComponentDefinitions<THtmlComponents>;
|
|
290
|
+
/** Log parse/render timing stats (dev only). */
|
|
291
|
+
debugPerformance?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Custom HTML-like tags that should be emitted as custom nodes (e.g. ['thinking']).
|
|
294
|
+
* Forwarded to `getMarkdown()` and merged into parseOptions.
|
|
295
|
+
*/
|
|
296
|
+
customHtmlTags?: readonly string[];
|
|
297
|
+
htmlPolicy?: HtmlPolicy;
|
|
298
|
+
viewportPriority?: boolean;
|
|
299
|
+
codeBlockStream?: boolean;
|
|
300
|
+
codeBlockDarkTheme?: CodeBlockMonacoTheme;
|
|
301
|
+
codeBlockLightTheme?: CodeBlockMonacoTheme;
|
|
302
|
+
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
303
|
+
renderCodeBlocksAsPre?: boolean;
|
|
304
|
+
codeBlockMinWidth?: string | number;
|
|
305
|
+
codeBlockMaxWidth?: string | number;
|
|
306
|
+
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
307
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
308
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
309
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
310
|
+
showTooltips?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Theme names or theme objects preloaded for Monaco-backed code blocks.
|
|
313
|
+
* When Shiki code blocks are used, only string theme names are forwarded to
|
|
314
|
+
* MarkdownCodeBlockNode / stream-markdown; theme objects are ignored.
|
|
315
|
+
*/
|
|
316
|
+
themes?: CodeBlockMonacoTheme[];
|
|
317
|
+
/**
|
|
318
|
+
* Shiki language preload list forwarded to MarkdownCodeBlockNode.
|
|
319
|
+
*
|
|
320
|
+
* The default Octane code block renderer is Monaco-backed. This prop is used
|
|
321
|
+
* when a custom `code_block` or language renderer uses MarkdownCodeBlockNode.
|
|
322
|
+
*/
|
|
323
|
+
langs?: readonly string[];
|
|
324
|
+
isDark?: boolean;
|
|
325
|
+
customId?: string;
|
|
326
|
+
indexKey?: number | string;
|
|
327
|
+
/** Show a blinking typewriter cursor while streamed content grows. Default: false */
|
|
328
|
+
typewriter?: boolean;
|
|
329
|
+
/** Enable/disable non-code-node enter and streamed-text fade animations. Default: true */
|
|
330
|
+
fade?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Enable built-in smooth pacing for streaming `content` updates.
|
|
333
|
+
* - `true`: force-enable smooth streaming (content mode only)
|
|
334
|
+
* - `false`: force-disable smooth streaming
|
|
335
|
+
* - `'auto'` (default): enable only when typewriter/incremental mode is active
|
|
336
|
+
* Applies when rendering from `content` (not `nodes`).
|
|
337
|
+
*/
|
|
338
|
+
smoothStreaming?: boolean | 'auto';
|
|
339
|
+
/** Options forwarded to the built-in smooth streaming controller. Read once when the renderer is created. */
|
|
340
|
+
smoothStreamingOptions?: SmoothMarkdownStreamOptions;
|
|
341
|
+
batchRendering?: boolean;
|
|
342
|
+
initialRenderBatchSize?: number;
|
|
343
|
+
renderBatchSize?: number;
|
|
344
|
+
renderBatchDelay?: number;
|
|
345
|
+
renderBatchBudgetMs?: number;
|
|
346
|
+
renderBatchIdleTimeoutMs?: number;
|
|
347
|
+
deferNodesUntilVisible?: boolean;
|
|
348
|
+
maxLiveNodes?: number;
|
|
349
|
+
liveNodeBuffer?: number;
|
|
350
|
+
onCopy?: (code: string) => void;
|
|
351
|
+
onHandleArtifactClick?: (payload: CodeBlockPreviewPayload$1) => void;
|
|
352
|
+
onClick?: (event: MouseEvent) => void;
|
|
353
|
+
onMouseOver?: (event: MouseEvent) => void;
|
|
354
|
+
onMouseOut?: (event: MouseEvent) => void;
|
|
355
|
+
}
|
|
356
|
+
interface RenderContext$1 {
|
|
357
|
+
customId?: string;
|
|
358
|
+
isDark?: boolean;
|
|
359
|
+
final?: boolean;
|
|
360
|
+
indexKey?: string;
|
|
361
|
+
typewriter?: boolean;
|
|
362
|
+
/** Enable/disable fade animations. Default: true */
|
|
363
|
+
fade?: boolean;
|
|
364
|
+
textStreamState?: Map<string, string>;
|
|
365
|
+
streamRenderVersion?: number;
|
|
366
|
+
customComponents?: CustomComponentMap$1;
|
|
367
|
+
streamingComponents?: StreamingComponentMap;
|
|
368
|
+
htmlComponents?: HtmlComponentMap;
|
|
369
|
+
customHtmlTags?: readonly string[];
|
|
370
|
+
htmlPolicy?: HtmlPolicy;
|
|
371
|
+
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
372
|
+
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
373
|
+
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
374
|
+
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
375
|
+
showTooltips?: boolean;
|
|
376
|
+
codeBlockStream?: boolean;
|
|
377
|
+
renderCodeBlocksAsPre?: boolean;
|
|
378
|
+
codeBlockThemes?: {
|
|
379
|
+
themes?: CodeBlockMonacoTheme[];
|
|
380
|
+
darkTheme?: CodeBlockMonacoTheme;
|
|
381
|
+
lightTheme?: CodeBlockMonacoTheme;
|
|
382
|
+
monacoOptions?: CodeBlockMonacoOptions;
|
|
383
|
+
minWidth?: string | number;
|
|
384
|
+
maxWidth?: string | number;
|
|
385
|
+
langs?: readonly string[];
|
|
386
|
+
};
|
|
387
|
+
events: {
|
|
388
|
+
onCopy?: (code: string) => void;
|
|
389
|
+
onHandleArtifactClick?: (payload: CodeBlockPreviewPayload$1) => void;
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
type RenderNodeFn$1 = (node: ParsedNode, key: string | number | bigint, ctx: RenderContext$1) => Octane.OctaneNode;
|
|
393
|
+
|
|
394
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
395
|
+
|
|
396
|
+
interface NodeComponentProps<TNode = unknown> {
|
|
397
|
+
node: TNode;
|
|
398
|
+
ctx?: RenderContext$1;
|
|
399
|
+
renderNode?: RenderNodeFn$1;
|
|
400
|
+
indexKey?: string | number | bigint;
|
|
401
|
+
customId?: string;
|
|
402
|
+
isDark?: boolean;
|
|
403
|
+
typewriter?: boolean;
|
|
404
|
+
/** Enable/disable fade animations. Default: true */
|
|
405
|
+
fade?: boolean;
|
|
406
|
+
children?: Octane.OctaneNode;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
410
|
+
|
|
411
|
+
type CustomComponentDisplayMode = 'inline' | 'block';
|
|
412
|
+
type MarkstreamCustomComponent<P = any> = ComponentBody<P> & {
|
|
413
|
+
markstreamDisplay?: CustomComponentDisplayMode;
|
|
414
|
+
};
|
|
415
|
+
type CustomComponentMap$1 = Record<string, MarkstreamCustomComponent>;
|
|
416
|
+
type StreamingComponent<TNode = any> = ComponentBody<NodeComponentProps<TNode>>;
|
|
417
|
+
type StreamingComponentMap = Record<string, StreamingComponent<any>>;
|
|
418
|
+
type HtmlComponent<P extends object = any> = ComponentBody<OctanePropsWithChildren<P>>;
|
|
419
|
+
type HtmlComponentMap = Record<string, HtmlComponent<any>>;
|
|
420
|
+
type IsAny<T> = 0 extends (1 & T) ? true : false;
|
|
421
|
+
type ComponentProps<T> = T extends ComponentBody<infer P> ? P : T extends (props: infer P) => any ? P : never;
|
|
422
|
+
type StreamingComponentDefinitions<T extends Record<string, any>> = {
|
|
423
|
+
[K in keyof T]: ComponentProps<T[K]> extends infer P ? IsAny<P> extends true ? T[K] : P extends NodeComponentProps<any> ? NodeComponentProps<any> extends P ? T[K] : never : never : never;
|
|
424
|
+
};
|
|
425
|
+
type ParserComponentOnlyProp = Exclude<keyof NodeComponentProps<any>, 'children' | 'node'>;
|
|
426
|
+
type HtmlComponentDefinitions<T extends Record<string, any>> = {
|
|
427
|
+
[K in keyof T]: ComponentProps<T[K]> extends infer P ? IsAny<P> extends true ? T[K] : Extract<keyof P, ParserComponentOnlyProp> extends never ? T[K] : never : never;
|
|
428
|
+
};
|
|
429
|
+
declare function setCustomComponents(id: string, mapping: CustomComponentMap$1): void;
|
|
430
|
+
declare function setCustomComponents(mapping: CustomComponentMap$1): void;
|
|
431
|
+
declare function getCustomNodeComponents(customId?: string): CustomComponentMap$1;
|
|
432
|
+
declare function removeCustomComponents(id: string): void;
|
|
433
|
+
declare function clearGlobalCustomComponents(): void;
|
|
434
|
+
declare function getCustomComponentDisplay(component: ComponentBody<any> | null | undefined): CustomComponentDisplayMode | undefined;
|
|
435
|
+
declare function withMarkstreamComponentDisplay<T extends ComponentBody<any>>(component: T, display: CustomComponentDisplayMode): T & {
|
|
436
|
+
markstreamDisplay: CustomComponentDisplayMode;
|
|
437
|
+
};
|
|
438
|
+
declare function defineStreamingComponents<const T extends Record<string, ComponentBody<any>>>(components: T & StreamingComponentDefinitions<T>): T & StreamingComponentDefinitions<T>;
|
|
439
|
+
declare function defineHtmlComponents<const T extends Record<string, ComponentBody<any>>>(components: T & HtmlComponentDefinitions<T>): T & HtmlComponentDefinitions<T>;
|
|
440
|
+
|
|
441
|
+
declare function AdmonitionNode(props: NodeComponentProps<{
|
|
442
|
+
type: 'admonition';
|
|
443
|
+
kind?: string;
|
|
444
|
+
title?: string;
|
|
445
|
+
children?: ParsedNode[];
|
|
446
|
+
collapsible?: boolean;
|
|
447
|
+
open?: boolean;
|
|
448
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
449
|
+
|
|
450
|
+
declare function BlockquoteNode(props: NodeComponentProps<{
|
|
451
|
+
type: 'blockquote';
|
|
452
|
+
children?: ParsedNode[];
|
|
453
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
454
|
+
|
|
455
|
+
declare function CheckboxNode(props: NodeComponentProps<{
|
|
456
|
+
type: 'checkbox' | 'checkbox_input';
|
|
457
|
+
checked?: boolean;
|
|
458
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
459
|
+
|
|
460
|
+
interface CodeBlockPreviewPayload {
|
|
461
|
+
node: CodeBlockNodeProps['node'];
|
|
462
|
+
artifactType: 'text/html' | 'image/svg+xml';
|
|
463
|
+
artifactTitle: string;
|
|
464
|
+
id: string;
|
|
465
|
+
}
|
|
466
|
+
interface CodeBlockNodeOctaneEvents {
|
|
467
|
+
onCopy?: (code: string) => void;
|
|
468
|
+
onPreviewCode?: (payload: CodeBlockPreviewPayload) => void;
|
|
469
|
+
}
|
|
470
|
+
declare function CodeBlockNode(rawProps: CodeBlockNodeProps & CodeBlockNodeOctaneEvents): octane_jsx_runtime.Octane.JSX.Element;
|
|
471
|
+
|
|
472
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
473
|
+
|
|
474
|
+
interface HtmlPreviewFrameProps {
|
|
475
|
+
code: string;
|
|
476
|
+
isDark?: boolean;
|
|
477
|
+
htmlPreviewAllowScripts?: boolean;
|
|
478
|
+
htmlPreviewSandbox?: string;
|
|
479
|
+
onClose?: () => void;
|
|
480
|
+
title?: string;
|
|
481
|
+
}
|
|
482
|
+
declare function HtmlPreviewFrame(props: HtmlPreviewFrameProps): Octane.PortalDescriptor | null;
|
|
483
|
+
|
|
484
|
+
type D2Loader = () => Promise<unknown> | unknown;
|
|
485
|
+
declare function setD2Loader(loader: D2Loader | null): void;
|
|
486
|
+
declare function enableD2(loader?: D2Loader): void;
|
|
487
|
+
declare function disableD2(): void;
|
|
488
|
+
declare function isD2Enabled(): boolean;
|
|
489
|
+
|
|
490
|
+
declare function D2BlockNode(rawProps: D2BlockNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
491
|
+
|
|
492
|
+
declare function DefinitionListNode(props: NodeComponentProps<{
|
|
493
|
+
type: 'definition_list';
|
|
494
|
+
items?: DefinitionItemNode[];
|
|
495
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
496
|
+
|
|
497
|
+
declare function EmojiNode(props: NodeComponentProps<{
|
|
498
|
+
type: 'emoji';
|
|
499
|
+
name: string;
|
|
500
|
+
markup?: string;
|
|
501
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
502
|
+
|
|
503
|
+
declare function EmphasisNode(props: NodeComponentProps<{
|
|
504
|
+
type: 'emphasis';
|
|
505
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
506
|
+
|
|
507
|
+
declare function FootnoteAnchorNode(props: NodeComponentProps<{
|
|
508
|
+
type: 'footnote_anchor';
|
|
509
|
+
id: string;
|
|
510
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
511
|
+
|
|
512
|
+
declare function FootnoteNode(props: NodeComponentProps<{
|
|
513
|
+
type: 'footnote';
|
|
514
|
+
id: string;
|
|
515
|
+
children?: ParsedNode[];
|
|
516
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
517
|
+
|
|
518
|
+
declare function FootnoteReferenceNode(props: NodeComponentProps<{
|
|
519
|
+
type: 'footnote_reference';
|
|
520
|
+
id: string;
|
|
521
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
522
|
+
|
|
523
|
+
declare function HardBreakNode(_props: NodeComponentProps<{
|
|
524
|
+
type: 'hardbreak';
|
|
525
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
526
|
+
|
|
527
|
+
declare function HeadingNode(props: NodeComponentProps<{
|
|
528
|
+
type: 'heading';
|
|
529
|
+
level?: number;
|
|
530
|
+
children?: ParsedNode[];
|
|
531
|
+
attrs?: Record<string, string | boolean>;
|
|
532
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
533
|
+
|
|
534
|
+
declare function HighlightNode(props: NodeComponentProps<{
|
|
535
|
+
type: 'highlight';
|
|
536
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
537
|
+
|
|
538
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
539
|
+
|
|
540
|
+
declare function HtmlBlockNode(props: NodeComponentProps<{
|
|
541
|
+
type: 'html_block';
|
|
542
|
+
content: string;
|
|
543
|
+
raw?: string;
|
|
544
|
+
tag?: string;
|
|
545
|
+
attrs?: [string, string | null][] | null;
|
|
546
|
+
children?: ParsedNode[];
|
|
547
|
+
loading?: boolean;
|
|
548
|
+
}> & {
|
|
549
|
+
customComponents?: CustomComponentMap$1;
|
|
550
|
+
htmlPolicy?: HtmlPolicy;
|
|
551
|
+
placeholder?: Octane.OctaneNode;
|
|
552
|
+
}): Octane.ElementDescriptor<any>;
|
|
553
|
+
|
|
554
|
+
declare function HtmlInlineNode(props: NodeComponentProps<{
|
|
555
|
+
type: 'html_inline';
|
|
556
|
+
content: string;
|
|
557
|
+
tag?: string;
|
|
558
|
+
attrs?: [string, string | null][] | null;
|
|
559
|
+
children?: ParsedNode[];
|
|
560
|
+
loading?: boolean;
|
|
561
|
+
autoClosed?: boolean;
|
|
562
|
+
}> & {
|
|
563
|
+
htmlPolicy?: HtmlPolicy;
|
|
564
|
+
}): octane_jsx_runtime.Octane.JSX.Element | Octane.ElementDescriptor<Record<string, stream_markdown_parser.HtmlPropValue>>;
|
|
565
|
+
|
|
566
|
+
interface ImageNodeOctaneEvents {
|
|
567
|
+
onLoad?: (src: string) => void;
|
|
568
|
+
onError?: (src: string) => void;
|
|
569
|
+
onClick?: (payload: [event: MouseEvent, src: string]) => void;
|
|
570
|
+
}
|
|
571
|
+
declare function ImageNode(rawProps: ImageNodeProps & ImageNodeOctaneEvents): octane_jsx_runtime.Octane.JSX.Element | null;
|
|
572
|
+
|
|
573
|
+
interface InfographicBlockNodeOctaneEvents {
|
|
574
|
+
onCopy?: (code: string) => void;
|
|
575
|
+
onExport?: (event: MermaidBlockEvent<{
|
|
576
|
+
type: 'export';
|
|
577
|
+
}>) => void;
|
|
578
|
+
onOpenModal?: (event: MermaidBlockEvent<{
|
|
579
|
+
type: 'open-modal';
|
|
580
|
+
}>) => void;
|
|
581
|
+
onToggleMode?: (target: 'preview' | 'source', event: MermaidBlockEvent<{
|
|
582
|
+
type: 'toggle-mode';
|
|
583
|
+
target: 'preview' | 'source';
|
|
584
|
+
}>) => void;
|
|
585
|
+
}
|
|
586
|
+
declare function InfographicBlockNode(rawProps: InfographicBlockNodeProps & InfographicBlockNodeOctaneEvents): octane_jsx_runtime.Octane.JSX.Element;
|
|
587
|
+
|
|
588
|
+
declare function InlineCodeNode(props: NodeComponentProps<{
|
|
589
|
+
type: 'inline_code';
|
|
590
|
+
code: string;
|
|
591
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
592
|
+
|
|
593
|
+
declare function InsertNode(props: NodeComponentProps<{
|
|
594
|
+
type: 'insert';
|
|
595
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
596
|
+
|
|
597
|
+
interface LinkNodeStyleProps {
|
|
598
|
+
showTooltip?: boolean;
|
|
599
|
+
color?: string;
|
|
600
|
+
underlineHeight?: number;
|
|
601
|
+
underlineBottom?: number | string;
|
|
602
|
+
animationDuration?: number;
|
|
603
|
+
animationOpacity?: number;
|
|
604
|
+
animationTiming?: string;
|
|
605
|
+
animationIteration?: string | number;
|
|
606
|
+
}
|
|
607
|
+
declare function LinkNode(props: NodeComponentProps<{
|
|
608
|
+
type: 'link';
|
|
609
|
+
href: string;
|
|
610
|
+
title: string | null;
|
|
611
|
+
text: string;
|
|
612
|
+
children?: ParsedNode[];
|
|
613
|
+
loading?: boolean;
|
|
614
|
+
}> & LinkNodeStyleProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
615
|
+
|
|
616
|
+
interface ListItemNodeData {
|
|
617
|
+
type: 'list_item';
|
|
618
|
+
children?: ParsedNode[];
|
|
619
|
+
raw?: string;
|
|
620
|
+
}
|
|
621
|
+
interface ListItemNodeProps extends NodeComponentProps<ListItemNodeData> {
|
|
622
|
+
value?: number;
|
|
623
|
+
}
|
|
624
|
+
declare function ListItemNode(props: ListItemNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
625
|
+
|
|
626
|
+
declare function ListNode(props: NodeComponentProps<{
|
|
627
|
+
type: 'list';
|
|
628
|
+
ordered?: boolean;
|
|
629
|
+
start?: number;
|
|
630
|
+
items?: ListItemNode$1[];
|
|
631
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
632
|
+
|
|
633
|
+
interface MarkdownCodeBlockNodeProps extends ShikiCodeBlockProps {
|
|
634
|
+
node: {
|
|
635
|
+
type: 'code_block';
|
|
636
|
+
language: string;
|
|
637
|
+
code: string;
|
|
638
|
+
raw: string;
|
|
639
|
+
diff?: boolean;
|
|
640
|
+
originalCode?: string;
|
|
641
|
+
updatedCode?: string;
|
|
642
|
+
};
|
|
643
|
+
loading?: boolean;
|
|
644
|
+
stream?: boolean;
|
|
645
|
+
darkTheme?: string;
|
|
646
|
+
lightTheme?: string;
|
|
647
|
+
isDark?: boolean;
|
|
648
|
+
isShowPreview?: boolean;
|
|
649
|
+
enableFontSizeControl?: boolean;
|
|
650
|
+
minWidth?: string | number;
|
|
651
|
+
maxWidth?: string | number;
|
|
652
|
+
showPreviewButton?: boolean;
|
|
653
|
+
showCollapseButton?: boolean;
|
|
654
|
+
showFontSizeButtons?: boolean;
|
|
655
|
+
showTooltips?: boolean;
|
|
656
|
+
onCopy?: (code: string) => void;
|
|
657
|
+
onPreviewCode?: (payload: {
|
|
658
|
+
type: string;
|
|
659
|
+
content: string;
|
|
660
|
+
title: string;
|
|
661
|
+
}) => void;
|
|
662
|
+
}
|
|
663
|
+
declare function MarkdownCodeBlockNode(rawProps: MarkdownCodeBlockNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
664
|
+
|
|
665
|
+
declare function MathBlockNode({ node }: MathBlockNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
666
|
+
|
|
667
|
+
declare function MathInlineNode({ node }: MathInlineNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
668
|
+
|
|
669
|
+
interface MermaidBlockNodeOctaneEvents {
|
|
670
|
+
onCopy?: (code: string) => void;
|
|
671
|
+
onExport?: (event: MermaidBlockEvent<{
|
|
672
|
+
type: 'export';
|
|
673
|
+
}>) => void;
|
|
674
|
+
onOpenModal?: (event: MermaidBlockEvent<{
|
|
675
|
+
type: 'open-modal';
|
|
676
|
+
}>) => void;
|
|
677
|
+
onToggleMode?: (target: 'preview' | 'source', event: MermaidBlockEvent<{
|
|
678
|
+
type: 'toggle-mode';
|
|
679
|
+
target: 'preview' | 'source';
|
|
680
|
+
}>) => void;
|
|
681
|
+
}
|
|
682
|
+
declare function MermaidBlockNode(rawProps: MermaidBlockNodeProps & MermaidBlockNodeOctaneEvents): octane_jsx_runtime.Octane.JSX.Element;
|
|
683
|
+
|
|
684
|
+
declare function NodeRenderer<TStreamingComponents extends StreamingComponentMap = StreamingComponentMap, THtmlComponents extends Record<string, any> = HtmlComponentMap>(rawProps: NodeRendererProps<TStreamingComponents, THtmlComponents>): octane_jsx_runtime.Octane.JSX.Element;
|
|
685
|
+
|
|
686
|
+
declare function FallbackComponent(props: NodeComponentProps<{
|
|
687
|
+
type: string;
|
|
688
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
689
|
+
|
|
690
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
691
|
+
|
|
692
|
+
declare function ParagraphNode(props: NodeComponentProps<{
|
|
693
|
+
type: 'paragraph';
|
|
694
|
+
children?: ParsedNode[];
|
|
695
|
+
}>): Octane.ElementDescriptor<{}>;
|
|
696
|
+
|
|
697
|
+
declare function PreCodeNode({ node, className, diffInline, showLineNumbers, style }: PreCodeNodeProps): octane_jsx_runtime.Octane.JSX.Element;
|
|
698
|
+
|
|
699
|
+
interface ReferenceNodeHandlers {
|
|
700
|
+
onClick?: (event: MouseEvent, id: string, messageId?: string, threadId?: string) => void;
|
|
701
|
+
onMouseEnter?: (event: MouseEvent, id: string, messageId?: string, threadId?: string) => void;
|
|
702
|
+
onMouseLeave?: (event: MouseEvent, id: string, messageId?: string, threadId?: string) => void;
|
|
703
|
+
}
|
|
704
|
+
declare function ReferenceNode(props: NodeComponentProps<{
|
|
705
|
+
type: 'reference';
|
|
706
|
+
id: string;
|
|
707
|
+
}> & {
|
|
708
|
+
messageId?: string;
|
|
709
|
+
threadId?: string;
|
|
710
|
+
} & ReferenceNodeHandlers): octane_jsx_runtime.Octane.JSX.Element;
|
|
711
|
+
|
|
712
|
+
declare function StrikethroughNode(props: NodeComponentProps<{
|
|
713
|
+
type: 'strikethrough';
|
|
714
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
715
|
+
|
|
716
|
+
declare function StrongNode(props: NodeComponentProps<{
|
|
717
|
+
type: 'strong';
|
|
718
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
719
|
+
|
|
720
|
+
declare function SubscriptNode(props: NodeComponentProps<{
|
|
721
|
+
type: 'subscript';
|
|
722
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
723
|
+
|
|
724
|
+
declare function SuperscriptNode(props: NodeComponentProps<{
|
|
725
|
+
type: 'superscript';
|
|
726
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
727
|
+
|
|
728
|
+
declare function TableNode(props: NodeComponentProps<{
|
|
729
|
+
type: 'table';
|
|
730
|
+
header?: TableRowNode;
|
|
731
|
+
rows?: TableRowNode[];
|
|
732
|
+
loading?: boolean;
|
|
733
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
734
|
+
|
|
735
|
+
declare function TextNode(props: NodeComponentProps<{
|
|
736
|
+
type: 'text';
|
|
737
|
+
content: string;
|
|
738
|
+
center?: boolean;
|
|
739
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
740
|
+
|
|
741
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
742
|
+
declare function ThematicBreakNode(): octane_jsx_runtime.Octane.JSX.Element;
|
|
743
|
+
|
|
744
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
745
|
+
|
|
746
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
747
|
+
interface TooltipProps {
|
|
748
|
+
visible: boolean;
|
|
749
|
+
anchorEl: HTMLElement | null;
|
|
750
|
+
content: string;
|
|
751
|
+
placement?: TooltipPlacement;
|
|
752
|
+
offset?: number;
|
|
753
|
+
originX?: number | null;
|
|
754
|
+
originY?: number | null;
|
|
755
|
+
id?: string | null;
|
|
756
|
+
isDark?: boolean | null;
|
|
757
|
+
}
|
|
758
|
+
declare function Tooltip(props: TooltipProps): Octane.PortalDescriptor | null;
|
|
759
|
+
|
|
760
|
+
declare function VmrContainerNode(props: NodeComponentProps<{
|
|
761
|
+
type: 'vmr_container';
|
|
762
|
+
name: string;
|
|
763
|
+
attrs?: Record<string, string> | [string, string | null][] | null;
|
|
764
|
+
children?: ParsedNode[];
|
|
765
|
+
}>): octane_jsx_runtime.Octane.JSX.Element;
|
|
766
|
+
|
|
767
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
768
|
+
declare const defaultMap: Record<string, string>;
|
|
769
|
+
/**
|
|
770
|
+
* Replace the entire default translation map.
|
|
771
|
+
* Consumers can call this to provide their own fallback translations (e.g. Chinese).
|
|
772
|
+
*/
|
|
773
|
+
declare function setDefaultI18nMap(map: Record<keyof typeof defaultMap, string>): void;
|
|
774
|
+
declare function useSafeI18n(): {
|
|
775
|
+
t: (key: string) => string;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
779
|
+
|
|
780
|
+
declare function renderNode(node: ParsedNode, key: string | number | bigint, ctx: RenderContext$1): Octane.OctaneNode;
|
|
781
|
+
|
|
782
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
783
|
+
type LanguageIconResolver = (lang: string) => string | undefined | null;
|
|
784
|
+
declare function setLanguageIconResolver(resolver?: LanguageIconResolver | null): void;
|
|
785
|
+
declare function normalizeLanguageIdentifier(lang?: string | null): string;
|
|
786
|
+
declare function resolveMonacoLanguageId(lang?: string | null): string;
|
|
787
|
+
declare function preloadExtendedLanguageIcons(): Promise<void>;
|
|
788
|
+
declare function subscribeLanguageIconsRevision(listener: () => void): () => void;
|
|
789
|
+
declare function getLanguageIcon(lang: string): string;
|
|
790
|
+
declare const languageMap: Record<string, string>;
|
|
791
|
+
|
|
792
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
793
|
+
declare function setKaTeXWorker(w: Worker): void;
|
|
794
|
+
declare function clearKaTeXWorker(): void;
|
|
795
|
+
declare function setKaTeXWorkerDebug(enabled: boolean): void;
|
|
796
|
+
declare const WORKER_BUSY_CODE = "WORKER_BUSY";
|
|
797
|
+
declare function renderKaTeXInWorker(content: string, displayMode?: boolean, timeout?: number, signal?: AbortSignal): Promise<string>;
|
|
798
|
+
declare function setKaTeXCache(content: string, displayMode: boolean, html: string): void;
|
|
799
|
+
declare function clearKaTeXCache(): void;
|
|
800
|
+
declare function setKaTeXConcurrencyLimit(limit: number): void;
|
|
801
|
+
declare function waitForKaTeXWorkerSlot(timeout?: number, signal?: AbortSignal): Promise<void>;
|
|
802
|
+
interface BackpressureOptions {
|
|
803
|
+
timeout?: number;
|
|
804
|
+
waitTimeout?: number;
|
|
805
|
+
backoffMs?: number;
|
|
806
|
+
maxRetries?: number;
|
|
807
|
+
signal?: AbortSignal;
|
|
808
|
+
}
|
|
809
|
+
declare const defaultBackpressure: {
|
|
810
|
+
timeout: number;
|
|
811
|
+
waitTimeout: number;
|
|
812
|
+
backoffMs: number;
|
|
813
|
+
maxRetries: number;
|
|
814
|
+
};
|
|
815
|
+
declare function setKaTeXBackpressureDefaults(opts: Partial<typeof defaultBackpressure>): void;
|
|
816
|
+
declare function getKaTeXBackpressureDefaults(): {
|
|
817
|
+
timeout: number;
|
|
818
|
+
waitTimeout: number;
|
|
819
|
+
backoffMs: number;
|
|
820
|
+
maxRetries: number;
|
|
821
|
+
};
|
|
822
|
+
declare function renderKaTeXWithBackpressure(content: string, displayMode?: boolean, opts?: BackpressureOptions): Promise<string>;
|
|
823
|
+
|
|
824
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
825
|
+
type Theme = 'light' | 'dark';
|
|
826
|
+
declare function setMermaidWorkerClientDebug(enabled: boolean): void;
|
|
827
|
+
declare function setMermaidWorkerMaxConcurrency(n: number): void;
|
|
828
|
+
declare function getMermaidWorkerLoad(): {
|
|
829
|
+
inFlight: number;
|
|
830
|
+
max: number;
|
|
831
|
+
};
|
|
832
|
+
declare const MERMAID_WORKER_BUSY_CODE = "WORKER_BUSY";
|
|
833
|
+
declare function setMermaidWorker(w: Worker): void;
|
|
834
|
+
declare function clearMermaidWorker(): void;
|
|
835
|
+
declare function canParseOffthread(code: string, theme: Theme, timeout?: number): Promise<boolean>;
|
|
836
|
+
declare function findPrefixOffthread(code: string, theme: Theme, timeout?: number): Promise<string | null>;
|
|
837
|
+
declare function terminateWorker(): void;
|
|
838
|
+
|
|
839
|
+
// Generated by scripts/generate-tsrx-types.mjs for the built package.
|
|
840
|
+
|
|
841
|
+
type CustomComponentMap = CustomComponentMap$1;
|
|
842
|
+
type RenderContext = RenderContext$1;
|
|
843
|
+
type RenderNodeFn = RenderNodeFn$1;
|
|
844
|
+
|
|
845
|
+
export { AdmonitionNode, BackpressureOptions, BlockquoteNode, CheckboxNode, CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, CodeBlockNode, CodeBlockNodeProps, CodeBlockPreviewPayload$1 as CodeBlockPreviewPayload, CustomComponentDisplayMode, CustomComponentMap, D2BlockNode, D2BlockNodeProps, D2Loader, DefinitionListNode, EmojiNode, EmphasisNode, FallbackComponent, FootnoteAnchorNode, FootnoteNode, FootnoteReferenceNode, HardBreakNode, HeadingNode, HighlightNode, HtmlBlockNode, HtmlComponent, HtmlComponentMap, HtmlInlineNode, HtmlPreviewFrame, HtmlPreviewFrameProps, ImageNode, ImageNodeProps, InfographicBlockNode, InfographicBlockNodeProps, InlineCodeNode, InsertNode, LanguageIconResolver, LinkNode, LinkNodeProps, LinkNodeStyleProps, ListItemNode, ListItemNodeProps, ListNode, MERMAID_WORKER_BUSY_CODE, MarkdownCodeBlockNode, MarkdownCodeBlockNodeProps, MarkstreamCustomComponent, MathBlockNode, MathBlockNodeProps, MathInlineNode, MathInlineNodeProps, MermaidBlockEvent, MermaidBlockNode, MermaidBlockNodeProps, NodeComponentProps, NodeRenderer, NodeRendererCodeBlockProps, NodeRendererProps, CodeBlockNode as OctaneCodeBlockNode, ParagraphNode, PreCodeNode, PreCodeNodeProps, ReferenceNode, RenderContext, RenderNodeFn, ShikiCodeBlockProps, StreamingComponent, StreamingComponentMap, StrikethroughNode, StrongNode, SubscriptNode, SuperscriptNode, TableNode, TextNode, ThematicBreakNode, Tooltip, TooltipPlacement, TooltipProps, VmrContainerNode, WORKER_BUSY_CODE, canParseOffthread, clearGlobalCustomComponents, clearKaTeXCache, clearKaTeXWorker, clearMermaidWorker, NodeRenderer as default, defineHtmlComponents, defineStreamingComponents, disableD2, enableD2, findPrefixOffthread, getCustomComponentDisplay, getCustomNodeComponents, getKaTeXBackpressureDefaults, getLanguageIcon, getMermaidWorkerLoad, isD2Enabled, languageMap, normalizeLanguageIdentifier, preloadExtendedLanguageIcons, removeCustomComponents, renderKaTeXInWorker, renderKaTeXWithBackpressure, renderNode, resolveMonacoLanguageId, setCustomComponents, setD2Loader, setDefaultI18nMap, setKaTeXBackpressureDefaults, setKaTeXCache, setKaTeXConcurrencyLimit, setKaTeXWorker, setKaTeXWorkerDebug, setLanguageIconResolver, setMermaidWorker, setMermaidWorkerClientDebug, setMermaidWorkerMaxConcurrency, subscribeLanguageIconsRevision, terminateWorker, useSafeI18n, useSmoothMarkdownStream, waitForKaTeXWorkerSlot, withMarkstreamComponentDisplay };
|