import type { ApnsPort, ApnsPush, ApnsResult } from './port'; /** * The real thing: HTTP/2 to Apple, with a token-based authentication header. * * Three details carry most of the ways this goes wrong. * * **The topic is the pass type identifier**, not an application's bundle id. * Getting it wrong produces `TopicDisallowed` on every push and no other * symptom. * * **The payload is empty.** A pass update carries `{}`; anything else is * ignored at best. * * **The authentication token is cached.** Apple refuses a provider token * regenerated more often than once every twenty minutes — `TooManyProviderTokenUpdates` * — and expires one older than an hour. Minting per request fails both ways at * once, which is why this holds one and refreshes it well inside the window. */ export interface Http2ApnsOptions { /** The `.p8` signing key from the Apple Developer account, as PEM. */ privateKey: string; /** The key's ten-character identifier. */ keyId: string; /** The ten-character team identifier. */ teamId: string; /** `production` talks to api.push.apple.com; `sandbox` to the other one. */ environment?: 'production' | 'sandbox'; /** Injected so a test can hold the clock still. */ now?: () => Date; } export declare class Http2Apns implements ApnsPort { private readonly options; private session; private token; constructor(options: Http2ApnsOptions); send(pushes: readonly ApnsPush[]): Promise; /** Closes the connection. A worker that has finished should not hold one open. */ close(): void; private connect; private authenticationToken; private one; } //# sourceMappingURL=http2.apns.d.ts.map