@vonq/hapi-elements-types 1.7.0 → 1.8.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.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ This package contains type definitions for VONQ HAPI Elements project.
2
+
3
+ To get started using the types, install the package as a dev dependency:
4
+
5
+
6
+ Using NPM:
7
+ ```
8
+ npm install @vonq/hapi-elements-types --save-dev
9
+ ```
10
+
11
+ Using Yarn:
12
+ ```
13
+ yarn add -D @vonq/hapi-elements-types
14
+ ```
15
+
16
+ All the types have been exported in a single file so you can get started using the types as such:
17
+ ```
18
+ import {CreateCampaignForm} from "@vonq/hapi-elements-types";
19
+
20
+ const campaignObject: CreateCampaignForm = {} //Typescript will warn about missing properties
21
+ ```
@@ -40,6 +40,7 @@ import {
40
40
  WindowHapiClassInterface,
41
41
  } from "./window"
42
42
  import { WindowHapiServiceUI } from "../ui/service.types"
43
+ import { ATSState, WindowHapiAPIATS, WindowHapiServiceATS } from "../ats"
43
44
 
44
45
  export type WindowHapiSDKModule<
45
46
  APIModule,
@@ -126,8 +127,16 @@ export type WindowHapiSDKUI = WindowHapiSDKModule<
126
127
  undefined,
127
128
  undefined
128
129
  >
130
+ export type WindowHapiSDKATS = WindowHapiSDKModule<
131
+ WindowHapiAPIATS,
132
+ WindowHapiServiceATS,
133
+ undefined,
134
+ WindowHapiStateModule<ATSState>
135
+ >
136
+
129
137
  export type WindowHapiSDK = WindowHapiModuleWithConstructorArgs<
130
138
  {
139
+ [WindowHapiModuleName.ats]: WindowHapiSDKATS
131
140
  [WindowHapiModuleName.contract]: WindowHapiSDKContract
132
141
  [WindowHapiModuleName.basket]: WindowHapiSDKBasket
133
142
  [WindowHapiModuleName.campaign]: WindowHapiSDKCampaign
@@ -81,6 +81,7 @@ export type WindowHapiStatesJSON = {
81
81
  }
82
82
 
83
83
  export type WindowHapiStateBase = {
84
+ propertiesThatShouldNotBeDocumented: string[]
84
85
  __stateName: string
85
86
  toJSON: any
86
87
  }
package/ats/types.ts CHANGED
@@ -11,7 +11,7 @@ export type ATSUserSettings = {
11
11
  ats_managed_payment: boolean
12
12
  can_pay_with_purchase_order: boolean
13
13
  can_use_wallets: boolean
14
- invoice_currency: string
14
+ invoice_currency: string | null
15
15
  }
16
16
  export type ATSSettings = {
17
17
  payment_settings: ATSUserPaymentSetting[]
@@ -23,6 +23,10 @@ export type BasketState = {
23
23
  * Sum of prices of Products and/or Contracts in GBP currency. **This value is a computed getter meaning that it cannot be set from outside**
24
24
  */
25
25
  totalInGBP: number
26
+ /**
27
+ * Sum of prices of Products and/or Contracts in AUD currency. **This value is a computed getter meaning that it cannot be set from outside**
28
+ */
29
+ totalInAUD: number
26
30
  /**
27
31
  * Sum of prices of Products and/or Contracts in the current display currency that is used throughout the widgets. **This value is a computed getter meaning that it cannot be set from outside**
28
32
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.7.0",
4
+ "version": "1.8.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
package/product/enums.ts CHANGED
@@ -8,4 +8,5 @@ export enum ProductPriceCurrency {
8
8
  "USD" = "USD",
9
9
  "EUR" = "EUR",
10
10
  "GBP" = "GBP",
11
+ "AUD" = "AUD",
11
12
  }
@@ -1,9 +1,5 @@
1
1
  import { ProductFilterQueryParams, ProductUserProvidedFilters } from "./types"
2
2
  import { PaginationResponseV1 } from "../common/types"
3
- import {
4
- OrderJourneyPaymentMethod,
5
- OrderJourneyStepKey,
6
- } from "../orderJourney/enums"
7
3
  import { WindowHapiUtils } from "../_window/utils.types"
8
4
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
9
5
 
@@ -6,7 +6,7 @@ export type RouterState = {
6
6
  as: string
7
7
  options: RouteTransitionOptions
8
8
  }
9
- export type RouterStoreState = {
9
+ export type RoutingState = {
10
10
  /**
11
11
  * Holds the current route "asPath" (NextJS Router related) path URL
12
12
  */