@vonq/hapi-elements-types 1.6.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 +21 -0
- package/{src/_window → _window}/sdk.types.ts +9 -0
- package/{src/_window → _window}/state.types.ts +1 -0
- package/{src/ats → ats}/types.ts +1 -1
- package/{src/basket → basket}/state.types.ts +4 -0
- package/package.json +2 -2
- package/{src/product → product}/enums.ts +1 -0
- package/{src/product → product}/utils.types.ts +0 -4
- package/{src/routing → routing}/state.types.ts +1 -1
- package/{src/theming → theming}/types.ts +38 -1
- package/tsconfig.json +1 -1
- /package/{src/_window → _window}/api.types.ts +0 -0
- /package/{src/_window → _window}/auth.types.ts +0 -0
- /package/{src/_window → _window}/config.types.ts +0 -0
- /package/{src/_window → _window}/events.types.ts +0 -0
- /package/{src/_window → _window}/index.ts +0 -0
- /package/{src/_window → _window}/instances.types.ts +0 -0
- /package/{src/_window → _window}/qa.types.ts +0 -0
- /package/{src/_window → _window}/routing.types.ts +0 -0
- /package/{src/_window → _window}/service.types.ts +0 -0
- /package/{src/_window → _window}/ui.types.ts +0 -0
- /package/{src/_window → _window}/utils.types.ts +0 -0
- /package/{src/_window → _window}/validation.types.ts +0 -0
- /package/{src/_window → _window}/window.ts +0 -0
- /package/{src/alert → alert}/enums.ts +0 -0
- /package/{src/alert → alert}/index.ts +0 -0
- /package/{src/alert → alert}/service.types.ts +0 -0
- /package/{src/alert → alert}/state.types.ts +0 -0
- /package/{src/alert → alert}/types.ts +0 -0
- /package/{src/ats → ats}/api.types.ts +0 -0
- /package/{src/ats → ats}/index.ts +0 -0
- /package/{src/ats → ats}/service.types.ts +0 -0
- /package/{src/ats → ats}/state.types.ts +0 -0
- /package/{src/basket → basket}/index.ts +0 -0
- /package/{src/basket → basket}/service.types.ts +0 -0
- /package/{src/basket → basket}/types.ts +0 -0
- /package/{src/basket → basket}/utils.types.ts +0 -0
- /package/{src/basket → basket}/validations.types.ts +0 -0
- /package/{src/campaign → campaign}/api.types.ts +0 -0
- /package/{src/campaign → campaign}/enums.ts +0 -0
- /package/{src/campaign → campaign}/index.ts +0 -0
- /package/{src/campaign → campaign}/qa.types.ts +0 -0
- /package/{src/campaign → campaign}/service.types.ts +0 -0
- /package/{src/campaign → campaign}/state.types.ts +0 -0
- /package/{src/campaign → campaign}/types.ts +0 -0
- /package/{src/campaign → campaign}/utils.types.ts +0 -0
- /package/{src/campaign → campaign}/validations.types.ts +0 -0
- /package/{src/common → common}/enums.ts +0 -0
- /package/{src/common → common}/events/EventCommand/enums.ts +0 -0
- /package/{src/common → common}/events/EventCommand/index.ts +0 -0
- /package/{src/common → common}/events/EventCommand/types.ts +0 -0
- /package/{src/common → common}/events/index.ts +0 -0
- /package/{src/common → common}/events/types.ts +0 -0
- /package/{src/common → common}/index.ts +0 -0
- /package/{src/common → common}/logger/enums.ts +0 -0
- /package/{src/common → common}/logger/types.ts +0 -0
- /package/{src/common → common}/qa.types.ts +0 -0
- /package/{src/common → common}/types.ts +0 -0
- /package/{src/common → common}/validations.types.ts +0 -0
- /package/{src/common → common}/validator/types.ts +0 -0
- /package/{src/contract → contract}/api.types.ts +0 -0
- /package/{src/contract → contract}/index.ts +0 -0
- /package/{src/contract → contract}/qa.types.ts +0 -0
- /package/{src/contract → contract}/service.types.ts +0 -0
- /package/{src/contract → contract}/state.types.ts +0 -0
- /package/{src/contract → contract}/types.ts +0 -0
- /package/{src/contract → contract}/utils.types.ts +0 -0
- /package/{src/contract → contract}/validations.types.ts +0 -0
- /package/{src/debugging → debugging}/index.ts +0 -0
- /package/{src/debugging → debugging}/state.types.ts +0 -0
- /package/{src/index.ts → index.ts} +0 -0
- /package/{src/language → language}/index.ts +0 -0
- /package/{src/language → language}/qa.types.ts +0 -0
- /package/{src/language → language}/state.types.ts +0 -0
- /package/{src/language → language}/validations.types.ts +0 -0
- /package/{src/modal → modal}/enums.ts +0 -0
- /package/{src/modal → modal}/index.ts +0 -0
- /package/{src/modal → modal}/service.types.ts +0 -0
- /package/{src/modal → modal}/state.types.ts +0 -0
- /package/{src/modal → modal}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/enums.ts +0 -0
- /package/{src/orderJourney → orderJourney}/index.ts +0 -0
- /package/{src/orderJourney → orderJourney}/qa.types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/state.types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/utils.types.ts +0 -0
- /package/{src/orderJourney → orderJourney}/validations.types.ts +0 -0
- /package/{src/product → product}/api.types.ts +0 -0
- /package/{src/product → product}/index.ts +0 -0
- /package/{src/product → product}/qa.types.ts +0 -0
- /package/{src/product → product}/service.types.ts +0 -0
- /package/{src/product → product}/state.types.ts +0 -0
- /package/{src/product → product}/types.ts +0 -0
- /package/{src/product → product}/validations.types.ts +0 -0
- /package/{src/routing → routing}/index.ts +0 -0
- /package/{src/theming → theming}/index.ts +0 -0
- /package/{src/theming → theming}/qa.types.ts +0 -0
- /package/{src/theming → theming}/state.types.ts +0 -0
- /package/{src/theming → theming}/validations.types.ts +0 -0
- /package/{src/ui → ui}/index.ts +0 -0
- /package/{src/ui → ui}/service.types.ts +0 -0
- /package/{src/wallet → wallet}/api.types.ts +0 -0
- /package/{src/wallet → wallet}/index.ts +0 -0
- /package/{src/wallet → wallet}/service.types.ts +0 -0
- /package/{src/wallet → wallet}/state.types.ts +0 -0
- /package/{src/wallet → wallet}/types.ts +0 -0
- /package/{src/wallet → wallet}/validations.types.ts +0 -0
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
|
package/{src/ats → ats}/types.ts
RENAMED
@@ -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.
|
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",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"publish:types": "npm publish --access public",
|
13
13
|
"generate:index": "cti create ./src"
|
14
14
|
},
|
15
|
-
"main": "
|
15
|
+
"main": "index.ts",
|
16
16
|
"types": "index.d.ts",
|
17
17
|
"dependencies": {
|
18
18
|
"@datadog/browser-logs": "^4.34.2",
|
@@ -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
|
|
@@ -1,4 +1,41 @@
|
|
1
|
-
import
|
1
|
+
import * as React from "react"
|
2
|
+
|
3
|
+
type DefaultTheme = object | null
|
4
|
+
|
5
|
+
type WithThemeFactory<Theme> = <
|
6
|
+
InnerProps extends { theme: NonNullable<Theme> },
|
7
|
+
InnerComponent extends React.ComponentType<InnerProps>,
|
8
|
+
OuterProps extends InnerProps & { theme?: NonNullable<Theme> },
|
9
|
+
>(
|
10
|
+
comp: InnerComponent,
|
11
|
+
) => React.ComponentType<OuterProps>
|
12
|
+
|
13
|
+
interface ThemeProviderProps<Theme> {
|
14
|
+
theme: NonNullable<Theme> | ((outerTheme: Theme) => NonNullable<Theme>)
|
15
|
+
children: React.ReactNode
|
16
|
+
}
|
17
|
+
|
18
|
+
type ThemeProviderFactory<Theme> = React.ComponentType<
|
19
|
+
ThemeProviderProps<Theme>
|
20
|
+
>
|
21
|
+
|
22
|
+
type UseThemeFactory<Theme> = <CustomTheme = Theme>() => CustomTheme
|
23
|
+
|
24
|
+
interface Theming<Theme> {
|
25
|
+
context: React.Context<Theme>
|
26
|
+
withTheme: WithThemeFactory<Theme>
|
27
|
+
ThemeProvider: ThemeProviderFactory<Theme>
|
28
|
+
useTheme: UseThemeFactory<Theme>
|
29
|
+
}
|
30
|
+
|
31
|
+
declare function createTheming<Theme>(
|
32
|
+
context: React.Context<Theme>,
|
33
|
+
): Theming<Theme>
|
34
|
+
|
35
|
+
declare const withTheme: WithThemeFactory<DefaultTheme>
|
36
|
+
declare const ThemeProvider: ThemeProviderFactory<DefaultTheme>
|
37
|
+
declare const ThemeContext: React.Context<DefaultTheme>
|
38
|
+
declare const useTheme: UseThemeFactory<DefaultTheme>
|
2
39
|
|
3
40
|
export type ThemeGlobalStyles = {
|
4
41
|
borderRadius: string
|
package/tsconfig.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/{src/ui → ui}/index.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|