UNPKG

@open-tender/store

Version:

A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API

52 lines (51 loc) 2.6 kB
import { Devices, MenuColors, RequestError, RequestStatus, SelectOptions, Store, Timezone } from '@open-tender/types'; import { AppState } from '../app'; import { PosAPI } from '../services'; import { InitAPI } from '../services/api'; export interface ConfigApp { apiUrl: string; } export interface ConfigState { api: PosAPI; app: ConfigApp | null; version?: string | null; devices: Devices | null; store: Store | null; selectOptions: SelectOptions | null; menuColors: MenuColors | null; name: string | null; ipAddress: string | null; hasPinpad: boolean; hasCashDrawer: boolean; loading: RequestStatus; error: RequestError | null; retries: number; } export declare enum ConfigActionType { FetchConfig = "config/getConfig" } export declare const fetchConfig: import("@reduxjs/toolkit").AsyncThunk<ConfigState, { apiUrl: string; }, { state: AppState; rejectValue: RequestError; dispatch?: import("redux").Dispatch<import("redux").UnknownAction> | 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">, setVersion: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setVersion">, setApi: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "config/setApi">, setApiTerminal: import("@reduxjs/toolkit").ActionCreatorWithPayload<InitAPI, "config/setApiTerminal">; export declare const selectConfig: (state: AppState) => ConfigState; export declare const selectApi: (state: AppState) => PosAPI; export declare const selectVersion: (state: AppState) => string | null | undefined; export declare const selectDevices: (state: AppState) => Devices | null; export declare const selectSelectOptions: (state: AppState) => SelectOptions; export declare const selectMenuColors: (state: AppState) => MenuColors; export declare const selectTimezone: () => Timezone; export declare const selectLoyalty: (state: AppState) => boolean; export declare const selectPinpad: (state: AppState) => boolean; export declare const selectCashDrawer: (state: AppState) => boolean; export declare const selectStore: (state: AppState) => Store | null; export declare const configReducer: import("redux").Reducer<ConfigState>;