@marketrix.ai/widget 3.8.477 → 3.8.478
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/src/utils/validation.d.ts +15 -2
- package/dist/widget.mjs +65 -66
- package/package.json +1 -1
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WidgetSettingsData } from '../sdk';
|
|
2
2
|
export declare function isHTMLElement(element: Element | null): element is HTMLElement;
|
|
3
3
|
export declare function isHTMLScriptElement(element: Element | null): element is HTMLScriptElement;
|
|
4
|
-
export
|
|
4
|
+
export type WidgetSettingsResult = {
|
|
5
|
+
settings: WidgetSettingsData;
|
|
6
|
+
invalidFields?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
settings?: undefined;
|
|
9
|
+
invalidFields: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Validates and PICKS, because stripping is load-bearing: `widgetDefaultGet` returns the render
|
|
13
|
+
* constants too, and the settings object is spread into the widget config — passing unknown keys
|
|
14
|
+
* through would leak them where zod used to drop them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseWidgetSettings(value: unknown): WidgetSettingsResult;
|
|
17
|
+
export declare const invalidSettingsMessage: (invalidFields: string[]) => string;
|