UNPKG

@shopify/app-bridge-core

Version:

**[Join our team and work on libraries like this one.](https://www.shopify.ca/careers)**

53 lines (52 loc) 1.16 kB
import { ClientApplication } from '../../client/types'; import { ComplexDispatch, MetaAction } from '../types'; import { ActionSet } from '../ActionSet'; /** * Types */ /** * @public */ export declare enum Action { SHOW = "APP::SHARE::SHOW", CLOSE = "APP::SHARE::CLOSE" } /** * @public */ export interface TextPayload { text: string; } export interface UrlPayload { url: string; } export type InputPayload = TextPayload | UrlPayload; /** * @public */ export interface OutputPayload { success: boolean; id?: string; } /** * Action */ /** * A set of actions for displaying a Share Sheet component * @public */ export declare class Share extends ActionSet implements ComplexDispatch<InputPayload> { constructor(app: ClientApplication); /** * @public */ dispatch(action: Action.SHOW, payload: InputPayload): Share; dispatch(action: Action.CLOSE, payload: OutputPayload): Share; /** * @internal */ private dispatchShareAction; } export type ShareAction = MetaAction; export declare function show(): ShareAction; export declare function close(payload: OutputPayload): ShareAction;