mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Added preferredStyleSchemes getter error throwing
This commit is contained in:
@@ -220,11 +220,16 @@ export default class PKPass extends Bundle {
|
|||||||
* Allows accessing to iOS 18 new Event Ticket
|
* Allows accessing to iOS 18 new Event Ticket
|
||||||
* property `preferredStyleSchemes`.
|
* property `preferredStyleSchemes`.
|
||||||
*
|
*
|
||||||
* @throws (automatically) if current type is not
|
* @throws if current type is not "eventTicket".
|
||||||
* "eventTicket".
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public get preferredStyleSchemes(): Schemas.PreferredStyleSchemes {
|
public get preferredStyleSchemes(): Schemas.PreferredStyleSchemes {
|
||||||
|
if (this.type !== "eventTicket") {
|
||||||
|
throw new TypeError(
|
||||||
|
Messages.PREFERRED_STYLE_SCHEMES.UNEXPECTED_PASS_TYPE_GET,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return this[propsSymbol].preferredStyleSchemes;
|
return this[propsSymbol].preferredStyleSchemes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +246,7 @@ export default class PKPass extends Bundle {
|
|||||||
|
|
||||||
if (this.type !== "eventTicket") {
|
if (this.type !== "eventTicket") {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
Messages.PREFERRED_STYLE_SCHEMES.UNEXPECTED_PASS_TYPE,
|
Messages.PREFERRED_STYLE_SCHEMES.UNEXPECTED_PASS_TYPE_SET,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ export const TRANSIT_TYPE = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const PREFERRED_STYLE_SCHEMES = {
|
export const PREFERRED_STYLE_SCHEMES = {
|
||||||
UNEXPECTED_PASS_TYPE:
|
UNEXPECTED_PASS_TYPE_SET:
|
||||||
"Cannot set preferredStyleSchemes on a pass with type different from eventTicket.",
|
"Cannot set preferredStyleSchemes on a pass with type different from eventTicket.",
|
||||||
|
UNEXPECTED_PASS_TYPE_GET:
|
||||||
|
"Cannot get preferredStyleSchemes on a pass with type different from eventTicket.",
|
||||||
INVALID:
|
INVALID:
|
||||||
"Cannot set preferredStyleSchemes because not compliant with Apple specifications - %s",
|
"Cannot set preferredStyleSchemes because not compliant with Apple specifications - %s",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user