@thenextgateway/core
Core TypeScript types and constants shared by TNG packages.
Installation
npm install @thenextgateway/core
Usage
import { CASHIER_MESSAGE_TYPES, CROSSFRAME_MESSAGE_TYPES, TNG_TRANSACTION_TYPES, type TNGCssVars } from "@thenextgateway/core";
const transactionType = TNG_TRANSACTION_TYPES.deposit;
const theme: TNGCssVars = {
color: {
primary: {
default: "#0057ff",
contrast: "#fff",
},
},
};
const initMessageType = CROSSFRAME_MESSAGE_TYPES.init; // "tng_init"
const initConfirmMessageType = CASHIER_MESSAGE_TYPES.initConfirm; // "tng_initConfirm"
Exports
This package is primarily used by @thenextgateway/cashier.sdk and includes:
- Cashier configuration types, including
CashierConfig,MethodStepConfig, andAmountStepConfig. - Transaction constants and types, including
TNG_TRANSACTION_TYPES,TNG_TRANSACTION_STATES,TNG_TRANSACTION_STATUSES,TNGTransactionType,TNGTransactionState, andTNGTransactionStatus. - Cross-frame message types used by Cashier and host applications, including
CROSSFRAME_MESSAGE_TYPESandCASHIER_MESSAGE_TYPES. Message type values are prefixed withtng_. - Host listener types, including
HostGlobalListenersandHostEventData. - Payment method, progress step, error, icon, stylesheet, and theming types.