import AdmZip from 'adm-zip';
import type { KeyObject } from 'node:crypto';
import type { ModuleManifest } from '../../typings/ext/module';
import type { MarketLicenseFile, MarketPricing, MarketSigPayload } from '../../typings/ext/market';
/** 随下载注入的永久 license（不参与内容指纹，安装时抽出） */
export declare const MARKET_LIC_ENTRY = "market.lic";
/** 对 zip 内除 market.sig / market.lic 外的条目做内容指纹 */
export declare function hashZipEntries(zip: AdmZip): string;
export declare function readZipManifest(zip: AdmZip): ModuleManifest;
export type MarketSigFile = {
    payload: MarketSigPayload;
    sig: string;
};
export declare function readMarketSig(zip: AdmZip): MarketSigFile | null;
/**
 * 市场注入 marketId / pricing，写入 market.sig（作者无需手写 marketId）
 */
export declare function sealVomeBuffer(input: Buffer, opts: {
    marketId: string;
    pricing: MarketPricing;
    privateKey: string | Uint8Array | KeyObject;
}): Buffer;
/** 读取包内随附 license（下载核销时注入） */
export declare function readZipMarketLicense(input: Buffer | AdmZip): MarketLicenseFile | null;
/** 签封后附加永久 license（不改 contentHash） */
export declare function attachMarketLicense(sealed: Buffer, license: MarketLicenseFile): Buffer;
/**
 * 验签市场包。无 market.sig → 非市场包（null）。
 * 有签但失败 → 抛错。
 */
export declare function verifySealedVome(input: Buffer | AdmZip, publicKey?: string | Uint8Array | KeyObject): {
    manifest: ModuleManifest;
    sig: MarketSigFile;
} | null;
