@grafikr/shopify-typescript 2.0.0 → 2.1.1

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.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/global/{Shopify.ts → Shopify.d.ts} +2 -2
  3. package/package.json +1 -1
  4. package/type/endpoints/BrowsingContextSuggestions.d.ts +3 -0
  5. package/type/endpoints/{Cart.ts → Cart.d.ts} +2 -2
  6. package/type/endpoints/{Collection.ts → Collection.d.ts} +2 -2
  7. package/type/endpoints/{Page.ts → Page.d.ts} +1 -1
  8. package/type/endpoints/Policy.d.ts +5 -0
  9. package/type/endpoints/{Product.ts → Product.d.ts} +1 -1
  10. package/type/endpoints/{Search.ts → Search.d.ts} +4 -4
  11. package/type/json/{Cart.ts → Cart.d.ts} +2 -2
  12. package/type/json/{Collection.ts → Collection.d.ts} +1 -1
  13. package/type/json/{DiscountAllocation.ts → DiscountAllocation.d.ts} +1 -1
  14. package/type/json/{LineItem.ts → LineItem.d.ts} +2 -2
  15. package/type/json/{Product.ts → Product.d.ts} +3 -3
  16. package/type/json/{ProductImage.ts → ProductImage.d.ts} +1 -1
  17. package/type/json/Search/{Article.ts → Article.d.ts} +2 -2
  18. package/type/json/Search/Collection.d.ts +7 -0
  19. package/type/json/Search/{Page.ts → Page.d.ts} +1 -1
  20. package/type/json/Search/{Product.ts → Product.d.ts} +3 -3
  21. package/type/json/Search/{ProductVariant.ts → ProductVariant.d.ts} +1 -1
  22. package/type/liquid/{Article.ts → Article.d.ts} +1 -1
  23. package/type/liquid/{Collection.ts → Collection.d.ts} +1 -1
  24. package/type/liquid/{FeaturedVariantMedia.ts → FeaturedVariantMedia.d.ts} +1 -1
  25. package/type/liquid/{Product.ts → Product.d.ts} +2 -2
  26. package/type/liquid/{ProductMedia.ts → ProductMedia.d.ts} +1 -1
  27. package/type/liquid/{ProductVariant.ts → ProductVariant.d.ts} +2 -2
  28. package/type/endpoints/BrowsingContextSuggestions.ts +0 -3
  29. package/type/endpoints/Policy.ts +0 -5
  30. package/type/json/Search/Collection.ts +0 -7
  31. /package/global/{CustomEvents.ts → CustomEvents.d.ts} +0 -0
  32. /package/global/modules/{customerPrivacy.ts → customerPrivacy.d.ts} +0 -0
  33. /package/type/json/{BrowsingContextSuggestions.ts → BrowsingContextSuggestions.d.ts} +0 -0
  34. /package/type/json/{DiscountApplication.ts → DiscountApplication.d.ts} +0 -0
  35. /package/type/json/{FeaturedImage.ts → FeaturedImage.d.ts} +0 -0
  36. /package/type/json/{Image.ts → Image.d.ts} +0 -0
  37. /package/type/json/{Page.ts → Page.d.ts} +0 -0
  38. /package/type/json/{Policy.ts → Policy.d.ts} +0 -0
  39. /package/type/json/{ProductOption.ts → ProductOption.d.ts} +0 -0
  40. /package/type/json/{ProductVariant.ts → ProductVariant.d.ts} +0 -0
  41. /package/type/json/Search/{SearchItem.ts → SearchItem.d.ts} +0 -0
  42. /package/type/liquid/{FeaturedVariantImage.ts → FeaturedVariantImage.d.ts} +0 -0
  43. /package/type/liquid/{Image.ts → Image.d.ts} +0 -0
  44. /package/type/liquid/{Pagination.ts → Pagination.d.ts} +0 -0
  45. /package/type/liquid/{PreviewImage.ts → PreviewImage.d.ts} +0 -0
package/README.md CHANGED
@@ -7,13 +7,13 @@ This packages adds TypeScript for all Shopify responses and objects.
7
7
  You can install the package using Yarn:
8
8
 
9
9
  ```
10
- $ yarn install @grafikr/shopify-typescript --save
10
+ $ yarn install @grafikr/shopify-typescript
11
11
  ```
12
12
 
13
13
  ### Usage
14
14
 
15
15
  ```ts
16
- import Product from '@grafikr/shopify-typescript/type/Product';
16
+ import type { Product } from '@grafikr/shopify-typescript/type/json/Product';
17
17
 
18
18
  const func = (data: Product) => {
19
19
  ...
@@ -1,9 +1,9 @@
1
- import { CustomerPrivacy } from './modules/customerPrivacy';
1
+ import type { CustomerPrivacy } from './modules/customerPrivacy';
2
2
 
3
3
  export type Shopify = {
4
4
  loadFeatures: (
5
5
  features: Array<{ name: string; version: string }>,
6
- callback: CallableFunction,
6
+ callback: (error?: Error | null) => void,
7
7
  ) => void;
8
8
  customerPrivacy?: CustomerPrivacy;
9
9
  currency: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafikr/shopify-typescript",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "format": "yarn prettier . --write"
@@ -0,0 +1,3 @@
1
+ import type { BrowsingContextSuggestions as BrowsingContextSuggestionsType } from '../json/BrowsingContextSuggestions';
2
+
3
+ export type BrowsingContextSuggestions = BrowsingContextSuggestionsType;
@@ -1,9 +1,9 @@
1
- import {
1
+ import type {
2
2
  Cart as CartType,
3
3
  UpdatedCart as UpdatedCartType,
4
4
  CartError as CartErrorType,
5
5
  } from '../json/Cart';
6
- import { UpdatedLineItem } from '../json/LineItem';
6
+ import type { UpdatedLineItem } from '../json/LineItem';
7
7
 
8
8
  export type Cart = CartType;
9
9
 
@@ -1,5 +1,5 @@
1
- import { Collection as CollectionType } from '../json/Collection';
2
- import { Product as ProductType } from '../json/Product';
1
+ import type { Collection as CollectionType } from '../json/Collection';
2
+ import type { Product as ProductType } from '../json/Product';
3
3
 
4
4
  export type Collection = {
5
5
  collection: CollectionType;
@@ -1,4 +1,4 @@
1
- import { Page as PageType } from '../json/Page';
1
+ import type { Page as PageType } from '../json/Page';
2
2
 
3
3
  export type Page = {
4
4
  page: PageType;
@@ -0,0 +1,5 @@
1
+ import type { Policy as PolicyType } from '../json/Policy';
2
+
3
+ export type Policy = {
4
+ policy: PolicyType;
5
+ };
@@ -1,4 +1,4 @@
1
- import { Product as ProductType } from '../json/Product';
1
+ import type { Product as ProductType } from '../json/Product';
2
2
 
3
3
  export type Product = {
4
4
  product: ProductType;
@@ -1,7 +1,7 @@
1
- import { Article as ArticleType } from '../json/Search/Article';
2
- import { Collection as CollectionType } from '../json/Search/Collection';
3
- import { Page as PageType } from '../json/Search/Page';
4
- import { Product as ProductType } from '../json/Search/Product';
1
+ import type { Article as ArticleType } from '../json/Search/Article';
2
+ import type { Collection as CollectionType } from '../json/Search/Collection';
3
+ import type { Page as PageType } from '../json/Search/Page';
4
+ import type { Product as ProductType } from '../json/Search/Product';
5
5
 
6
6
  export type Suggest = {
7
7
  resources: {
@@ -1,5 +1,5 @@
1
- import { LineItem, UpdatedLineItem } from './LineItem';
2
- import { DiscountApplication } from './DiscountApplication';
1
+ import type { LineItem, UpdatedLineItem } from './LineItem';
2
+ import type { DiscountApplication } from './DiscountApplication';
3
3
 
4
4
  export type Cart = {
5
5
  token: string;
@@ -1,4 +1,4 @@
1
- import { Image } from './Image';
1
+ import type { Image } from './Image';
2
2
 
3
3
  export type Collection = {
4
4
  id: number;
@@ -1,4 +1,4 @@
1
- import { DiscountApplication } from './DiscountApplication';
1
+ import type { DiscountApplication } from './DiscountApplication';
2
2
 
3
3
  export type DiscountAllocation = {
4
4
  amount: number;
@@ -1,5 +1,5 @@
1
- import { DiscountAllocation } from './DiscountAllocation';
2
- import { FeaturedImage } from './FeaturedImage';
1
+ import type { DiscountAllocation } from './DiscountAllocation';
2
+ import type { FeaturedImage } from './FeaturedImage';
3
3
 
4
4
  export type LineItem = {
5
5
  id: number;
@@ -1,6 +1,6 @@
1
- import { ProductVariant } from './ProductVariant';
2
- import { ProductOption } from './ProductOption';
3
- import { ProductImage } from './ProductImage';
1
+ import type { ProductVariant } from './ProductVariant';
2
+ import type { ProductOption } from './ProductOption';
3
+ import type { ProductImage } from './ProductImage';
4
4
 
5
5
  export type Product = {
6
6
  id: number;
@@ -1,4 +1,4 @@
1
- import { Image } from './Image';
1
+ import type { Image } from './Image';
2
2
 
3
3
  export type ProductImage = Image & {
4
4
  product_id: number;
@@ -1,5 +1,5 @@
1
- import { SearchItem } from './SearchItem';
2
- import { FeaturedImage } from '../FeaturedImage';
1
+ import type { SearchItem } from './SearchItem';
2
+ import type { FeaturedImage } from '../FeaturedImage';
3
3
 
4
4
  export type Article = SearchItem & {
5
5
  author: string;
@@ -0,0 +1,7 @@
1
+ import type { SearchItem } from './SearchItem';
2
+ import type { FeaturedImage } from '../FeaturedImage';
3
+
4
+ export type Collection = SearchItem & {
5
+ published_at: string;
6
+ featured_image: FeaturedImage;
7
+ };
@@ -1,4 +1,4 @@
1
- import { SearchItem } from './SearchItem';
1
+ import type { SearchItem } from './SearchItem';
2
2
 
3
3
  export type Page = SearchItem & {
4
4
  author: null;
@@ -1,6 +1,6 @@
1
- import { FeaturedImage } from '../FeaturedImage';
2
- import { SearchItem } from './SearchItem';
3
- import { ProductVariant } from './ProductVariant';
1
+ import type { FeaturedImage } from '../FeaturedImage';
2
+ import type { SearchItem } from './SearchItem';
3
+ import type { ProductVariant } from './ProductVariant';
4
4
 
5
5
  export type Product = SearchItem & {
6
6
  available: boolean;
@@ -1,4 +1,4 @@
1
- import { FeaturedImage } from '../FeaturedImage';
1
+ import type { FeaturedImage } from '../FeaturedImage';
2
2
 
3
3
  export type ProductVariant = {
4
4
  available: true;
@@ -1,4 +1,4 @@
1
- import { Image } from './Image';
1
+ import type { Image } from './Image';
2
2
 
3
3
  export type Article = {
4
4
  id: number;
@@ -1,4 +1,4 @@
1
- import { Image } from './Image';
1
+ import type { Image } from './Image';
2
2
 
3
3
  export type Collection = {
4
4
  id: number;
@@ -1,4 +1,4 @@
1
- import { PreviewImage } from './PreviewImage';
1
+ import type { PreviewImage } from './PreviewImage';
2
2
 
3
3
  export type FeaturedVariantMedia = {
4
4
  alt: string | null;
@@ -1,5 +1,5 @@
1
- import { ProductVariant } from './ProductVariant';
2
- import { ProductMedia } from './ProductMedia';
1
+ import type { ProductVariant } from './ProductVariant';
2
+ import type { ProductMedia } from './ProductMedia';
3
3
 
4
4
  export type Product = {
5
5
  id: number;
@@ -1,4 +1,4 @@
1
- import { PreviewImage } from './PreviewImage';
1
+ import type { PreviewImage } from './PreviewImage';
2
2
 
3
3
  export type ProductMedia = {
4
4
  alt: string | null;
@@ -1,5 +1,5 @@
1
- import { FeaturedVariantImage } from './FeaturedVariantImage';
2
- import { FeaturedVariantMedia } from './FeaturedVariantMedia';
1
+ import type { FeaturedVariantImage } from './FeaturedVariantImage';
2
+ import type { FeaturedVariantMedia } from './FeaturedVariantMedia';
3
3
 
4
4
  export type ProductVariant = {
5
5
  id: number;
@@ -1,3 +0,0 @@
1
- import { BrowsingContextSuggestions as BrowsingContextSuggestionsType } from '../json/BrowsingContextSuggestions';
2
-
3
- export type BrowsingContextSuggestions = BrowsingContextSuggestionsType;
@@ -1,5 +0,0 @@
1
- import { Policy as PolicyType } from '../json/Policy';
2
-
3
- export type Policy = {
4
- policy: PolicyType;
5
- };
@@ -1,7 +0,0 @@
1
- import { SearchItem } from './SearchItem';
2
- import { FeaturedImage } from '../FeaturedImage';
3
-
4
- export type Collection = SearchItem & {
5
- published_at: string;
6
- featured_image: FeaturedImage;
7
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes