@botpress/webchat 1.3.13 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/dist/client/MessagingClient/client.d.ts +1 -0
- package/dist/client/PushpinClient/index.d.ts +6 -0
- package/dist/client/PushpinClient/inner-client/index.d.ts +1 -0
- package/dist/client/types.d.ts +6 -1
- package/dist/components/Composer.d.ts +7 -1
- package/dist/contexts/WebchatContext.d.ts +1 -2
- package/dist/gen/client/errors.d.ts +9 -2
- package/dist/gen/client/index.d.ts +3 -0
- package/dist/gen/client/models.d.ts +18 -0
- package/dist/gen/client/operations/createFile.d.ts +65 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/useWebchatStore.d.ts +2 -33
- package/dist/{index-c46225a0.js → index-9fb68c18.js} +1 -1
- package/dist/index-d69c3138.js +44477 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +26 -24
- package/dist/index.umd.cjs +255 -214
- package/dist/providers/WebchatProvider.d.ts +4 -15
- package/dist/schemas/init.d.ts +180 -0
- package/dist/schemas/theme.d.ts +80 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/offlineStore.d.ts +33 -0
- package/dist/stores/webchatStore.d.ts +46 -0
- package/dist/types/block-type.d.ts +3 -0
- package/package.json +3 -2
- package/dist/index-45673b38.js +0 -40750
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat@1.
|
|
2
|
+
> @botpress/webchat@2.1.0 build /home/runner/work/echo/echo/packages/webchat-frontend
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v4.4.11 [32mbuilding for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
7
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/packages/webchat-frontend/src/gen/client/errors.ts". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
8
|
-
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "node:http" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.
|
|
9
|
-
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.
|
|
8
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "node:http" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.29_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
9
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.29_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
10
10
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "path" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.6.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
11
11
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "path" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.6.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
12
12
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
13
13
|
../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js (1:9) "inspect" is not exported by "__vite-browser-external", imported by "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js".
|
|
14
|
-
[32m✓[39m
|
|
14
|
+
[32m✓[39m 2436 modules transformed.
|
|
15
15
|
rendering chunks...
|
|
16
16
|
[32m
|
|
17
17
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
18
18
|
computing gzip size...
|
|
19
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
19
|
+
[32m[36m[vite:dts][32m Declaration files built in 14485ms.
|
|
20
20
|
[39m
|
|
21
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m 1.
|
|
22
|
-
[2mdist/[22m[36mindex-
|
|
23
|
-
[2mdist/[22m[36mindex-
|
|
24
|
-
[2mdist/[22m[36mindex.umd.cjs [39m[1m[
|
|
25
|
-
[32m✓ built in
|
|
21
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 1.14 kB[22m[1m[22m[2m │ gzip: 0.55 kB[22m
|
|
22
|
+
[2mdist/[22m[36mindex-9fb68c18.js [39m[1m[2m 118.52 kB[22m[1m[22m[2m │ gzip: 31.78 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex-d69c3138.js [39m[1m[33m1,449.26 kB[39m[22m[2m │ gzip: 360.64 kB[22m
|
|
24
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m1,082.62 kB[39m[22m[2m │ gzip: 327.97 kB[22m
|
|
25
|
+
[32m✓ built in 23.78s[39m
|
|
@@ -18,6 +18,7 @@ export declare class MessagingClient implements WebchatClient {
|
|
|
18
18
|
disconnect(): Promise<void>;
|
|
19
19
|
getUser(): Promise<User>;
|
|
20
20
|
updateUser(): Promise<User>;
|
|
21
|
+
sendFile(_file: File): Promise<any>;
|
|
21
22
|
sendMessage(message: string): Promise<void>;
|
|
22
23
|
sendEvent(event: Record<string, any>): Promise<void>;
|
|
23
24
|
switchConversation(id: string): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../utils';
|
|
2
2
|
import { Events, Message, UserCredentials, UserData, WebchatClient, type User } from '../types';
|
|
3
|
+
import { type FileType } from '../../types';
|
|
3
4
|
export type PushpinClientProps = {
|
|
4
5
|
apiUrl: string;
|
|
5
6
|
clientId: string;
|
|
@@ -25,6 +26,11 @@ export declare class PushpinClient extends EventEmitter<Events> implements Webch
|
|
|
25
26
|
private _initialConnect;
|
|
26
27
|
private _reConnect;
|
|
27
28
|
disconnect(): Promise<void>;
|
|
29
|
+
sendFile(file: File): Promise<{
|
|
30
|
+
fileUrl: string;
|
|
31
|
+
name: string;
|
|
32
|
+
type: FileType;
|
|
33
|
+
}>;
|
|
28
34
|
sendMessage(message: string): Promise<void>;
|
|
29
35
|
sendEvent(event: Record<string, any>): Promise<void>;
|
|
30
36
|
switchConversation(id: string): Promise<void>;
|
|
@@ -31,6 +31,7 @@ export declare class Client implements IClient {
|
|
|
31
31
|
readonly createMessage: IAutoClient['createMessage'];
|
|
32
32
|
readonly getMessage: IAutoClient['getMessage'];
|
|
33
33
|
readonly deleteMessage: IAutoClient['deleteMessage'];
|
|
34
|
+
readonly createFile: IAutoClient['createFile'];
|
|
34
35
|
readonly createUser: IAutoClient['createUser'];
|
|
35
36
|
readonly getUser: IAutoClient['getUser'];
|
|
36
37
|
readonly updateUser: IAutoClient['updateUser'];
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../utils';
|
|
2
|
-
import { BlockObject } from '../types/block-type';
|
|
2
|
+
import { BlockObject, type FileType } from '../types/block-type';
|
|
3
3
|
export type UserCredentials = {
|
|
4
4
|
userId: string;
|
|
5
5
|
userToken: string;
|
|
@@ -47,6 +47,11 @@ export type WebchatClient = {
|
|
|
47
47
|
getUser(): Promise<User>;
|
|
48
48
|
updateUser(user: User): Promise<User>;
|
|
49
49
|
sendMessage(message: string): Promise<void>;
|
|
50
|
+
sendFile(file: File): Promise<{
|
|
51
|
+
fileUrl: string;
|
|
52
|
+
name: string;
|
|
53
|
+
type: FileType;
|
|
54
|
+
}>;
|
|
50
55
|
sendEvent(event: Record<string, any>): Promise<void>;
|
|
51
56
|
switchConversation(id: string): Promise<void>;
|
|
52
57
|
conversationExists(id: string): Promise<boolean>;
|
|
@@ -3,10 +3,16 @@ import { ComponentProps, FC } from 'react';
|
|
|
3
3
|
import { type StyleOptions } from '../contexts';
|
|
4
4
|
declare const Composer: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
5
5
|
declare const ComposerInput: import("react").MemoExoticComponent<(props: ComponentProps<'textarea'>) => import("react/jsx-runtime").JSX.Element>;
|
|
6
|
+
type UploadButtonStyle = NonNullable<Theme['composer']>['uploadButton'];
|
|
7
|
+
type UploadButtonProps = {
|
|
8
|
+
icon?: FC<StyleOptions>;
|
|
9
|
+
styles?: UploadButtonStyle;
|
|
10
|
+
} & ComponentProps<'button'>;
|
|
11
|
+
declare const UploadButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<UploadButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
6
12
|
type ComposerButtonStyle = NonNullable<Theme['composer']>['button'];
|
|
7
13
|
type ComposerButtonProps = {
|
|
8
14
|
icon?: FC<StyleOptions>;
|
|
9
15
|
styles?: ComposerButtonStyle;
|
|
10
16
|
} & ComponentProps<'button'>;
|
|
11
17
|
declare const ComposerButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<ComposerButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
12
|
-
export { Composer, ComposerInput, ComposerButton };
|
|
18
|
+
export { Composer, ComposerInput, ComposerButton, UploadButton };
|
|
@@ -34,10 +34,9 @@ export type ContextVaue = {
|
|
|
34
34
|
on: WebchatClient['on'];
|
|
35
35
|
sendMessage: WebchatClient['sendMessage'];
|
|
36
36
|
restartConversation: () => void;
|
|
37
|
-
} & Pick<WebchatClient, 'userId' | 'conversationId' | 'clientId'>;
|
|
37
|
+
} & Pick<WebchatClient, 'userId' | 'conversationId' | 'clientId' | 'sendFile'>;
|
|
38
38
|
closeWindow?: () => void;
|
|
39
39
|
setState: (state: Partial<ContextVaue['state']>) => void;
|
|
40
40
|
setTheme: (styles: Partial<Theme>) => void;
|
|
41
41
|
};
|
|
42
42
|
export declare const WebchatContext: import("react").Context<ContextVaue | null>;
|
|
43
|
-
export declare function useWebchatContext(): ContextVaue;
|
|
@@ -135,6 +135,13 @@ type ReferenceConstraintType = 'ReferenceConstraint';
|
|
|
135
135
|
export declare class ReferenceConstraintError extends BaseApiError<409, ReferenceConstraintType, 'The resource cannot be deleted because it\'s referenced by another resource'> {
|
|
136
136
|
constructor(message: string, error?: Error, id?: string);
|
|
137
137
|
}
|
|
138
|
+
type ResourceLockedConflictType = 'ResourceLockedConflict';
|
|
139
|
+
/**
|
|
140
|
+
* The resource is current locked and cannot be operated on until the lock is released.
|
|
141
|
+
*/
|
|
142
|
+
export declare class ResourceLockedConflictError extends BaseApiError<409, ResourceLockedConflictType, 'The resource is current locked and cannot be operated on until the lock is released.'> {
|
|
143
|
+
constructor(message: string, error?: Error, id?: string);
|
|
144
|
+
}
|
|
138
145
|
type ReferenceNotFoundType = 'ReferenceNotFound';
|
|
139
146
|
/**
|
|
140
147
|
* The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
|
|
@@ -198,7 +205,7 @@ type BreakingChangesType = 'BreakingChanges';
|
|
|
198
205
|
export declare class BreakingChangesError extends BaseApiError<400, BreakingChangesType, 'Request payload contains breaking changes which is not allowed for this resource without a version increment.'> {
|
|
199
206
|
constructor(message: string, error?: Error, id?: string);
|
|
200
207
|
}
|
|
201
|
-
export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceConstraint' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired' | 'QuotaExceeded' | 'LimitExceeded' | 'BreakingChanges';
|
|
202
|
-
export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceConstraintError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError | QuotaExceededError | LimitExceededError | BreakingChangesError;
|
|
208
|
+
export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceConstraint' | 'ResourceLockedConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired' | 'QuotaExceeded' | 'LimitExceeded' | 'BreakingChanges';
|
|
209
|
+
export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceConstraintError | ResourceLockedConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError | QuotaExceededError | LimitExceededError | BreakingChangesError;
|
|
203
210
|
export declare const errorFrom: (err: unknown) => ApiError;
|
|
204
211
|
export {};
|
|
@@ -19,6 +19,7 @@ import * as getUser from './operations/getUser';
|
|
|
19
19
|
import * as updateUser from './operations/updateUser';
|
|
20
20
|
import * as createEvent from './operations/createEvent';
|
|
21
21
|
import * as getEvent from './operations/getEvent';
|
|
22
|
+
import * as createFile from './operations/createFile';
|
|
22
23
|
export * from './models';
|
|
23
24
|
export * as addParticipant from './operations/addParticipant';
|
|
24
25
|
export * as createConversation from './operations/createConversation';
|
|
@@ -39,6 +40,7 @@ export * as getUser from './operations/getUser';
|
|
|
39
40
|
export * as updateUser from './operations/updateUser';
|
|
40
41
|
export * as createEvent from './operations/createEvent';
|
|
41
42
|
export * as getEvent from './operations/getEvent';
|
|
43
|
+
export * as createFile from './operations/createFile';
|
|
42
44
|
export type ClientProps = {
|
|
43
45
|
toAxiosRequest: typeof toAxiosRequest;
|
|
44
46
|
};
|
|
@@ -65,4 +67,5 @@ export declare class Client {
|
|
|
65
67
|
readonly updateUser: (input: updateUser.UpdateUserInput) => Promise<updateUser.UpdateUserResponse>;
|
|
66
68
|
readonly createEvent: (input: createEvent.CreateEventInput) => Promise<createEvent.CreateEventResponse>;
|
|
67
69
|
readonly getEvent: (input: getEvent.GetEventInput) => Promise<getEvent.GetEventResponse>;
|
|
70
|
+
readonly createFile: (input: createFile.CreateFileInput) => Promise<createFile.CreateFileResponse>;
|
|
68
71
|
}
|
|
@@ -214,3 +214,21 @@ export interface Event {
|
|
|
214
214
|
*/
|
|
215
215
|
userId: string;
|
|
216
216
|
}
|
|
217
|
+
export interface File {
|
|
218
|
+
id: string;
|
|
219
|
+
botId: string;
|
|
220
|
+
key: string;
|
|
221
|
+
size: number | null;
|
|
222
|
+
contentType: string;
|
|
223
|
+
tags: {
|
|
224
|
+
[k: string]: string;
|
|
225
|
+
};
|
|
226
|
+
createdAt: string;
|
|
227
|
+
updatedAt: string;
|
|
228
|
+
accessPolicies: ("integrations" | "public_content")[];
|
|
229
|
+
index: boolean;
|
|
230
|
+
url: string;
|
|
231
|
+
status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
|
|
232
|
+
failedStatusReason?: string;
|
|
233
|
+
uploadUrl: string;
|
|
234
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface CreateFileRequestHeaders {
|
|
2
|
+
"x-user-key": string;
|
|
3
|
+
}
|
|
4
|
+
export interface CreateFileRequestQuery {
|
|
5
|
+
}
|
|
6
|
+
export interface CreateFileRequestParams {
|
|
7
|
+
}
|
|
8
|
+
export interface CreateFileRequestBody {
|
|
9
|
+
/**
|
|
10
|
+
* Unique key for the file. Must be unique across the bot (and the integration, when applicable).
|
|
11
|
+
*/
|
|
12
|
+
key: string;
|
|
13
|
+
/**
|
|
14
|
+
* File size in bytes. This will count against your File Storage quota. If the index parameter is set to true, this will also count against your Vector DB Storage quota.
|
|
15
|
+
*/
|
|
16
|
+
size: number;
|
|
17
|
+
/**
|
|
18
|
+
* File access policies. Add "public_content" to allow public access to the file content. Add "integrations" to allow read, search and list operations for any integration installed in the bot.
|
|
19
|
+
*/
|
|
20
|
+
accessPolicies?: ("integrations" | "public_content")[];
|
|
21
|
+
/**
|
|
22
|
+
* Whether the file should be indexed. If true, the file content will be searchable in the Vector DB. This will count against your Vector DB Storage quota.
|
|
23
|
+
*/
|
|
24
|
+
index?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* File content type. If omitted, the content type will be inferred from the file extension (if any) specified in key. If a content type cannot be inferred, the default is "application/octet-stream".
|
|
27
|
+
*/
|
|
28
|
+
contentType?: string;
|
|
29
|
+
/**
|
|
30
|
+
* File tags. These are used for search and filtering operations.
|
|
31
|
+
*/
|
|
32
|
+
tags?: {
|
|
33
|
+
[k: string]: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export type CreateFileInput = CreateFileRequestBody & CreateFileRequestHeaders & CreateFileRequestQuery & CreateFileRequestParams;
|
|
37
|
+
export type CreateFileRequest = {
|
|
38
|
+
headers: CreateFileRequestHeaders;
|
|
39
|
+
query: CreateFileRequestQuery;
|
|
40
|
+
params: CreateFileRequestParams;
|
|
41
|
+
body: CreateFileRequestBody;
|
|
42
|
+
};
|
|
43
|
+
export declare const parseReq: (input: CreateFileInput) => CreateFileRequest & {
|
|
44
|
+
path: string;
|
|
45
|
+
};
|
|
46
|
+
export interface CreateFileResponse {
|
|
47
|
+
file: {
|
|
48
|
+
id: string;
|
|
49
|
+
botId: string;
|
|
50
|
+
key: string;
|
|
51
|
+
size: number | null;
|
|
52
|
+
contentType: string;
|
|
53
|
+
tags: {
|
|
54
|
+
[k: string]: string;
|
|
55
|
+
};
|
|
56
|
+
createdAt: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
accessPolicies: ("integrations" | "public_content")[];
|
|
59
|
+
index: boolean;
|
|
60
|
+
url: string;
|
|
61
|
+
status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed";
|
|
62
|
+
failedStatusReason?: string;
|
|
63
|
+
uploadUrl: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export * from './useAutosizeTextArea';
|
|
2
|
+
export * from './useClient';
|
|
1
3
|
export * from './useImageSize';
|
|
4
|
+
export * from './useRefresh';
|
|
2
5
|
export * from './useWebchatStore';
|
|
3
|
-
export * from './useRefresh.ts';
|
|
4
|
-
export * from './useClient.ts';
|
|
5
|
-
export * from './useAutosizeTextArea.ts';
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
messageHistory: {
|
|
4
|
-
[key: string]: string[];
|
|
5
|
-
};
|
|
6
|
-
user?: UserCredentials;
|
|
7
|
-
conversationId?: string;
|
|
8
|
-
clientMode: string;
|
|
9
|
-
addMessageToHistory: (props: {
|
|
10
|
-
userId: string;
|
|
11
|
-
message: string;
|
|
12
|
-
}) => void;
|
|
13
|
-
setClientMode: (clientMode: string) => void;
|
|
14
|
-
setUser: (userId?: UserCredentials) => void;
|
|
15
|
-
setConversationId: (conversationId?: string) => void;
|
|
16
|
-
clearAll: () => void;
|
|
17
|
-
};
|
|
18
|
-
export declare const useWebchatStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<WebchatState>, "setState"> & {
|
|
19
|
-
setState<A extends string | {
|
|
20
|
-
type: unknown;
|
|
21
|
-
}>(partial: WebchatState | Partial<WebchatState> | ((state: WebchatState) => WebchatState | Partial<WebchatState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
22
|
-
}, "persist"> & {
|
|
23
|
-
persist: {
|
|
24
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WebchatState, WebchatState>>) => void;
|
|
25
|
-
clearStorage: () => void;
|
|
26
|
-
rehydrate: () => void | Promise<void>;
|
|
27
|
-
hasHydrated: () => boolean;
|
|
28
|
-
onHydrate: (fn: (state: WebchatState) => void) => () => void;
|
|
29
|
-
onFinishHydration: (fn: (state: WebchatState) => void) => () => void;
|
|
30
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<WebchatState, WebchatState>>;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
33
|
-
export {};
|
|
1
|
+
import { type WebchatState } from '../stores';
|
|
2
|
+
export declare function useWebchatStoreContext<T>(selector: (state: WebchatState) => T): T;
|