@grafikr/shopify-typescript 1.0.5 → 1.1.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/global/Shopify.ts CHANGED
@@ -1,31 +1,27 @@
1
1
  import ProductJSON from '../type/Product';
2
2
  import ProductObject from '../type/object/Product';
3
+ import Image from './modules/Image';
4
+ import CustomerPrivacy from './modules/customerPrivacy';
3
5
 
4
6
  export default interface Shopify {
5
- CountryProvinceSelector: (country_domid: string, province_domid: string, options?: {
7
+ CountryProvinceSelector?: (country_domid: string, province_domid: string, options?: {
6
8
  hideElement: string
7
9
  }) => void
8
- postLink: (path: string, options?: {
10
+ postLink?: (path: string, options?: {
9
11
  method?: string
10
12
  parameters?: object
11
13
  }) => void
12
- addListener: (target: HTMLElement, eventName: string, callback: CallableFunction) => void
13
- setSelectorByValue: (selector: HTMLSelectElement, value: any) => number
14
- Image: {
15
- switchImage: CallableFunction
16
- getSizedImageUrl: (src: string, size: string) => string
17
- imageSize: (src: string) => string | null
18
- loadImage: (src: string) => void
19
- removeProtocol: (url: string) => string
20
- }
21
- OptionSelectors: (selector: string, config: {
14
+ addListener?: (target: HTMLElement, eventName: string, callback: CallableFunction) => void
15
+ setSelectorByValue?: (selector: HTMLSelectElement, value: any) => number
16
+ Image?: Image
17
+ OptionSelectors?: (selector: string, config: {
22
18
  product: ProductJSON | ProductObject
23
19
  onVariantSelected: CallableFunction
24
20
  enableHistoryState?: boolean
25
21
  }) => void
26
- OptionSelectorsFromDOM: FunctionConstructor
22
+ OptionSelectorsFromDOM?: FunctionConstructor
27
23
  loadFeatures: (features: any[], callback: CallableFunction) => void
28
- customerPrivacy?: (consented: boolean, callback: CallableFunction) => void
24
+ customerPrivacy?: CustomerPrivacy
29
25
  currency: {
30
26
  active: string
31
27
  rate: string
@@ -0,0 +1,7 @@
1
+ export default interface Image {
2
+ switchImage: CallableFunction
3
+ getSizedImageUrl: (src: string, size: string) => string
4
+ imageSize: (src: string) => string | null
5
+ loadImage: (src: string) => void
6
+ removeProtocol: (url: string) => string
7
+ }
@@ -0,0 +1,15 @@
1
+ export default interface CustomerPrivacy {
2
+ getCCPAConsent(): string
3
+ getRegulation(): string
4
+ getShopPrefs(): {
5
+ limit: string[]
6
+ }
7
+ getTrackingConsent(): string
8
+ isRegulationEnforced(): boolean
9
+ setCCPAConsent(consented: boolean, callback: CallableFunction): void
10
+ setTrackingConsent(consented: boolean, callback: CallableFunction): void
11
+ shouldShowCCPABanner(): boolean
12
+ shouldShowGDPRBanner(): boolean
13
+ userCanBeTracked(): boolean
14
+ userDataCanBeSold(): boolean
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafikr/shopify-typescript",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "lint": "node_modules/.bin/eslint . --ext .js,.ts",