export type ProductType = 'consumable' | 'non-consumable' | 'subscription';
export type SubscriptionPeriod = 'weekly' | 'monthly' | 'quarterly' | 'yearly';
export interface IAPProduct {
    id: string;
    name: string;
    description: string;
    type: ProductType;
    price: number;
    currency: string;
    storeProductId: string;
    icon?: string;
    category: string;
    subscriptionPeriod?: SubscriptionPeriod;
    trialDays?: number;
    contents: IAPContent[];
}
export interface IAPContent {
    type: 'currency' | 'item' | 'bundle' | 'cosmetic' | 'boost' | 'unlock';
    itemId: string;
    amount: number;
}
export type PurchaseState = 'pending' | 'purchased' | 'failed' | 'refunded' | 'cancelled';
export interface PurchaseRecord {
    id: string;
    productId: string;
    userId: string;
    state: PurchaseState;
    platform: 'ios' | 'android' | 'web' | 'steam';
    transactionId: string;
    purchaseDate: number;
    expiresAt?: number;
    receipt?: string;
    verified: boolean;
}
export interface IAPStore {
    products: IAPProduct[];
    purchaseHistory: PurchaseRecord[];
}
export declare function getActiveSubscriptions(store: IAPStore, now: number): PurchaseRecord[];
export declare function hasProduct(store: IAPStore, productId: string): boolean;
export interface VirtualCurrency {
    id: string;
    name: string;
    icon: string;
    soft: boolean;
    maxBalance: number;
}
export interface WalletEntry {
    currencyId: string;
    balance: number;
}
export interface Wallet {
    userId: string;
    entries: WalletEntry[];
}
export declare function getBalance(wallet: Wallet, currencyId: string): number;
export declare function modifyBalance(wallet: Wallet, currencyId: string, amount: number, maxBalance?: number): boolean;
export type AnalyticsEventType = 'session_start' | 'session_end' | 'level_start' | 'level_complete' | 'level_fail' | 'purchase' | 'ad_watched' | 'tutorial_step' | 'achievement' | 'custom';
export interface AnalyticsEvent {
    type: AnalyticsEventType;
    name: string;
    timestamp: number;
    sessionId: string;
    userId?: string;
    params: Record<string, string | number | boolean>;
}
export interface AnalyticsConfig {
    enabled: boolean;
    providers: AnalyticsProvider[];
    batchSize: number;
    flushInterval: number;
    sampleRate: number;
    respectDNT: boolean;
    anonymizeIP: boolean;
    retentionDays: number;
    customDimensions: string[];
}
export interface AnalyticsProvider {
    name: string;
    apiKey: string;
    endpoint: string;
    enabled: boolean;
}
export declare class AnalyticsBuffer {
    private events;
    private config;
    private flushCallback;
    constructor(config: AnalyticsConfig);
    onFlush(callback: (events: AnalyticsEvent[]) => void): void;
    track(type: AnalyticsEventType, name: string, params?: Record<string, string | number | boolean>): void;
    flush(): void;
    getBufferSize(): number;
}
export interface ABTest {
    id: string;
    name: string;
    description: string;
    variants: ABVariant[];
    startDate: number;
    endDate?: number;
    targetAudience: string;
    status: 'draft' | 'running' | 'paused' | 'completed';
    winnerVariant?: string;
}
export interface ABVariant {
    id: string;
    name: string;
    weight: number;
    config: Record<string, unknown>;
}
export interface ABAssignment {
    testId: string;
    variantId: string;
    userId: string;
    assignedAt: number;
}
/** Deterministic assignment based on userId hash. */
export declare function assignVariant(test: ABTest, userId: string): ABVariant;
export type LeaderboardSort = 'highest' | 'lowest' | 'latest';
export type LeaderboardPeriod = 'alltime' | 'daily' | 'weekly' | 'monthly' | 'seasonal';
export interface LeaderboardDef {
    id: string;
    name: string;
    sort: LeaderboardSort;
    period: LeaderboardPeriod;
    maxEntries: number;
    scoreFormat: 'integer' | 'decimal' | 'time' | 'custom';
    metadata: string[];
    antiCheat: LeaderboardAntiCheat;
}
export interface LeaderboardAntiCheat {
    maxScorePerSubmission: number;
    maxSubmissionsPerDay: number;
    requireServerValidation: boolean;
    banThreshold: number;
}
export interface LeaderboardEntry {
    rank: number;
    userId: string;
    displayName: string;
    score: number;
    metadata: Record<string, string | number>;
    submittedAt: number;
    verified: boolean;
}
export interface LeaderboardPage {
    leaderboardId: string;
    entries: LeaderboardEntry[];
    total: number;
    page: number;
    pageSize: number;
    userEntry?: LeaderboardEntry;
}
export declare function insertScore(entries: LeaderboardEntry[], newEntry: LeaderboardEntry, sort: LeaderboardSort, maxEntries: number): LeaderboardEntry[];
export declare function formatLeaderboardScore(score: number, format: LeaderboardDef['scoreFormat']): string;
export interface CloudSaveConfig {
    provider: 'firebase' | 'aws' | 'azure' | 'custom';
    autoSync: boolean;
    syncInterval: number;
    maxSaveSlots: number;
    maxSaveSize: number;
    compression: boolean;
    encryption: boolean;
    conflictResolution: 'latest' | 'largest' | 'manual';
}
export interface CloudSaveSlot {
    slotId: number;
    userId: string;
    name: string;
    data: string;
    checksum: string;
    createdAt: number;
    updatedAt: number;
    size: number;
    version: number;
    metadata: Record<string, string>;
    thumbnail?: string;
}
export interface CloudSyncResult {
    success: boolean;
    slot: CloudSaveSlot;
    conflict: boolean;
    localVersion: number;
    remoteVersion: number;
    resolution?: 'local' | 'remote' | 'merged';
}
/** Simple checksum for save integrity. */
export declare function computeChecksum(data: string): string;
export interface AchievementDef {
    id: string;
    name: string;
    description: string;
    icon: string;
    lockedIcon: string;
    category: string;
    points: number;
    hidden: boolean;
    progressive: boolean;
    maxProgress?: number;
    reward?: {
        type: string;
        amount: number;
        itemId?: string;
    };
    prerequisites?: string[];
}
export interface AchievementProgress {
    achievementId: string;
    unlocked: boolean;
    progress: number;
    unlockedAt?: number;
}
export declare class AchievementTracker {
    private definitions;
    private progress;
    registerAchievement(def: AchievementDef): void;
    incrementProgress(achievementId: string, amount?: number): boolean;
    unlock(achievementId: string): boolean;
    isUnlocked(achievementId: string): boolean;
    getProgress(achievementId: string): AchievementProgress | undefined;
    getUnlockedCount(): number;
    getTotalPoints(): number;
    getAllProgress(): AchievementProgress[];
}
