import type { PassAssets, PassContent } from '../content'; import { type SigningCertificate } from './certificate'; import { type PassJson } from './pass-json'; import type { PassProblem } from './rules'; import { type SigningMaterial } from './sign'; export interface BuildOptions { /** * The moment written into the signature and into every archive entry. * * Given one, the same content produces the same bytes — which is what the * golden-file tests rest on and what makes "did this pass change" a question * with an answer. Left out, it is now. */ builtAt?: Date; /** * Build the archive even though the content breaks a rule. * * Exists for exactly one caller: the conformance tests, which have to be able * to produce a bad pass in order to prove the checker catches it. Anything * else using this is building a pass that will be refused by a device, which * is the thing this package was written to prevent. */ ignoreProblems?: boolean; } export interface BuiltPass { /** The `.pkpass` archive. */ bytes: Buffer; /** What went into it, for a caller that wants to show or store it. */ passJson: PassJson; manifest: Record; certificate: SigningCertificate; /** * Rules the content broke. * * Empty unless `ignoreProblems` was set — otherwise the build throws instead * of returning them, because a pass that breaks a rule is not a pass. */ problems: PassProblem[]; } /** * Builds and signs a `.pkpass`. * * The order matters and is the whole of it: validate, render, hash every file, * sign the hashes, and only then zip. Signing anything other than the finished * manifest — or hashing the manifest into itself — produces an archive that is * internally inconsistent in a way no error message explains. */ export declare function buildPkPass(content: PassContent, material: SigningMaterial, options?: BuildOptions): Promise; /** * The image files, at the names Apple looks for. * * `@2x` and `@3x` are a filename convention rather than metadata, so a * mis-spelling here is an image the device never loads and never mentions. */ export declare function assetFiles(assets: PassAssets): Map; //# sourceMappingURL=build.d.ts.map