@xpert-ai/chatkit-types 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -18
- package/dist/index.js +2 -2118
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -231,6 +231,10 @@ export declare interface ChatkitMessage {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
export declare type ChatKitOptions = {
|
|
234
|
+
/**
|
|
235
|
+
* ChatKit iframe URL for web component integrations.
|
|
236
|
+
*/
|
|
237
|
+
frameUrl?: string;
|
|
234
238
|
api: CustomApiConfig | HostedApiConfig;
|
|
235
239
|
/**
|
|
236
240
|
* Locale override for ChatKit UI. If not provided, the browser's locale
|
|
@@ -658,22 +662,22 @@ export declare type FileUploadStrategy = {
|
|
|
658
662
|
};
|
|
659
663
|
|
|
660
664
|
/**
|
|
661
|
-
*
|
|
665
|
+
* Filter out only the allowed options from a Playground config
|
|
662
666
|
*
|
|
663
|
-
* @param options -
|
|
664
|
-
* @returns
|
|
667
|
+
* @param options - Full config copied from the playground
|
|
668
|
+
* @returns An object containing only whitelisted options
|
|
665
669
|
*
|
|
666
670
|
* @example
|
|
667
671
|
* ```ts
|
|
668
|
-
* //
|
|
672
|
+
* // Config copied from the playground
|
|
669
673
|
* const playgroundConfig = {
|
|
670
674
|
* theme: { colorScheme: 'light', radius: 'pill' },
|
|
671
|
-
* threadItemActions: { feedback: true }, //
|
|
675
|
+
* threadItemActions: { feedback: true }, // will be filtered out
|
|
672
676
|
* startScreen: { greeting: 'Hello!' },
|
|
673
677
|
* };
|
|
674
678
|
*
|
|
675
679
|
* const filtered = filterPlaygroundOptions(playgroundConfig);
|
|
676
|
-
* //
|
|
680
|
+
* // Result: { theme: { colorScheme: 'light', radius: 'pill' }, startScreen: { greeting: 'Hello!' } }
|
|
677
681
|
* ```
|
|
678
682
|
*/
|
|
679
683
|
export declare function filterPlaygroundOptions<T extends Partial<ChatKitOptions>>(options: T): PlaygroundAllowedOptions;
|
|
@@ -850,28 +854,28 @@ export declare type Markdown = {
|
|
|
850
854
|
};
|
|
851
855
|
|
|
852
856
|
/**
|
|
853
|
-
*
|
|
854
|
-
* Playground
|
|
857
|
+
* Merge Playground config with local config
|
|
858
|
+
* Playground config overrides matching items in local config (whitelist only)
|
|
855
859
|
*
|
|
856
|
-
* @param localOptions -
|
|
857
|
-
* @param playgroundOptions -
|
|
858
|
-
* @returns
|
|
860
|
+
* @param localOptions - Base config in the local project (can include onClientTool, header, etc.)
|
|
861
|
+
* @param playgroundOptions - Config copied from the playground
|
|
862
|
+
* @returns Merged config
|
|
859
863
|
*
|
|
860
864
|
* @example
|
|
861
865
|
* ```ts
|
|
862
866
|
* const localConfig = {
|
|
863
867
|
* api: { getClientSecret: async () => '...' },
|
|
864
|
-
* onClientTool: async () => { ... }, //
|
|
865
|
-
* header: { enabled: true },
|
|
868
|
+
* onClientTool: async () => { ... }, // kept
|
|
869
|
+
* header: { enabled: true }, // kept
|
|
866
870
|
* };
|
|
867
871
|
*
|
|
868
872
|
* const playgroundConfig = {
|
|
869
873
|
* theme: { colorScheme: 'dark' },
|
|
870
|
-
* threadItemActions: { feedback: true }, //
|
|
874
|
+
* threadItemActions: { feedback: true }, // filtered out
|
|
871
875
|
* };
|
|
872
876
|
*
|
|
873
877
|
* const merged = mergeWithPlaygroundOptions(localConfig, playgroundConfig);
|
|
874
|
-
* //
|
|
878
|
+
* // Result: { api, onClientTool, header, theme }
|
|
875
879
|
* ```
|
|
876
880
|
*/
|
|
877
881
|
export declare function mergeWithPlaygroundOptions<T extends Partial<ChatKitOptions>>(localOptions: T, playgroundOptions: Partial<ChatKitOptions>): T & PlaygroundAllowedOptions;
|
|
@@ -903,11 +907,11 @@ export declare type ModelOption = {
|
|
|
903
907
|
};
|
|
904
908
|
|
|
905
909
|
/**
|
|
906
|
-
* Playground
|
|
907
|
-
*
|
|
910
|
+
* Playground configuration whitelist - only allow these options to take effect when copied from the playground
|
|
911
|
+
* Filters out: locale, initialThread, header, history, threadItemActions, disclaimer, entities, widgets, onClientTool
|
|
908
912
|
*/
|
|
909
913
|
/**
|
|
910
|
-
*
|
|
914
|
+
* Options allowed to be configured from Playground
|
|
911
915
|
*/
|
|
912
916
|
export declare type PlaygroundAllowedOptions = {
|
|
913
917
|
api?: ChatKitOptions['api'];
|