mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
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
This commit is contained in:
Vendored
+34
-23
@@ -21,7 +21,7 @@ declare namespace ShopifyBuy {
|
||||
product: ShopifyBuy.ProductResource;
|
||||
collection: ShopifyBuy.CollectionResource;
|
||||
checkout: ShopifyBuy.CheckoutResource;
|
||||
shop: any;
|
||||
shop: ShopResource;
|
||||
image: Image;
|
||||
fetchNextPage<T extends GraphModel>(nextArray: T[]): T[];
|
||||
}
|
||||
@@ -32,9 +32,11 @@ declare namespace ShopifyBuy {
|
||||
}
|
||||
|
||||
export interface ProductResource {
|
||||
fetch(id: string): Promise<Product[]>;
|
||||
fetchQuery(id: Query): Promise<Product[]>;
|
||||
fetchAll(): Promise<Product[]>;
|
||||
fetch(id: string): Promise<Product>;
|
||||
fetchAll(pageSizeopt: number): Promise<Product[]>;
|
||||
fetchByHandle(handle: string): Promise<Product>;
|
||||
fetchMultiple(ids: string[]): Promise<Product[]>;
|
||||
fetchQuery(query: Query): Promise<Product[]>;
|
||||
}
|
||||
|
||||
export interface CollectionResource {
|
||||
@@ -93,6 +95,11 @@ declare namespace ShopifyBuy {
|
||||
): Promise<Cart>;
|
||||
}
|
||||
|
||||
export interface ShopResource {
|
||||
fetchInfo():Promise<Shop>;
|
||||
fetchPolicies(): Promise<Shop>;
|
||||
}
|
||||
|
||||
export interface Query {
|
||||
/*
|
||||
* query: title, collection_type, updated_at
|
||||
@@ -251,6 +258,12 @@ declare namespace ShopifyBuy {
|
||||
values: Array<any>;
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user