@shopify/app-bridge
Version:
**Shopify is doubling our engineering staff in 2021! [Join our team and work on libraries like this one.](https://smrtr.io/5GGrc)**
36 lines (35 loc) • 1.28 kB
TypeScript
import { ClientApplication } from '../../../client/index';
import { ActionSet } from '../../helper';
import { ActionSetProps, Component, Group, MetaAction } from '../../types';
import { Action as RedirectType, AppPayload } from '../../Navigation/Redirect';
export declare enum Action {
UPDATE = "UPDATE"
}
export interface Options {
label: string;
destination: string;
}
export interface InternalOptions extends Options {
redirectType: RedirectType;
}
export interface Payload {
readonly id: string;
label: string;
redirectType: RedirectType;
destination: AppPayload;
}
export interface UpdateAction extends MetaAction {
readonly group: typeof Group.Link;
payload: Payload;
}
export declare function update(group: string, component: Component, updatePayload: Payload): UpdateAction;
export declare class AppLink extends ActionSet implements ActionSetProps<Options, Payload> {
label: string;
destination: string;
constructor(app: ClientApplication<any>, options: Options);
get options(): InternalOptions;
get payload(): Payload;
set(options: Partial<Options>, shouldUpdate?: boolean): this;
dispatch(action: Action): this;
}
export declare function create(app: ClientApplication<any>, options: Options): AppLink;