export interface SignMachOOptions { cert?: Uint8Array | ArrayBuffer; pkey?: Uint8Array | ArrayBuffer; prov?: Uint8Array | ArrayBuffer; entitlements?: Uint8Array | ArrayBuffer; password?: string; adhoc?: boolean; sha256Only?: boolean; forceSign?: boolean; } export interface SignIpaOptions extends SignMachOOptions { bundleId?: string; bundleVersion?: string; displayName?: string; weakInject?: boolean; enableCache?: boolean; zipLevel?: number; } type ModuleFactory = (opts?: Record) => Promise; type BinaryLike = Uint8Array | ArrayBuffer | Buffer; interface CreateOptions { moduleFactory?: ModuleFactory; moduleOptions?: Record; } export interface SignBundleOptions { certFile?: string; pkeyFile?: string; provFile?: string; password?: string; entitlementsFile?: string; bundleId?: string; bundleVersion?: string; displayName?: string; adhoc?: boolean; sha256Only?: boolean; forceSign?: boolean; weakInject?: boolean; enableCache?: boolean; } /** * Multi-profile bundle signing: one provisioning profile per bundle in the * folder (main app + each app extension / watch app). zsign matches each * profile to a bundle by its app-id suffix. */ export interface SignBundleMultiOptions extends Omit { provFiles: string[]; } export interface EmscriptenFs { mkdirTree(pathname: string): void; writeFile(pathname: string, data: Uint8Array, options?: Record): void; readFile(pathname: string, options?: Record): Uint8Array; readdir(pathname: string): string[]; stat(pathname: string): { mode: number; }; analyzePath(pathname: string): { exists: boolean; }; isDir(mode: number): boolean; isFile(mode: number): boolean; rmdir(pathname: string): void; unlink(pathname: string): void; } export interface EmscriptenModuleLike { FS?: EmscriptenFs; } /** The client instance created by the wasm bundle's `ZsignWasmClient.create()`. */ export interface ZsignWasmClientInstance { mod: EmscriptenModuleLike; version(): string; setLogLevel(level: number): number; signMacho(inputMachO: BinaryLike, options?: SignMachOOptions): Uint8Array; signBundle(inputFolder: string, options?: SignBundleOptions): number | void; signBundleMulti(inputFolder: string, options: SignBundleMultiOptions): number | void; } /** The CommonJS exports of `zsign-wasm/binary/zsign-wasm.min.js`. */ export interface WasmBundleExports { ZsignWasmClient: { create(options?: CreateOptions): Promise; }; createZsignModule?: ModuleFactory; createEmbeddedZsignModule?: ModuleFactory; } export declare function createZsignModule(opts?: Record): Promise; export declare function createEmbeddedZsignModule(opts?: Record): Promise; export declare class ZsignWasmClient { readonly mod: EmscriptenModuleLike; private readonly client; private constructor(); static create(options?: CreateOptions): Promise; version(): string; setLogLevel(level: number): number; signMachO(inputMachO: BinaryLike, options?: SignMachOOptions): Uint8Array; signBundle(inputFolder: string, options?: SignBundleOptions): number | void; signBundleMulti(inputFolder: string, options: SignBundleMultiOptions): number | void; } export declare class ZsignWasmResigner { readonly mod: EmscriptenModuleLike; private readonly client; private readonly fs; private constructor(); static create(options?: CreateOptions): Promise; version(): string; setLogLevel(level: number): number; signMachO(inputMachO: BinaryLike, options?: SignMachOOptions): Uint8Array; signIpa(inputIpa: BinaryLike, options?: SignIpaOptions): Promise; private writeOptionalAsset; private writeFile; private walkFiles; private removeRecursively; private newWorkspacePath; } export {};