Added implementation method to add upcoming pass information

This commit is contained in:
Alexander Cerutti
2025-09-17 21:46:53 +02:00
parent 51388ddf81
commit 8fc00dc9bb
2 changed files with 37 additions and 0 deletions

View File

@@ -261,6 +261,34 @@ export default class PKPass extends Bundle {
this[propsSymbol].preferredStyleSchemes = value;
}
public set upcomingPassInformation(
value: Schemas.UpcomingPassInformationEntry[],
) {
Utils.assertUnfrozen(this);
if (this.type !== "eventTicket") {
throw new TypeError(
Messages.UPCOMING_PASS_INFORMATION.UNEXPECTED_PASS_TYPE,
);
}
if (!this.preferredStyleSchemes?.includes("posterEventTicket")) {
throw new TypeError(
Messages.UPCOMING_PASS_INFORMATION.UNEXPECTED_STYLE_SCHEME,
);
}
for (const entry of value) {
Schemas.assertValidity(
Schemas.UpcomingPassInformationEntry,
entry,
Messages.UPCOMING_PASS_INFORMATION.INVALID,
);
}
this[propsSymbol].upcomingPassInformation = value;
}
/**
* Allows setting a transitType property
* for a boardingPass.