diff --git a/index.d.ts b/index.d.ts index d54d4ab..62a4aea 100644 --- a/index.d.ts +++ b/index.d.ts @@ -4,11 +4,11 @@ export declare class Pass { constructor(options: Schema.Instance); public transitType: "PKTransitTypeAir" | "PKTransitTypeBoat" | "PKTransitTypeBus" | "PKTransitTypeGeneric" | "PKTransitTypeTrain"; - public headerFields: FieldContainer; - public primaryFields: FieldContainer; - public secondaryFields: FieldContainer; - public auxiliaryFields: FieldContainer; - public backFields: FieldContainer; + public headerFields: Field[]; + public primaryFields: Field[]; + public secondaryFields: Field[]; + public auxiliaryFields: (Field & { row: number })[]; + public backFields: Field[]; /** * Generates a Stream of a zip file using the infos passed through overrides or methods. @@ -67,11 +67,6 @@ export declare class Pass { load(resource: string, name: string): this; } -declare class FieldContainer { - push(...fields: Schema.Field[]): number; - pop(amount?: number): undefined | number; -} - interface BarcodeInterfaces extends BarcodeSuccessfulOperations { autocomplete: () => void | BarcodeSuccessfulOperations } @@ -91,73 +86,170 @@ declare namespace Schema { type NumberStyle = "PKNumberStyleDecimal" | "PKNumberStylePercent" | "PKNumberStyleScientific" | "PKNumberStyleSpellOut"; type BarcodeFormat = "PKBarcodeFormatQR" | "PKBarcodeFormatPDF417" | "PKBarcodeFormatAztec" | "PKBarcodeFormatCode128"; type RelevanceType = "beacons" | "locations" | "maxDistance" | "relevantDate"; + type SemanticsEventType = "PKEventTypeGeneric" | "PKEventTypeLivePerformance" | "PKEventTypeMovie" | "PKEventTypeSports" | "PKEventTypeConference" | "PKEventTypeConvention" | "PKEventTypeWorkshop" | "PKEventTypeSocialGathering"; interface Instance { - model: string, + model: string; certificates: { - wwdr: string, - signerCert: string, + wwdr: string; + signerCert: string; signerKey: { - keyFile: string, - passphrase: string + keyFile: string; + passphrase: string; } - }, - overrides: SupportedOptions, - shouldOverwrite?: boolean + }; + overrides: SupportedOptions; + shouldOverwrite?: boolean; } interface SupportedOptions { - serialNumber?: string, - description?: string, - userInfo?: Object | any[], - webServiceURL?: string, - authenticationToken?: string, - backgroundColor?: string, - foregroundColor?: string, - labelColor?: string, - groupingIdentifier?: string, - suppressStripShine?: boolean + serialNumber?: string; + description?: string; + userInfo?: Object | any[]; + webServiceURL?: string; + authenticationToken?: string; + backgroundColor?: string; + foregroundColor?: string; + labelColor?: string; + groupingIdentifier?: string; + suppressStripShine?: boolean; } interface Field { - attributedValue?: string, - changeMessage?: string, - dataDetectorType?: DataDetectorType[], - label?: string, - textAlignment?: TextAlignment, - key: string, - value: string | number, - dateStyle?: DateTimeStyle, - ignoreTimeZone?: boolean, - isRelative?: boolean, - timeStyle?: DateTimeStyle, - currencyCode?: string, - numberStyle?: NumberStyle + attributedValue?: string; + changeMessage?: string; + dataDetectorType?: DataDetectorType[]; + label?: string; + textAlignment?: TextAlignment; + key: string; + value: string | number; + dateStyle?: DateTimeStyle; + ignoreTimeZone?: boolean; + isRelative?: boolean; + timeStyle?: DateTimeStyle; + currencyCode?: string; + numberStyle?: NumberStyle; + semantics?: Semantics; } interface Beacon { - major?: number, - minor?: number, - proximityUUID: string, - relevantText?: string + major?: number; + minor?: number; + proximityUUID: string; + relevantText?: string; } interface Location { - altitude?: number, - latitude: number, - longitude: number, - relevantText?: string + altitude?: number; + latitude: number; + longitude: number; + relevantText?: string; } interface NFC { - message: string, - encryptionPublicKey?: string + message: string; + encryptionPublicKey?: string; } interface Barcode { - altText?: string, - messageEncoding?: string, - format: BarcodeFormat, - message: string + altText?: string; + messageEncoding?: string; + format: BarcodeFormat; + message: string; + } + + interface Semantics { + // All + totalPrice?: SemanticsCurrencyAmount; + // boarding Passes and Events + duration?: number; + seats?: Seat[]; + silenceRequested?: boolean; + // all boarding passes + departureLocation?: SemanticsLocation; + destinationLocation?: SemanticsLocation; + destinationLocationDescription?: SemanticsLocation; + transitProvider?: string; + vehicleName?: string; + vehicleType?: string; + originalDepartureDate?: string; + currentDepartureDate?: string; + originalArrivalDate?: string; + currentArrivalDate?: string; + originalBoardingDate?: string; + currentBoardingDate?: string; + boardingGroup?: string; + boardingSequenceNumber?: string; + confirmationNumber?: string; + transitStatus?: string; + transitStatuReason?: string; + passengetName?: SemanticsPersonNameComponents; + membershipProgramName?: string; + membershipProgramNumber?: string; + priorityStatus?: string; + securityScreening?: string; + // Airline Boarding Passes + flightCode?: string; + airlineCode?: string; + flightNumber?: number; + departureAirportCode?: string; + departureAirportName?: string; + destinationTerminal?: string; + destinationGate?: string; + // Train and Other Rail Boarding Passes + departurePlatform?: string; + departureStationName?: string; + destinationPlatform?: string; + destinationStationName?: string; + carNumber?: string; + // All Event Tickets + eventName?: string; + venueName?: string; + venueLocation?: SemanticsLocation; + venueEntrance?: string; + venuePhoneNumber?: string; + venueRoom?: string; + eventType?: SemanticsEventType; + eventStartDate?: string; + eventEndDate?: string; + artistIDs?: string; + performerNames?: string[]; + genre?: string; + // Sport Event Tickets + leagueName?: string; + leagueAbbreviation?: string; + homeTeamLocation?: string; + homeTeamName?: string; + homeTeamAbbreviation?: string; + awayTeamLocation?: string; + awayTeamName?: string; + awayTeamAbbreviation?: string; + sportName?: string; + // Store Card Passes + balance?: SemanticsCurrencyAmount; + }; + + interface SemanticsCurrencyAmount { + currencyCode: string; + amount: string; + }; + + interface SemanticsPersonNameComponents { + givenName: string; + familyName: string; + } + + interface SemanticsSeat { + seatSection?: string; + seatRow?: string; + seatNumber?: string; + seatIdentifier?: string; + seatType?: string; + seatDescription?: string; + } + + interface SemanticsLocation { + latitude: number; + longitude: number; } }