import type { PassContent } from '../content'; /** * Google's half of the same pass. * * Fed from the identical {@link PassContent}, and the differences are Google's * rather than ours. Three of them shape everything here: * * **Images are URIs, not bytes.** Google fetches them; Apple is handed them in * the archive. So this renderer takes the URLs of images the caller has already * published, and cannot be given the same `assets` the Apple side uses. * * **There is a class as well as an object.** The class is the programme — one * per loyalty programme — and the object is one person's card. A field put on * the wrong one either cannot vary per holder or has to be written two thousand * times. * * **Updates are direct writes.** No registration, no silent push, no device * dance. Which makes this side much the simpler of the two, and is worth saying * plainly so that nobody goes looking for the missing complexity. */ /** * `ACTIVE` unless the pass has been voided or has expired. * * The same four words on a loyalty object and an event ticket object — Google * shares the enumeration, and so does this. */ export type LoyaltyState = 'ACTIVE' | 'COMPLETED' | 'EXPIRED' | 'INACTIVE'; export interface GoogleIssuer { /** The numeric issuer identifier from the Google Wallet console. */ issuerId: string; /** The business, as the holder knows it. */ issuerName: string; } export interface LoyaltyClassInput extends GoogleIssuer { /** Unique within the issuer. The class id becomes `{issuerId}.{classSuffix}`. */ classSuffix: string; programName: string; /** A published URL. Google fetches it; it is not uploaded through this. */ programLogoUri?: string; heroImageUri?: string; /** * `UNDER_REVIEW` until Google approves the class, then `APPROVED`. * * A class left in `DRAFT` issues objects that install and show nothing to * anyone but the issuer's own test accounts, which is a confusing way to * discover the setting exists. */ reviewStatus?: 'UNDER_REVIEW' | 'APPROVED' | 'DRAFT'; /** ISO 3166-1 alpha-2, e.g. `RO`. Decides some of Google's own wording. */ countryCode?: string; } export interface LoyaltyObjectInput { issuerId: string; /** Unique within the issuer; becomes `{issuerId}.{objectSuffix}`. */ objectSuffix: string; classSuffix: string; /** * The moment the object's state is decided against. * * Injected rather than read from the clock, as everything else in this * programme that depends on time is: an object built for a card that expires * this afternoon is `ACTIVE` or `EXPIRED` depending on when the function ran, * and a test that cannot say which is a test that passes until it does not. */ now: Date; } /** The programme, written once. */ export declare function buildLoyaltyClass(content: PassContent, input: LoyaltyClassInput): Record; /** One person's card. */ export declare function buildLoyaltyObject(content: PassContent, input: LoyaltyObjectInput): Record; export interface EventTicketClassInput extends GoogleIssuer { /** Unique within the issuer. The class id becomes `{issuerId}.{classSuffix}`. */ classSuffix: string; /** The event, as it is advertised. One class per performance, not per run. */ eventName: string; /** Where it is. Google renders the name; the address is what maps open. */ venueName?: string; venueAddress?: string; /** When it starts, and when it is over. Both in the venue's own zone. */ startsAt?: Date; endsAt?: Date; /** The venue's clock, as an IANA zone. Without it Google reads the times as UTC. */ timezone?: string; logoUri?: string; heroImageUri?: string; reviewStatus?: 'UNDER_REVIEW' | 'APPROVED' | 'DRAFT'; countryCode?: string; } export interface EventTicketObjectInput { issuerId: string; objectSuffix: string; classSuffix: string; /** What a door reads out when the barcode will not scan. */ ticketNumber?: string; /** Where the holder sits. Any of them may be absent — a terrace has none. */ seat?: { section?: string; row?: string; seat?: string; gate?: string; }; /** See {@link LoyaltyObjectInput.now}: injected rather than read from a clock. */ now: Date; } /** * The performance, written once. * * **A class per event rather than per production**, because Google puts the * date, the venue and the name on the class and an object cannot override them: * a season of *Hamlet* sharing one class would show every holder the first * night's date. * * The second consumer of this package is what produced it. A loyalty programme * and an event are both "the thing a pass belongs to", and everything about how * they are built, signed and saved is shared — but Google models them as * different classes with different fields, and a ticket rendered as a loyalty * card shows a balance where its seat should be. */ export declare function buildEventTicketClass(content: PassContent, input: EventTicketClassInput): Record; /** One person's ticket. */ export declare function buildEventTicketObject(content: PassContent, input: EventTicketObjectInput): Record; //# sourceMappingURL=payload.d.ts.map