@oakkles/llm-ui-react 0.1.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 +203 -0
- package/dist/index.cjs +2566 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +431 -0
- package/dist/index.d.ts +431 -0
- package/dist/index.js +2518 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +3 -0
- package/dist/style.js +0 -0
- package/package.json +100 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, CSSProperties, RefObject } from 'react';
|
|
3
|
+
|
|
4
|
+
type LLMRole = 'user' | 'assistant' | 'system';
|
|
5
|
+
type messageStatus = 'sending' | 'sent' | 'error';
|
|
6
|
+
|
|
7
|
+
interface BubblePrimitiveProps {
|
|
8
|
+
/** 消息角色,决定气泡的语义与布局方向 */
|
|
9
|
+
role: LLMRole;
|
|
10
|
+
/** 文本内容;如果传入 children,则通常由 children 接管渲染 */
|
|
11
|
+
content?: string;
|
|
12
|
+
/** 头像插槽,可传入图片、图标或自定义节点 */
|
|
13
|
+
avatar?: ReactNode;
|
|
14
|
+
/** 时间戳,可传入格式化后的字符串或 Date 对象 */
|
|
15
|
+
timestamp?: Date | string;
|
|
16
|
+
/** 消息发送状态,用于渲染发送中、已发送、错误等语义状态 */
|
|
17
|
+
status?: messageStatus;
|
|
18
|
+
/** 是否处于加载中,常用于 assistant 消息的等待动画 */
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
/** 自定义内容插槽,优先级高于 content */
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/** 消息下方操作区插槽 */
|
|
23
|
+
actions?: ReactNode;
|
|
24
|
+
/** 最外层元素类名,供 Styled 层或使用者覆盖 */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** 最外层元素内联样式 */
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
}
|
|
29
|
+
declare function BubblePrimitive({ role, content, avatar, timestamp, status, loading, children, actions, className, style, }: BubblePrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
type BubbleProps = BubblePrimitiveProps;
|
|
32
|
+
declare function Bubble({ className, ...props }: BubbleProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
|
|
34
|
+
interface MarkPrimitiveProps {
|
|
35
|
+
content: string;
|
|
36
|
+
streaming?: boolean;
|
|
37
|
+
onComplete?: () => void;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
declare function MarkPrimitive({ content, streaming, className, }: MarkPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
|
|
42
|
+
type MarkProps = MarkPrimitiveProps;
|
|
43
|
+
declare function Mark({ className, ...props }: MarkProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
interface CodeHighlighterPrimitiveProps {
|
|
46
|
+
code: string;
|
|
47
|
+
copyable?: boolean;
|
|
48
|
+
language?: string;
|
|
49
|
+
showLineNumbers?: boolean;
|
|
50
|
+
startingLineNumber?: number;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
declare function CodeHighlighterPrimitive({ code, copyable, language, showLineNumbers, startingLineNumber, className, }: CodeHighlighterPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
type CodeHighlighterProps = CodeHighlighterPrimitiveProps;
|
|
56
|
+
declare function CodeHighlighter({ className, ...props }: CodeHighlighterProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
type SenderPrefixAction = 'upload' | 'image' | 'search' | 'reasoning';
|
|
59
|
+
interface SenderModelOption {
|
|
60
|
+
value: string;
|
|
61
|
+
label: string;
|
|
62
|
+
}
|
|
63
|
+
interface SenderPrimitiveProps {
|
|
64
|
+
value?: string;
|
|
65
|
+
defaultValue?: string;
|
|
66
|
+
onChange?: (message: string) => void;
|
|
67
|
+
onSend?: (message: string) => void;
|
|
68
|
+
onCancel?: () => void;
|
|
69
|
+
onPrefixAction?: (action: SenderPrefixAction) => void;
|
|
70
|
+
onModelChange?: (model: string) => void;
|
|
71
|
+
onVoiceClick?: () => void;
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
placeholder?: string;
|
|
75
|
+
model?: string;
|
|
76
|
+
modelOptions?: SenderModelOption[];
|
|
77
|
+
prefix?: ReactNode;
|
|
78
|
+
suffix?: ReactNode;
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
declare function SenderPrimitive({ value, defaultValue, onChange, onSend, onCancel, onPrefixAction, onModelChange, onVoiceClick, loading, disabled, placeholder, model, modelOptions, prefix, suffix, className, }: SenderPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
type SenderProps = SenderPrimitiveProps;
|
|
84
|
+
|
|
85
|
+
declare function Sender({ className, ...props }: SenderProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface ThinkPrimitiveProps {
|
|
88
|
+
content?: string;
|
|
89
|
+
status?: 'thinking' | 'done';
|
|
90
|
+
label?: string;
|
|
91
|
+
defaultOpen?: boolean;
|
|
92
|
+
className?: string;
|
|
93
|
+
style?: CSSProperties;
|
|
94
|
+
}
|
|
95
|
+
declare function ThinkPrimitive({ content, status, label, defaultOpen, className, style, }: ThinkPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
type ThinkProps = ThinkPrimitiveProps;
|
|
98
|
+
declare function Think({ className, ...props }: ThinkProps): react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
100
|
+
type NotificationType = 'success' | 'error' | 'loading';
|
|
101
|
+
interface NotificationPrimitiveProps {
|
|
102
|
+
type?: NotificationType;
|
|
103
|
+
title?: ReactNode;
|
|
104
|
+
description?: ReactNode;
|
|
105
|
+
duration?: number;
|
|
106
|
+
showProgress?: boolean;
|
|
107
|
+
closeable?: boolean;
|
|
108
|
+
icon?: ReactNode;
|
|
109
|
+
onClose?: () => void;
|
|
110
|
+
className?: string;
|
|
111
|
+
style?: CSSProperties;
|
|
112
|
+
}
|
|
113
|
+
declare function NotificationPrimitive({ type, title, description, duration, showProgress, closeable, icon, onClose, className, style, }: NotificationPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
type NotificationProps = NotificationPrimitiveProps;
|
|
116
|
+
interface NotificationItem extends NotificationProps {
|
|
117
|
+
id: string;
|
|
118
|
+
}
|
|
119
|
+
interface NotificationStackProps {
|
|
120
|
+
items: NotificationItem[];
|
|
121
|
+
onClose?: (id: string) => void;
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
declare function Notification({ className, ...props }: NotificationProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
declare function NotificationStack({ items, onClose, className, }: NotificationStackProps): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
type ActionVariant = 'default' | 'primary' | 'danger';
|
|
128
|
+
interface ActionItem {
|
|
129
|
+
key: string;
|
|
130
|
+
label: string;
|
|
131
|
+
icon?: ReactNode;
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
variant?: ActionVariant;
|
|
134
|
+
}
|
|
135
|
+
interface ActionsPrimitiveProps {
|
|
136
|
+
items: ActionItem[];
|
|
137
|
+
onAction?: (key: string, item: ActionItem) => void;
|
|
138
|
+
copiedKey?: string;
|
|
139
|
+
copiedDuration?: number;
|
|
140
|
+
orientation?: 'horizontal' | 'vertical';
|
|
141
|
+
size?: 'sm' | 'md';
|
|
142
|
+
className?: string;
|
|
143
|
+
style?: CSSProperties;
|
|
144
|
+
}
|
|
145
|
+
declare function ActionsPrimitive({ items, onAction, copiedKey, copiedDuration, orientation, size, className, style, }: ActionsPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
146
|
+
|
|
147
|
+
type ActionsProps = ActionsPrimitiveProps;
|
|
148
|
+
|
|
149
|
+
declare function Actions({ className, ...props }: ActionsProps): react_jsx_runtime.JSX.Element;
|
|
150
|
+
|
|
151
|
+
type ActionPresetKey = 'copy' | 'regenerate' | 'correct' | 'summary' | 'polish' | 'explain-code';
|
|
152
|
+
declare const actionPresets: Record<ActionPresetKey, ActionItem>;
|
|
153
|
+
declare function createPresetActions(keys: ActionPresetKey[]): ActionItem[];
|
|
154
|
+
|
|
155
|
+
interface PromptItem {
|
|
156
|
+
key: string;
|
|
157
|
+
title: ReactNode;
|
|
158
|
+
prompt?: string;
|
|
159
|
+
description?: ReactNode;
|
|
160
|
+
category?: ReactNode;
|
|
161
|
+
icon?: ReactNode;
|
|
162
|
+
disabled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
interface PromptsPrimitiveProps {
|
|
165
|
+
items: PromptItem[];
|
|
166
|
+
onPrompt?: (key: string, item: PromptItem) => void;
|
|
167
|
+
title?: ReactNode;
|
|
168
|
+
description?: ReactNode;
|
|
169
|
+
emptyText?: ReactNode;
|
|
170
|
+
columns?: 1 | 2 | 3;
|
|
171
|
+
className?: string;
|
|
172
|
+
style?: CSSProperties;
|
|
173
|
+
}
|
|
174
|
+
declare function PromptsPrimitive({ items, onPrompt, title, description, emptyText, columns, className, style, }: PromptsPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
175
|
+
|
|
176
|
+
type PromptsProps = PromptsPrimitiveProps;
|
|
177
|
+
|
|
178
|
+
declare function Prompts({ className, ...props }: PromptsProps): react_jsx_runtime.JSX.Element;
|
|
179
|
+
|
|
180
|
+
interface ConversationRecord {
|
|
181
|
+
id: string;
|
|
182
|
+
title: string;
|
|
183
|
+
lastMessage?: string;
|
|
184
|
+
timestamp?: Date | string;
|
|
185
|
+
pinned?: boolean;
|
|
186
|
+
favorite?: boolean;
|
|
187
|
+
}
|
|
188
|
+
interface ConversationItemPrimitiveProps {
|
|
189
|
+
conversation: ConversationRecord;
|
|
190
|
+
active?: boolean;
|
|
191
|
+
onSelect?: (id: string) => void;
|
|
192
|
+
onDelete?: (id: string) => void;
|
|
193
|
+
onPin?: (id: string) => void;
|
|
194
|
+
onFavorite?: (id: string) => void;
|
|
195
|
+
className?: string;
|
|
196
|
+
style?: CSSProperties;
|
|
197
|
+
}
|
|
198
|
+
declare function ConversationItemPrimitive({ conversation, active, onSelect, onDelete, onPin, onFavorite, className, style, }: ConversationItemPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
199
|
+
|
|
200
|
+
type ConversationItemProps = ConversationItemPrimitiveProps;
|
|
201
|
+
|
|
202
|
+
declare function ConversationItem({ className, ...props }: ConversationItemProps): react_jsx_runtime.JSX.Element;
|
|
203
|
+
|
|
204
|
+
interface ConversationListPrimitiveProps {
|
|
205
|
+
conversations: ConversationRecord[];
|
|
206
|
+
activeId?: string;
|
|
207
|
+
onSelect?: (id: string) => void;
|
|
208
|
+
onDelete?: (id: string) => void;
|
|
209
|
+
onPin?: (id: string) => void;
|
|
210
|
+
onFavorite?: (id: string) => void;
|
|
211
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
212
|
+
onNewConversation?: () => void;
|
|
213
|
+
collapsed?: boolean;
|
|
214
|
+
searchable?: boolean;
|
|
215
|
+
searchPlaceholder?: string;
|
|
216
|
+
title?: ReactNode;
|
|
217
|
+
emptyText?: ReactNode;
|
|
218
|
+
virtualized?: boolean;
|
|
219
|
+
itemHeight?: number;
|
|
220
|
+
overscan?: number;
|
|
221
|
+
className?: string;
|
|
222
|
+
style?: CSSProperties;
|
|
223
|
+
}
|
|
224
|
+
declare function ConversationListPrimitive({ conversations, activeId, onSelect, onDelete, onPin, onFavorite, onCollapsedChange, onNewConversation, collapsed, searchable, searchPlaceholder, title, emptyText, virtualized, itemHeight, overscan, className, style, }: ConversationListPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
|
|
226
|
+
type ConversationListProps = ConversationListPrimitiveProps;
|
|
227
|
+
declare function ConversationList({ className, ...props }: ConversationListProps): react_jsx_runtime.JSX.Element;
|
|
228
|
+
|
|
229
|
+
interface MessageRecord {
|
|
230
|
+
id: string;
|
|
231
|
+
role: LLMRole;
|
|
232
|
+
content?: string;
|
|
233
|
+
avatar?: ReactNode;
|
|
234
|
+
timestamp?: Date | string;
|
|
235
|
+
status?: messageStatus;
|
|
236
|
+
loading?: boolean;
|
|
237
|
+
actions?: ReactNode;
|
|
238
|
+
}
|
|
239
|
+
interface MessageListPrimitiveProps {
|
|
240
|
+
messages: MessageRecord[];
|
|
241
|
+
virtualized?: boolean;
|
|
242
|
+
itemHeight?: number;
|
|
243
|
+
overscan?: number;
|
|
244
|
+
emptyText?: ReactNode;
|
|
245
|
+
renderMessage?: (message: MessageRecord, index: number) => ReactNode;
|
|
246
|
+
role?: 'log' | 'list';
|
|
247
|
+
ariaLabel?: string;
|
|
248
|
+
className?: string;
|
|
249
|
+
style?: CSSProperties;
|
|
250
|
+
}
|
|
251
|
+
declare function MessageListPrimitive({ messages, virtualized, itemHeight, overscan, emptyText, renderMessage, role, ariaLabel, className, style, }: MessageListPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
252
|
+
|
|
253
|
+
type MessageListProps = MessageListPrimitiveProps;
|
|
254
|
+
|
|
255
|
+
declare function MessageList({ className, ...props }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
256
|
+
|
|
257
|
+
type ThoughtStatus = 'pending' | 'loading' | 'success' | 'error' | 'abort';
|
|
258
|
+
interface ThoughtItem {
|
|
259
|
+
key: string;
|
|
260
|
+
title: ReactNode;
|
|
261
|
+
description?: ReactNode;
|
|
262
|
+
content?: ReactNode;
|
|
263
|
+
footer?: ReactNode;
|
|
264
|
+
status?: ThoughtStatus;
|
|
265
|
+
icon?: ReactNode | false;
|
|
266
|
+
collapsible?: boolean;
|
|
267
|
+
defaultOpen?: boolean;
|
|
268
|
+
children?: ThoughtItem[];
|
|
269
|
+
}
|
|
270
|
+
interface ThoughtPrimitiveProps {
|
|
271
|
+
items: ThoughtItem[];
|
|
272
|
+
title?: ReactNode;
|
|
273
|
+
description?: ReactNode;
|
|
274
|
+
defaultExpandedKeys?: string[];
|
|
275
|
+
expandedKeys?: string[];
|
|
276
|
+
onExpand?: (expandedKeys: string[], item: ThoughtItem) => void;
|
|
277
|
+
line?: boolean;
|
|
278
|
+
compact?: boolean;
|
|
279
|
+
emptyText?: ReactNode;
|
|
280
|
+
className?: string;
|
|
281
|
+
style?: CSSProperties;
|
|
282
|
+
}
|
|
283
|
+
declare function ThoughtPrimitive({ items, title, description, defaultExpandedKeys, expandedKeys, onExpand, line, compact, emptyText, className, style, }: ThoughtPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
284
|
+
|
|
285
|
+
type ThoughtProps = ThoughtPrimitiveProps;
|
|
286
|
+
|
|
287
|
+
declare function Thought({ className, ...props }: ThoughtProps): react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
289
|
+
interface CitationItem {
|
|
290
|
+
key: string;
|
|
291
|
+
title: ReactNode;
|
|
292
|
+
description?: ReactNode;
|
|
293
|
+
url?: string;
|
|
294
|
+
icon?: ReactNode;
|
|
295
|
+
}
|
|
296
|
+
interface CitationPrimitiveProps {
|
|
297
|
+
items: CitationItem[];
|
|
298
|
+
title?: ReactNode;
|
|
299
|
+
defaultExpanded?: boolean;
|
|
300
|
+
expanded?: boolean;
|
|
301
|
+
onExpand?: (expanded: boolean) => void;
|
|
302
|
+
onCitation?: (key: string, item: CitationItem) => void;
|
|
303
|
+
emptyText?: ReactNode;
|
|
304
|
+
className?: string;
|
|
305
|
+
style?: CSSProperties;
|
|
306
|
+
}
|
|
307
|
+
interface CitationInlinePrimitiveProps {
|
|
308
|
+
item: CitationItem;
|
|
309
|
+
index?: number;
|
|
310
|
+
active?: boolean;
|
|
311
|
+
onCitation?: (key: string, item: CitationItem) => void;
|
|
312
|
+
className?: string;
|
|
313
|
+
style?: CSSProperties;
|
|
314
|
+
}
|
|
315
|
+
declare function CitationInlinePrimitive({ item, index, active, onCitation, className, style, }: CitationInlinePrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
316
|
+
declare function CitationPrimitive({ items, title, defaultExpanded, expanded, onExpand, onCitation, emptyText, className, style, }: CitationPrimitiveProps): react_jsx_runtime.JSX.Element;
|
|
317
|
+
|
|
318
|
+
type CitationProps = CitationPrimitiveProps;
|
|
319
|
+
type CitationInlineProps = CitationInlinePrimitiveProps;
|
|
320
|
+
|
|
321
|
+
declare function Citation({ className, ...props }: CitationProps): react_jsx_runtime.JSX.Element;
|
|
322
|
+
declare namespace Citation {
|
|
323
|
+
var Inline: typeof CitationInline;
|
|
324
|
+
}
|
|
325
|
+
declare function CitationInline({ className, ...props }: CitationInlineProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
|
|
327
|
+
interface Locale {
|
|
328
|
+
think: {
|
|
329
|
+
loading: string;
|
|
330
|
+
done: string;
|
|
331
|
+
};
|
|
332
|
+
sender: {
|
|
333
|
+
placeholder: string;
|
|
334
|
+
send: string;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
type ComponentDefaultProps = Record<string, unknown>;
|
|
339
|
+
interface ConfigProviderProps {
|
|
340
|
+
theme?: {
|
|
341
|
+
mode?: 'light' | 'dark' | 'system';
|
|
342
|
+
primaryColor?: string;
|
|
343
|
+
};
|
|
344
|
+
locale?: 'zh-CN' | 'en-US' | Locale;
|
|
345
|
+
components?: Record<string, ComponentDefaultProps>;
|
|
346
|
+
ai?: {
|
|
347
|
+
apiKey: string;
|
|
348
|
+
model: string;
|
|
349
|
+
baseURL?: string;
|
|
350
|
+
};
|
|
351
|
+
children: ReactNode;
|
|
352
|
+
}
|
|
353
|
+
interface ConfigContextValue {
|
|
354
|
+
theme: {
|
|
355
|
+
mode: 'light' | 'dark' | 'system';
|
|
356
|
+
primaryColor: string;
|
|
357
|
+
};
|
|
358
|
+
setTheme: (theme: {
|
|
359
|
+
mode?: 'light' | 'dark' | 'system';
|
|
360
|
+
primaryColor?: string;
|
|
361
|
+
}) => void;
|
|
362
|
+
locale: Locale;
|
|
363
|
+
components?: Record<string, ComponentDefaultProps>;
|
|
364
|
+
ai?: {
|
|
365
|
+
apiKey: string;
|
|
366
|
+
model: string;
|
|
367
|
+
baseURL?: string;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
declare function ConfigProvider({ theme, locale, ai, children, components }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
372
|
+
|
|
373
|
+
declare function useConfig(): ConfigContextValue;
|
|
374
|
+
|
|
375
|
+
declare function useLocale(): Locale;
|
|
376
|
+
|
|
377
|
+
declare function useTheme(): {
|
|
378
|
+
mode: "system" | "dark" | "light";
|
|
379
|
+
isDark: boolean;
|
|
380
|
+
setMode: (mode: "light" | "dark" | "system") => void;
|
|
381
|
+
primaryColor: string;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
type StreamState = 'idle' | 'streaming' | 'error' | 'complete';
|
|
385
|
+
interface StreamStartOptions {
|
|
386
|
+
onComplete?: (content: string) => void;
|
|
387
|
+
onError?: () => void;
|
|
388
|
+
onToken?: (content: string, token: string) => void;
|
|
389
|
+
}
|
|
390
|
+
declare function useStream(): {
|
|
391
|
+
content: string;
|
|
392
|
+
state: StreamState;
|
|
393
|
+
start: (generator: AsyncGenerator<string>, options?: StreamStartOptions) => Promise<void>;
|
|
394
|
+
cancel: () => void;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
type VirtualListKey = string | number;
|
|
398
|
+
type VirtualListAlign = 'start' | 'center' | 'end';
|
|
399
|
+
interface UseVirtualListOptions<T> {
|
|
400
|
+
items: T[];
|
|
401
|
+
itemHeight: number;
|
|
402
|
+
overscan?: number;
|
|
403
|
+
enabled?: boolean;
|
|
404
|
+
getItemKey?: (item: T, index: number) => VirtualListKey;
|
|
405
|
+
}
|
|
406
|
+
interface VirtualListItem<T> {
|
|
407
|
+
item: T;
|
|
408
|
+
index: number;
|
|
409
|
+
key: VirtualListKey;
|
|
410
|
+
start: number;
|
|
411
|
+
size: number;
|
|
412
|
+
}
|
|
413
|
+
interface UseVirtualListReturn<T> {
|
|
414
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
415
|
+
virtualItems: VirtualListItem<T>[];
|
|
416
|
+
totalSize: number;
|
|
417
|
+
scrollToIndex: (index: number, align?: VirtualListAlign) => void;
|
|
418
|
+
}
|
|
419
|
+
declare function useVirtualList<T>({ items, itemHeight, overscan, enabled, getItemKey, }: UseVirtualListOptions<T>): UseVirtualListReturn<T>;
|
|
420
|
+
|
|
421
|
+
declare function streamToGenerator(stream: ReadableStream<Uint8Array>, encoding?: string): AsyncGenerator<string>;
|
|
422
|
+
declare function generatorToStream(gen: AsyncGenerator<string>): ReadableStream<Uint8Array>;
|
|
423
|
+
declare function mockStream(text: string, delay?: number): AsyncGenerator<string>;
|
|
424
|
+
|
|
425
|
+
declare function sanitizeMarkdown(content: string): string;
|
|
426
|
+
|
|
427
|
+
declare const zhCN: Locale;
|
|
428
|
+
|
|
429
|
+
declare const enUS: Locale;
|
|
430
|
+
|
|
431
|
+
export { type ActionItem, type ActionPresetKey, type ActionVariant, Actions, ActionsPrimitive, type ActionsPrimitiveProps, type ActionsProps, Bubble, BubblePrimitive, type BubblePrimitiveProps, type BubbleProps, Citation, CitationInlinePrimitive, type CitationInlinePrimitiveProps, type CitationInlineProps, type CitationItem, CitationPrimitive, type CitationPrimitiveProps, type CitationProps, CodeHighlighter, CodeHighlighterPrimitive, type CodeHighlighterPrimitiveProps, type CodeHighlighterProps, type ComponentDefaultProps, type ConfigContextValue, ConfigProvider, type ConfigProviderProps, ConversationItem, ConversationItemPrimitive, type ConversationItemPrimitiveProps, type ConversationItemProps, ConversationList, ConversationListPrimitive, type ConversationListPrimitiveProps, type ConversationListProps, type ConversationRecord, type Locale, Mark, MarkPrimitive, type MarkPrimitiveProps, type MarkProps, MessageList, MessageListPrimitive, type MessageListPrimitiveProps, type MessageListProps, type MessageRecord, Notification, type NotificationItem, NotificationPrimitive, type NotificationPrimitiveProps, type NotificationProps, NotificationStack, type NotificationStackProps, type NotificationType, type PromptItem, Prompts, PromptsPrimitive, type PromptsPrimitiveProps, type PromptsProps, Sender, type SenderModelOption, type SenderPrefixAction, SenderPrimitive, type SenderPrimitiveProps, type SenderProps, Think, ThinkPrimitive, type ThinkPrimitiveProps, type ThinkProps, Thought, type ThoughtItem, ThoughtPrimitive, type ThoughtPrimitiveProps, type ThoughtProps, type ThoughtStatus, type UseVirtualListOptions, type UseVirtualListReturn, type VirtualListAlign, type VirtualListItem, type VirtualListKey, actionPresets, createPresetActions, enUS, generatorToStream, mockStream, sanitizeMarkdown, streamToGenerator, useConfig, useLocale, useStream, useTheme, useVirtualList, zhCN };
|