import { NexaApp } from '../app/initializeApp'; export interface NexaSDKOptions { app?: NexaApp; baseURL?: string; } export interface AdjustStockParams { productId: string; delta: number; reason?: string; referenceId?: string; } export interface ScanResiParams { noResi: string; orderId?: string; courier?: string; } export interface CancelOrderParams { orderId: string; reason?: string; } export interface TransferParams { fromUserId: string; toUserId: string; amount: number; currency?: string; note?: string; } export interface IncrementCounterParams { docPath: string; field: string; amount?: number; } /** * Universal NexaBase Client SDK Facade (Domain & Server-Authoritative Logic) * Decouples client components & stores from raw primitives like getDocs/runTransaction. */ export declare class NexaSDKFacade { private appInstance; private customBaseURL; constructor(options?: NexaSDKOptions); private getApp; private getBaseURL; /** * Universal Server-Authoritative Cloud Function Caller */ call(functionName: string, data?: any): Promise; products: { /** * Atomically adjust product stock in server with audit log trail */ adjustStock: (params: AdjustStockParams) => Promise; /** * Quick stock deduction helper */ deductStock: (productId: string, qty: number, reason?: string) => Promise; /** * Quick stock addition helper */ addStock: (productId: string, qty: number, reason?: string) => Promise; }; orders: { /** * Scan tracking number (resi), update shipping status & auto-deduct stock atomically */ scanResi: (params: ScanResiParams) => Promise; /** * Cancel an order & automatically return deducted stock to inventory */ cancelOrder: (params: CancelOrderParams) => Promise; }; finance: { /** * Atomic balance transfer between users with ledger record */ transferBalance: (params: TransferParams) => Promise; }; utils: { /** * Atomic field incrementer on any Firestore document */ increment: (params: IncrementCounterParams) => Promise; }; } /** * Singleton Default Facade Export */ export declare const nexaSDK: NexaSDKFacade; /** * Factory function to create custom facade instance with specific NexaApp */ export declare function createNexaSDK(app?: NexaApp, options?: { baseURL?: string; }): NexaSDKFacade;