mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Added upcomingPassInformation getter
This commit is contained in:
@@ -276,7 +276,7 @@ export default class PKPass extends Bundle {
|
|||||||
|
|
||||||
if (this.type !== "eventTicket") {
|
if (this.type !== "eventTicket") {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
Messages.UPCOMING_PASS_INFORMATION.UNEXPECTED_PASS_TYPE,
|
Messages.UPCOMING_PASS_INFORMATION.UNEXPECTED_PASS_TYPE_SET,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,6 +297,16 @@ export default class PKPass extends Bundle {
|
|||||||
this[propsSymbol].upcomingPassInformation = value;
|
this[propsSymbol].upcomingPassInformation = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get upcomingPassInformation(): Schemas.UpcomingPassInformationEntry[] {
|
||||||
|
if (this.type !== "eventTicket") {
|
||||||
|
throw new TypeError(
|
||||||
|
Messages.UPCOMING_PASS_INFORMATION.UNEXPECTED_PASS_TYPE_GET,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this[propsSymbol].upcomingPassInformation || [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows setting a transitType property
|
* Allows setting a transitType property
|
||||||
* for a boardingPass.
|
* for a boardingPass.
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ export const PREFERRED_STYLE_SCHEMES = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const UPCOMING_PASS_INFORMATION = {
|
export const UPCOMING_PASS_INFORMATION = {
|
||||||
UNEXPECTED_PASS_TYPE:
|
UNEXPECTED_PASS_TYPE_SET:
|
||||||
"Cannot set upcomingPassInformation on a pass with type different from eventTicket.",
|
"Cannot set upcomingPassInformation on a pass with type different from eventTicket.",
|
||||||
|
UNEXPECTED_PASS_TYPE_GET:
|
||||||
|
"Cannot get upcomingPassInformation on a pass with type different from eventTicket.",
|
||||||
UNEXPECTED_STYLE_SCHEME:
|
UNEXPECTED_STYLE_SCHEME:
|
||||||
"Cannot set upcomingPassInformation because 'preferredStyleSchemes' does not include 'posterEventTicket' style.",
|
"Cannot set upcomingPassInformation because 'preferredStyleSchemes' does not include 'posterEventTicket' style.",
|
||||||
INVALID:
|
INVALID:
|
||||||
|
|||||||
Reference in New Issue
Block a user