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

70 lines (69 loc) 3.35 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; accessibilityOn?: boolean; paymentConfigs: { integration: string; is_testing: boolean; merchant_api_key: string; merchant_id: string; merchant_password: string; merchant_username: string; offline_limit: string; saved_cards: boolean; signature_threshold: string | null; freedompay_store_id: string; card_stor_service_url: string; client_selling_system: string; client_selling_system_version: string; freedompay_terminal_id: string; } | null; } 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">, setAccessibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "config/setAccessibility">; 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 selectAccessibility: (state: AppState) => boolean | undefined; export declare const selectStore: (state: AppState) => Store | null; export declare const configReducer: import("redux").Reducer<ConfigState>;