@claspo/common 5.2.1 → 6.0.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.
Files changed (68) hide show
  1. package/DefaultEventEmitter.d.ts +8 -8
  2. package/HttpAbortableLoader.d.ts +5 -5
  3. package/HttpAbortableLoader.js +1 -1
  4. package/PrizePool.interface.d.ts +27 -0
  5. package/PrizePool.interface.js +1 -0
  6. package/RenderMode.d.ts +6 -0
  7. package/RenderMode.js +1 -0
  8. package/WidgetInitConfig.interface.d.ts +42 -0
  9. package/WidgetInitConfig.interface.js +1 -0
  10. package/action/type.d.ts +2 -2
  11. package/async/createAsyncIterator.d.ts +10 -13
  12. package/async/createAsyncIterator.js +1 -1
  13. package/async/debounce.d.ts +3 -1
  14. package/async/debounce.js +1 -1
  15. package/async/timeout.d.ts +1 -1
  16. package/component-manifest/ComponentManifest.interface.d.ts +217 -0
  17. package/component-manifest/ComponentManifest.interface.js +1 -0
  18. package/converter/time/TimeUnit.d.ts +11 -9
  19. package/converter/time/TimerConverter.d.ts +6 -7
  20. package/document/ComponentInsertType.d.ts +6 -6
  21. package/document/Document.interface.d.ts +188 -0
  22. package/document/Document.interface.js +1 -0
  23. package/document/DocumentCssVarsReplace.d.ts +3 -6
  24. package/document/DocumentUtils.d.ts +18 -13
  25. package/document/DocumentUtils.js +1 -1
  26. package/dom/ViewportSize.d.ts +8 -7
  27. package/dom/ViewportSize.js +1 -1
  28. package/dom/copyToClipboard.d.ts +1 -1
  29. package/dom/getMostNestedNode.d.ts +1 -1
  30. package/dom/insertHtmlIntoElement.d.ts +6 -1
  31. package/dom/sanitizeHTML.d.ts +1 -1
  32. package/element/BaseElementInViewportHandler.d.ts +4 -4
  33. package/element/BaseElementInViewportHandler.js +1 -1
  34. package/element/CssVarsOperations.d.ts +4 -3
  35. package/element/CssVarsOperations.js +1 -1
  36. package/element/recursiveFindParentNodeByAttribute.d.ts +1 -1
  37. package/flat.d.ts +1 -1
  38. package/form/common/InAppLayoutType.d.ts +6 -6
  39. package/form/common/LayoutType.d.ts +8 -8
  40. package/form/common/WidgetType.d.ts +8 -8
  41. package/handler/HandlerTypes.d.ts +4 -4
  42. package/math/RandomDistributor.d.ts +14 -7
  43. package/math/RandomDistributor.js +1 -1
  44. package/math/sum.d.ts +1 -1
  45. package/network/HttpClient.d.ts +3 -3
  46. package/network/HttpClient.js +1 -1
  47. package/network/HttpStatus.d.ts +4 -4
  48. package/object/isDictionary.d.ts +1 -1
  49. package/object/omitKeys.d.ts +1 -1
  50. package/package.json +1 -1
  51. package/url/sanitizeUrl.d.ts +1 -1
  52. package/utils/CaseTransformer.d.ts +3 -3
  53. package/utils/NullishCoalescingOperator.d.ts +1 -1
  54. package/utils/NumericDecline.d.ts +1 -1
  55. package/utils/addEventListener.d.ts +1 -1
  56. package/utils/addEventListener.js +1 -1
  57. package/utils/allSettled.d.ts +1 -7
  58. package/utils/checkTimeZone.d.ts +1 -1
  59. package/utils/deviceUtils.d.ts +3 -3
  60. package/utils/flatMap.d.ts +1 -1
  61. package/utils/fromEntries.d.ts +1 -1
  62. package/utils/generateRandomNumber.d.ts +1 -1
  63. package/utils/objectSort.d.ts +2 -2
  64. package/utils/orientationUtils.d.ts +1 -1
  65. package/utils/orientationUtils.js +1 -1
  66. package/velocity/SysVelocityContext.d.ts +24 -21
  67. package/velocity/SysVelocityContext.js +1 -1
  68. package/velocity/SysVelocityRenderer.d.ts +1 -1
@@ -1,13 +1,13 @@
1
+ type EventCallback = (value: any, eventName: string, params: any) => void;
2
+ type ListenersMap = Record<string, Record<string, EventCallback>>;
1
3
  export default class DefaultEventEmitter {
2
- static createDefaultListenersState: () => {
3
- '*': {};
4
- };
5
- listeners: {
6
- '*': {};
7
- };
8
- emit(eventName: any, value: any, params?: null): void;
9
- on(eventName: any, listener: any): {
4
+ static createDefaultListenersState: () => ListenersMap;
5
+ listeners: ListenersMap;
6
+ constructor();
7
+ emit(eventName: string, value: any, params?: any): void;
8
+ on(eventName: string, listener: EventCallback): {
10
9
  off: () => void;
11
10
  };
12
11
  destroy(): void;
13
12
  }
13
+ export {};
@@ -1,11 +1,11 @@
1
1
  export default class HttpAbortableLoader {
2
- constructor(url: any, headers: any, httpClient: any);
3
- url: any;
4
- headers: any;
2
+ url: string;
3
+ headers: Record<string, string>;
5
4
  httpClient: any;
6
5
  loaded: boolean;
7
- load(): any;
8
- abortController: AbortController | undefined;
6
+ abortController: AbortController | null;
7
+ constructor(url: string, headers: Record<string, string>, httpClient: any);
8
+ load(): Promise<any>;
9
9
  isLoaded(): boolean;
10
10
  abortLoading(): void;
11
11
  }
@@ -1 +1 @@
1
- export default class HttpAbortableLoader{constructor(t,r,o){this.url=t,this.headers=r,this.httpClient=o,this.loaded=!1}load(){return window.AbortController&&(this.abortController=new AbortController),this.httpClient.execute(this.url,"GET",null,this.headers,this.abortController&&this.abortController.signal).then(t=>(this.loaded=!0,t))}isLoaded(){return this.loaded}abortLoading(){this.abortController&&this.abortController.abort()}}
1
+ export default class HttpAbortableLoader{constructor(t,r,o){this.abortController=null,this.url=t,this.headers=r,this.httpClient=o,this.loaded=!1}load(){return window.AbortController&&(this.abortController=new AbortController),this.httpClient.execute(this.url,"GET",null,this.headers,this.abortController&&this.abortController.signal).then(t=>(this.loaded=!0,t))}isLoaded(){return this.loaded}abortLoading(){this.abortController&&this.abortController.abort()}}
@@ -0,0 +1,27 @@
1
+ export interface PrizePoolModelI {
2
+ id: string;
3
+ sourceType: PrizeSourceType;
4
+ distributionType?: PrizeDistributionType;
5
+ options?: PrizePoolOptionI[];
6
+ }
7
+ export declare enum PrizeSourceType {
8
+ MANUAL = "MANUAL"
9
+ }
10
+ export declare enum PrizeDistributionType {
11
+ PERCENT_CHANCE = "PERCENT_CHANCE"
12
+ }
13
+ export interface PrizePoolOptionI {
14
+ valueType: PrizeOptionValueType;
15
+ value: string;
16
+ code: string;
17
+ weight: number;
18
+ id?: string;
19
+ config?: PrizeOptionConfigI;
20
+ }
21
+ export declare enum PrizeOptionValueType {
22
+ DISCOUNT_PERCENTAGE = "DISCOUNT_PERCENTAGE",
23
+ CUSTOM = "CUSTOM"
24
+ }
25
+ export interface PrizeOptionConfigI {
26
+ imageUrl?: string;
27
+ }
@@ -0,0 +1 @@
1
+ export var PrizeSourceType;!function(e){e.MANUAL="MANUAL"}(PrizeSourceType||(PrizeSourceType={}));export var PrizeDistributionType;!function(e){e.PERCENT_CHANCE="PERCENT_CHANCE"}(PrizeDistributionType||(PrizeDistributionType={}));export var PrizeOptionValueType;!function(e){e.DISCOUNT_PERCENTAGE="DISCOUNT_PERCENTAGE",e.CUSTOM="CUSTOM"}(PrizeOptionValueType||(PrizeOptionValueType={}));
@@ -0,0 +1,6 @@
1
+ declare const RenderMode: {
2
+ readonly STATIC: "STATIC";
3
+ readonly UPDATING: "UPDATING";
4
+ };
5
+ export type RenderModeT = typeof RenderMode[keyof typeof RenderMode];
6
+ export default RenderMode;
package/RenderMode.js ADDED
@@ -0,0 +1 @@
1
+ const RenderMode={STATIC:"STATIC",UPDATING:"UPDATING"};export default RenderMode;
@@ -0,0 +1,42 @@
1
+ import { PrizePoolModelI } from './PrizePool.interface';
2
+ import { ClDocumentI } from './document/Document.interface';
3
+ import type { RenderModeT } from './RenderMode';
4
+ export interface TrackingServiceI {
5
+ send: (eventName: string, payload?: any) => void;
6
+ trackClick: (elementId: string, payload?: any) => void;
7
+ trackTargetAction: (actionType: string, payload?: any) => void;
8
+ }
9
+ export type TranslationsI = Record<string, Record<string, string>>;
10
+ export interface WidgetInitConfigI {
11
+ documentModel: ClDocumentI;
12
+ formVariantId?: string;
13
+ staticResourcesUrl?: string;
14
+ siteId?: string;
15
+ browserLanguage?: string;
16
+ optionalDocumentStyles?: Record<string, string>;
17
+ previewMode?: boolean;
18
+ editorPreviewMode?: boolean;
19
+ branded?: boolean;
20
+ upgradePlanButton?: boolean;
21
+ viewIndex?: number;
22
+ forceMobileEnv?: boolean;
23
+ actionFactoryClass?: any;
24
+ widgetId?: number;
25
+ prizePoolModels?: PrizePoolModelI[];
26
+ layoutType?: string;
27
+ widgetType?: string;
28
+ bundledComponentClasses?: any[];
29
+ translations?: TranslationsI;
30
+ trackingService?: TrackingServiceI;
31
+ disableGoogleFonts?: boolean;
32
+ layoutFactoryClass?: any;
33
+ zIndex?: number;
34
+ isMobileEnv?: boolean;
35
+ disabled?: boolean;
36
+ disableSmartPosition?: boolean;
37
+ disableScrollbarCalculation?: boolean;
38
+ disableLayoutAnimations?: boolean;
39
+ displayPosition?: string;
40
+ renderMode?: RenderModeT;
41
+ [key: string]: any;
42
+ }
@@ -0,0 +1 @@
1
+ export{};
package/action/type.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export function successAction(type: any): string;
2
- export function failureAction(type: any): string;
1
+ export declare function successAction(type: string): string;
2
+ export declare function failureAction(type: string): string;
@@ -1,15 +1,12 @@
1
- export default function createAsyncIterator(times: any): {
1
+ interface RangeIterator extends Iterator<number> {
2
+ current: number;
3
+ last: number;
4
+ next(): IteratorResult<number>;
5
+ }
6
+ interface RangeIterable extends Iterable<number> {
2
7
  from: number;
3
8
  to: number;
4
- [Symbol.iterator](): {
5
- current: number;
6
- last: number;
7
- next(): {
8
- done: boolean;
9
- value: number;
10
- } | {
11
- done: boolean;
12
- value?: undefined;
13
- };
14
- };
15
- };
9
+ [Symbol.iterator](): RangeIterator;
10
+ }
11
+ export default function createAsyncIterator(times: number): RangeIterable;
12
+ export {};
@@ -1 +1 @@
1
- export default function createAsyncIterator(t){return{from:0,to:t-1,[Symbol.iterator](){return{current:this.from,last:this.to,next(){return this.current<=this.last?{done:!1,value:this.current++}:{done:!0}}}}}}
1
+ export default function createAsyncIterator(t){return{from:0,to:t-1,[Symbol.iterator](){return{current:this.from,last:this.to,next(){return this.current<=this.last?{done:!1,value:this.current++}:{done:!0,value:void 0}}}}}}
@@ -1 +1,3 @@
1
- export default function debounce(func: any, timeout?: number): (...args: any[]) => void;
1
+ type DebouncedFunction<T extends (...args: any[]) => any> = (this: ThisParameterType<T>, ...args: Parameters<T>) => void;
2
+ export default function debounce<T extends (...args: any[]) => any>(func: T, timeout?: number): DebouncedFunction<T>;
3
+ export {};
package/async/debounce.js CHANGED
@@ -1 +1 @@
1
- export default function debounce(e,t=300){let u;return(...o)=>{clearTimeout(u),u=setTimeout(()=>{e.apply(this,o)},t)}}
1
+ export default function debounce(e,t=300){let u;return function(...n){clearTimeout(u),u=setTimeout(()=>{e.apply(this,n)},t)}}
@@ -1 +1 @@
1
- export default function timeout(ms: any): Promise<any>;
1
+ export default function timeout(ms: number): Promise<void>;
@@ -0,0 +1,217 @@
1
+ import { ClBaseComponentI, ClBaseComponentPropsI } from '../document/Document.interface';
2
+ export interface ComponentManifestI {
3
+ name: string;
4
+ componentType: string;
5
+ version: string;
6
+ contextMenuModel: BaseContextMenuManifestModelI[];
7
+ floatingControlsModel: BaseFloatingControlManifestModelI[];
8
+ propertyPaneModel: PropertyPaneManifestI;
9
+ events: any;
10
+ props: ClBaseComponentPropsI;
11
+ metaDescription: ComponentManifestMetaDescriptionI;
12
+ i18nPropertyPaneModel?: PropertyPaneManifestI;
13
+ i18nPropPaths?: string[];
14
+ focusParentOnClick?: boolean;
15
+ preventDraggable?: boolean;
16
+ recursiveRemove?: boolean;
17
+ canStack?: boolean;
18
+ i18n?: ComponentManifestTranslationI;
19
+ children?: ClBaseComponentI[];
20
+ mappingTypes?: ManifestMappingType[];
21
+ focusableElements?: string[];
22
+ actionsConditions?: {
23
+ remove?: string;
24
+ replace?: string;
25
+ cut?: string;
26
+ copy?: string;
27
+ duplicate?: string;
28
+ paste?: string;
29
+ move?: string;
30
+ };
31
+ autoContrast?: AutoContrastI[];
32
+ keepGeneralTabOpenUntilInteracted?: boolean;
33
+ isExternalStartCapable?: boolean;
34
+ waitForResourcesLoad?: boolean;
35
+ resourcesPropPaths?: string[][];
36
+ }
37
+ export declare enum ManifestMappingType {
38
+ TEXT = "TEXT",
39
+ TEXT_AREA = "TEXT_AREA",
40
+ INTEGER = "INTEGER",
41
+ FLOAT = "FLOAT",
42
+ SELECT = "SELECT",
43
+ CHECKBOX_LIST = "CHECKBOX_LIST",
44
+ CHECKBOX = "CHECKBOX",
45
+ DATE = "DATE",
46
+ DATE_TIME = "DATE_TIME"
47
+ }
48
+ export interface ComponentManifestTranslationI {
49
+ [languageCode: string]: ComponentManifestTranslationItemI;
50
+ }
51
+ export interface ComponentManifestTranslationItemI {
52
+ [propPath: string]: string;
53
+ }
54
+ export interface ComponentManifestMetaDescriptionI {
55
+ label: ComponentManifestDescriptionLabelItemI;
56
+ sortWeight?: number;
57
+ icon?: string;
58
+ }
59
+ export interface ComponentManifestDescriptionLabelItemI {
60
+ [languageCode: string]: string;
61
+ }
62
+ export interface BaseContextMenuManifestModelI {
63
+ type: ContextMenuManifestModelType;
64
+ name?: ContextMenuManifestModelName;
65
+ propPath?: string[];
66
+ element?: string;
67
+ elementProp?: string;
68
+ elementSubProp?: string;
69
+ children?: BaseContextMenuManifestModelI[];
70
+ }
71
+ export interface BaseFloatingControlManifestModelI {
72
+ type: FloatingControlManifestModelType;
73
+ name?: FloatingControlManifestModelName;
74
+ propPath?: string[];
75
+ element?: string;
76
+ elementProp?: string;
77
+ elementSubProp?: string;
78
+ propPathCondition?: string;
79
+ children?: BaseFloatingControlManifestModelI[];
80
+ params?: any;
81
+ }
82
+ export declare enum ContextMenuManifestModelType {
83
+ GROUP = "GROUP",
84
+ CONTROL = "CONTROL"
85
+ }
86
+ export declare enum ContextMenuManifestModelName {
87
+ FOCUS_PARENT_COMPONENT = "FOCUS_PARENT_COMPONENT",
88
+ COMPONENT_OPERATIONS = "COMPONENT_OPERATIONS",
89
+ BRING_BACK_FORWARD = "BRING_BACK_FORWARD"
90
+ }
91
+ export declare enum FloatingControlManifestModelType {
92
+ GROUP = "GROUP",
93
+ CONTROL = "CONTROL"
94
+ }
95
+ export declare enum FloatingControlManifestModelName {
96
+ SIZE = "SIZE",
97
+ MARGIN = "MARGIN",
98
+ PARENT_ALIGNMENT = "PARENT_ALIGNMENT",
99
+ CONTAINER_PADDING = "CONTAINER_PADDING",
100
+ SLIDES_MANAGEMENT = "SLIDES_MANAGEMENT",
101
+ COLUMNS_PROPORTIONS = "COLUMNS_PROPORTIONS",
102
+ VIEW_SWITCHER = "VIEW_SWITCHER",
103
+ ROTATION = "ROTATION"
104
+ }
105
+ export interface PropertyPaneManifestI {
106
+ content: BasePropertyPaneManifestModelI[];
107
+ general?: BasePropertyPaneManifestModelI[];
108
+ header?: BasePropertyPaneManifestModelI[];
109
+ }
110
+ export interface BasePropertyPaneManifestModelI {
111
+ type: PropertyPaneManifestModelType;
112
+ name?: ClPropertyPaneManifestModelName;
113
+ propPath?: string[];
114
+ element?: string;
115
+ elementProp?: string;
116
+ elementSubProp?: string;
117
+ elementSubProps?: string[];
118
+ propPathCondition?: string;
119
+ params?: any;
120
+ displayCondition?: string;
121
+ hideSyncSelect?: boolean;
122
+ syncSelectDisplayCondition?: string;
123
+ syncSelectOptions?: Array<string | null>;
124
+ label?: string;
125
+ disableControlIfPropPathIsFalsy?: string[];
126
+ disableControlIfPropPathMatchValue?: DisableControlIfPropPathMatchValueParamsI;
127
+ disableValidation?: boolean;
128
+ children?: BasePropertyPaneManifestModelI[];
129
+ transformers?: TransformerConfig[];
130
+ mode?: string;
131
+ }
132
+ export declare enum PropertyPaneManifestModelType {
133
+ CONTROL = "CONTROL",
134
+ TEXT = "TEXT",
135
+ GROUP = "GROUP"
136
+ }
137
+ export declare enum ClPropertyPaneManifestModelName {
138
+ SIZE = "SIZE",
139
+ INDENTATION = "INDENTATION",
140
+ ALIGNMENT = "ALIGNMENT",
141
+ BACKGROUND = "BACKGROUND",
142
+ BACKDROP_FILTER = "BACKDROP_FILTER",
143
+ BACKGROUND_MARKER_SELECTED = "BACKGROUND_MARKER_SELECTED",
144
+ BORDERS = "BORDERS",
145
+ BOX_SHADOW = "BOX_SHADOW",
146
+ BORDER_RADIUS = "BORDER_RADIUS",
147
+ TEXT_PARAMS = "TEXT_PARAMS",
148
+ TEXT_INPUT = "TEXT_INPUT",
149
+ SWITCH = "SWITCH",
150
+ SWITCH_WITH_INPUT = "SWITCH_WITH_INPUT",
151
+ INPUT_VALIDATION = "INPUT_VALIDATION",
152
+ INPUT_LABEL = "INPUT_LABEL",
153
+ TEXT_COLOR = "TEXT_COLOR",
154
+ SELECT = "SELECT",
155
+ RADIO_BUTTONS = "RADIO_BUTTONS",
156
+ IMAGE_SOURCES = "IMAGE_SOURCES",
157
+ COUNTRY_PHONE_SELECT = "COUNTRY_PHONE_SELECT",
158
+ HOVER_ANIMATION = "HOVER_ANIMATION",
159
+ ACTIONS = "ACTIONS",
160
+ NPS_ACTIONS = "NPS_ACTIONS",
161
+ DATEPICKER = "DATEPICKER",
162
+ DATEPICKER_COUNTDOWN_TIMER = "DATEPICKER_COUNTDOWN_TIMER",
163
+ DISPLAY = "DISPLAY",
164
+ COMPONENT_OPTIONS = "COMPONENT_OPTIONS",
165
+ COLOR_SELECT = "COLOR_SELECT",
166
+ FLOATING_COMPONENT_POSITION = "FLOATING_COMPONENT_POSITION",
167
+ LOOP_ANIMATION = "LOOP_ANIMATION",
168
+ VIDEO_URL = "VIDEO_URL",
169
+ VIDEO_CUSTOM_COVER = "VIDEO_CUSTOM_COVER",
170
+ WIDGET_LAYOUT_SELECT = "WIDGET_LAYOUT_SELECT",
171
+ MULTIPLE_INPUT_SIZE = "MULTIPLE_INPUT_SIZE",
172
+ DATE_FORMAT = "DATE_FORMAT",
173
+ ICON = "ICON",
174
+ PROMOCODE_ICON = "PROMOCODE_ICON",
175
+ ICON_SELECT = "ICON_SELECT",
176
+ TEXT_VISIBILITY = "TEXT_VISIBILITY",
177
+ SLIDER_SETTINGS = "SLIDER_SETTINGS",
178
+ SLIDER_MANAGE_SLIDES = "SLIDER_MANAGE_SLIDES",
179
+ SLIDER_MODES = "SLIDER_MODES",
180
+ SLIDER_NAVIGATION_BUTTONS = "SLIDER_NAVIGATION_BUTTONS",
181
+ SLIDER_INDICATION = "SLIDER_INDICATION",
182
+ SLIDER_SLIDESHOW_ANIMATION = "SLIDER_SLIDESHOW_ANIMATION",
183
+ INTEGRATION_FIELD_MAPPING = "INTEGRATION_FIELD_MAPPING",
184
+ SUPPORTED_LANGUAGES = "SUPPORTED_LANGUAGES",
185
+ LIST_POSITION = "LIST_POSITION",
186
+ SOCIAL_ICON_SIZE = "SOCIAL_ICON_SIZE",
187
+ SOCIAL_TYPE_AND_ICON_SELECT = "SOCIAL_TYPE_AND_ICON_SELECT",
188
+ COLUMNS = "COLUMNS",
189
+ INSERT_BLOCK = "INSERT_BLOCK",
190
+ NUMBER_INPUT = "NUMBER_INPUT",
191
+ PRIZE_SETTINGS = "PRIZE_SETTINGS",
192
+ ROOT_COMPONENT_SELECT = "ROOT_COMPONENT_SELECT",
193
+ FEEDBACK_TYPE = "FEEDBACK_TYPE",
194
+ FEEDBACK_ICONS_SELECT = "FEEDBACK_ICONS_SELECT",
195
+ FEEDBACK_ACTIONS = "FEEDBACK_ACTIONS",
196
+ FLOATING_BOX_POSITION = "FLOATING_BOX_POSITION"
197
+ }
198
+ export interface DisableControlIfPropPathMatchValueParamsI {
199
+ propPath: string[];
200
+ value: any;
201
+ }
202
+ export interface TransformerConfig<TParams = undefined> {
203
+ name: string;
204
+ params?: TParams;
205
+ }
206
+ export interface AutoContrastI {
207
+ master: AutoContrastMemberI;
208
+ slave: AutoContrastMemberI;
209
+ enabledPropPath: string[];
210
+ }
211
+ export interface AutoContrastMemberI {
212
+ element: string;
213
+ elementProp?: string;
214
+ elementSubProp?: string;
215
+ propPath?: string[];
216
+ dimmed?: boolean | null;
217
+ }
@@ -0,0 +1 @@
1
+ export var ManifestMappingType;!function(T){T.TEXT="TEXT",T.TEXT_AREA="TEXT_AREA",T.INTEGER="INTEGER",T.FLOAT="FLOAT",T.SELECT="SELECT",T.CHECKBOX_LIST="CHECKBOX_LIST",T.CHECKBOX="CHECKBOX",T.DATE="DATE",T.DATE_TIME="DATE_TIME"}(ManifestMappingType||(ManifestMappingType={}));export var ContextMenuManifestModelType;!function(T){T.GROUP="GROUP",T.CONTROL="CONTROL"}(ContextMenuManifestModelType||(ContextMenuManifestModelType={}));export var ContextMenuManifestModelName;!function(T){T.FOCUS_PARENT_COMPONENT="FOCUS_PARENT_COMPONENT",T.COMPONENT_OPERATIONS="COMPONENT_OPERATIONS",T.BRING_BACK_FORWARD="BRING_BACK_FORWARD"}(ContextMenuManifestModelName||(ContextMenuManifestModelName={}));export var FloatingControlManifestModelType;!function(T){T.GROUP="GROUP",T.CONTROL="CONTROL"}(FloatingControlManifestModelType||(FloatingControlManifestModelType={}));export var FloatingControlManifestModelName;!function(T){T.SIZE="SIZE",T.MARGIN="MARGIN",T.PARENT_ALIGNMENT="PARENT_ALIGNMENT",T.CONTAINER_PADDING="CONTAINER_PADDING",T.SLIDES_MANAGEMENT="SLIDES_MANAGEMENT",T.COLUMNS_PROPORTIONS="COLUMNS_PROPORTIONS",T.VIEW_SWITCHER="VIEW_SWITCHER",T.ROTATION="ROTATION"}(FloatingControlManifestModelName||(FloatingControlManifestModelName={}));export var PropertyPaneManifestModelType;!function(T){T.CONTROL="CONTROL",T.TEXT="TEXT",T.GROUP="GROUP"}(PropertyPaneManifestModelType||(PropertyPaneManifestModelType={}));export var ClPropertyPaneManifestModelName;!function(T){T.SIZE="SIZE",T.INDENTATION="INDENTATION",T.ALIGNMENT="ALIGNMENT",T.BACKGROUND="BACKGROUND",T.BACKDROP_FILTER="BACKDROP_FILTER",T.BACKGROUND_MARKER_SELECTED="BACKGROUND_MARKER_SELECTED",T.BORDERS="BORDERS",T.BOX_SHADOW="BOX_SHADOW",T.BORDER_RADIUS="BORDER_RADIUS",T.TEXT_PARAMS="TEXT_PARAMS",T.TEXT_INPUT="TEXT_INPUT",T.SWITCH="SWITCH",T.SWITCH_WITH_INPUT="SWITCH_WITH_INPUT",T.INPUT_VALIDATION="INPUT_VALIDATION",T.INPUT_LABEL="INPUT_LABEL",T.TEXT_COLOR="TEXT_COLOR",T.SELECT="SELECT",T.RADIO_BUTTONS="RADIO_BUTTONS",T.IMAGE_SOURCES="IMAGE_SOURCES",T.COUNTRY_PHONE_SELECT="COUNTRY_PHONE_SELECT",T.HOVER_ANIMATION="HOVER_ANIMATION",T.ACTIONS="ACTIONS",T.NPS_ACTIONS="NPS_ACTIONS",T.DATEPICKER="DATEPICKER",T.DATEPICKER_COUNTDOWN_TIMER="DATEPICKER_COUNTDOWN_TIMER",T.DISPLAY="DISPLAY",T.COMPONENT_OPTIONS="COMPONENT_OPTIONS",T.COLOR_SELECT="COLOR_SELECT",T.FLOATING_COMPONENT_POSITION="FLOATING_COMPONENT_POSITION",T.LOOP_ANIMATION="LOOP_ANIMATION",T.VIDEO_URL="VIDEO_URL",T.VIDEO_CUSTOM_COVER="VIDEO_CUSTOM_COVER",T.WIDGET_LAYOUT_SELECT="WIDGET_LAYOUT_SELECT",T.MULTIPLE_INPUT_SIZE="MULTIPLE_INPUT_SIZE",T.DATE_FORMAT="DATE_FORMAT",T.ICON="ICON",T.PROMOCODE_ICON="PROMOCODE_ICON",T.ICON_SELECT="ICON_SELECT",T.TEXT_VISIBILITY="TEXT_VISIBILITY",T.SLIDER_SETTINGS="SLIDER_SETTINGS",T.SLIDER_MANAGE_SLIDES="SLIDER_MANAGE_SLIDES",T.SLIDER_MODES="SLIDER_MODES",T.SLIDER_NAVIGATION_BUTTONS="SLIDER_NAVIGATION_BUTTONS",T.SLIDER_INDICATION="SLIDER_INDICATION",T.SLIDER_SLIDESHOW_ANIMATION="SLIDER_SLIDESHOW_ANIMATION",T.INTEGRATION_FIELD_MAPPING="INTEGRATION_FIELD_MAPPING",T.SUPPORTED_LANGUAGES="SUPPORTED_LANGUAGES",T.LIST_POSITION="LIST_POSITION",T.SOCIAL_ICON_SIZE="SOCIAL_ICON_SIZE",T.SOCIAL_TYPE_AND_ICON_SELECT="SOCIAL_TYPE_AND_ICON_SELECT",T.COLUMNS="COLUMNS",T.INSERT_BLOCK="INSERT_BLOCK",T.NUMBER_INPUT="NUMBER_INPUT",T.PRIZE_SETTINGS="PRIZE_SETTINGS",T.ROOT_COMPONENT_SELECT="ROOT_COMPONENT_SELECT",T.FEEDBACK_TYPE="FEEDBACK_TYPE",T.FEEDBACK_ICONS_SELECT="FEEDBACK_ICONS_SELECT",T.FEEDBACK_ACTIONS="FEEDBACK_ACTIONS",T.FLOATING_BOX_POSITION="FLOATING_BOX_POSITION"}(ClPropertyPaneManifestModelName||(ClPropertyPaneManifestModelName={}));
@@ -1,10 +1,12 @@
1
+ declare const TimeUnit: {
2
+ readonly MILLISECOND: "MILLISECOND";
3
+ readonly SECOND: "SECOND";
4
+ readonly MINUTE: "MINUTE";
5
+ readonly HOUR: "HOUR";
6
+ readonly DAY: "DAY";
7
+ readonly WEEK: "WEEK";
8
+ readonly getAll: () => string[];
9
+ };
10
+ export type TimeUnitKey = Exclude<keyof typeof TimeUnit, 'getAll'>;
11
+ export type TimeUnitValue = typeof TimeUnit[TimeUnitKey];
1
12
  export default TimeUnit;
2
- declare namespace TimeUnit {
3
- const MILLISECOND: string;
4
- const SECOND: string;
5
- const MINUTE: string;
6
- const HOUR: string;
7
- const DAY: string;
8
- const WEEK: string;
9
- function getAll(): string[];
10
- }
@@ -1,9 +1,8 @@
1
+ import { TimeUnitValue } from "./TimeUnit";
2
+ type TimeUnitMapper = Record<TimeUnitValue, (v: number) => number>;
1
3
  export default class TimerConverter {
2
- static toMsMapper: {
3
- [x: string]: (v: any) => any;
4
- };
5
- static fromMsMapper: {
6
- [x: string]: (v: any) => any;
7
- };
8
- static convert(fromUnit: any, toUnit: any, value: any): any;
4
+ static toMsMapper: TimeUnitMapper;
5
+ static fromMsMapper: TimeUnitMapper;
6
+ static convert(fromUnit: TimeUnitValue, toUnit: TimeUnitValue, value: number): number;
9
7
  }
8
+ export {};
@@ -1,7 +1,7 @@
1
+ declare const ComponentInsertType: {
2
+ BEFORE: string;
3
+ AFTER: string;
4
+ INSIDE: string;
5
+ INSTEAD: string;
6
+ };
1
7
  export default ComponentInsertType;
2
- declare namespace ComponentInsertType {
3
- const BEFORE: string;
4
- const AFTER: string;
5
- const INSIDE: string;
6
- const INSTEAD: string;
7
- }
@@ -0,0 +1,188 @@
1
+ export interface ClDocumentI {
2
+ views: ClBaseComponentI[];
3
+ shared: ClDocumentSharedI;
4
+ }
5
+ export interface ClBaseComponentI {
6
+ id: string;
7
+ path: number[];
8
+ type: string;
9
+ version: string;
10
+ props: ClBaseComponentPropsI;
11
+ name: string;
12
+ label?: string;
13
+ children?: ClBaseComponentI[];
14
+ componentRef?: any;
15
+ }
16
+ export interface ClBaseComponentPropsI {
17
+ adaptiveStyles?: BaseComponentAdaptiveStylesI;
18
+ styles?: ClBaseComponentElementParamsI[];
19
+ handlers?: ClDocumentHandlerI[];
20
+ content?: any;
21
+ control?: any;
22
+ isResponsive?: boolean;
23
+ isAlignRestricted?: boolean;
24
+ floating?: boolean;
25
+ }
26
+ export interface BaseComponentAdaptiveStylesI {
27
+ desktop: ClBaseComponentElementParamsI[];
28
+ mobile: ClBaseComponentElementParamsI[];
29
+ }
30
+ export interface ClBaseComponentElementParamsI {
31
+ element: string;
32
+ styleAttributes: ClComponentStyleAttributesI;
33
+ hoverStyleAttributes?: ClComponentStyleAttributesI;
34
+ hoverAnimationType?: string;
35
+ placeholderStyleAttributes?: ClComponentStyleAttributesI;
36
+ markerStyleAttributes?: ClComponentStyleAttributesI;
37
+ params?: any;
38
+ classes?: string;
39
+ }
40
+ export interface ClComponentStyleAttributesI {
41
+ [key: string]: string;
42
+ }
43
+ export interface ClDocumentHandlerI {
44
+ type: string;
45
+ actions: ClDocumentActionI[];
46
+ relativeSelector?: string;
47
+ }
48
+ export interface ClDocumentActionI<T = any> {
49
+ type: string;
50
+ params?: T;
51
+ }
52
+ export interface ClDocumentSharedI {
53
+ headerFontFamily: string;
54
+ textFontFamily: string;
55
+ textClasses: {
56
+ [key: string]: ClDocumentSharedTextClassI;
57
+ };
58
+ googleFonts: string[];
59
+ floatingBox?: ClFloatingBoxParamsI;
60
+ floatingBar?: ClFloatingBarParamsI;
61
+ launcher?: ClLauncherParamsI;
62
+ dialog?: ClDialogParamsI;
63
+ closeIcon?: ClCloseButtonParamsI;
64
+ colorSchemaName?: string;
65
+ cssVars?: ClDocumentCssVarsI;
66
+ actualSize?: ClDocumentActualSizeI[];
67
+ linkParams?: ClDocumentLinkParamsI;
68
+ mobileBreakpointWidth?: number;
69
+ zIndex?: number;
70
+ }
71
+ export interface ClDialogParamsI {
72
+ background: string;
73
+ }
74
+ export interface ClDocumentSharedTextClassI {
75
+ id: string;
76
+ name: string;
77
+ isHeader: boolean;
78
+ styleAttributes: any;
79
+ placeholderStyleAttributes?: any;
80
+ }
81
+ export interface ClFloatingBoxParamsI {
82
+ verticalPosition: ClWidgetVerticalPosition;
83
+ horizontalPosition: ClWidgetHorizontalPosition;
84
+ verticalOffset: string;
85
+ horizontalOffset: string;
86
+ mobile: ClFloatingBoxEnvironmentParamsI;
87
+ }
88
+ export declare enum ClWidgetVerticalPosition {
89
+ TOP = "TOP",
90
+ CENTER = "CENTER",
91
+ BOTTOM = "BOTTOM"
92
+ }
93
+ export declare enum ClWidgetHorizontalPosition {
94
+ LEFT = "LEFT",
95
+ CENTER = "CENTER",
96
+ RIGHT = "RIGHT"
97
+ }
98
+ export interface ClFloatingBoxEnvironmentParamsI {
99
+ verticalPosition: ClWidgetVerticalPosition;
100
+ horizontalPosition: ClWidgetHorizontalPosition;
101
+ verticalOffset: string;
102
+ horizontalOffset: string;
103
+ }
104
+ export interface ClFloatingBarParamsI {
105
+ desktop: ClFloatingBarEnvironmentParamsI;
106
+ mobile: ClFloatingBarEnvironmentParamsI;
107
+ }
108
+ export interface ClFloatingBarEnvironmentParamsI {
109
+ verticalPosition: ClWidgetVerticalPosition;
110
+ horizontalPosition: ClWidgetHorizontalPosition;
111
+ verticalOffset: string;
112
+ horizontalOffset: string;
113
+ }
114
+ export interface ClLauncherParamsI {
115
+ desktop: ClLauncherEnvironmentParamsI;
116
+ mobile: ClLauncherEnvironmentParamsI;
117
+ entryAnimation: ClLauncherEntryAnimationI;
118
+ loopAnimation: ClLoopAnimationI;
119
+ }
120
+ export interface ClLauncherEnvironmentParamsI {
121
+ verticalPosition: ClWidgetVerticalPosition;
122
+ horizontalPosition: ClWidgetHorizontalPosition;
123
+ verticalOffset: string;
124
+ horizontalOffset: string;
125
+ }
126
+ export interface ClLauncherEntryAnimationI {
127
+ type: ClLauncherEntryAnimationType | null;
128
+ }
129
+ export declare enum ClLauncherEntryAnimationType {
130
+ SLIDE_TO_TOP = "SLIDE_TO_TOP",
131
+ SLIDE_TO_BOTTOM = "SLIDE_TO_BOTTOM",
132
+ SLIDE_TO_LEFT = "SLIDE_TO_LEFT",
133
+ SLIDE_TO_RIGHT = "SLIDE_TO_RIGHT"
134
+ }
135
+ export interface ClLoopAnimationI {
136
+ type: ClLoopAnimationType | null;
137
+ params?: any;
138
+ }
139
+ export declare enum ClLoopAnimationType {
140
+ PULSE = "PULSE",
141
+ VIBRATE = "VIBRATE",
142
+ WOBBLE = "WOBBLE",
143
+ SHAKE = "SHAKE",
144
+ JELLO = "JELLO",
145
+ BOUNCE = "BOUNCE",
146
+ BLINK = "BLINK",
147
+ FLICKER = "FLICKER",
148
+ PING = "PING"
149
+ }
150
+ export interface ClCloseButtonParamsI {
151
+ desktop?: ClCloseButtonEnvironmentParamsI;
152
+ mobile?: ClCloseButtonEnvironmentParamsI;
153
+ showOnViews?: string[];
154
+ enabled?: boolean;
155
+ }
156
+ export interface ClCloseButtonEnvironmentParamsI extends ClIconEnvironmentParamsI {
157
+ verticalOffset: string;
158
+ horizontalOffset: string;
159
+ width: string;
160
+ height: string;
161
+ horizontalPosition: ClCloseButtonHorizontalPosition;
162
+ }
163
+ export interface ClIconEnvironmentParamsI {
164
+ content: string;
165
+ defaultIcon: boolean;
166
+ color?: string;
167
+ size?: number;
168
+ }
169
+ export declare enum ClCloseButtonHorizontalPosition {
170
+ LEFT = "LEFT",
171
+ RIGHT = "RIGHT"
172
+ }
173
+ export interface ClDocumentCssVarsI {
174
+ [key: string]: string;
175
+ }
176
+ export interface ClDocumentActualSizeI {
177
+ viewId: string;
178
+ desktop: ClDocumentEnvironmentActualSize;
179
+ mobile: ClDocumentEnvironmentActualSize;
180
+ }
181
+ export interface ClDocumentEnvironmentActualSize {
182
+ width: string;
183
+ height: string;
184
+ }
185
+ export interface ClDocumentLinkParamsI {
186
+ color?: string;
187
+ removeUnderline?: boolean;
188
+ }
@@ -0,0 +1 @@
1
+ export var ClWidgetVerticalPosition;!function(o){o.TOP="TOP",o.CENTER="CENTER",o.BOTTOM="BOTTOM"}(ClWidgetVerticalPosition||(ClWidgetVerticalPosition={}));export var ClWidgetHorizontalPosition;!function(o){o.LEFT="LEFT",o.CENTER="CENTER",o.RIGHT="RIGHT"}(ClWidgetHorizontalPosition||(ClWidgetHorizontalPosition={}));export var ClLauncherEntryAnimationType;!function(o){o.SLIDE_TO_TOP="SLIDE_TO_TOP",o.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",o.SLIDE_TO_LEFT="SLIDE_TO_LEFT",o.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(ClLauncherEntryAnimationType||(ClLauncherEntryAnimationType={}));export var ClLoopAnimationType;!function(o){o.PULSE="PULSE",o.VIBRATE="VIBRATE",o.WOBBLE="WOBBLE",o.SHAKE="SHAKE",o.JELLO="JELLO",o.BOUNCE="BOUNCE",o.BLINK="BLINK",o.FLICKER="FLICKER",o.PING="PING"}(ClLoopAnimationType||(ClLoopAnimationType={}));export var ClCloseButtonHorizontalPosition;!function(o){o.LEFT="LEFT",o.RIGHT="RIGHT"}(ClCloseButtonHorizontalPosition||(ClCloseButtonHorizontalPosition={}));
@@ -1,8 +1,5 @@
1
+ import { ClDocumentCssVarsI, ClDocumentI } from './Document.interface';
1
2
  export default class DocumentCssVarsReplace {
2
- static replaceVars(document: any, colorsMap: {
3
- [k: string]: string;
4
- }): any;
5
- static replaceValues(document: any, cssVarsMap: {
6
- [k: string]: string;
7
- }): any;
3
+ static replaceVars(document: ClDocumentI, colorsMap: ClDocumentCssVarsI): ClDocumentI;
4
+ static replaceValues(document: ClDocumentI, cssVarsMap: ClDocumentCssVarsI): ClDocumentI;
8
5
  }
@@ -1,17 +1,22 @@
1
- export function iterateDepthFirst(node: any, callback: any): void;
1
+ import { ClBaseComponentI, ClDocumentActionI } from './Document.interface';
2
+ export interface IterableNodeI {
3
+ children?: IterableNodeI[];
4
+ [key: string]: any;
5
+ }
2
6
  export default class DocumentUtils {
3
- static removeNode(views: any, path: any): any;
4
- static insertNode(node: any, targetPath: any, views: any, insertPosition: any): any;
5
- static moveNode(views: any, fromPath: any, targetPath: any, insertType: any): void;
6
- static iterateDepthFirst(...args: any[]): void;
7
- static reIndex(node: any, nodePath: any): void;
8
- static getRelativePath(path: any): any;
9
- static getParentPath(path: any): any;
10
- static getNodeByPath(components: any, path: any): any;
11
- static getNodeById(componentsTree: any, id: any): any;
12
- static getPathToInsert(targetPath: any, insertPosition: any, views: any, node: any): any;
13
- static getNodeOnClickData(node: any): {
14
- actions: any[];
7
+ static removeNode(views: ClBaseComponentI[], path: number[]): ClBaseComponentI;
8
+ static insertNode(node: ClBaseComponentI, targetPath: number[], views: ClBaseComponentI[], insertPosition: string): ClBaseComponentI;
9
+ static moveNode(views: ClBaseComponentI[], fromPath: number[], targetPath: number[], insertType: string): void;
10
+ static iterateDepthFirst<T extends IterableNodeI>(node: T, callback: (node: T) => void): void;
11
+ static reIndex(node: ClBaseComponentI, nodePath: number[]): void;
12
+ static getRelativePath(path: number[]): number[];
13
+ static getParentPath(path: number[]): number[];
14
+ static getNodeByPath(components: ClBaseComponentI[], path: number[]): ClBaseComponentI | null;
15
+ static getNodeById(componentsTree: ClBaseComponentI[], id: string): ClBaseComponentI | null;
16
+ static getPathToInsert(targetPath: number[], insertPosition: string, views: ClBaseComponentI[], node?: ClBaseComponentI): number[];
17
+ static getNodeOnClickData(node: ClBaseComponentI): {
18
+ actions: ClDocumentActionI[];
15
19
  npsViewIds: string[];
16
20
  };
17
21
  }
22
+ export declare function iterateDepthFirst<T extends IterableNodeI>(node: T, callback: (node: T) => void): void;
@@ -1 +1 @@
1
- import ComponentInsertType from"./ComponentInsertType";import HandlerTypes from"../handler/HandlerTypes";export default class DocumentUtils{static removeNode(t,e){const n=this.getParentPath(e),r=e[e.length-1],i=this.getNodeByPath(t,n);if(i){const t=i.children.splice(r,1)[0];return t.prevPath=e,t.path=null,DocumentUtils.reIndex(i,i.path),t}{const n=t.splice(r,1)[0];return n.prevPath=e,n.path=null,t.forEach((t,e)=>{t.path=[e],DocumentUtils.reIndex(t,t.path)}),n}}static insertNode(t,e,n,r){const i=DocumentUtils.getPathToInsert(e,r,n,t),o=r===ComponentInsertType.INSIDE?e:this.getParentPath(i),s=this.getNodeByPath(n,o),l=i[i.length-1];return s?(s.children.splice(l,0,t),DocumentUtils.reIndex(s,s.path),t):(n.splice(l,0,t),n.forEach((t,e)=>{t.path=[e],DocumentUtils.reIndex(t,t.path)}),t)}static moveNode(t,e,n,r){const i=DocumentUtils.getNodeByPath(t,n);if(!i)return;const o=DocumentUtils.removeNode(t,e),s=DocumentUtils.getNodeById(t,i.id).path;DocumentUtils.insertNode(o,s,t,r)}static iterateDepthFirst(...t){return iterateDepthFirst(...t)}static reIndex(t,e){t.path=e,t.children&&t.children.forEach((t,n)=>{DocumentUtils.reIndex(t,e.concat(n))})}static getRelativePath(t){return t.slice(1,t.length)}static getParentPath(t){return t.slice(0,-1)}static getNodeByPath(t,e){for(let n=0;n<e.length;n++){if(n===e.length-1)return t[e[n]]||null;if(!t[e[n]])return null;t=t[e[n]].children}}static getNodeById(t,e){let n=null;for(let r=0;r<t.length;r++){const i=t[r];if(n)break;if(i.id===e){n=i;break}i.children&&i.children.length&&(n=this.getNodeById(i.children,e))}return n}static getPathToInsert(t,e,n,r){let i;const o=t[t.length-1];switch(e){case ComponentInsertType.BEFORE:i=t;break;case ComponentInsertType.AFTER:i=t.slice(),i[t.length-1]=o+1;break;case ComponentInsertType.INSIDE:i=t.concat([DocumentUtils.getNodeByPath(n,t).children.length]);break;case ComponentInsertType.INSTEAD:i=r.prevPath.at(-1)<=o?[...t.slice(0,-1),o+1]:t;break;default:i=t}return i}static getNodeOnClickData(t){let e=[],n={};return DocumentUtils.iterateDepthFirst(t,t=>{var r,i,o;const s=null===(i=null===(r=t.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find(t=>t.type===HandlerTypes.CLICK).actions;(null==s?void 0:s.length)&&(e=[...e,...s]),Object.keys((null===(o=t.props)||void 0===o?void 0:o.content)||{}).filter(t=>["detractor","passive","promoter"].includes(t)).map(e=>{var n;return((null===(n=t.props)||void 0===n?void 0:n.content)||{})[e]||null}).filter(t=>t).forEach(t=>n[t]=t)}),{actions:e,npsViewIds:Object.keys(n)}}}export function iterateDepthFirst(t,e){t.children&&t.children.forEach(t=>iterateDepthFirst(t,e)),e(t)}
1
+ import ComponentInsertType from"./ComponentInsertType";import HandlerTypes from"../handler/HandlerTypes";export default class DocumentUtils{static removeNode(t,e){const n=this.getParentPath(e),r=e[e.length-1],i=this.getNodeByPath(t,n);if(i&&i.children&&i.path){const t=i.children.splice(r,1)[0];return t.prevPath=e,t.path=null,DocumentUtils.reIndex(i,i.path),t}{const n=t.splice(r,1)[0];return n.prevPath=e,n.path=null,t.forEach((t,e)=>{t.path=[e],DocumentUtils.reIndex(t,t.path)}),n}}static insertNode(t,e,n,r){const i=DocumentUtils.getPathToInsert(e,r,n,t),l=r===ComponentInsertType.INSIDE?e:this.getParentPath(i),o=this.getNodeByPath(n,l),s=i[i.length-1];return o&&o.children&&o.path?(o.children.splice(s,0,t),DocumentUtils.reIndex(o,o.path),t):(n.splice(s,0,t),n.forEach((t,e)=>{t.path=[e],DocumentUtils.reIndex(t,t.path)}),t)}static moveNode(t,e,n,r){const i=DocumentUtils.getNodeByPath(t,n);if(!i)return;const l=DocumentUtils.removeNode(t,e),o=DocumentUtils.getNodeById(t,i.id);o&&o.path&&DocumentUtils.insertNode(l,o.path,t,r)}static iterateDepthFirst(t,e){return iterateDepthFirst(t,e)}static reIndex(t,e){t.path=e,t.children&&t.children.forEach((t,n)=>{DocumentUtils.reIndex(t,e.concat(n))})}static getRelativePath(t){return t.slice(1,t.length)}static getParentPath(t){return t.slice(0,-1)}static getNodeByPath(t,e){let n=t;for(let t=0;t<e.length;t++){if(t===e.length-1)return n[e[t]]||null;if(!n[e[t]]||!n[e[t]].children)return null;n=n[e[t]].children}return null}static getNodeById(t,e){let n=null;for(let r=0;r<t.length;r++){const i=t[r];if(n)break;if(i.id===e){n=i;break}i.children&&i.children.length&&(n=this.getNodeById(i.children,e))}return n}static getPathToInsert(t,e,n,r){var i,l;let o;const s=t[t.length-1];switch(e){case ComponentInsertType.BEFORE:o=t;break;case ComponentInsertType.AFTER:o=t.slice(),o[t.length-1]=s+1;break;case ComponentInsertType.INSIDE:{const e=DocumentUtils.getNodeByPath(n,t),r=null!==(l=null===(i=null==e?void 0:e.children)||void 0===i?void 0:i.length)&&void 0!==l?l:0;o=t.concat([r]);break}case ComponentInsertType.INSTEAD:{const e=null==r?void 0:r.prevPath;o=(null==e?void 0:e.at(-1))<=s?[...t.slice(0,-1),s+1]:t;break}default:o=t}return o}static getNodeOnClickData(t){let e=[],n={};return DocumentUtils.iterateDepthFirst(t,t=>{var r,i,l,o;const s=null===(l=null===(i=null===(r=t.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find(t=>t.type===HandlerTypes.CLICK))||void 0===l?void 0:l.actions;(null==s?void 0:s.length)&&(e=[...e,...s]),Object.keys((null===(o=t.props)||void 0===o?void 0:o.content)||{}).filter(t=>["detractor","passive","promoter"].includes(t)).map(e=>{var n;return((null===(n=t.props)||void 0===n?void 0:n.content)||{})[e]||null}).filter(t=>t).forEach(t=>n[t]=t)}),{actions:e,npsViewIds:Object.keys(n)}}}export function iterateDepthFirst(t,e){t.children&&t.children.forEach(t=>iterateDepthFirst(t,e)),e(t)}
@@ -1,9 +1,10 @@
1
+ export interface ViewportSizeI {
2
+ width: number;
3
+ height: number;
4
+ }
1
5
  export default class ViewportSize {
2
- static size(htmlDocumentObject: any): {
3
- width: number;
4
- height: number;
5
- };
6
- static width(htmlDocumentObject: any): number;
7
- static height(htmlDocumentObject: any): number;
8
- static scrollbarWidth(htmlDocumentObject: any): number;
6
+ static size(htmlDocumentObject?: Document): ViewportSizeI;
7
+ static width(htmlDocumentObject?: Document): number;
8
+ static height(htmlDocumentObject?: Document): number;
9
+ static scrollbarWidth(htmlDocumentObject?: Document): number;
9
10
  }
@@ -1 +1 @@
1
- export default class ViewportSize{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}
1
+ export default class ViewportSize{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const i=t||document;return Math.max(i.documentElement.clientWidth,(null===(e=i.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const i=t||document;return Math.max(i.documentElement.clientHeight,(null===(e=i.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const i=t||document;return((null===(e=i.defaultView)||void 0===e?void 0:e.innerWidth)||0)-i.documentElement.clientWidth}}
@@ -1 +1 @@
1
- export default function copyToClipboard(textToCopy: any): Promise<void>;
1
+ export default function copyToClipboard(textToCopy: string): Promise<void>;
@@ -1 +1 @@
1
- export default function getMostNestedNode(containerElement: any): any;
1
+ export default function getMostNestedNode(containerElement: Element): Element;
@@ -1 +1,6 @@
1
- export default function insertHtmlIntoElement(params: any): void;
1
+ export interface InsertHtmlIntoElementParamsI {
2
+ element: Element;
3
+ html: string;
4
+ appendHtml?: boolean;
5
+ }
6
+ export default function insertHtmlIntoElement(params: InsertHtmlIntoElementParamsI): void;
@@ -1 +1 @@
1
- export default function sanitizeHTML(html: any): string;
1
+ export default function sanitizeHTML(html: string): string;
@@ -1,8 +1,8 @@
1
1
  export default class BaseElementInViewportHandler {
2
- constructor(rootElement: any, oneTimeObserver: any);
3
2
  observer: IntersectionObserver | null;
4
- rootElement: any;
5
- oneTimeObserver: any;
6
- handle(visibleCallback: any, notVisibleCallback: any): void;
3
+ rootElement: Element;
4
+ oneTimeObserver: boolean;
5
+ constructor(rootElement: Element, oneTimeObserver: boolean);
6
+ handle(visibleCallback: () => void, notVisibleCallback?: () => void): void;
7
7
  unsubscribe(): void;
8
8
  }
@@ -1 +1 @@
1
- export default class BaseElementInViewportHandler{constructor(e,r){this.observer=null,this.rootElement=e,this.oneTimeObserver=r}handle(e,r){this.observer=new IntersectionObserver(s=>{!s.find(e=>e.isIntersecting)?r&&"function"==typeof r&&r():(e(),this.oneTimeObserver&&this.unsubscribe())},{root:null,rootMargin:"0px",threshold:.1}),this.observer.observe(this.rootElement)}unsubscribe(){this.observer.disconnect()}}
1
+ export default class BaseElementInViewportHandler{constructor(e,r){this.observer=null,this.rootElement=e,this.oneTimeObserver=r}handle(e,r){this.observer=new IntersectionObserver(s=>{!s.find(e=>e.isIntersecting)?r&&"function"==typeof r&&r():(e(),this.oneTimeObserver&&this.unsubscribe())},{root:null,rootMargin:"0px",threshold:.1}),this.observer.observe(this.rootElement)}unsubscribe(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}}
@@ -1,5 +1,6 @@
1
+ import { ClDocumentCssVarsI } from '../document/Document.interface';
1
2
  export default class CssVarsOperations {
2
- static get(varName: any, element: any): any;
3
- static apply(cssVarsMap: {} | undefined, element: any): void;
4
- static override(cssVarsMap: {} | undefined, element: any): void;
3
+ static get(varName: string, element: HTMLElement): string;
4
+ static apply(cssVarsMap: ClDocumentCssVarsI | undefined, element: HTMLElement): void;
5
+ static override(cssVarsMap: ClDocumentCssVarsI | undefined, element: HTMLElement): void;
5
6
  }
@@ -1 +1 @@
1
- function forEachCssVarKey(e,t){e&&Object.keys(e)&&Object.keys(e).forEach(t)}export default class CssVarsOperations{static get(e,t){return t.style.getPropertyValue(`--${e}`)}static apply(e={},t){forEachCssVarKey(e,s=>{let r=`--${s}`,a=e[s];t.style.getPropertyValue(r)||t.style.setProperty(r,a)})}static override(e={},t){forEachCssVarKey(e,s=>{let r=`--${s}`,a=e[s];t.style.setProperty(r,a)})}}
1
+ function forEachCssVarKey(e,t){e&&Object.keys(e)&&Object.keys(e).forEach(t)}export default class CssVarsOperations{static get(e,t){return t.style.getPropertyValue(`--${e}`)}static apply(e={},t){forEachCssVarKey(e,s=>{const r=`--${s}`,a=e[s];t.style.getPropertyValue(r)||t.style.setProperty(r,a)})}static override(e={},t){forEachCssVarKey(e,s=>{const r=`--${s}`,a=e[s];t.style.setProperty(r,a)})}}
@@ -1 +1 @@
1
- export default function recursiveFindParentNodeByAttribute(ref: any, attributeName: any, attributeValue: any, attributeValuePredicate: any): any;
1
+ export default function recursiveFindParentNodeByAttribute(ref: Node | null, attributeName: string, attributeValue: string, attributeValuePredicate?: (value: string | null) => boolean): Element | null;
package/flat.d.ts CHANGED
@@ -1 +1 @@
1
- export function flat(arr: any, depth?: number): any;
1
+ export declare function flat<T>(arr: (T | T[])[], depth?: number): T[];
@@ -1,7 +1,7 @@
1
+ declare const InAppLayoutType: {
2
+ SLIDE_UP: string;
3
+ POP_UP: string;
4
+ FULL: string;
5
+ BOTTOM_BAR: string;
6
+ };
1
7
  export default InAppLayoutType;
2
- declare namespace InAppLayoutType {
3
- const SLIDE_UP: string;
4
- const POP_UP: string;
5
- const FULL: string;
6
- const BOTTOM_BAR: string;
7
- }
@@ -1,9 +1,9 @@
1
+ declare const LayoutType: {
2
+ BUILT_IN: string;
3
+ DETACHED: string;
4
+ FLOATING_BOX: string;
5
+ FLOATING_BAR: string;
6
+ LAUNCHER: string;
7
+ CONTENT_LOCKER: string;
8
+ };
1
9
  export default LayoutType;
2
- declare namespace LayoutType {
3
- const BUILT_IN: string;
4
- const DETACHED: string;
5
- const FLOATING_BOX: string;
6
- const FLOATING_BAR: string;
7
- const LAUNCHER: string;
8
- const CONTENT_LOCKER: string;
9
- }
@@ -1,9 +1,9 @@
1
+ declare const WidgetType: {
2
+ SUBSCRIPTION_FORM: string;
3
+ INFORMER: string;
4
+ REQUEST_FORM: string;
5
+ LAUNCHER: string;
6
+ AGE_VERIFY: string;
7
+ TEASER: string;
8
+ };
1
9
  export default WidgetType;
2
- declare namespace WidgetType {
3
- const SUBSCRIPTION_FORM: string;
4
- const INFORMER: string;
5
- const REQUEST_FORM: string;
6
- const LAUNCHER: string;
7
- const AGE_VERIFY: string;
8
- const TEASER: string;
9
- }
@@ -1,5 +1,5 @@
1
+ declare const HandlerTypes: {
2
+ CLICK: string;
3
+ COMPONENT_EVENT: string;
4
+ };
1
5
  export default HandlerTypes;
2
- declare namespace HandlerTypes {
3
- const CLICK: string;
4
- const COMPONENT_EVENT: string;
5
- }
@@ -1,9 +1,16 @@
1
+ interface WeightedOption {
2
+ id: string | number;
3
+ weight: number;
4
+ [key: string]: any;
5
+ }
6
+ interface Range {
7
+ from: number;
8
+ to: number;
9
+ id: string | number;
10
+ }
1
11
  export default class RandomDistributor {
2
- calculateFromWeights(originOptions: any, multiplier?: number): any;
3
- _getRangeByWeight(ranges: any, weight: any): any;
4
- _buildRanges(rules: any): {
5
- from: any;
6
- to: any;
7
- id: any;
8
- }[];
12
+ calculateFromWeights(originOptions: WeightedOption[], multiplier?: number): WeightedOption | undefined;
13
+ _getRangeByWeight(ranges: Range[], weight: number): Range | undefined;
14
+ _buildRanges(rules: WeightedOption[]): Range[];
9
15
  }
16
+ export {};
@@ -1 +1 @@
1
- import sum from"./sum";import generateRandomNumber from"../utils/generateRandomNumber";export default class RandomDistributor{calculateFromWeights(e,t=1e3){const i=e.map(e=>Object.assign(Object.assign({},e),{weight:e.weight*t})),r=sum(i.map(e=>parseFloat(e.weight))),o=generateRandomNumber(1,r);let s=this._buildRanges(i);const a=this._getRangeByWeight(s,o);return i.find(e=>e.id===a.id)}_getRangeByWeight(e,t){return e.find(e=>t>=e.from&&t<=e.to)}_buildRanges(e){let t=[];for(let i=0;i<e.length;i++){const r=e[i];if(0===i)t.push({from:1,to:parseFloat(r.weight),id:r.id});else{const e=t[t.length-1].to,i=e+parseFloat(r.weight);t.push({from:e+1,to:i,id:r.id})}}return t}}
1
+ import sum from"./sum";import generateRandomNumber from"../utils/generateRandomNumber";export default class RandomDistributor{calculateFromWeights(t,e=1e3){const i=t.map(t=>Object.assign(Object.assign({},t),{weight:t.weight*e})),r=sum(i.map(t=>parseFloat(String(t.weight)))),n=generateRandomNumber(1,r);let o=this._buildRanges(i);const s=this._getRangeByWeight(o,n);return i.find(t=>t.id===(null==s?void 0:s.id))}_getRangeByWeight(t,e){return t.find(t=>e>=t.from&&e<=t.to)}_buildRanges(t){let e=[];for(let i=0;i<t.length;i++){const r=t[i];if(0===i)e.push({from:1,to:parseFloat(String(r.weight)),id:r.id});else{const t=e[e.length-1].to,i=t+parseFloat(String(r.weight));e.push({from:t+1,to:i,id:r.id})}}return e}}
package/math/sum.d.ts CHANGED
@@ -1 +1 @@
1
- export default function sum(list: any): any;
1
+ export default function sum(list: number[]): number;
@@ -1,5 +1,5 @@
1
- declare const _default: HttpClient;
2
- export default _default;
3
1
  declare class HttpClient {
4
- execute(URL: any, method: any, body: null | undefined, headers: any, abortSignal: any): Promise<Response>;
2
+ execute(URL: string, method?: string, body?: any, headers?: Record<string, string>, abortSignal?: AbortSignal): Promise<Response>;
5
3
  }
4
+ declare const _default: HttpClient;
5
+ export default _default;
@@ -1 +1 @@
1
- class HttpClient{execute(t,e,n=null,i,l){const s={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:l};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,s)}}export default new HttpClient;
1
+ class HttpClient{execute(t,e="GET",n=null,i,l){const s={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:l};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,s)}}export default new HttpClient;
@@ -1,5 +1,5 @@
1
+ declare const HttpStatus: {
2
+ EMPTY_RESPONSE: number;
3
+ TOO_MANY_REQUESTS: number;
4
+ };
1
5
  export default HttpStatus;
2
- declare namespace HttpStatus {
3
- const EMPTY_RESPONSE: number;
4
- const TOO_MANY_REQUESTS: number;
5
- }
@@ -1 +1 @@
1
- export default function isDictionary(object: any): boolean;
1
+ export default function isDictionary(object: unknown): boolean;
@@ -1 +1 @@
1
- export default function omitKeys(kv: any, ignoreKeys: any): {};
1
+ export default function omitKeys<T extends Record<string, unknown>, K extends keyof T>(kv: T, ignoreKeys: K[]): Omit<T, K>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/common",
3
- "version": "5.2.1",
3
+ "version": "6.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1 +1 @@
1
- export default function sanitizeUrl(url: any): string;
1
+ export default function sanitizeUrl(url: string | null | undefined): string;
@@ -1,4 +1,4 @@
1
- export class CaseTransformer {
2
- static camelCaseToDashCase(string: any): any;
3
- static camelCaseToUpperSnakeCase(string: any): any;
1
+ export declare class CaseTransformer {
2
+ static camelCaseToDashCase(string: string): string;
3
+ static camelCaseToUpperSnakeCase(string: string): string;
4
4
  }
@@ -1 +1 @@
1
- export default function nullishCoalescingOperator(a: any, b: any): any;
1
+ export default function nullishCoalescingOperator<T>(a: T | null | undefined, b: T): T;
@@ -1 +1 @@
1
- export default function getNumericDecline(itemsCount: any, translateKeys: any, language: any): any;
1
+ export default function getNumericDecline(itemsCount: number, translateKeys: string[], language: string): string;
@@ -1,2 +1,2 @@
1
+ declare const addEventListenerToElement: (element: EventTarget, eventType: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void;
1
2
  export default addEventListenerToElement;
2
- declare function addEventListenerToElement(element: any, eventType: any, callback: any, options: any): void;
@@ -1 +1 @@
1
- const addEventListenerToElement=(e,t,n,d)=>{const{addEventListenerBase:a,addEventListener:o}=EventTarget.prototype;(a||o).call(e,t,n,d)};export default addEventListenerToElement;
1
+ const addEventListenerToElement=(e,t,n,d)=>{const a=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=a;(o||r).call(e,t,n,d)};export default addEventListenerToElement;
@@ -1,7 +1 @@
1
- export function allSettled(promises?: any[]): Promise<({
2
- status: string;
3
- value: any;
4
- } | {
5
- status: string;
6
- reason: any;
7
- })[]>;
1
+ export declare function allSettled<T>(promises?: Promise<T>[]): Promise<PromiseSettledResult<T>[]>;
@@ -1 +1 @@
1
- export function checkTimeZone(timeZone: any): any;
1
+ export declare function checkTimeZone(timeZone: string | undefined): string | undefined;
@@ -1,3 +1,3 @@
1
- export function isIPad(): boolean;
2
- export function isIPhone(): boolean;
3
- export function isIOS(): boolean;
1
+ export declare const isIPad: () => boolean;
2
+ export declare const isIPhone: () => boolean;
3
+ export declare const isIOS: () => boolean;
@@ -1 +1 @@
1
- export default function flatMap(arr: any, func: any): any;
1
+ export default function flatMap<T, U>(arr: T[], func: (item: T) => U[]): U[];
@@ -1 +1 @@
1
- export function fromEntries(iterable: any): any;
1
+ export declare function fromEntries<V>(iterable: Iterable<[string, V]>): Record<string, V>;
@@ -1 +1 @@
1
- export default function generateRandomNumber(min: any, max: any): any;
1
+ export default function generateRandomNumber(min: number, max: number): number;
@@ -1,2 +1,2 @@
1
- export function comparisonFunction(a: any, b: any, property: any, descending?: boolean): any;
2
- export function sort(object: any, property: any, descending?: boolean): any;
1
+ export declare function comparisonFunction(a: Record<string, any>, b: Record<string, any>, property: string, descending?: boolean): number;
2
+ export declare function sort(object: Record<string, Record<string, any>>, property: string, descending?: boolean): Record<string, Record<string, any>>;
@@ -1 +1 @@
1
- export function detectOrientation(): "PORTRAIT" | "LANDSCAPE" | undefined;
1
+ export declare const detectOrientation: () => 'PORTRAIT' | 'LANDSCAPE';
@@ -1 +1 @@
1
- export const detectOrientation=()=>{const n=window.screen.orientation||window.screen.mozOrientation||window.screen.msOrientation;return n?n.type.includes("portrait")?"PORTRAIT":"LANDSCAPE":void 0===window.orientation||0===window.orientation||180===window.orientation?"PORTRAIT":90===window.orientation||-90===window.orientation?"LANDSCAPE":void 0};
1
+ export const detectOrientation=()=>{const n=window.screen,i=n.orientation||n.mozOrientation||n.msOrientation;if(i)return i.type.includes("portrait")?"PORTRAIT":"LANDSCAPE";if(void 0!==window.orientation){if(0===window.orientation||180===window.orientation)return"PORTRAIT";if(90===window.orientation||-90===window.orientation)return"LANDSCAPE"}return"PORTRAIT"};
@@ -1,23 +1,26 @@
1
- export default class SysVelocityContext {
2
- create(): {
3
- mathTool: {
4
- add: (a: any, b: any) => number;
5
- sub: (a: any, b: any) => number;
6
- mul: (a: any, b: any) => number;
7
- div: (a: any, b: any) => number;
8
- };
9
- stringTool: {
10
- equalsIgnoreCase: (a: any, b: any) => boolean;
11
- };
12
- numberTool: {
13
- integer: (a: any) => number;
14
- format: (f: any, v: any) => string;
15
- number: (v: any, separator?: string, precision?: number) => string;
16
- };
17
- dateTool: {
18
- currentDate: (format: any) => any;
19
- currentTimeStamp: () => any;
20
- formatDate: (format: any, date: any) => any;
21
- };
1
+ type NumberLike = number | string;
2
+ export interface SysVelocityContextI {
3
+ mathTool: {
4
+ add: (a: NumberLike, b: NumberLike) => number;
5
+ sub: (a: NumberLike, b: NumberLike) => number;
6
+ mul: (a: NumberLike, b: NumberLike) => number;
7
+ div: (a: NumberLike, b: NumberLike) => number;
8
+ };
9
+ stringTool: {
10
+ equalsIgnoreCase: (a: string, b: string) => boolean;
11
+ };
12
+ numberTool: {
13
+ integer: (a: NumberLike) => number;
14
+ format: (f: string | null, v: NumberLike) => string;
15
+ number: (v: NumberLike, separator?: string, precision?: number) => string;
22
16
  };
17
+ dateTool: {
18
+ currentDate: (format?: string) => string | number;
19
+ currentTimeStamp: () => number;
20
+ formatDate: (format: string | null, date: Date | string | number) => string | number;
21
+ };
22
+ }
23
+ export default class SysVelocityContext {
24
+ create(): SysVelocityContextI;
23
25
  }
26
+ export {};
@@ -1 +1 @@
1
- export default class SysVelocityContext{create(){return{mathTool:{add:function(e,t){return 1*e+1*t},sub:function(e,t){return e-t},mul:function(e,t){return e*t},div:function(e,t){return e/t}},stringTool:{equalsIgnoreCase:function(e,t){return String(e).toLowerCase()===String(t).toLowerCase()}},numberTool:{integer:function(e){return Math.floor(e)},format:function(e,t){const n=(e||"").split(".")[1];return Number(t).toFixed((n||"").length)},number:function(e,t=",",n=3){return Number(e).toFixed(n).replace(new RegExp(`[.]0{${n}}`),"").split(".").map((e,n)=>0===n?e.split("").reverse().join("").split("").map((e,n,r)=>n%3==0&&0!==n?e+=t:e).reverse().join(""):1===n?e:void 0).join(".")}},dateTool:{currentDate:function(e){return this.formatDate(e||"ISO",new Date)},currentTimeStamp:function(){return this.formatDate(null,new Date)},formatDate:function(e,t){const n=e=>e<9?`0${e}`:`${e}`,r=new Date(t);if("Invalid Date"===r.toString())return t;if("ISO"===e)return r.toISOString();if(!e||"string"!=typeof e)return r.getTime();const o=e.split(" ");let i="";return o.forEach(e=>{const t=e.toUpperCase();i=0===i.length?i:i+" ",t.includes("HH")&&(i+=t.replace("HH",n(r.getHours())).replace("MM",n(r.getMinutes())).replace("SS",n(r.getSeconds()))),(t.includes("YYYY")||t.includes("DD"))&&(i+=t.replace("YYYY",String(r.getFullYear())).replace("DD",n(r.getDate())).replace("MM",n(r.getMonth()+1)))}),i}}}}}
1
+ export default class SysVelocityContext{create(){return{mathTool:{add:function(e,t){return Number(e)+Number(t)},sub:function(e,t){return e-t},mul:function(e,t){return e*t},div:function(e,t){return e/t}},stringTool:{equalsIgnoreCase:function(e,t){return String(e).toLowerCase()===String(t).toLowerCase()}},numberTool:{integer:function(e){return Math.floor(e)},format:function(e,t){const r=(e||"").split(".")[1];return Number(t).toFixed((r||"").length)},number:function(e,t=",",r=3){return Number(e).toFixed(r).replace(new RegExp(`[.]0{${r}}`),"").split(".").map((e,r)=>0===r?e.split("").reverse().join("").split("").map((e,r)=>r%3==0&&0!==r?e+=t:e).reverse().join(""):1===r?e:void 0).join(".")}},dateTool:{currentDate:function(e){return this.formatDate(e||"ISO",new Date)},currentTimeStamp:function(){return this.formatDate(null,new Date)},formatDate:function(e,t){const r=e=>e<9?`0${e}`:`${e}`,n=new Date(t);if("Invalid Date"===n.toString())return t;if("ISO"===e)return n.toISOString();if(!e||"string"!=typeof e)return n.getTime();const o=e.split(" ");let u="";return o.forEach(e=>{const t=e.toUpperCase();u=0===u.length?u:u+" ",t.includes("HH")&&(u+=t.replace("HH",r(n.getHours())).replace("MM",r(n.getMinutes())).replace("SS",r(n.getSeconds()))),(t.includes("YYYY")||t.includes("DD"))&&(u+=t.replace("YYYY",String(n.getFullYear())).replace("DD",r(n.getDate())).replace("MM",r(n.getMonth()+1)))}),u}}}}}
@@ -1,3 +1,3 @@
1
1
  export default class SysVelocityRenderer {
2
- render(template: any, context: any): any;
2
+ render(template: string, context: Record<string, any>): string;
3
3
  }