@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.
- package/README.md +2 -2
- package/global/{Shopify.ts → Shopify.d.ts} +2 -2
- package/package.json +1 -1
- package/type/endpoints/BrowsingContextSuggestions.d.ts +3 -0
- package/type/endpoints/{Cart.ts → Cart.d.ts} +2 -2
- package/type/endpoints/{Collection.ts → Collection.d.ts} +2 -2
- package/type/endpoints/{Page.ts → Page.d.ts} +1 -1
- package/type/endpoints/Policy.d.ts +5 -0
- package/type/endpoints/{Product.ts → Product.d.ts} +1 -1
- package/type/endpoints/{Search.ts → Search.d.ts} +4 -4
- package/type/json/{Cart.ts → Cart.d.ts} +2 -2
- package/type/json/{Collection.ts → Collection.d.ts} +1 -1
- package/type/json/{DiscountAllocation.ts → DiscountAllocation.d.ts} +1 -1
- package/type/json/{LineItem.ts → LineItem.d.ts} +2 -2
- package/type/json/{Product.ts → Product.d.ts} +3 -3
- package/type/json/{ProductImage.ts → ProductImage.d.ts} +1 -1
- package/type/json/Search/{Article.ts → Article.d.ts} +2 -2
- package/type/json/Search/Collection.d.ts +7 -0
- package/type/json/Search/{Page.ts → Page.d.ts} +1 -1
- package/type/json/Search/{Product.ts → Product.d.ts} +3 -3
- package/type/json/Search/{ProductVariant.ts → ProductVariant.d.ts} +1 -1
- package/type/liquid/{Article.ts → Article.d.ts} +1 -1
- package/type/liquid/{Collection.ts → Collection.d.ts} +1 -1
- package/type/liquid/{FeaturedVariantMedia.ts → FeaturedVariantMedia.d.ts} +1 -1
- package/type/liquid/{Product.ts → Product.d.ts} +2 -2
- package/type/liquid/{ProductMedia.ts → ProductMedia.d.ts} +1 -1
- package/type/liquid/{ProductVariant.ts → ProductVariant.d.ts} +2 -2
- package/type/endpoints/BrowsingContextSuggestions.ts +0 -3
- package/type/endpoints/Policy.ts +0 -5
- package/type/json/Search/Collection.ts +0 -7
- /package/global/{CustomEvents.ts → CustomEvents.d.ts} +0 -0
- /package/global/modules/{customerPrivacy.ts → customerPrivacy.d.ts} +0 -0
- /package/type/json/{BrowsingContextSuggestions.ts → BrowsingContextSuggestions.d.ts} +0 -0
- /package/type/json/{DiscountApplication.ts → DiscountApplication.d.ts} +0 -0
- /package/type/json/{FeaturedImage.ts → FeaturedImage.d.ts} +0 -0
- /package/type/json/{Image.ts → Image.d.ts} +0 -0
- /package/type/json/{Page.ts → Page.d.ts} +0 -0
- /package/type/json/{Policy.ts → Policy.d.ts} +0 -0
- /package/type/json/{ProductOption.ts → ProductOption.d.ts} +0 -0
- /package/type/json/{ProductVariant.ts → ProductVariant.d.ts} +0 -0
- /package/type/json/Search/{SearchItem.ts → SearchItem.d.ts} +0 -0
- /package/type/liquid/{FeaturedVariantImage.ts → FeaturedVariantImage.d.ts} +0 -0
- /package/type/liquid/{Image.ts → Image.d.ts} +0 -0
- /package/type/liquid/{Pagination.ts → Pagination.d.ts} +0 -0
- /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
|
|
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:
|
|
6
|
+
callback: (error?: Error | null) => void,
|
|
7
7
|
) => void;
|
|
8
8
|
customerPrivacy?: CustomerPrivacy;
|
|
9
9
|
currency: {
|
package/package.json
CHANGED
|
@@ -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,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,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,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,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;
|
package/type/endpoints/Policy.ts
DELETED
|
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
|