import { AppBridgeBase } from '../Base'; export declare namespace global { interface Window { /** * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo * * Set an iframe's size. Depending on the context, the host page may decide * to apply or ignore the new sizes. For example, if the iframe is meant to * fill its parent container the host would ignore the request. Conversely, * if the parent container allows the iframe to fill it the host would * apply the new size. */ resizeTo(width: number, height: number): void; } interface shopify extends AppBridgeBase { /** * The references and APIs to the UI extension that helped bootstrap the iframe. */ extension: { /** * @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/configuration#how-it-works * * The unique handle name of the UI extension as defined by the developer. */ handle: string; /** * @see https://developer.mozilla.org/en-US/docs/Web/API/MessagePort * * A MessagePort instance for communicating directly to and from the UI * Extension that created the iframe. It will need to be started to begin * receiving messages. */ port: MessagePort; /** * Alias to window.resizeTo, available here for feature discovery by the * embedding app. */ resizeTo?: Window['resizeTo']; }; /** * Information about the current visitor. * * @ignore async via our RPC endpoints to ensure a secure handshake between * host and client is established. */ visitor: () => Promise; } } interface Visitor { /** * The unique token of a given user across all surfaces in a shop, present * if a user has opted-in to tracking. * * @ignore this maps to the _shopify_y cookie which Trekkie refers to as a * uniqToken. */ id?: string; } export {};