import type { ExtensionConfig } from './types'; /** * Pixel dimensions of a PNG or JPEG, read from its header. * * Enough to answer "does the listing already show these images", which is the * only reason this file needs to know. Decoding them properly would mean * making the whole codec stack a dependency of the publisher, to compare two * pairs of integers. */ export declare function imageSize(bytes: Uint8Array): { width: number, height: number } | undefined; /** * A short-lived HS256 token, which is what AMO's external API takes. * * Signed here rather than pulled from a JWT library: the payload is four * claims and the signature is one HMAC, and `web-ext` — the only other AMO * caller in this package — does not expose its own. */ export declare function amoToken(issuer: string, secret: string, now?: number): string; /** Read the previews a listing currently shows. */ export declare function listFirefoxPreviews(addonId: string, auth: { issuer: string, secret: string }): Promise; /** * Bring the listing's screenshots in line with the config. * * Skips the whole exchange when the listing already shows the same images at * the same sizes in the same order — a publish should not churn a public * listing's preview ids just because it ran again. */ export declare function syncFirefoxPreviews(config: ExtensionConfig, options?: FirefoxPreviewSyncOptions): Promise; /** * Listing screenshots on addons.mozilla.org. * * Of the three stores this package publishes to, AMO is the middle case: * Apple's API takes screenshots as part of a version's metadata, Chrome's has * no endpoint for them at all, and AMO has a writable previews collection that * nothing was using. So a Firefox listing kept whatever was dragged into the * Developer Hub the first time — for very-good-adblock, two images at mismatched * sizes and captions that said "A screenshot showcasing the extension" — while * every other surface regenerated from the product. * * Replacement is upload-then-delete rather than delete-then-upload. Either * order is fine when it works; only one of them leaves a public listing with no * screenshots at all if the process dies in the middle. */ export declare interface FirefoxPreviewAuth { issuer?: string secret?: string } export declare interface FirefoxPreviewSyncOptions extends FirefoxPreviewAuth { cwd?: string dryRun?: boolean } export declare interface FirefoxPreview { id: number position: number size: [number, number] caption?: string } export declare interface FirefoxPreviewSyncResult { unchanged: boolean uploaded: FirefoxPreview[] removed: number[] }