UNPKG

@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)**

39 lines (38 loc) 1.39 kB
import { AppLink, Payload as LinkPayload } from '../../Link/AppLink'; import { ClientApplication } from '../../../client'; import { ActionSetWithChildren } from '../../helper'; import { ActionSetProps, Group, MetaAction } from '../../types'; export declare enum Action { UPDATE = "APP::MENU::CHANNEL_MENU::UPDATE", LINK_UPDATE = "APP::MENU::CHANNEL_MENU::LINK::UPDATE" } export interface Options { items?: AppLink[]; active?: AppLink; } export interface Payload { readonly id?: string; items: LinkPayload[]; active?: string; } export interface MenuAction extends MetaAction { readonly group: typeof Group.Menu; readonly type: Action; payload: Payload; } export declare type ChannelMenuAction = MenuAction | MetaAction; export declare function update(payload: Payload): MenuAction; export declare class ChannelMenu extends ActionSetWithChildren implements ActionSetProps<Options, Payload> { private items; private active?; private itemsOptions?; private activeOptions?; constructor(app: ClientApplication<any>, options: Options); get options(): Options; get payload(): Payload; set(options: Partial<Options>, shouldUpdate?: boolean): this; dispatch(action: Action): this; private updateItem; private setItems; } export declare function create(app: ClientApplication<any>, options: Options): ChannelMenu;