/// import { PassThrough, Stream } from 'stream'; import { NATIVE_FULL_APK_NAME, NATIVE_APK_NAME, NATIVE_IL2CPP_NAME } from './mixed-constant'; import { SizeLimitConfig } from './source.type'; import { ISubPackage } from '@byted/miniprogram-utils/dist/data/schema/base'; import { checkAppId, getAppId } from './package'; /** 不参与体积计算的 glob pattern */ export declare const PKG_SIZE_IGNORE_GLOBS: string[]; export declare const getSizeLimitConfig: (appId: string) => Promise>; /** * @description: 目前小游戏分包大小有以下限制: 整个小游戏所有主包+分包大小不超过 30M 主包不超过 4M 单个普通分包不限制大小 * @return {*} */ export declare function verifyPkgSize(devAppid: string, projectPath: string, options?: { withNative: boolean; isUpload: boolean; }): Promise; declare type NativeFileName = typeof NATIVE_APK_NAME | typeof NATIVE_FULL_APK_NAME | typeof NATIVE_IL2CPP_NAME; declare type GetProjectEntriesReturn = { main: string[] | null; subPkgs: Array | null; openData: string[] | null; total: string[]; native: Partial<{ [K in NativeFileName]: string; }>; }; /** * @description: 获取项目下的所有文件 * @return {*} */ export declare const getProjectEntries: (projectPath: string, ignore?: string[], options?: { withNative: boolean; isUpload: boolean; }) => Promise; export declare function getProjectSize(projectPath: string, options?: { withNative: boolean; isUpload: boolean; }): Promise<{ main: number; subPkgs: { subs: Array<[ string, number ]>; total: number; }; openData: number; total: number; native?: { il2cpp: number; apk: number; }; }>; declare type ReturnTypeOfFolderToZipStream = Partial> & { zipStream: PassThrough; }; /** * @description: 将项目打包为 zip,如果是native,则一起返回native产物 * @param {string} folderPath * @return {ReturnTypeOfFolderToZipStream} */ export declare function folderToZipStream(folderPath: string, options?: { withNative: boolean; isUpload: boolean; }): Promise; /** * @description: 压缩文件 * @return {Buffer | PassThrough} */ export declare const compress: ({ entries, rootPath, }: { entries: string[]; rootPath: string; }) => Promise; export { getAppId, checkAppId }; export declare const validateAppId: (appId: string) => Promise; /** * @description: for 混合引擎小游戏,计算项目 hash: * StreamingAssets下面所有文件均计算 * native 预览只计算full.apk * 除去 native 和StreamingAssets的文件按白名单计算 * 最后把三个hash拼起来作为最终的hash * 目前上传不需要计算hash(上传不做缓存,预览才做) * @param {string} projectPath * @param {boolean} withNative * @return {string} */ export declare const getMixedProjectHash: (projectPath: string, withNative: boolean) => Promise;