@vinaverse/react-native 0.0.0-stage → 0.1.0-alpha.2

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.
@@ -0,0 +1,264 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ComponentType, ReactElement, RefObject } from 'react';
3
+ import { HeldCard, CardItem, Question, MessageItem, TimelineItem, SystemItem, ProposalOutcome, ConversationStore } from '@vinaverse/client/conversation';
4
+ import { CopyOverrides } from '@vinaverse/react';
5
+ import { ImageProps, StyleProp, ViewStyle } from 'react-native';
6
+ import { ColorScheme, Colors, font, space, radius, motion, size } from '@vinaverse/tokens';
7
+
8
+ declare function CardFrame(props: {
9
+ readonly label: string;
10
+ readonly restored?: boolean;
11
+ readonly children?: ReactNode;
12
+ readonly testID?: string;
13
+ }): react.JSX.Element;
14
+
15
+ interface CardProps {
16
+ readonly card: HeldCard;
17
+ /** A proposal being decided: draw its buttons busy. */
18
+ readonly busy: boolean;
19
+ /** Restored after a restart: draw it as it was, taking no answer or action. */
20
+ readonly restored: boolean;
21
+ /** The kit's own renderer for this kind, to wrap rather than rewrite. */
22
+ readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
23
+ }
24
+
25
+ /** The kit's own renderer for a kind. */
26
+ declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
27
+ declare const CardView: react.NamedExoticComponent<{
28
+ readonly item: CardItem;
29
+ }>;
30
+
31
+ declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
32
+
33
+ declare function NextStepCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
34
+
35
+ /** A field's value as text, by its type (`text`, `list`, `time_range`, `address`, `money_cents`). */
36
+ declare function fieldText(type: string, value: unknown, locale: string | undefined, timeZone: string | undefined): string;
37
+ declare function ProposalCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
38
+
39
+ declare function QuestionCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
40
+ /** A recorded answer, in words. */
41
+ declare function answerText(question: Question, locale: string | undefined, otherLabel: string): string | null;
42
+
43
+ declare function TimeSlotsCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
44
+
45
+ declare const ActivityLine: react.NamedExoticComponent<object>;
46
+
47
+ declare const Avatar: react.NamedExoticComponent<{
48
+ readonly name: string;
49
+ readonly uri: string | null;
50
+ readonly person?: boolean;
51
+ }>;
52
+
53
+ interface ButtonProps {
54
+ readonly label: string;
55
+ readonly onPress: () => void;
56
+ readonly variant?: 'primary' | 'secondary' | 'text';
57
+ readonly disabled?: boolean;
58
+ readonly busy?: boolean;
59
+ /** A role other than a button: `radio` and `checkbox` for choices. */
60
+ readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
61
+ readonly selected?: boolean;
62
+ readonly hint?: string;
63
+ readonly children?: ReactNode;
64
+ readonly testID?: string;
65
+ }
66
+ declare const Button: react.NamedExoticComponent<ButtonProps>;
67
+
68
+ interface HeaderProps {
69
+ readonly name: string;
70
+ readonly avatarUrl: string | null;
71
+ /** While a person from the business replies: their role. */
72
+ readonly takeoverBy: string | null;
73
+ readonly Default: ComponentType<Omit<HeaderProps, 'Default'>>;
74
+ }
75
+ interface MessageBubbleProps {
76
+ readonly item: MessageItem;
77
+ /** The text to draw: the message's, or the streamed text so far. */
78
+ readonly text: string;
79
+ readonly Default: ComponentType<Omit<MessageBubbleProps, 'Default'>>;
80
+ }
81
+ interface ComposerProps {
82
+ readonly placeholder: string;
83
+ readonly responding: boolean;
84
+ readonly onSend: (text: string) => void;
85
+ readonly onStop: () => void;
86
+ readonly Default: ComponentType<Omit<ComposerProps, 'Default'>>;
87
+ }
88
+ interface EmptyStateProps {
89
+ readonly agentName: string;
90
+ }
91
+ /** The props the kit gives its list: FlashList's, so FlashList or LegendList take them as they are. */
92
+ interface ListProps {
93
+ readonly data: readonly TimelineItem[];
94
+ readonly renderItem: (info: {
95
+ item: TimelineItem;
96
+ index: number;
97
+ }) => ReactElement | null;
98
+ readonly keyExtractor: (item: TimelineItem) => string;
99
+ readonly getItemType: (item: TimelineItem) => string;
100
+ readonly maintainVisibleContentPosition: {
101
+ readonly startRenderingFromBottom: boolean;
102
+ readonly autoscrollToBottomThreshold: number;
103
+ readonly animateAutoScrollToBottom: boolean;
104
+ };
105
+ readonly ListFooterComponent: ReactElement | null;
106
+ readonly ListEmptyComponent: ReactElement | null;
107
+ readonly keyboardShouldPersistTaps: 'handled';
108
+ readonly contentContainerStyle: object;
109
+ }
110
+
111
+ declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
112
+ declare const ChatHeader: react.NamedExoticComponent<object>;
113
+
114
+ declare const ChatSkeleton: react.NamedExoticComponent<object>;
115
+
116
+ declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
117
+ declare const Composer: react.NamedExoticComponent<{
118
+ readonly onError?: (error: unknown) => void;
119
+ }>;
120
+
121
+ declare const DisclosureBar: react.NamedExoticComponent<object>;
122
+
123
+ declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
124
+ declare const MessageBubble: react.NamedExoticComponent<{
125
+ readonly item: MessageItem;
126
+ /** The first of a run from the same author: its label is shown. */
127
+ readonly showAuthor: boolean;
128
+ }>;
129
+ /** The reply streaming now: the only cell that re-renders as the text arrives. */
130
+ declare const StreamingBubble: react.NamedExoticComponent<{
131
+ readonly item: MessageItem;
132
+ readonly showAuthor: boolean;
133
+ }>;
134
+
135
+ /** Rows of one kind recycle together. */
136
+ declare function itemType(item: TimelineItem): string;
137
+ declare const Row: react.NamedExoticComponent<{
138
+ readonly item: TimelineItem;
139
+ readonly showAuthor: boolean;
140
+ }>;
141
+ declare const MessageList: react.NamedExoticComponent<object>;
142
+
143
+ declare const StatusBanner: react.NamedExoticComponent<object>;
144
+
145
+ declare const SystemRow: react.NamedExoticComponent<{
146
+ readonly item: SystemItem;
147
+ }>;
148
+
149
+ type ProposalDecision = 'confirm' | 'decline';
150
+ /** What the kit asks of the tenant's app. Only `onProposal` and `onOpenLink` are needed for the cards that use them. */
151
+ interface ChatHandlers {
152
+ /**
153
+ * The person confirmed or declined a proposal: call your backend with the person's own token, then say what
154
+ * happened (`confirmed`, `declined`, `failed`, or `expired` when it had expired). The kit reports it to the session.
155
+ */
156
+ readonly onProposal?: (card: HeldCard, decision: ProposalDecision) => Promise<ProposalOutcome>;
157
+ /** Open a card's link in your app (it already passed the deep-link rule); route by the page it names. */
158
+ readonly onOpenLink?: (link: string, card: HeldCard) => void;
159
+ /** A card action without a link (`show_times`, …): sent to the session; this tells your app too. */
160
+ readonly onCardAction?: (card: HeldCard, action: string) => void;
161
+ /** A photo question: let the person pick one, upload it to your backend, and give back its `upload_ref`. */
162
+ readonly onPickPhoto?: (question: Question, card: HeldCard) => Promise<{
163
+ readonly upload_ref: string;
164
+ } | null>;
165
+ /** Development warnings: a theme that is hard to read, copy that says "assistant". */
166
+ readonly onWarning?: (message: string) => void;
167
+ }
168
+ /** Parts a tenant can replace. Each gets the default's props and the default itself (`Default`), to wrap it. */
169
+ interface ChatSlots {
170
+ readonly Header?: ComponentType<HeaderProps>;
171
+ readonly MessageBubble?: ComponentType<MessageBubbleProps>;
172
+ readonly Composer?: ComponentType<ComposerProps>;
173
+ readonly EmptyState?: ComponentType<EmptyStateProps>;
174
+ readonly Image?: ComponentType<ImageProps>;
175
+ /** A list with FlashList's props (LegendList works). Default: FlashList. */
176
+ readonly ListComponent?: ComponentType<ListProps>;
177
+ /** Card renderers by kind (`professional`, `proposal`, …). */
178
+ readonly cards?: Readonly<Partial<Record<string, ComponentType<CardProps>>>>;
179
+ }
180
+ interface ChatContextValue {
181
+ readonly store: ConversationStore;
182
+ readonly handlers: RefObject<ChatHandlers>;
183
+ readonly slots: ChatSlots;
184
+ readonly agentAvatar: string | undefined;
185
+ readonly timeZone: string | undefined;
186
+ }
187
+ /** The conversation, handlers and slots; only inside `VinaverseChat` (or `VinaverseChatProvider`). */
188
+ declare function useChat(): ChatContextValue;
189
+
190
+ interface Theme {
191
+ readonly scheme: ColorScheme;
192
+ readonly colors: Colors;
193
+ readonly font: typeof font & {
194
+ readonly family?: string;
195
+ };
196
+ readonly space: typeof space;
197
+ readonly radius: typeof radius;
198
+ readonly motion: typeof motion;
199
+ readonly size: typeof size;
200
+ }
201
+ /** A tenant's brand: colors per scheme, a font family, radii. Anything left out keeps the Vinaverse default. */
202
+ interface ThemeOverrides {
203
+ readonly light?: Partial<Colors>;
204
+ readonly dark?: Partial<Colors>;
205
+ readonly fontFamily?: string;
206
+ readonly radius?: Partial<typeof radius>;
207
+ readonly space?: Partial<typeof space>;
208
+ }
209
+ type ColorSchemeSetting = 'system' | 'light' | 'dark';
210
+ /** The theme for a scheme, with the tenant's overrides on top. */
211
+ declare function createTheme(scheme: ColorScheme, overrides?: ThemeOverrides): Theme;
212
+ /** The pairs a tenant's colors made hard to read, in either scheme, as messages for a development warning. */
213
+ declare function themeProblems(overrides?: ThemeOverrides): string[];
214
+ declare function ThemeProvider(props: {
215
+ readonly theme?: ThemeOverrides | undefined;
216
+ readonly colorScheme?: ColorSchemeSetting | undefined;
217
+ readonly children?: ReactNode;
218
+ }): ReactNode;
219
+ declare function useTheme(): Theme;
220
+
221
+ interface VinaverseChatProps extends ChatHandlers {
222
+ /** The conversation (`createConversation`), created where it can outlive the screen. */
223
+ readonly conversation: ConversationStore;
224
+ /** The person's locale: the copy, dates, money and text direction (pass the same one to `getSession`). */
225
+ readonly locale?: string;
226
+ /** For dates and times on cards; default: the device's. */
227
+ readonly timeZone?: string;
228
+ readonly copy?: CopyOverrides;
229
+ readonly theme?: ThemeOverrides;
230
+ readonly colorScheme?: ColorSchemeSetting;
231
+ /** Parts to replace. Keep the object stable (module level, or memoized). */
232
+ readonly components?: ChatSlots;
233
+ /** The agent's picture, until the session carries one. */
234
+ readonly agentAvatar?: string;
235
+ /** Hide the header (a screen that draws its own); the disclosure stays. */
236
+ readonly hideHeader?: boolean;
237
+ /** iOS: the height above the keyboard that is not this view's (a navigation header). */
238
+ readonly keyboardVerticalOffset?: number;
239
+ /**
240
+ * How the composer stays above the keyboard. Default: `padding` on iOS, none on Android (the window resizes). An
241
+ * edge-to-edge Android app whose window does not resize passes `padding`; one that manages the keyboard itself
242
+ * (react-native-keyboard-controller) passes `none`.
243
+ */
244
+ readonly keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
245
+ readonly style?: StyleProp<ViewStyle>;
246
+ }
247
+ /** The providers alone, for a tenant composing its own layout from the exported parts. */
248
+ declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style'> & {
249
+ readonly children?: ReactNode;
250
+ }): ReactNode;
251
+ declare function VinaverseChat(props: VinaverseChatProps): ReactNode;
252
+
253
+ /** The part of the conversation store the adapter drives. */
254
+ interface LifecycleTarget {
255
+ setForeground(foreground: boolean): void;
256
+ }
257
+ /** Tells the store when the app comes to the foreground or goes to the background (it pings only in the foreground). */
258
+ declare function useNativeLifecycle(store: LifecycleTarget): void;
259
+ /** Whether the person asked for reduced motion: animations and animated scrolling stay off. */
260
+ declare function useReducedMotion(): boolean;
261
+ /** Reads a line to a screen reader, without moving focus. */
262
+ declare function announce(text: string): void;
263
+
264
+ export { ActivityLine, Avatar, Button, type ButtonProps, CardFrame, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultHeader, DisclosureBar, type EmptyStateProps, type HeaderProps, InfoCard, type LifecycleTarget, type ListProps, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, announce, answerText, createTheme, defaultCard, fieldText, itemType, themeProblems, useChat, useNativeLifecycle, useReducedMotion, useTheme };
@@ -0,0 +1,264 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ComponentType, ReactElement, RefObject } from 'react';
3
+ import { HeldCard, CardItem, Question, MessageItem, TimelineItem, SystemItem, ProposalOutcome, ConversationStore } from '@vinaverse/client/conversation';
4
+ import { CopyOverrides } from '@vinaverse/react';
5
+ import { ImageProps, StyleProp, ViewStyle } from 'react-native';
6
+ import { ColorScheme, Colors, font, space, radius, motion, size } from '@vinaverse/tokens';
7
+
8
+ declare function CardFrame(props: {
9
+ readonly label: string;
10
+ readonly restored?: boolean;
11
+ readonly children?: ReactNode;
12
+ readonly testID?: string;
13
+ }): react.JSX.Element;
14
+
15
+ interface CardProps {
16
+ readonly card: HeldCard;
17
+ /** A proposal being decided: draw its buttons busy. */
18
+ readonly busy: boolean;
19
+ /** Restored after a restart: draw it as it was, taking no answer or action. */
20
+ readonly restored: boolean;
21
+ /** The kit's own renderer for this kind, to wrap rather than rewrite. */
22
+ readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
23
+ }
24
+
25
+ /** The kit's own renderer for a kind. */
26
+ declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
27
+ declare const CardView: react.NamedExoticComponent<{
28
+ readonly item: CardItem;
29
+ }>;
30
+
31
+ declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
32
+
33
+ declare function NextStepCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
34
+
35
+ /** A field's value as text, by its type (`text`, `list`, `time_range`, `address`, `money_cents`). */
36
+ declare function fieldText(type: string, value: unknown, locale: string | undefined, timeZone: string | undefined): string;
37
+ declare function ProposalCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
38
+
39
+ declare function QuestionCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
40
+ /** A recorded answer, in words. */
41
+ declare function answerText(question: Question, locale: string | undefined, otherLabel: string): string | null;
42
+
43
+ declare function TimeSlotsCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
44
+
45
+ declare const ActivityLine: react.NamedExoticComponent<object>;
46
+
47
+ declare const Avatar: react.NamedExoticComponent<{
48
+ readonly name: string;
49
+ readonly uri: string | null;
50
+ readonly person?: boolean;
51
+ }>;
52
+
53
+ interface ButtonProps {
54
+ readonly label: string;
55
+ readonly onPress: () => void;
56
+ readonly variant?: 'primary' | 'secondary' | 'text';
57
+ readonly disabled?: boolean;
58
+ readonly busy?: boolean;
59
+ /** A role other than a button: `radio` and `checkbox` for choices. */
60
+ readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
61
+ readonly selected?: boolean;
62
+ readonly hint?: string;
63
+ readonly children?: ReactNode;
64
+ readonly testID?: string;
65
+ }
66
+ declare const Button: react.NamedExoticComponent<ButtonProps>;
67
+
68
+ interface HeaderProps {
69
+ readonly name: string;
70
+ readonly avatarUrl: string | null;
71
+ /** While a person from the business replies: their role. */
72
+ readonly takeoverBy: string | null;
73
+ readonly Default: ComponentType<Omit<HeaderProps, 'Default'>>;
74
+ }
75
+ interface MessageBubbleProps {
76
+ readonly item: MessageItem;
77
+ /** The text to draw: the message's, or the streamed text so far. */
78
+ readonly text: string;
79
+ readonly Default: ComponentType<Omit<MessageBubbleProps, 'Default'>>;
80
+ }
81
+ interface ComposerProps {
82
+ readonly placeholder: string;
83
+ readonly responding: boolean;
84
+ readonly onSend: (text: string) => void;
85
+ readonly onStop: () => void;
86
+ readonly Default: ComponentType<Omit<ComposerProps, 'Default'>>;
87
+ }
88
+ interface EmptyStateProps {
89
+ readonly agentName: string;
90
+ }
91
+ /** The props the kit gives its list: FlashList's, so FlashList or LegendList take them as they are. */
92
+ interface ListProps {
93
+ readonly data: readonly TimelineItem[];
94
+ readonly renderItem: (info: {
95
+ item: TimelineItem;
96
+ index: number;
97
+ }) => ReactElement | null;
98
+ readonly keyExtractor: (item: TimelineItem) => string;
99
+ readonly getItemType: (item: TimelineItem) => string;
100
+ readonly maintainVisibleContentPosition: {
101
+ readonly startRenderingFromBottom: boolean;
102
+ readonly autoscrollToBottomThreshold: number;
103
+ readonly animateAutoScrollToBottom: boolean;
104
+ };
105
+ readonly ListFooterComponent: ReactElement | null;
106
+ readonly ListEmptyComponent: ReactElement | null;
107
+ readonly keyboardShouldPersistTaps: 'handled';
108
+ readonly contentContainerStyle: object;
109
+ }
110
+
111
+ declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
112
+ declare const ChatHeader: react.NamedExoticComponent<object>;
113
+
114
+ declare const ChatSkeleton: react.NamedExoticComponent<object>;
115
+
116
+ declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
117
+ declare const Composer: react.NamedExoticComponent<{
118
+ readonly onError?: (error: unknown) => void;
119
+ }>;
120
+
121
+ declare const DisclosureBar: react.NamedExoticComponent<object>;
122
+
123
+ declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
124
+ declare const MessageBubble: react.NamedExoticComponent<{
125
+ readonly item: MessageItem;
126
+ /** The first of a run from the same author: its label is shown. */
127
+ readonly showAuthor: boolean;
128
+ }>;
129
+ /** The reply streaming now: the only cell that re-renders as the text arrives. */
130
+ declare const StreamingBubble: react.NamedExoticComponent<{
131
+ readonly item: MessageItem;
132
+ readonly showAuthor: boolean;
133
+ }>;
134
+
135
+ /** Rows of one kind recycle together. */
136
+ declare function itemType(item: TimelineItem): string;
137
+ declare const Row: react.NamedExoticComponent<{
138
+ readonly item: TimelineItem;
139
+ readonly showAuthor: boolean;
140
+ }>;
141
+ declare const MessageList: react.NamedExoticComponent<object>;
142
+
143
+ declare const StatusBanner: react.NamedExoticComponent<object>;
144
+
145
+ declare const SystemRow: react.NamedExoticComponent<{
146
+ readonly item: SystemItem;
147
+ }>;
148
+
149
+ type ProposalDecision = 'confirm' | 'decline';
150
+ /** What the kit asks of the tenant's app. Only `onProposal` and `onOpenLink` are needed for the cards that use them. */
151
+ interface ChatHandlers {
152
+ /**
153
+ * The person confirmed or declined a proposal: call your backend with the person's own token, then say what
154
+ * happened (`confirmed`, `declined`, `failed`, or `expired` when it had expired). The kit reports it to the session.
155
+ */
156
+ readonly onProposal?: (card: HeldCard, decision: ProposalDecision) => Promise<ProposalOutcome>;
157
+ /** Open a card's link in your app (it already passed the deep-link rule); route by the page it names. */
158
+ readonly onOpenLink?: (link: string, card: HeldCard) => void;
159
+ /** A card action without a link (`show_times`, …): sent to the session; this tells your app too. */
160
+ readonly onCardAction?: (card: HeldCard, action: string) => void;
161
+ /** A photo question: let the person pick one, upload it to your backend, and give back its `upload_ref`. */
162
+ readonly onPickPhoto?: (question: Question, card: HeldCard) => Promise<{
163
+ readonly upload_ref: string;
164
+ } | null>;
165
+ /** Development warnings: a theme that is hard to read, copy that says "assistant". */
166
+ readonly onWarning?: (message: string) => void;
167
+ }
168
+ /** Parts a tenant can replace. Each gets the default's props and the default itself (`Default`), to wrap it. */
169
+ interface ChatSlots {
170
+ readonly Header?: ComponentType<HeaderProps>;
171
+ readonly MessageBubble?: ComponentType<MessageBubbleProps>;
172
+ readonly Composer?: ComponentType<ComposerProps>;
173
+ readonly EmptyState?: ComponentType<EmptyStateProps>;
174
+ readonly Image?: ComponentType<ImageProps>;
175
+ /** A list with FlashList's props (LegendList works). Default: FlashList. */
176
+ readonly ListComponent?: ComponentType<ListProps>;
177
+ /** Card renderers by kind (`professional`, `proposal`, …). */
178
+ readonly cards?: Readonly<Partial<Record<string, ComponentType<CardProps>>>>;
179
+ }
180
+ interface ChatContextValue {
181
+ readonly store: ConversationStore;
182
+ readonly handlers: RefObject<ChatHandlers>;
183
+ readonly slots: ChatSlots;
184
+ readonly agentAvatar: string | undefined;
185
+ readonly timeZone: string | undefined;
186
+ }
187
+ /** The conversation, handlers and slots; only inside `VinaverseChat` (or `VinaverseChatProvider`). */
188
+ declare function useChat(): ChatContextValue;
189
+
190
+ interface Theme {
191
+ readonly scheme: ColorScheme;
192
+ readonly colors: Colors;
193
+ readonly font: typeof font & {
194
+ readonly family?: string;
195
+ };
196
+ readonly space: typeof space;
197
+ readonly radius: typeof radius;
198
+ readonly motion: typeof motion;
199
+ readonly size: typeof size;
200
+ }
201
+ /** A tenant's brand: colors per scheme, a font family, radii. Anything left out keeps the Vinaverse default. */
202
+ interface ThemeOverrides {
203
+ readonly light?: Partial<Colors>;
204
+ readonly dark?: Partial<Colors>;
205
+ readonly fontFamily?: string;
206
+ readonly radius?: Partial<typeof radius>;
207
+ readonly space?: Partial<typeof space>;
208
+ }
209
+ type ColorSchemeSetting = 'system' | 'light' | 'dark';
210
+ /** The theme for a scheme, with the tenant's overrides on top. */
211
+ declare function createTheme(scheme: ColorScheme, overrides?: ThemeOverrides): Theme;
212
+ /** The pairs a tenant's colors made hard to read, in either scheme, as messages for a development warning. */
213
+ declare function themeProblems(overrides?: ThemeOverrides): string[];
214
+ declare function ThemeProvider(props: {
215
+ readonly theme?: ThemeOverrides | undefined;
216
+ readonly colorScheme?: ColorSchemeSetting | undefined;
217
+ readonly children?: ReactNode;
218
+ }): ReactNode;
219
+ declare function useTheme(): Theme;
220
+
221
+ interface VinaverseChatProps extends ChatHandlers {
222
+ /** The conversation (`createConversation`), created where it can outlive the screen. */
223
+ readonly conversation: ConversationStore;
224
+ /** The person's locale: the copy, dates, money and text direction (pass the same one to `getSession`). */
225
+ readonly locale?: string;
226
+ /** For dates and times on cards; default: the device's. */
227
+ readonly timeZone?: string;
228
+ readonly copy?: CopyOverrides;
229
+ readonly theme?: ThemeOverrides;
230
+ readonly colorScheme?: ColorSchemeSetting;
231
+ /** Parts to replace. Keep the object stable (module level, or memoized). */
232
+ readonly components?: ChatSlots;
233
+ /** The agent's picture, until the session carries one. */
234
+ readonly agentAvatar?: string;
235
+ /** Hide the header (a screen that draws its own); the disclosure stays. */
236
+ readonly hideHeader?: boolean;
237
+ /** iOS: the height above the keyboard that is not this view's (a navigation header). */
238
+ readonly keyboardVerticalOffset?: number;
239
+ /**
240
+ * How the composer stays above the keyboard. Default: `padding` on iOS, none on Android (the window resizes). An
241
+ * edge-to-edge Android app whose window does not resize passes `padding`; one that manages the keyboard itself
242
+ * (react-native-keyboard-controller) passes `none`.
243
+ */
244
+ readonly keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
245
+ readonly style?: StyleProp<ViewStyle>;
246
+ }
247
+ /** The providers alone, for a tenant composing its own layout from the exported parts. */
248
+ declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style'> & {
249
+ readonly children?: ReactNode;
250
+ }): ReactNode;
251
+ declare function VinaverseChat(props: VinaverseChatProps): ReactNode;
252
+
253
+ /** The part of the conversation store the adapter drives. */
254
+ interface LifecycleTarget {
255
+ setForeground(foreground: boolean): void;
256
+ }
257
+ /** Tells the store when the app comes to the foreground or goes to the background (it pings only in the foreground). */
258
+ declare function useNativeLifecycle(store: LifecycleTarget): void;
259
+ /** Whether the person asked for reduced motion: animations and animated scrolling stay off. */
260
+ declare function useReducedMotion(): boolean;
261
+ /** Reads a line to a screen reader, without moving focus. */
262
+ declare function announce(text: string): void;
263
+
264
+ export { ActivityLine, Avatar, Button, type ButtonProps, CardFrame, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultHeader, DisclosureBar, type EmptyStateProps, type HeaderProps, InfoCard, type LifecycleTarget, type ListProps, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, announce, answerText, createTheme, defaultCard, fieldText, itemType, themeProblems, useChat, useNativeLifecycle, useReducedMotion, useTheme };