@vonq/hapi-elements-types 1.54.0 → 1.56.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.
@@ -87,10 +87,23 @@ export type WindowHapiEventMediator = WindowHapiModuleWithConstructorArgs<
87
87
  name: WindowHapiEventCommandNames,
88
88
  id?: string,
89
89
  ) => WindowHapiEventListener | undefined
90
+ getEventListenerById: (
91
+ id: string,
92
+ ) => WindowHapiEventListener | undefined
93
+ createListener: (
94
+ name: WindowHapiEventCommandNames,
95
+ callback: WindowHapiEventCommandCallbackHandler | undefined,
96
+ id?: string,
97
+ parentListenerId?: string,
98
+ ) => WindowHapiEventListener
99
+ addEventListenerToEventStorage: (
100
+ listener: WindowHapiEventListener,
101
+ ) => void
90
102
  addEventListener: (
91
103
  name: WindowHapiEventCommandNames,
92
104
  callback: WindowHapiEventCommandCallbackHandler,
93
105
  id?: string,
106
+ parentListenerId?: string,
94
107
  ) => WindowHapiEventListener
95
108
  removeEventListener: (eventId: string) => void
96
109
  },
@@ -115,6 +128,9 @@ export type WindowHapiEventMediator = WindowHapiModuleWithConstructorArgs<
115
128
  }
116
129
  >
117
130
 
131
+ export type WindowHapiEventStorageRemoveHandler = (id: string) => void
132
+ export type WindowHapiEventStorageClearHandler = () => void
133
+
118
134
  export type WindowHapiEventStorage = WindowHapiModuleWithConstructorArgs<
119
135
  {
120
136
  cache: (WindowHapiEventCommand | WindowHapiEventListener)[]
@@ -127,7 +143,7 @@ export type WindowHapiEventStorage = WindowHapiModuleWithConstructorArgs<
127
143
  add: (
128
144
  eventCommand: WindowHapiEventCommand | WindowHapiEventListener,
129
145
  ) => void
130
- remove: (id: string) => void
146
+ remove: WindowHapiEventStorageRemoveHandler
131
147
  removeByName: (name: string) => void
132
148
  getEventsByName: (
133
149
  name: string,
@@ -55,6 +55,7 @@ import { ProductCacheState } from "../product/state.cache.types"
55
55
  import { WindowHapiValidationsUI } from "../ui/validations.types"
56
56
  import { WindowHapiUtilsUI } from "../ui/utils.types"
57
57
  import { UIState } from "types/ui/state.types"
58
+ import { WindowHapiEventStorageRemoveHandler } from "./events.types"
58
59
 
59
60
  export type WindowHapiSDKModule<
60
61
  APIModule,
@@ -172,6 +173,7 @@ export type WindowHapiSDK = WindowHapiModuleWithConstructorArgs<
172
173
  [WindowHapiModuleName.alert]: WindowHapiSDKAlert
173
174
  [WindowHapiModuleName.ui]: WindowHapiSDKUI
174
175
  [WindowHapiModuleName.experimental]: WindowHapiSDKExperimental
176
+ removeEventById: WindowHapiEventStorageRemoveHandler
175
177
  },
176
178
  { readonly core: WindowHapiClassInterface }
177
179
  >
@@ -25,7 +25,7 @@ export type HapiServiceFunctionLifecycleHookCallbackHandler = (
25
25
  export type HapiServiceFunctionLifecycleHookHandler = (
26
26
  callback: HapiServiceFunctionLifecycleHookCallbackHandler,
27
27
  runArgs?: any[],
28
- ) => void
28
+ ) => string
29
29
 
30
30
  export type HapiServiceFunctionWithLifecycleHooks<HandlerType> = {
31
31
  functionName: string
@@ -119,7 +119,7 @@ export type WindowHapiStateBase<T, CacheType = undefined> = {
119
119
  }
120
120
 
121
121
  export type HapiStateValueWithListener<T> = {
122
- onChange: (callback: WindowHapiEventCommandCallbackHandler) => void
122
+ onChange: (callback: WindowHapiEventCommandCallbackHandler) => string
123
123
  value: T
124
124
  }
125
125
 
package/_window/window.ts CHANGED
@@ -155,6 +155,12 @@ export type WindowHapiClassInterface = {
155
155
  logDeprecationNotice: () => void
156
156
  logLatestTypesPackageVersion: () => Promise<void>
157
157
  logFeatureBranches: () => Promise<void>
158
+ logPerformanceDegradationWarning: (
159
+ detailsStrings: [
160
+ string,
161
+ string | undefined | null | number | boolean,
162
+ ][],
163
+ ) => Promise<void>
158
164
  querySelectorAllThatAlsoSearchesShadowDOM: (
159
165
  node: Element | ShadowRoot | Document,
160
166
  selector: string,
@@ -45,6 +45,9 @@ export enum WindowHapiEventCommandName {
45
45
  domSetAttribute = "dom:set-attribute",
46
46
  domAddClass = "dom:add-class",
47
47
  domRemoveClass = "dom:remove-class",
48
+ domSetStyle = "dom:set-style",
49
+ domAddStyleSheet = "dom:add-stylesheet",
50
+ domRemoveStyleSheet = "dom:remove-stylesheet",
48
51
  domSlotAvailable = "dom:slot-available",
49
52
  domElementMounted = "dom:element-mounted",
50
53
  domElementUnmounted = "dom:element-unmounted",
@@ -48,9 +48,12 @@ export type WindowHapiEventCommandWithCallback = WindowHapiEventCommand & {
48
48
  }
49
49
 
50
50
  export type WindowHapiEventListener = {
51
- id?: string
51
+ id: string
52
52
  name: WindowHapiEventCommandNames
53
53
  callback:
54
54
  | WindowHapiEventCommandCallbackHandler
55
55
  | WindowHapiEventCommandCommitHandler
56
+ | undefined
57
+ parentListenerId?: string
58
+ setCallback: (callback: WindowHapiEventCommandCallbackHandler) => void
56
59
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.54.0",
4
+ "version": "1.56.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -5,26 +5,39 @@ import { HapiUIIconConfig } from "./types"
5
5
 
6
6
  export type WindowHapiServiceUI = WindowHapiModuleWithConstructorArgs<
7
7
  {
8
- onIframeLoaded: (callback: (iframeName: string) => void) => void
9
- onIframeUnloaded: (callback: (iframeName: string) => void) => void
8
+ onIframeLoaded: (callback: (iframeName: string) => void) => string
9
+ onIframeUnloaded: (callback: (iframeName: string) => void) => string
10
10
  setStyleAttribute: (
11
11
  selector: string,
12
12
  attributeName: string,
13
13
  attributeValue: any,
14
- ) => Promise<void>
15
- setStyle: (selector: string, style: any) => Promise<void>
16
- addClass: (selector: string, className: string) => Promise<void>
17
- removeClass: (selector: string, className: string) => Promise<void>
14
+ ) => Promise<string>
15
+ setAttribute: (
16
+ selector: string,
17
+ attributeName: string,
18
+ attributeValue: string,
19
+ ) => Promise<string>
20
+ setStyle: (
21
+ selector: string,
22
+ style: Record<string, string | number>,
23
+ ) => Promise<string>
24
+ addClass: (selector: string, className: string) => Promise<string>
25
+ removeClass: (selector: string, className: string) => Promise<string>
26
+ addStyleSheet: (
27
+ idWithoutPoundSign: string,
28
+ stylesheetStr: string,
29
+ ) => Promise<string>
30
+ removeStyleSheet: (idWithoutPoundSign: string) => Promise<void>
18
31
  appendChildToSlot: (
19
32
  slotId: string,
20
33
  element: HTMLElement,
21
- ) => Promise<void>
34
+ ) => Promise<string>
22
35
  removeChildFromSlot: (
23
36
  slotId: string,
24
37
  elementSelector: string,
25
38
  ) => Promise<void>
26
- hideElement: (elementSelector: string) => Promise<void>
27
- showElement: (elementSelector: string) => Promise<void>
39
+ hideElement: (elementSelector: string) => Promise<string>
40
+ showElement: (elementSelector: string) => Promise<string>
28
41
  changeIcons: (configs: HapiUIIconConfig[]) => Promise<void>
29
42
  },
30
43
  { readonly service: WindowHapiService }