UNPKG

@shopify/app-bridge-host

Version:

App Bridge Host contains middleware and components that are meant to be consumed by the app's host. The middleware and `Frame` component are responsible for facilitating messages posted between the client and host, and used to act on actions sent from the

33 lines (32 loc) 1.77 kB
import { Button as AppBridgeButton, Cart } from '@shopify/app-bridge/actions'; import { AnyAction, Dispatch, MiddlewareAPI } from 'redux'; export declare const CART_PERMISSION_MESSAGE = "Missing read_orders or write_orders permission to perform this action"; type MobileMiddlewareFunction = <D extends Dispatch, S>(store: MiddlewareAPI<D, S>, next: Dispatch<AnyAction>, action: AnyAction) => any; declare global { interface Window { __MOBILE_MIDDLEWARE__: MobileMiddlewareFunction; __MOBILE_MIDDLEWARE_RESOLVER__: (middleware: MobileMiddlewareFunction) => void; } } export declare function isCartAction(action: AnyAction): boolean; export declare function isMobileMiddlewareAvailable(): boolean; export declare function isMobileMiddlewareSupported(): boolean; export declare function isMobile(): boolean; export declare function isShopifyMobile(): boolean; export declare function isShopifyPOS(): boolean; export declare function isShopifyPing(): boolean; export declare function isLegacyShopifyMobile(): boolean; export declare function isLegacyShopifyPOS(): boolean; export declare function applyPrintToLegacyButton(button: AppBridgeButton.Options): void; declare type QueueItemData = { [key: string]: any; }; export interface QueueItem { message: string; data?: QueueItemData; } export declare function buildCallbackQueueItem(message: string, action: AnyAction, data?: QueueItemData): QueueItem; export declare function buildQueueItem(message: string, data?: QueueItemData): QueueItem; export declare function traverseButtonPayload(payload: any[], onEach?: (button: any) => void, legacyMutate?: boolean): any[]; export declare function fixDiscountInCartResponse(data: any, supportBothDiscountPayload?: boolean): Cart.Data; export {};