UNPKG

@open-tender/cloud

Version:

A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.

322 lines (321 loc) 17.1 kB
import { AppTheme, ConfigApp, ConfigBrand, ConfigContent, ConfigPage, ConfigPageType, ConfigPages, ConfigSettings, RequestError, RequestStatus, Theme } from '@open-tender/types'; import { AppState } from '../app'; export interface ConfigState { api: any; app: ConfigApp | null; appTheme: AppTheme | null; brand: ConfigBrand | null; content: ConfigContent | null; error: any; isApp: boolean | undefined; isBackgroundFetch: boolean; loading: RequestStatus; pages: ConfigPages | null; retries: number; settings: ConfigSettings | null; stylesheet: string | null; theme: Theme | null; } export declare enum ConfigActionType { FetchConfig = "config/getConfig" } export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigState, { baseUrl?: string | undefined; authUrl?: string | undefined; clientId?: string | undefined; brandId?: string | undefined; callback?: (() => void) | undefined; isApp?: boolean | undefined; }, { state: AppState; rejectValue: RequestError; dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined; extra?: unknown; serializedErrorType?: unknown; pendingMeta?: unknown; fulfilledMeta?: unknown; rejectedMeta?: unknown; }>; export declare const resetConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetConfig">, resetRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/resetRetries">, incrementRetries: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"config/incrementRetries">; export declare const selectConfig: (state: AppState) => ConfigState; export declare const selectBrand: (state: AppState) => ConfigBrand | null; export declare const selectTheme: (state: AppState) => Theme | null; export declare const selectContent: (state: AppState) => ConfigContent | null; export declare const selectSettings: (state: AppState) => ConfigSettings | null; export declare const selectStylesheet: (state: AppState) => string | null; export declare const selectPages: (state: AppState) => ConfigPages | null; export declare const selectApi: (state: AppState) => any; export declare const selectAccountConfig: (state: AppState) => { addresses: import("@open-tender/types").ConfigContentField; allergens: import("@open-tender/types").ConfigContentField; background: string; content: string; creditCards: import("@open-tender/types").ConfigContentField; deals: import("@open-tender/types").ConfigContentField; displayLogo: boolean; displayLogoApp: boolean; displayLogoMobile: boolean; displayed: import("@open-tender/types").AccountSections; displayedMobile: import("@open-tender/types").AccountSections; favorites: import("@open-tender/types").ConfigContentField; giftCards: import("@open-tender/types").ConfigContentField; greeting: string; groupOrders: import("@open-tender/types").ConfigContentField; houseAccounts: import("@open-tender/types").ConfigContentField; levelup: import("@open-tender/types").ConfigContentField; loyalty: { signUp: string; title: string; subtitle: string; skip: string; }; mobile: string; pointsShop: import("@open-tender/types").ConfigContentField; profile: import("@open-tender/types").ConfigContentField; punctuation: string; recentItems: import("@open-tender/types").ConfigContentField; recentOrders: import("@open-tender/types").ConfigContentField; rewards: import("@open-tender/types").ConfigContentField; showFirstName: boolean; showHero: boolean; subtitle: string; thanx: import("@open-tender/types").ConfigContentField; title: string; videoUrl: string; videoUrlMobile: string; useAppHomeHeading: boolean; } | undefined; export declare const selectCateringOnly: (state: AppState) => boolean; export declare const selectDisplaySettings: (state: AppState) => import("@open-tender/types").ConfigDisplaySetting | undefined; export declare const selectConfigRetries: (state: AppState) => number; export declare const selectLightColor: (state: AppState) => string; export declare const selectOptIns: ((state: import("redux").EmptyObject & { alerts: import("@open-tender/types").Alerts; allergens: import("./allergens").AllergensState; announcements: import("./announcements").AnnouncementsState; checkout: import("./checkout").CheckoutState; completedOrders: import("./completedOrders").CompletedOrdersState; config: ConfigState; confirmation: import("./confirmation").ConfirmationState; customer: import("redux").CombinedState<{ account: import("./customer").AccountState; communicationPreferences: import("./customer").CustomerCommunicationPrefsState; creditCards: import("./customer").CustomerCreditCardsState; allergens: import("./customer").CustomerAllergensState; addresses: import("./customer").CustomerAddressesState; favorites: import("./customer").CustomerFavoritesState; fcmToken: import("./customer").CustomerFcmTokenState; giftCards: import("./customer").CustomerGiftCardsState; groupOrders: import("./customer").CustomerGroupOrdersState; history: import("./customer").CustomerHistoryState; houseAccounts: import("./customer").CustomerHouseAccountsState; loyalty: import("./customer").CustomerLoyaltyState; order: import("./customer").CustomerOrderState; orders: import("./customer").CustomerOrdersState; pointsShop: import("./customer").PointsShopState; tplsPointsShop: import("./customer").TplsPointsShopState; qrcode: import("./customer").CustomerQRCodeState; rewards: import("./customer").CustomerRewardsState; thanx: import("./customer").CustomerThanxState; tpls: import("./customer").CustomerTplsState; }>; deals: import("./deals").DealsState; donations: import("./donations").DonationState; geolocation: import("./geolocation").GeoLocationState; giftCards: import("./giftCards").GiftCardsState; groupOrder: import("./groupOrder").GroupOrderState; guest: import("./guest").GuestState; loader: import("./loader").LoaderState; menu: import("./menu").MenuState; menuDisplay: import("./menuDisplay").MenuDisplayState; menuItems: import("./menuItems").MenuItemsState; modal: import("@open-tender/types").Modal; misc: import("./misc").MiscState; nav: import("./nav").NavState; navSite: import("./navSite").NavSiteState; notifications: import("@open-tender/types").Notifications; oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState; order: import("./order").OrderState; orderFulfillment: import("./orderFulfillment").OrderFulfillmentState; orderRating: import("./orderRating").OrderRatingState; posts: import("./posts").PostsSlice; pushNotifications: import("./pushNotifications").PushNotificationsState; qr: import("./qr").QrState; quote: import("./quote").QuoteState; resetPassword: import("./resetPassword").ResetPasswordState; revenueCenters: import("./revenueCenters").RevenueCentersState; rewardCode: import("./rewardCode").RewardCodeState; sidebar: import("./sidebar").SidebarState; sidebarModal: import("./sidebarModal").SidebarModalState; signUp: import("./signUp").SignUpState; tags: import("./tags").TagsState; terms: import("./terms").TermsSlice; Unsubscribe: import("./unsubscribe").UnsubscribeState; validTimes: import("./validTimes").ValidTimesState; verifyAccount: import("./verifyAccount").VerifyAccountState; }) => { accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | null | undefined; order_notifications: import("@open-tender/types").ConfigOrderNotifications | null | undefined; }) & import("reselect").OutputSelectorFields<(args_0: { accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | null | undefined; order_notifications: import("@open-tender/types").ConfigOrderNotifications | null | undefined; }) => { accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | null | undefined; order_notifications: import("@open-tender/types").ConfigOrderNotifications | null | undefined; }, { clearCache: () => void; }> & { clearCache: () => void; }; export declare const selectShowLoyalty: ((state: import("redux").EmptyObject & { alerts: import("@open-tender/types").Alerts; allergens: import("./allergens").AllergensState; announcements: import("./announcements").AnnouncementsState; checkout: import("./checkout").CheckoutState; completedOrders: import("./completedOrders").CompletedOrdersState; config: ConfigState; confirmation: import("./confirmation").ConfirmationState; customer: import("redux").CombinedState<{ account: import("./customer").AccountState; communicationPreferences: import("./customer").CustomerCommunicationPrefsState; creditCards: import("./customer").CustomerCreditCardsState; allergens: import("./customer").CustomerAllergensState; addresses: import("./customer").CustomerAddressesState; favorites: import("./customer").CustomerFavoritesState; fcmToken: import("./customer").CustomerFcmTokenState; giftCards: import("./customer").CustomerGiftCardsState; groupOrders: import("./customer").CustomerGroupOrdersState; history: import("./customer").CustomerHistoryState; houseAccounts: import("./customer").CustomerHouseAccountsState; loyalty: import("./customer").CustomerLoyaltyState; order: import("./customer").CustomerOrderState; orders: import("./customer").CustomerOrdersState; pointsShop: import("./customer").PointsShopState; tplsPointsShop: import("./customer").TplsPointsShopState; qrcode: import("./customer").CustomerQRCodeState; rewards: import("./customer").CustomerRewardsState; thanx: import("./customer").CustomerThanxState; tpls: import("./customer").CustomerTplsState; }>; deals: import("./deals").DealsState; donations: import("./donations").DonationState; geolocation: import("./geolocation").GeoLocationState; giftCards: import("./giftCards").GiftCardsState; groupOrder: import("./groupOrder").GroupOrderState; guest: import("./guest").GuestState; loader: import("./loader").LoaderState; menu: import("./menu").MenuState; menuDisplay: import("./menuDisplay").MenuDisplayState; menuItems: import("./menuItems").MenuItemsState; modal: import("@open-tender/types").Modal; misc: import("./misc").MiscState; nav: import("./nav").NavState; navSite: import("./navSite").NavSiteState; notifications: import("@open-tender/types").Notifications; oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState; order: import("./order").OrderState; orderFulfillment: import("./orderFulfillment").OrderFulfillmentState; orderRating: import("./orderRating").OrderRatingState; posts: import("./posts").PostsSlice; pushNotifications: import("./pushNotifications").PushNotificationsState; qr: import("./qr").QrState; quote: import("./quote").QuoteState; resetPassword: import("./resetPassword").ResetPasswordState; revenueCenters: import("./revenueCenters").RevenueCentersState; rewardCode: import("./rewardCode").RewardCodeState; sidebar: import("./sidebar").SidebarState; sidebarModal: import("./sidebarModal").SidebarModalState; signUp: import("./signUp").SignUpState; tags: import("./tags").TagsState; terms: import("./terms").TermsSlice; Unsubscribe: import("./unsubscribe").UnsubscribeState; validTimes: import("./validTimes").ValidTimesState; verifyAccount: import("./verifyAccount").VerifyAccountState; }) => boolean) & import("reselect").OutputSelectorFields<(args_0: { has_loyalty: boolean | undefined; tpls: "COMO" | "THANX" | "PUNCHH" | "SPARKFLY" | null | undefined; }) => boolean, { clearCache: () => void; }> & { clearCache: () => void; }; export declare const selectFulfillment: (state: AppState) => import("@open-tender/types").ConfigFulfillment | undefined; export declare const selectRecaptcha: (state: AppState) => import("@open-tender/types").ConfigRecaptcha | undefined; export declare const selectContentSection: <T extends keyof ConfigContent>(page: T) => (state: AppState) => ConfigContent[T] | undefined; export declare const selectPage: (page: ConfigPageType) => (state: AppState) => ConfigPage | undefined; export declare const selectBottomTabsDisplayed: (state: AppState) => import("@open-tender/types").BottomTabsSections; export declare const selectBottomTabsTitles: ((state: import("redux").EmptyObject & { alerts: import("@open-tender/types").Alerts; allergens: import("./allergens").AllergensState; announcements: import("./announcements").AnnouncementsState; checkout: import("./checkout").CheckoutState; completedOrders: import("./completedOrders").CompletedOrdersState; config: ConfigState; confirmation: import("./confirmation").ConfirmationState; customer: import("redux").CombinedState<{ account: import("./customer").AccountState; communicationPreferences: import("./customer").CustomerCommunicationPrefsState; creditCards: import("./customer").CustomerCreditCardsState; allergens: import("./customer").CustomerAllergensState; addresses: import("./customer").CustomerAddressesState; favorites: import("./customer").CustomerFavoritesState; fcmToken: import("./customer").CustomerFcmTokenState; giftCards: import("./customer").CustomerGiftCardsState; groupOrders: import("./customer").CustomerGroupOrdersState; history: import("./customer").CustomerHistoryState; houseAccounts: import("./customer").CustomerHouseAccountsState; loyalty: import("./customer").CustomerLoyaltyState; order: import("./customer").CustomerOrderState; orders: import("./customer").CustomerOrdersState; pointsShop: import("./customer").PointsShopState; tplsPointsShop: import("./customer").TplsPointsShopState; qrcode: import("./customer").CustomerQRCodeState; rewards: import("./customer").CustomerRewardsState; thanx: import("./customer").CustomerThanxState; tpls: import("./customer").CustomerTplsState; }>; deals: import("./deals").DealsState; donations: import("./donations").DonationState; geolocation: import("./geolocation").GeoLocationState; giftCards: import("./giftCards").GiftCardsState; groupOrder: import("./groupOrder").GroupOrderState; guest: import("./guest").GuestState; loader: import("./loader").LoaderState; menu: import("./menu").MenuState; menuDisplay: import("./menuDisplay").MenuDisplayState; menuItems: import("./menuItems").MenuItemsState; modal: import("@open-tender/types").Modal; misc: import("./misc").MiscState; nav: import("./nav").NavState; navSite: import("./navSite").NavSiteState; notifications: import("@open-tender/types").Notifications; oneTimePasscode: import("./oneTimePasscode").OneTimePasscodeState; order: import("./order").OrderState; orderFulfillment: import("./orderFulfillment").OrderFulfillmentState; orderRating: import("./orderRating").OrderRatingState; posts: import("./posts").PostsSlice; pushNotifications: import("./pushNotifications").PushNotificationsState; qr: import("./qr").QrState; quote: import("./quote").QuoteState; resetPassword: import("./resetPassword").ResetPasswordState; revenueCenters: import("./revenueCenters").RevenueCentersState; rewardCode: import("./rewardCode").RewardCodeState; sidebar: import("./sidebar").SidebarState; sidebarModal: import("./sidebarModal").SidebarModalState; signUp: import("./signUp").SignUpState; tags: import("./tags").TagsState; terms: import("./terms").TermsSlice; Unsubscribe: import("./unsubscribe").UnsubscribeState; validTimes: import("./validTimes").ValidTimesState; verifyAccount: import("./verifyAccount").VerifyAccountState; }) => {}) & import("reselect").OutputSelectorFields<(args_0: (import("@open-tender/types").BottomTabsDisplayed & import("@open-tender/types").BottomTabsTitles) | undefined) => {}, { clearCache: () => void; }> & { clearCache: () => void; }; export declare const selectSoldOutMsg: (state: AppState) => string; export declare const selectHeaderHeight: (state: AppState) => (isBrowser: boolean) => number; export declare const selectOutpostName: (state: AppState) => string | undefined; export declare const selectHasCatering: (state: AppState) => boolean; export declare const selectCategoryType: (isMobile: boolean) => (state: AppState) => import("@open-tender/types").ThemeCategoryDisplayType; export declare const configReducer: import("redux").Reducer<ConfigState, import("redux").AnyAction>;