@shopify/app-bridge
Version:
[](https://travis-ci.com/Shopify/app-bridge) [](https:
133 lines (132 loc) • 3.35 kB
TypeScript
/**
* @module ResourcePicker
*/
export declare enum Action {
OPEN = "OPEN",
SELECT = "SELECT",
CLOSE = "CLOSE",
UPDATE = "UPDATE",
}
export declare enum ActionType {
OPEN = "APP::RESOURCE_PICKER::OPEN",
SELECT = "APP::RESOURCE_PICKER::SELECT",
CLOSE = "APP::RESOURCE_PICKER::CLOSE",
UPDATE = "APP::RESOURCE_PICKER::UPDATE",
}
export declare type Money = string;
export declare enum FulfillmentServiceType {
GiftCard = "GIFT_CARD",
Manual = "MANUAL",
ThirdParty = "THIRD_PARTY",
}
export declare enum WeightUnit {
Kilograms = "KILOGRAMS",
Grams = "GRAMS",
Pounds = "POUNDS",
Ounces = "OUNCES",
}
export declare enum ProductVariantInventoryPolicy {
Deny = "DENY",
Continue = "CONTINUE",
}
export declare enum ProductVariantInventoryManagement {
Shopify = "SHOPIFY",
NotManaged = "NOT_MANAGED",
FulfillmentService = "FULFILLMENT_SERVICE",
}
export interface Image {
id: string;
altText?: string;
originalSrc: string;
}
export interface Resource {
id: string;
createdAt: string;
updatedAt: string;
}
export interface ProductVariant extends Resource {
availableForSale: boolean;
barcode?: string | null;
compareAtPrice?: Money | null;
displayName: string;
fulfillmentService?: {
id: string;
inventoryManagement: boolean;
productBased: boolean;
serviceName: string;
type: FulfillmentServiceType;
};
image?: Image | null;
inventoryItem: {
id: string;
};
inventoryManagement: ProductVariantInventoryManagement;
inventoryPolicy: ProductVariantInventoryPolicy;
inventoryQuantity?: number | null;
position: number;
price: Money;
product: Partial<Product>;
requiresShipping: boolean;
selectedOptions: {
value?: string | null;
}[];
sku?: string | null;
taxable: boolean;
title: string;
weight?: number | null;
weightUnit: WeightUnit;
}
export interface Product extends Resource {
availablePublicationCount: number;
descriptionHtml: string;
handle: string;
hasOnlyDefaultVariant: boolean;
images: Image[];
options: {
id: string;
name: string;
position: number;
values: string[];
}[];
productType: string;
publishedAt?: string | null;
tags: string[];
templateSuffix?: string | null;
title: string;
totalInventory: number;
tracksInventory: boolean;
variants: Partial<ProductVariant>[];
vendor: string;
}
export declare type Collection = Resource;
export interface ClosePayload {
readonly id?: string;
}
export interface Payload {
readonly id?: string;
initialQuery?: string;
title?: string;
selectMultiple?: boolean;
showHidden?: boolean;
resourceType: ResourceType;
}
export declare type ResourceSelection = Product | ProductVariant | Collection;
export interface SelectPayload {
readonly id?: string;
selection: ResourceSelection[];
}
export interface Options {
initialQuery?: string;
title?: string;
showHidden?: boolean;
selectMultiple?: boolean;
}
export interface BaseOptions {
resourceType: ResourceType;
options: Options;
}
export declare enum ResourceType {
Product = "product",
ProductVariant = "variant",
Collection = "collection",
}