TypeScript
Type-level conventions and exported types in @easylabs/react-native.
@easylabs/react-native is written in TypeScript and built against @tsconfig/strictest. All exports ship with .d.ts files; no extra @types/* package is required.
Public types
The package re-exports two upstream type sets, plus its own React Native-specific helper types.
Re-exported from @easylabs/common
The full payments domain model. Pull these types when you need to type your own state, server responses, or wrapper utilities.
import type {
// Responses
ApiResponse,
ErrorResponse,
Paginated,
PaginationParams,
// Customers
CreateCustomer,
CustomerData,
// Payment instruments
CreatePaymentInstrument,
CreatePaymentInstrumentBase,
UpdatePaymentInstrument,
PaymentInstrumentData,
FinixPaymentInstrumentData,
Address,
AccountType,
// Money movement
CreateTransfer,
TransferData,
// Catalog
CreateProduct,
CreatePrice,
ProductData,
PriceData,
// Subscriptions
CreateSubscription,
SubscriptionData,
// Checkout
CreateCheckoutSession,
} from '@easylabs/react-native';Re-exported from @basis-theory/react-native-elements
The element ref types. You'll attach these to useRef<…>(null) calls in any component that captures card or bank data.
| Type | Used for |
|---|---|
BTRef | Refs for CardNumberElement, CardVerificationCodeElement, and TextElement. |
BTDateRef | Ref for CardExpirationDateElement (exposes .month() / .year() for tokenization). |
InputBTRef | Underlying { id, format } shape produced by element refs — useful when typing custom token payloads. |
ElementEvent | Payload of onChange, onFocus, and onBlur element callbacks (empty, complete, valid, errors, brand, cardLast4, cvcLength, cardBin). |
import { type BTDateRef, type BTRef, CardNumberElement } from '@easylabs/react-native';
import { useRef } from 'react';
const cardNumberRef = useRef<BTRef>(null);
const expirationRef = useRef<BTDateRef>(null);React Native-specific helper types
Defined in this package and exported from the package root.
| Type | Description |
|---|---|
ClientOptions | { apiKey?: string } — minimal options shape exposed for forward compatibility. |
CreatePaymentInstrumentParams | Discriminated union of PAYMENT_CARD and BANK_ACCOUNT create payloads, with element refs in place of raw card or account data. Pass to createPaymentInstrument. |
CreatePaymentInstrumentTokenParams | Slimmer ref-only union used by tokenizePaymentInstrument when you want a token but no instrument record yet. |
Module augmentation
The SDK does not currently expose any module-augmentation slots. To add app-specific tag schemas, prefer typing them at your own call sites:
import type { CreateCustomer } from '@easylabs/react-native';
type AppCustomerTags = { source: 'web' | 'ios' | 'android'; campaign?: string };
const data: CreateCustomer & { tags: AppCustomerTags } = {
first_name: 'Jane',
last_name: 'Doe',
tags: { source: 'ios', campaign: 'launch-2026' },
};