@shopware-ag/storefront-types 0.2.1 → 0.2.2

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.
@@ -3,22 +3,22 @@ declare module 'src/helper/emitter.helper' {
3
3
  detail?: object;
4
4
  cancelable?: boolean;
5
5
  }
6
-
6
+
7
7
  interface NativeEventEmitterSubscribeOpts {
8
8
  once?: boolean;
9
9
  scope?: Function;
10
10
  }
11
-
12
- class NativeEventEmitter {
11
+
12
+ class NativeEventEmitter<El extends HTMLElement = HTMLElement> {
13
13
  private _listeners;
14
14
  private _el;
15
- constructor(el: HTMLElement);
15
+ constructor(el: El);
16
16
  publish(eventName: string, detail?: NativeEventEmitterPublish, cancelable?: boolean): CustomEvent;
17
17
  subscribe(eventName: string, callback: Function, opts?: NativeEventEmitterSubscribeOpts): boolean;
18
18
  unsubscribe(eventName: String): boolean;
19
19
  reset(): boolean;
20
- get el(): HTMLElement;
21
- set el(value: HTMLElement);
20
+ get el(): El;
21
+ set el(value: El);
22
22
  get listeners(): any[];
23
23
  set listeners(value: any[]);
24
24
  }
@@ -1,5 +1,5 @@
1
1
  interface CookieStorageHelper {
2
- setItem(key: string, value: string, expireationDays: number): void
2
+ setItem(key: string, value: string, expirationDays: number): void
3
3
 
4
4
  getItem(key: string): any
5
5
 
@@ -1,5 +1,5 @@
1
- declare module 'src/utility/modal-extension/psuedo-modal.util' {
2
- class PsuedoModalUtil {
1
+ declare module 'src/utility/modal-extension/pseudo-modal.util' {
2
+ class PseudoModalUtil {
3
3
  open(callback: Function): void
4
4
  close(): void
5
5
  getModal(): HTMLElement
@@ -7,5 +7,5 @@ declare module 'src/utility/modal-extension/psuedo-modal.util' {
7
7
  updateContent(content: string, callback: () => void): void
8
8
  }
9
9
 
10
- export = PsuedoModalUtil;
10
+ export = PseudoModalUtil;
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/storefront-types",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Provides Shopware Storefront Typescript types",
5
5
  "types": "index.d.ts",
6
6
  "scripts": {
@@ -3,16 +3,16 @@ interface NativeEventEmitterSubscribeOpts {
3
3
  scope?: Function;
4
4
  }
5
5
 
6
- export default class NativeEventEmitter {
6
+ export default class NativeEventEmitter<El extends HTMLElement = HTMLElement> {
7
7
  private _listeners;
8
8
  private _el;
9
- constructor(el: HTMLElement);
9
+ constructor(el: El);
10
10
  publish(eventName: string, detail?: object, cancelable?: boolean): CustomEvent;
11
11
  subscribe(eventName: string, callback: Function, opts?: NativeEventEmitterSubscribeOpts): boolean;
12
12
  unsubscribe(eventName: String): boolean;
13
13
  reset(): boolean;
14
- get el(): HTMLElement;
15
- set el(value: HTMLElement);
14
+ get el(): El;
15
+ set el(value: El);
16
16
  get listeners(): any[];
17
17
  set listeners(value: any[]);
18
18
  }
@@ -1,10 +1,10 @@
1
1
  import NativeEventEmitter from "./native-event-emitter";
2
2
 
3
- export default class PluginBaseClass<Options extends object = Record<string, unknown>> {
4
- constructor(el: HTMLElement, options?: Partial<Options>, pluginName?: false | string);
3
+ export default class PluginBaseClass<Options extends object = Record<string, unknown>, El extends HTMLElement = HTMLElement> {
4
+ constructor(el: El, options?: Partial<Options>, pluginName?: false | string);
5
5
 
6
- el: HTMLElement;
7
- $emitter: NativeEventEmitter;
6
+ el: El;
7
+ $emitter: NativeEventEmitter<El>;
8
8
  _pluginName: String;
9
9
  initialOptions: Options;
10
10
  options: Options;