UNPKG

@shopify/app-bridge-core

Version:

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

38 lines (37 loc) 1.29 kB
import { AppLink, Payload as LinkPayload } from '../../Link/AppLink'; import { ClientApplication } from '../../../client/types'; import { ActionSetWithChildren } from '../../ActionSet'; 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 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, options: Options); get options(): Options; get payload(): Payload; set(options: Partial<Options>, shouldUpdate?: boolean): this; dispatch(action: Action): this; private updateItem; private setItems; }