@@ -8,6 +8,19 @@ interface AddEventListenerOptions extends EventListenerOptions {
8
8
signal?: AbortSignal;
9
9
}
10
10
11
+ interface AddressErrors {
12
+ addressLine?: string;
13
+ city?: string;
14
+ country?: string;
15
+ dependentLocality?: string;
16
+ organization?: string;
17
+ phone?: string;
18
+ postalCode?: string;
19
+ recipient?: string;
20
+ region?: string;
21
+ sortingCode?: string;
22
+ }
23
+
11
24
interface AesCbcParams extends Algorithm {
12
25
iv: BufferSource;
13
26
}
@@ -1091,6 +1104,12 @@ interface PannerOptions extends AudioNodeOptions {
1091
1104
rolloffFactor?: number;
1092
1105
}
1093
1106
1107
+ interface PayerErrors {
1108
+ email?: string;
1109
+ name?: string;
1110
+ phone?: string;
1111
+ }
1112
+
1094
1113
interface PaymentCurrencyAmount {
1095
1114
currency: string;
1096
1115
value: string;
@@ -1099,6 +1118,7 @@ interface PaymentCurrencyAmount {
1099
1118
interface PaymentDetailsBase {
1100
1119
displayItems?: PaymentItem[];
1101
1120
modifiers?: PaymentDetailsModifier[];
1121
+ shippingOptions?: PaymentShippingOption[];
1102
1122
}
1103
1123
1104
1124
interface PaymentDetailsInit extends PaymentDetailsBase {
@@ -1114,7 +1134,9 @@ interface PaymentDetailsModifier {
1114
1134
}
1115
1135
1116
1136
interface PaymentDetailsUpdate extends PaymentDetailsBase {
1137
+ error?: string;
1117
1138
paymentMethodErrors?: any;
1139
+ shippingAddressErrors?: AddressErrors;
1118
1140
total?: PaymentItem;
1119
1141
}
1120
1142
@@ -1134,12 +1156,28 @@ interface PaymentMethodData {
1134
1156
supportedMethods: string;
1135
1157
}
1136
1158
1159
+ interface PaymentOptions {
1160
+ requestPayerEmail?: boolean;
1161
+ requestPayerName?: boolean;
1162
+ requestPayerPhone?: boolean;
1163
+ requestShipping?: boolean;
1164
+ shippingType?: PaymentShippingType;
1165
+ }
1166
+
1137
1167
interface PaymentRequestUpdateEventInit extends EventInit {
1138
1168
}
1139
1169
1170
+ interface PaymentShippingOption {
1171
+ amount: PaymentCurrencyAmount;
1172
+ id: string;
1173
+ label: string;
1174
+ selected?: boolean;
1175
+ }
1176
+
1140
1177
interface PaymentValidationErrors {
1141
1178
error?: string;
1142
- paymentMethod?: any;
1179
+ payer?: PayerErrors;
1180
+ shippingAddress?: AddressErrors;
1143
1181
}
1144
1182
1145
1183
interface Pbkdf2Params extends Algorithm {
@@ -1189,6 +1227,8 @@ interface PlaneLayout {
1189
1227
}
1190
1228
1191
1229
interface PointerEventInit extends MouseEventInit {
1230
+ altitudeAngle?: number;
1231
+ azimuthAngle?: number;
1192
1232
coalescedEvents?: PointerEvent[];
1193
1233
height?: number;
1194
1234
isPrimary?: boolean;
@@ -8720,7 +8760,7 @@ interface FontFace {
8720
8760
8721
8761
declare var FontFace: {
8722
8762
prototype: FontFace;
8723
- new(family: string, source: string | BinaryData , descriptors?: FontFaceDescriptors): FontFace;
8763
+ new(family: string, source: string | BufferSource , descriptors?: FontFaceDescriptors): FontFace;
8724
8764
};
8725
8765
8726
8766
interface FontFaceSetEventMap {
@@ -16731,6 +16771,37 @@ declare var Path2D: {
16731
16771
new(path?: Path2D | string): Path2D;
16732
16772
};
16733
16773
16774
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress) */
16775
+ interface PaymentAddress {
16776
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/addressLine) */
16777
+ readonly addressLine: ReadonlyArray<string>;
16778
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/city) */
16779
+ readonly city: string;
16780
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/country) */
16781
+ readonly country: string;
16782
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/dependentLocality) */
16783
+ readonly dependentLocality: string;
16784
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/organization) */
16785
+ readonly organization: string;
16786
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/phone) */
16787
+ readonly phone: string;
16788
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/postalCode) */
16789
+ readonly postalCode: string;
16790
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/recipient) */
16791
+ readonly recipient: string;
16792
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/region) */
16793
+ readonly region: string;
16794
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/sortingCode) */
16795
+ readonly sortingCode: string;
16796
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ContactAddress/toJSON) */
16797
+ toJSON(): any;
16798
+ }
16799
+
16800
+ declare var PaymentAddress: {
16801
+ prototype: PaymentAddress;
16802
+ new(): PaymentAddress;
16803
+ };
16804
+
16734
16805
/**
16735
16806
* Available only in secure contexts.
16736
16807
*
@@ -16750,6 +16821,8 @@ declare var PaymentMethodChangeEvent: {
16750
16821
16751
16822
interface PaymentRequestEventMap {
16752
16823
"paymentmethodchange": Event;
16824
+ "shippingaddresschange": Event;
16825
+ "shippingoptionchange": Event;
16753
16826
}
16754
16827
16755
16828
/**
@@ -16763,6 +16836,36 @@ interface PaymentRequest extends EventTarget {
16763
16836
readonly id: string;
16764
16837
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/paymentmethodchange_event) */
16765
16838
onpaymentmethodchange: ((this: PaymentRequest, ev: Event) => any) | null;
16839
+ /**
16840
+ * @deprecated
16841
+ *
16842
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/shippingaddresschange_event)
16843
+ */
16844
+ onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;
16845
+ /**
16846
+ * @deprecated
16847
+ *
16848
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/shippingoptionchange_event)
16849
+ */
16850
+ onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null;
16851
+ /**
16852
+ * @deprecated
16853
+ *
16854
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/shippingAddress)
16855
+ */
16856
+ readonly shippingAddress: PaymentAddress | null;
16857
+ /**
16858
+ * @deprecated
16859
+ *
16860
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/shippingOption)
16861
+ */
16862
+ readonly shippingOption: string | null;
16863
+ /**
16864
+ * @deprecated
16865
+ *
16866
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/shippingType)
16867
+ */
16868
+ readonly shippingType: PaymentShippingType | null;
16766
16869
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/abort) */
16767
16870
abort(): Promise<void>;
16768
16871
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentRequest/canMakePayment) */
@@ -16777,7 +16880,7 @@ interface PaymentRequest extends EventTarget {
16777
16880
16778
16881
declare var PaymentRequest: {
16779
16882
prototype: PaymentRequest;
16780
- new(methodData: PaymentMethodData[], details: PaymentDetailsInit): PaymentRequest;
16883
+ new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions ): PaymentRequest;
16781
16884
};
16782
16885
16783
16886
/**
@@ -16796,6 +16899,10 @@ declare var PaymentRequestUpdateEvent: {
16796
16899
new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;
16797
16900
};
16798
16901
16902
+ interface PaymentResponseEventMap {
16903
+ "payerdetailchange": Event;
16904
+ }
16905
+
16799
16906
/**
16800
16907
* This Payment Request API interface is returned after a user selects a payment method and approves a payment request.
16801
16908
* Available only in secure contexts.
@@ -16807,14 +16914,54 @@ interface PaymentResponse extends EventTarget {
16807
16914
readonly details: any;
16808
16915
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/methodName) */
16809
16916
readonly methodName: string;
16917
+ /**
16918
+ * @deprecated
16919
+ *
16920
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/payerdetailchange_event)
16921
+ */
16922
+ onpayerdetailchange: ((this: PaymentResponse, ev: Event) => any) | null;
16923
+ /**
16924
+ * @deprecated
16925
+ *
16926
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/payerEmail)
16927
+ */
16928
+ readonly payerEmail: string | null;
16929
+ /**
16930
+ * @deprecated
16931
+ *
16932
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/payerName)
16933
+ */
16934
+ readonly payerName: string | null;
16935
+ /**
16936
+ * @deprecated
16937
+ *
16938
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/payerPhone)
16939
+ */
16940
+ readonly payerPhone: string | null;
16810
16941
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/requestId) */
16811
16942
readonly requestId: string;
16943
+ /**
16944
+ * @deprecated
16945
+ *
16946
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/shippingAddress)
16947
+ */
16948
+ readonly shippingAddress: PaymentAddress | null;
16949
+ /**
16950
+ * @deprecated
16951
+ *
16952
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/shippingOption)
16953
+ */
16954
+ readonly shippingOption: string | null;
16812
16955
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/complete) */
16813
16956
complete(result?: PaymentComplete): Promise<void>;
16814
16957
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/retry) */
16815
16958
retry(errorFields?: PaymentValidationErrors): Promise<void>;
16816
16959
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PaymentResponse/toJSON) */
16817
16960
toJSON(): any;
16961
+ addEventListener<K extends keyof PaymentResponseEventMap>(type: K, listener: (this: PaymentResponse, ev: PaymentResponseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
16962
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
16963
+ removeEventListener<K extends keyof PaymentResponseEventMap>(type: K, listener: (this: PaymentResponse, ev: PaymentResponseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
16964
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
16818
16965
}
16819
16966
16820
16967
declare var PaymentResponse: {
@@ -27985,7 +28132,6 @@ type AutoFill = AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${Optiona
27985
28132
type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
27986
28133
type AutoFillSection = `section-${string}`;
27987
28134
type BigInteger = Uint8Array;
27988
- type BinaryData = ArrayBuffer | ArrayBufferView;
27989
28135
type BlobPart = BufferSource | Blob | string;
27990
28136
type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
27991
28137
type BufferSource = ArrayBufferView | ArrayBuffer;
@@ -28154,6 +28300,7 @@ type OscillatorType = "custom" | "sawtooth" | "sine" | "square" | "triangle";
28154
28300
type OverSampleType = "2x" | "4x" | "none";
28155
28301
type PanningModelType = "HRTF" | "equalpower";
28156
28302
type PaymentComplete = "fail" | "success" | "unknown";
28303
+ type PaymentShippingType = "delivery" | "pickup" | "shipping";
28157
28304
type PermissionName = "geolocation" | "midi" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "storage-access";
28158
28305
type PermissionState = "denied" | "granted" | "prompt";
28159
28306
type PlaybackDirection = "alternate" | "alternate-reverse" | "normal" | "reverse";
0 commit comments