diff --git a/src/schemas/Field.ts b/src/schemas/Field.ts index 1c837c5..f9852a3 100644 --- a/src/schemas/Field.ts +++ b/src/schemas/Field.ts @@ -1,6 +1,31 @@ import Joi from "joi"; 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 */ @@ -8,18 +33,18 @@ import { Semantics } from "./Semantics"; export interface Field { attributedValue?: string | number | Date; changeMessage?: string; - dataDetectorTypes?: string[]; + dataDetectorTypes?: PKDataDetectorType[]; label?: string; - textAlignment?: string; + textAlignment?: PKTextAlignmentType; key: string; value: string | number | Date; semantics?: Semantics; - dateStyle?: string; + dateStyle?: PKDateStyleType; ignoresTimeZone?: boolean; isRelative?: boolean; timeStyle?: string; currencyCode?: string; - numberStyle?: string; + numberStyle?: PKNumberStyleType; } export interface FieldWithRow extends Field {