UNPKG

@trycourier/courier-ui-inbox

Version:

Inbox components for the Courier web UI

52 lines (51 loc) 3.05 kB
import { CourierInboxDatastoreEvents } from '../datastore/datatore-events'; import { CourierInboxHeaderFactoryProps, CourierInboxListItemActionFactoryProps, CourierInboxListItemFactoryProps, CourierInboxMenuButtonFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxStateLoadingFactoryProps } from '../types/factories'; import { CourierInboxFeedType } from '../types/feed-type'; import { CourierInboxTheme } from '../types/courier-inbox-theme'; export type CourierInboxPopupAlignment = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center' | 'center-right' | 'center-left' | 'center-center'; export declare class CourierInboxMenu extends HTMLElement implements CourierInboxDatastoreEvents { private _width; private _height; private _popupAlignment; private _top; private _right; private _bottom; private _left; private _themeManager; get theme(): CourierInboxTheme; setLightTheme(theme: CourierInboxTheme): void; setDarkTheme(theme: CourierInboxTheme): void; private _triggerButton; private _popup; private _inbox; private _style; private _datastoreListener?; private _popupMenuButtonFactory?; static get observedAttributes(): string[]; constructor(); private refreshTheme; private getStyles; attributeChangedCallback(name: string, oldValue: string, newValue: string): void; onUnreadCountChange(_: number): void; onMessageClick(handler?: (props: CourierInboxListItemFactoryProps) => void): void; onMessageActionClick(handler?: (props: CourierInboxListItemActionFactoryProps) => void): void; onMessageLongPress(handler?: (props: CourierInboxListItemFactoryProps) => void): void; private isValidPosition; private updatePopupPosition; private togglePopup; private handleOutsideClick; setContent(element: HTMLElement): void; setSize(width: string, height: string): void; setPosition(position: CourierInboxPopupAlignment): void; setFeedType(feedType: CourierInboxFeedType): void; setPopupHeader(factory: (props: CourierInboxHeaderFactoryProps | undefined | null) => HTMLElement): void; removePopupHeader(): void; setPopupLoadingState(factory: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => HTMLElement): void; setPopupEmptyState(factory: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => HTMLElement): void; setPopupErrorState(factory: (props: CourierInboxStateErrorFactoryProps | undefined | null) => HTMLElement): void; setPopupListItem(factory: (props: CourierInboxListItemFactoryProps | undefined | null) => HTMLElement): void; setPopupPaginationItem(factory: (props: CourierInboxPaginationItemFactoryProps | undefined | null) => HTMLElement): void; setPopupMenuButton(factory: (props: CourierInboxMenuButtonFactoryProps | undefined | null) => HTMLElement): void; private render; disconnectedCallback(): void; }