@astropay/payments-lib
Version:
Official AstroPay payments library for web and mobile.
57 lines (56 loc) • 1.67 kB
TypeScript
import { Component } from '../../components/templates/Component';
import { APCore } from '../../types';
/**
* AstroPayCore is the main entry point for the AstroPay Payments Library.
* It handles initialization, configuration, and lifecycle management of payment components.
*
* @example
* ```ts
* // Basic initialization
* AstroPayCore.init('app-id');
*
* ```
*
* @see {@link APCore} for configuration options
*/
export declare class AstroPayCore {
private static isInitialized;
private static token;
private static components;
/**
* Initializes the AstroPay Payments Library.
*
* @example
* ```ts
* AstroPayCore.init('app-id',
* {
* environment: 'production', // or 'sandbox'
* theme: 'light' // or 'dark'
* language: 'en' // or 'es'/'pt'
* currencyMode: 'iso' // or 'symbol'
* tracking: true // or false to disable tracking
* styles: {
* primaryColor: '#000000',
* }
* });
* ```
*
* @param {string} token - The API token required for authentication.
* @param {APCore} [config] - Optional configuration settings.
*/
static init(token: string, config?: APCore): void;
static registerComponent(component: Component): void;
static unregisterComponent(component: Component): void;
static getToken(): string;
/**
* Destroys the AstroPay Payments Library instance, cleaning up any resources
* and resetting the initialization state.
*
* @example
* ```ts
* AstroPayCore.destroy();
* ```
*/
static destroy(): void;
static isLibInitialized(): boolean;
}