Merge pull request #139 from Songkeys/fix-pass-field-types

fix: complete pass field types for typescript
This commit is contained in:
Alexander Cerutti
2023-04-03 21:18:13 +02:00
committed by GitHub

View File

@@ -1,6 +1,31 @@
import Joi from "joi"; import Joi from "joi";
import { Semantics } from "./Semantics"; import { Semantics } from "./Semantics";
export type PKDataDetectorType =
| "PKDataDetectorTypePhoneNumber"
| "PKDataDetectorTypeLink"
| "PKDataDetectorTypeAddress"
| "PKDataDetectorTypeCalendarEvent";
export type PKTextAlignmentType =
| "PKTextAlignmentLeft"
| "PKTextAlignmentCenter"
| "PKTextAlignmentRight"
| "PKTextAlignmentNatural";
export type PKDateStyleType =
| "PKDateStyleNone"
| "PKDateStyleShort"
| "PKDateStyleMedium"
| "PKDateStyleLong"
| "PKDateStyleFull";
export type PKNumberStyleType =
| "PKNumberStyleDecimal"
| "PKNumberStylePercent"
| "PKNumberStyleScientific"
| "PKNumberStyleSpellOut";
/** /**
* @see https://developer.apple.com/documentation/walletpasses/passfieldcontent * @see https://developer.apple.com/documentation/walletpasses/passfieldcontent
*/ */
@@ -8,18 +33,18 @@ import { Semantics } from "./Semantics";
export interface Field { export interface Field {
attributedValue?: string | number | Date; attributedValue?: string | number | Date;
changeMessage?: string; changeMessage?: string;
dataDetectorTypes?: string[]; dataDetectorTypes?: PKDataDetectorType[];
label?: string; label?: string;
textAlignment?: string; textAlignment?: PKTextAlignmentType;
key: string; key: string;
value: string | number | Date; value: string | number | Date;
semantics?: Semantics; semantics?: Semantics;
dateStyle?: string; dateStyle?: PKDateStyleType;
ignoresTimeZone?: boolean; ignoresTimeZone?: boolean;
isRelative?: boolean; isRelative?: boolean;
timeStyle?: string; timeStyle?: string;
currencyCode?: string; currencyCode?: string;
numberStyle?: string; numberStyle?: PKNumberStyleType;
} }
export interface FieldWithRow extends Field { export interface FieldWithRow extends Field {