@xpert-ai/chatkit-types 0.0.5 → 0.0.6
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 +18 -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
|
@@ -658,22 +658,22 @@ export declare type FileUploadStrategy = {
|
|
|
658
658
|
};
|
|
659
659
|
|
|
660
660
|
/**
|
|
661
|
-
*
|
|
661
|
+
* Filter out only the allowed options from a Playground config
|
|
662
662
|
*
|
|
663
|
-
* @param options -
|
|
664
|
-
* @returns
|
|
663
|
+
* @param options - Full config copied from the playground
|
|
664
|
+
* @returns An object containing only whitelisted options
|
|
665
665
|
*
|
|
666
666
|
* @example
|
|
667
667
|
* ```ts
|
|
668
|
-
* //
|
|
668
|
+
* // Config copied from the playground
|
|
669
669
|
* const playgroundConfig = {
|
|
670
670
|
* theme: { colorScheme: 'light', radius: 'pill' },
|
|
671
|
-
* threadItemActions: { feedback: true }, //
|
|
671
|
+
* threadItemActions: { feedback: true }, // will be filtered out
|
|
672
672
|
* startScreen: { greeting: 'Hello!' },
|
|
673
673
|
* };
|
|
674
674
|
*
|
|
675
675
|
* const filtered = filterPlaygroundOptions(playgroundConfig);
|
|
676
|
-
* //
|
|
676
|
+
* // Result: { theme: { colorScheme: 'light', radius: 'pill' }, startScreen: { greeting: 'Hello!' } }
|
|
677
677
|
* ```
|
|
678
678
|
*/
|
|
679
679
|
export declare function filterPlaygroundOptions<T extends Partial<ChatKitOptions>>(options: T): PlaygroundAllowedOptions;
|
|
@@ -850,28 +850,28 @@ export declare type Markdown = {
|
|
|
850
850
|
};
|
|
851
851
|
|
|
852
852
|
/**
|
|
853
|
-
*
|
|
854
|
-
* Playground
|
|
853
|
+
* Merge Playground config with local config
|
|
854
|
+
* Playground config overrides matching items in local config (whitelist only)
|
|
855
855
|
*
|
|
856
|
-
* @param localOptions -
|
|
857
|
-
* @param playgroundOptions -
|
|
858
|
-
* @returns
|
|
856
|
+
* @param localOptions - Base config in the local project (can include onClientTool, header, etc.)
|
|
857
|
+
* @param playgroundOptions - Config copied from the playground
|
|
858
|
+
* @returns Merged config
|
|
859
859
|
*
|
|
860
860
|
* @example
|
|
861
861
|
* ```ts
|
|
862
862
|
* const localConfig = {
|
|
863
863
|
* api: { getClientSecret: async () => '...' },
|
|
864
|
-
* onClientTool: async () => { ... }, //
|
|
865
|
-
* header: { enabled: true },
|
|
864
|
+
* onClientTool: async () => { ... }, // kept
|
|
865
|
+
* header: { enabled: true }, // kept
|
|
866
866
|
* };
|
|
867
867
|
*
|
|
868
868
|
* const playgroundConfig = {
|
|
869
869
|
* theme: { colorScheme: 'dark' },
|
|
870
|
-
* threadItemActions: { feedback: true }, //
|
|
870
|
+
* threadItemActions: { feedback: true }, // filtered out
|
|
871
871
|
* };
|
|
872
872
|
*
|
|
873
873
|
* const merged = mergeWithPlaygroundOptions(localConfig, playgroundConfig);
|
|
874
|
-
* //
|
|
874
|
+
* // Result: { api, onClientTool, header, theme }
|
|
875
875
|
* ```
|
|
876
876
|
*/
|
|
877
877
|
export declare function mergeWithPlaygroundOptions<T extends Partial<ChatKitOptions>>(localOptions: T, playgroundOptions: Partial<ChatKitOptions>): T & PlaygroundAllowedOptions;
|
|
@@ -903,11 +903,11 @@ export declare type ModelOption = {
|
|
|
903
903
|
};
|
|
904
904
|
|
|
905
905
|
/**
|
|
906
|
-
* Playground
|
|
907
|
-
*
|
|
906
|
+
* Playground configuration whitelist - only allow these options to take effect when copied from the playground
|
|
907
|
+
* Filters out: locale, initialThread, header, history, threadItemActions, disclaimer, entities, widgets, onClientTool
|
|
908
908
|
*/
|
|
909
909
|
/**
|
|
910
|
-
*
|
|
910
|
+
* Options allowed to be configured from Playground
|
|
911
911
|
*/
|
|
912
912
|
export declare type PlaygroundAllowedOptions = {
|
|
913
913
|
api?: ChatKitOptions['api'];
|