export type Platform = 'playcraft' | 'facebook' | 'snapchat' | 'ironsource' | 'applovin' | 'google' | 'tiktok' | 'unity' | 'liftoff' | 'moloco' | 'bigo' | 'inmobi' | 'adikteev' | 'remerge' | 'mintegral';
export type OutputFormat = 'html' | 'zip';
/**
 * 商店跳转地址（CTA 按钮目标）
 */
export interface StoreUrls {
    ios?: string;
    android?: string;
}
export type BuildMode = 'classic' | 'esm';
export type ESMMode = 'auto' | 'enabled' | 'disabled';
export interface BuildOptions {
    platform: Platform;
    format?: OutputFormat;
    outputDir?: string;
    compressEngine?: boolean;
    compressConfigJson?: boolean;
    compressJS?: boolean;
    analyze?: boolean;
    analyzeReportPath?: string;
    patchXhrOut?: boolean;
    inlineGameScripts?: boolean;
    externFiles?: boolean | ExternFilesConfig;
    mraidSupport?: boolean;
    snapchatCta?: boolean;
    ammoReplacement?: 'p2' | 'cannon';
    snapchat?: {
        folderName?: string;
        externalUrlPrefix?: string;
    };
    engineVersion?: string;
    engineUrl?: string;
    enginePath?: string;
    useGitHubEngine?: boolean;
    autoBuild?: boolean;
    skipBuild?: boolean;
    buildOptions?: LocalBuildOptions;
    useVite?: boolean;
    selectedScenes?: string[];
    cssMinify?: boolean;
    jsMinify?: boolean;
    compressImages?: boolean;
    imageQuality?: number;
    convertToWebP?: boolean;
    compressModels?: boolean;
    modelCompression?: 'draco' | 'meshopt';
    esmMode?: ESMMode;
    preserveESM?: boolean;
    forceIIFE?: boolean;
    storeUrls?: StoreUrls;
    tracking?: {
        enabled?: boolean;
        adNetwork?: string;
        totalInteractions?: number;
    };
}
export interface BaseBuildMetadata {
    mode: BuildMode;
    importMap?: {
        id: string;
        imports: Record<string, string>;
    };
    entryPoint?: string;
    engine?: EngineType;
    buildTool?: BuildTool;
    skipChannelBuild?: boolean;
    buildOutputDir?: string;
}
export interface LocalBuildOptions {
    scriptsConcatenate?: boolean;
    scriptsMinify?: boolean;
    scriptsSourcemaps?: boolean;
    optimizeSceneFormat?: boolean;
}
export interface ExternFilesConfig {
    enabled: boolean;
    folderName?: string;
    externalUrlPrefix?: string;
}
export interface AssetInfo {
    path: string;
    type: string;
    size: number;
    base64?: string;
    mimeType?: string;
}
export interface ProjectManifest {
    format: string;
    version: string;
    project: {
        id: string;
        name: string;
        description?: string;
    };
    scenes: Array<{
        id: string;
        name: string;
        path: string;
        isMain?: boolean;
    }>;
    assets: Array<{
        id: string;
        name: string;
        type: string;
        path: string;
        preload?: boolean;
        tags?: string[];
        i18n?: Record<string, any>;
        data?: any;
        file?: {
            filename: string;
            size: number;
            hash: string;
            url?: string;
        };
    }>;
}
export interface SizeReport {
    engine: number;
    assets: Record<string, number>;
    total: number;
    limit: number;
}
/**
 * 支持的引擎类型
 */
export type EngineType = 'playcanvas' | 'phaser' | 'pixijs' | 'threejs' | 'cocos' | 'babylonjs' | 'layaair' | 'egret' | 'generic';
/**
 * 构建工具类型
 * 与引擎类型正交，决定使用哪个构建适配器
 */
export type BuildTool = 'playable-scripts' | 'playcanvas-native' | 'generic';
/**
 * 引擎 + 构建工具 二维检测结果
 */
export interface DetectionResult {
    engine: EngineType;
    buildTool: BuildTool;
}
/**
 * PlayableScripts 构建配置
 * 对应 playcraft.config.json 中的 build.playableScripts 配置节
 *
 * 注意：@playcraft/devkit 是用户项目的 npm devDependency，
 * PlayCraft 只负责检测其存在并传递配置参数。
 */
export interface PlayableScriptsConfig {
    /** 目标渠道列表（覆盖项目自带的 builds.config.js 中的 channels） */
    channels?: string[];
    /** 主题配置 */
    themes?: {
        enabled?: boolean;
        whitelist?: string[];
        sourceDir?: string;
        entryFile?: string;
    };
    /** 代码混淆等级 (1-4，PlayCraft 默认强制 4) */
    obfuscateLevel?: number;
    /** fflate 压缩（PlayCraft 默认强制 true） */
    fflateCompression?: boolean;
    /** 并发数（默认自动: CPU核心数-1, 最小2最大8） */
    parallel?: number;
    /** 输出目录（默认 dist） */
    outputDir?: string;
    /** 输出为 ZIP 格式（默认 false） */
    zip?: boolean;
    /** 自定义文件名格式（例如: {app}_{name}_{version}_{date}_{language}_{network}） */
    filename?: string;
    /** 所有渠道输出为 ZIP（默认 false） */
    isChannelFold2zip?: boolean;
    /** 文件命名配置 */
    naming?: {
        language?: string;
        format?: string;
        supplier?: string;
        follower?: string;
    };
    /** 商店跳转地址（iOS 和 Android） */
    storeUrls?: {
        ios: string;
        android: string;
    };
}
/**
 * 引擎能力集，驱动前端 UI 和 CLI 的条件逻辑
 */
export interface EngineCapabilities {
    supportsSceneSelection: boolean;
    supportsESMMode: boolean;
    supportsEngineCompression: boolean;
    supportsAmmoReplacement: boolean;
    supportsModelCompression: boolean;
    requiresNpmBuild: boolean;
}
/**
 * 各引擎的能力定义
 */
export declare const ENGINE_CAPABILITIES: Record<EngineType, EngineCapabilities>;
/**
 * 基础构建选项
 */
export interface BaseBuildOptions {
    outputDir: string;
    selectedScenes?: string[];
    analyze?: boolean;
    analyzeReportPath?: string;
    clean?: boolean;
    engine?: EngineType;
    /** 渠道产物格式（playable-scripts 阶段；与 Vite 阶段 format 对齐） */
    format?: OutputFormat;
}
/**
 * 基础构建输出
 */
export interface BaseBuildOutput {
    outputDir: string;
    metadata: BaseBuildMetadata;
    files: {
        html: string;
        engine: string | null;
        config: string;
        settings: string | null;
        modules: string | null;
        start: string;
        scenes: string[];
        assets: string[];
    };
}
/**
 * 扩展 BuildOptions，增加引擎类型
 */
export interface BuildOptions {
    platform: Platform;
    format?: OutputFormat;
    outputDir?: string;
    compressEngine?: boolean;
    compressConfigJson?: boolean;
    analyze?: boolean;
    analyzeReportPath?: string;
    patchXhrOut?: boolean;
    inlineGameScripts?: boolean;
    externFiles?: boolean | ExternFilesConfig;
    mraidSupport?: boolean;
    snapchatCta?: boolean;
    ammoReplacement?: 'p2' | 'cannon';
    snapchat?: {
        folderName?: string;
        externalUrlPrefix?: string;
    };
    engineVersion?: string;
    engineUrl?: string;
    enginePath?: string;
    useGitHubEngine?: boolean;
    autoBuild?: boolean;
    skipBuild?: boolean;
    buildOptions?: LocalBuildOptions;
    useVite?: boolean;
    selectedScenes?: string[];
    cssMinify?: boolean;
    jsMinify?: boolean;
    compressImages?: boolean;
    imageQuality?: number;
    convertToWebP?: boolean;
    compressModels?: boolean;
    modelCompression?: 'draco' | 'meshopt';
    esmMode?: ESMMode;
    preserveESM?: boolean;
    forceIIFE?: boolean;
    engine?: EngineType;
    storeUrls?: StoreUrls;
}
