From 2885a7b263ff269bc4a0e328d7f51fd6d65deb6a Mon Sep 17 00:00:00 2001 From: Triforce Date: Mon, 4 Jun 2018 00:42:41 -0400 Subject: [PATCH] Walked Through the Product Resource documentation to add all methods and types asscoiated, as well as rearanged the interfaces in logical order with related concepts , ei Address with cart instance etc --- types/shopify-buy/index.d.ts | 57 +++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/types/shopify-buy/index.d.ts b/types/shopify-buy/index.d.ts index 55ce3fa9c2..d922263fd9 100644 --- a/types/shopify-buy/index.d.ts +++ b/types/shopify-buy/index.d.ts @@ -21,7 +21,7 @@ declare namespace ShopifyBuy { product: ShopifyBuy.ProductResource; collection: ShopifyBuy.CollectionResource; checkout: ShopifyBuy.CheckoutResource; - shop: any; + shop: ShopResource; image: Image; fetchNextPage(nextArray: T[]): T[]; } @@ -32,9 +32,11 @@ declare namespace ShopifyBuy { } export interface ProductResource { - fetch(id: string): Promise; - fetchQuery(id: Query): Promise; - fetchAll(): Promise; + fetch(id: string): Promise; + fetchAll(pageSizeopt: number): Promise; + fetchByHandle(handle: string): Promise; + fetchMultiple(ids: string[]): Promise; + fetchQuery(query: Query): Promise; } export interface CollectionResource { @@ -93,6 +95,11 @@ declare namespace ShopifyBuy { ): Promise; } + export interface ShopResource { + fetchInfo():Promise; + fetchPolicies(): Promise; + } + export interface Query { /* * query: title, collection_type, updated_at @@ -251,6 +258,12 @@ declare namespace ShopifyBuy { values: Array; } + export interface OptionValue { + name: string; + option_id: string; + value: any; + } + /* * TODO this should be solved during TDD * export interface Collection {} @@ -350,6 +363,23 @@ declare namespace ShopifyBuy { quantity: number; } + export interface Address { + address1: String; + address2: String; + city: String; + company: String; + country: String; + firstName: String; + lastName: String; + phone: String; + province: String; + zip: String; + } + + export interface Shop { + + } + /** * Internal Image description */ @@ -369,25 +399,6 @@ declare namespace ShopifyBuy { src: string; } - export interface OptionValue { - name: string; - option_id: string; - value: any; - } - - export interface Address { - address1: String; - address2: String; - city: String; - company: String; - country: String; - firstName: String; - lastName: String; - phone: String; - province: String; - zip: String; - } - /* * https://help.shopify.com/api/custom-storefronts/storefront-api/reference/input_object/attributeinput */