UNPKG

@promokit/js

Version:

JavaScript SDK for PromoKit marketing infrastructure

71 lines (70 loc) 1.69 kB
export interface PromoConfig { apiKey: string; } export interface APIResponse<T = any> { data?: T; error?: string; success: boolean; } export interface WaitlistEntry { id: string; email: string; position: number; referralCode: string; referralUrl: string; createdAt: string; metadata?: Record<string, any>; } export interface Testimonial { id: string; content: string; author: string; role?: string; company?: string; avatar?: string; rating: number; status: 'PENDING' | 'APPROVED' | 'REJECTED'; createdAt: string; metadata?: Record<string, any>; } export interface ChangelogEntry { id: string; version: string; title: string; content: string; changes: string[]; publishedAt: string; } export interface WaitlistStats { totalSignups: number; signupsToday: number; signupsThisWeek: number; referralStats: Array<{ referrer: string; count: number; }>; } export interface APIError { status: number; statusText: string; message: string; details?: any; endpoint?: string; timestamp: string; } export declare class PromoError extends Error { readonly status: number; readonly statusText: string; readonly details?: any; readonly endpoint?: string; readonly timestamp: string; constructor(error: APIError); get isNetworkError(): boolean; get isClientError(): boolean; get isConflictError(): boolean; get isUnauthorizedError(): boolean; get isForbiddenError(): boolean; get isNotFoundError(): boolean; get isRateLimitError(): boolean; getUserFriendlyMessage(): string; }