@primer-io/primer-js 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ar.6MRFCKX4.js → ar.KRXB3WQO.js} +1 -1
- package/dist/chunks/{bg.HRSMU7Y5.js → bg.6SKJRXIR.js} +1 -1
- package/dist/chunks/{ca.3FSHJL7U.js → ca.SANDLFEK.js} +1 -1
- package/dist/chunks/chunk.DV3REKZU.js +1 -0
- package/dist/chunks/{cs.WAO4WFS3.js → cs.FC4I5M3C.js} +1 -1
- package/dist/chunks/{da.4OFYGDVA.js → da.YI32NZ7B.js} +1 -1
- package/dist/chunks/{de.3FZS52IN.js → de.7M7UFQB7.js} +1 -1
- package/dist/chunks/{el.A4R7VG5T.js → el.XSGTYDZR.js} +1 -1
- package/dist/chunks/en-GB.VO4GDE3X.js +1 -0
- package/dist/chunks/en.MNFLVOE3.js +1 -0
- package/dist/chunks/{es-AR.QKHDL4JV.js → es-AR.TBWVUZEF.js} +1 -1
- package/dist/chunks/{es-MX.GG7MJMG2.js → es-MX.6EMWUABR.js} +1 -1
- package/dist/chunks/{es.FEZ6BF3S.js → es.XZLDFHYI.js} +1 -1
- package/dist/chunks/{et-EE.FJLPTMF3.js → et-EE.JBSFMKZ2.js} +1 -1
- package/dist/chunks/{fi-FI.DM5R27A5.js → fi-FI.I75VK2ID.js} +1 -1
- package/dist/chunks/{fr.YZV52NTA.js → fr.JBNP6RXT.js} +1 -1
- package/dist/chunks/{he.6SCF3XZZ.js → he.PW253QAL.js} +1 -1
- package/dist/chunks/{hr.PPDZ7AAS.js → hr.LM4RITYJ.js} +1 -1
- package/dist/chunks/{hu.6WOPSGLW.js → hu.JGCKQA6J.js} +1 -1
- package/dist/chunks/{id.NS22WGWL.js → id.VBXULDDY.js} +1 -1
- package/dist/chunks/{it.42TO3R4G.js → it.7Q6BFLDK.js} +1 -1
- package/dist/chunks/{ja.UEGHEUAP.js → ja.QOC76SSC.js} +1 -1
- package/dist/chunks/{ko.HTMDY6RY.js → ko.BANZIFNH.js} +1 -1
- package/dist/chunks/{lt-LT.4U3GBQTQ.js → lt-LT.Q2SRJOKH.js} +1 -1
- package/dist/chunks/{lt.73ME4TDM.js → lt.XMNFEN5T.js} +1 -1
- package/dist/chunks/{lv-LV.JRWO2BF6.js → lv-LV.3AJDTMU5.js} +1 -1
- package/dist/chunks/{lv.KROS45TV.js → lv.TFPDXNEV.js} +1 -1
- package/dist/chunks/{ms.HE3SWJFQ.js → ms.FPTX4NM4.js} +1 -1
- package/dist/chunks/{nb.TR6TEKBY.js → nb.CAFSKRQ2.js} +1 -1
- package/dist/chunks/{nl.V5QP6OXL.js → nl.7BPSDYTC.js} +1 -1
- package/dist/chunks/{nl_NL.FCVWIF3Y.js → nl_NL.6ZVCFPVW.js} +1 -1
- package/dist/chunks/{pl.DQZDG7LR.js → pl.RF34QM23.js} +1 -1
- package/dist/chunks/{pt-BR.CR4ROBVE.js → pt-BR.AKDHLRUA.js} +1 -1
- package/dist/chunks/{pt.JRWVFJPX.js → pt.VBALOWHZ.js} +1 -1
- package/dist/chunks/{ro.NRMWYY3F.js → ro.WN7VCF27.js} +1 -1
- package/dist/chunks/{ru.OWSKHXVO.js → ru.ICXGVGRR.js} +1 -1
- package/dist/chunks/{sk.YGBRNNWT.js → sk.SIP5JIOX.js} +1 -1
- package/dist/chunks/{sl.IRTDTNTP.js → sl.R77UEKCA.js} +1 -1
- package/dist/chunks/{sr-RS.AWGLHKVE.js → sr-RS.6M2YSTDX.js} +1 -1
- package/dist/chunks/{sv.O4BXFGNF.js → sv.33ZY4CDS.js} +1 -1
- package/dist/chunks/{th.GZCEBRT2.js → th.M27YUIZC.js} +1 -1
- package/dist/chunks/{tr.ZDILMEEO.js → tr.Q2SIY6NA.js} +1 -1
- package/dist/chunks/{uk-UA.JUUBOEW3.js → uk-UA.EJZOGSJR.js} +1 -1
- package/dist/chunks/{vi.IN7CFTLL.js → vi.3RROGLXM.js} +1 -1
- package/dist/chunks/zf.GGWFQ3Y7.js +1 -0
- package/dist/chunks/{zh-CN.RBRAS4RP.js → zh-CN.MQHNRMN4.js} +1 -1
- package/dist/chunks/{zh-HK.4CK7LBWM.js → zh-HK.WNR7XUSX.js} +1 -1
- package/dist/chunks/{zh-TW.374TMWNJ.js → zh-TW.GNCY2PNY.js} +1 -1
- package/dist/custom-elements.json +1318 -847
- package/dist/jsx/index.d.ts +85 -87
- package/dist/primer-loader.d.ts +858 -2484
- package/dist/primer-loader.js +138 -2662
- package/dist/primer-react-wrappers.js +121 -2106
- package/dist/vscode.html-custom-data.json +54 -30
- package/dist/web-types.json +195 -117
- package/package.json +7 -2
- package/dist/chunks/chunk.I6YWTZRK.js +0 -1
- package/dist/chunks/en-GB.ILZ7SXSW.js +0 -1
- package/dist/chunks/en.7GZJA7MN.js +0 -1
- package/dist/chunks/zf.YT47ULXR.js +0 -1
package/dist/primer-loader.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { Task, initialState } from '@lit/task';
|
|
2
|
+
import { CSSResult, LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, SVGTemplateResult, TemplateResult, nothing } from 'lit';
|
|
3
|
+
|
|
1
4
|
export type CardNetwork = {
|
|
2
5
|
displayName: string;
|
|
3
6
|
network: string;
|
|
4
7
|
};
|
|
5
|
-
export type
|
|
8
|
+
export type CardNetworksContextType = {
|
|
6
9
|
detectedCardNetwork: CardNetwork | null;
|
|
7
10
|
selectableCardNetworks: CardNetwork[];
|
|
8
11
|
isLoading: boolean;
|
|
@@ -18,1045 +21,7 @@ export type SdkState = {
|
|
|
18
21
|
details?: Record<string, unknown>;
|
|
19
22
|
} | null;
|
|
20
23
|
};
|
|
21
|
-
export type
|
|
22
|
-
/**
|
|
23
|
-
* A CSSResult or native CSSStyleSheet.
|
|
24
|
-
*
|
|
25
|
-
* In browsers that support constructible CSS style sheets, CSSStyleSheet
|
|
26
|
-
* object can be used for styling along side CSSResult from the `css`
|
|
27
|
-
* template tag.
|
|
28
|
-
*/
|
|
29
|
-
export type CSSResultOrNative = CSSResult | CSSStyleSheet;
|
|
30
|
-
export type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;
|
|
31
|
-
/**
|
|
32
|
-
* A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.
|
|
33
|
-
*/
|
|
34
|
-
export type CSSResultGroup = CSSResultOrNative | CSSResultArray;
|
|
35
|
-
declare class CSSResult {
|
|
36
|
-
["_$cssResult$"]: boolean;
|
|
37
|
-
readonly cssText: string;
|
|
38
|
-
private _styleSheet?;
|
|
39
|
-
private _strings;
|
|
40
|
-
private constructor();
|
|
41
|
-
get styleSheet(): CSSStyleSheet | undefined;
|
|
42
|
-
toString(): string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* @license
|
|
46
|
-
* Copyright 2021 Google LLC
|
|
47
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* An object that can host Reactive Controllers and call their lifecycle
|
|
51
|
-
* callbacks.
|
|
52
|
-
*/
|
|
53
|
-
export interface ReactiveControllerHost {
|
|
54
|
-
/**
|
|
55
|
-
* Adds a controller to the host, which sets up the controller's lifecycle
|
|
56
|
-
* methods to be called with the host's lifecycle.
|
|
57
|
-
*/
|
|
58
|
-
addController(controller: ReactiveController): void;
|
|
59
|
-
/**
|
|
60
|
-
* Removes a controller from the host.
|
|
61
|
-
*/
|
|
62
|
-
removeController(controller: ReactiveController): void;
|
|
63
|
-
/**
|
|
64
|
-
* Requests a host update which is processed asynchronously. The update can
|
|
65
|
-
* be waited on via the `updateComplete` property.
|
|
66
|
-
*/
|
|
67
|
-
requestUpdate(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Returns a Promise that resolves when the host has completed updating.
|
|
70
|
-
* The Promise value is a boolean that is `true` if the element completed the
|
|
71
|
-
* update without triggering another update. The Promise result is `false` if
|
|
72
|
-
* a property was set inside `updated()`. If the Promise is rejected, an
|
|
73
|
-
* exception was thrown during the update.
|
|
74
|
-
*
|
|
75
|
-
* @return A promise of a boolean that indicates if the update resolved
|
|
76
|
-
* without triggering another update.
|
|
77
|
-
*/
|
|
78
|
-
readonly updateComplete: Promise<boolean>;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* A Reactive Controller is an object that enables sub-component code
|
|
82
|
-
* organization and reuse by aggregating the state, behavior, and lifecycle
|
|
83
|
-
* hooks related to a single feature.
|
|
84
|
-
*
|
|
85
|
-
* Controllers are added to a host component, or other object that implements
|
|
86
|
-
* the `ReactiveControllerHost` interface, via the `addController()` method.
|
|
87
|
-
* They can hook their host components's lifecycle by implementing one or more
|
|
88
|
-
* of the lifecycle callbacks, or initiate an update of the host component by
|
|
89
|
-
* calling `requestUpdate()` on the host.
|
|
90
|
-
*/
|
|
91
|
-
export interface ReactiveController {
|
|
92
|
-
/**
|
|
93
|
-
* Called when the host is connected to the component tree. For custom
|
|
94
|
-
* element hosts, this corresponds to the `connectedCallback()` lifecycle,
|
|
95
|
-
* which is only called when the component is connected to the document.
|
|
96
|
-
*/
|
|
97
|
-
hostConnected?(): void;
|
|
98
|
-
/**
|
|
99
|
-
* Called when the host is disconnected from the component tree. For custom
|
|
100
|
-
* element hosts, this corresponds to the `disconnectedCallback()` lifecycle,
|
|
101
|
-
* which is called the host or an ancestor component is disconnected from the
|
|
102
|
-
* document.
|
|
103
|
-
*/
|
|
104
|
-
hostDisconnected?(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Called during the client-side host update, just before the host calls
|
|
107
|
-
* its own update.
|
|
108
|
-
*
|
|
109
|
-
* Code in `update()` can depend on the DOM as it is not called in
|
|
110
|
-
* server-side rendering.
|
|
111
|
-
*/
|
|
112
|
-
hostUpdate?(): void;
|
|
113
|
-
/**
|
|
114
|
-
* Called after a host update, just before the host calls firstUpdated and
|
|
115
|
-
* updated. It is not called in server-side rendering.
|
|
116
|
-
*
|
|
117
|
-
*/
|
|
118
|
-
hostUpdated?(): void;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Converts property values to and from attribute values.
|
|
122
|
-
*/
|
|
123
|
-
export interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {
|
|
124
|
-
/**
|
|
125
|
-
* Called to convert an attribute value to a property
|
|
126
|
-
* value.
|
|
127
|
-
*/
|
|
128
|
-
fromAttribute?(value: string | null, type?: TypeHint): Type;
|
|
129
|
-
/**
|
|
130
|
-
* Called to convert a property value to an attribute
|
|
131
|
-
* value.
|
|
132
|
-
*
|
|
133
|
-
* It returns unknown instead of string, to be compatible with
|
|
134
|
-
* https://github.com/WICG/trusted-types (and similar efforts).
|
|
135
|
-
*/
|
|
136
|
-
toAttribute?(value: Type, type?: TypeHint): unknown;
|
|
137
|
-
}
|
|
138
|
-
export type AttributeConverter<Type = unknown, TypeHint = unknown> = ComplexAttributeConverter<Type> | ((value: string | null, type?: TypeHint) => Type);
|
|
139
|
-
/**
|
|
140
|
-
* Defines options for a property accessor.
|
|
141
|
-
*/
|
|
142
|
-
export interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {
|
|
143
|
-
/**
|
|
144
|
-
* When set to `true`, indicates the property is internal private state. The
|
|
145
|
-
* property should not be set by users. When using TypeScript, this property
|
|
146
|
-
* should be marked as `private` or `protected`, and it is also a common
|
|
147
|
-
* practice to use a leading `_` in the name. The property is not added to
|
|
148
|
-
* `observedAttributes`.
|
|
149
|
-
*/
|
|
150
|
-
readonly state?: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Indicates how and whether the property becomes an observed attribute.
|
|
153
|
-
* If the value is `false`, the property is not added to `observedAttributes`.
|
|
154
|
-
* If true or absent, the lowercased property name is observed (e.g. `fooBar`
|
|
155
|
-
* becomes `foobar`). If a string, the string value is observed (e.g
|
|
156
|
-
* `attribute: 'foo-bar'`).
|
|
157
|
-
*/
|
|
158
|
-
readonly attribute?: boolean | string;
|
|
159
|
-
/**
|
|
160
|
-
* Indicates the type of the property. This is used only as a hint for the
|
|
161
|
-
* `converter` to determine how to convert the attribute
|
|
162
|
-
* to/from a property.
|
|
163
|
-
*/
|
|
164
|
-
readonly type?: TypeHint;
|
|
165
|
-
/**
|
|
166
|
-
* Indicates how to convert the attribute to/from a property. If this value
|
|
167
|
-
* is a function, it is used to convert the attribute value a the property
|
|
168
|
-
* value. If it's an object, it can have keys for `fromAttribute` and
|
|
169
|
-
* `toAttribute`. If no `toAttribute` function is provided and
|
|
170
|
-
* `reflect` is set to `true`, the property value is set directly to the
|
|
171
|
-
* attribute. A default `converter` is used if none is provided; it supports
|
|
172
|
-
* `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,
|
|
173
|
-
* when a property changes and the converter is used to update the attribute,
|
|
174
|
-
* the property is never updated again as a result of the attribute changing,
|
|
175
|
-
* and vice versa.
|
|
176
|
-
*/
|
|
177
|
-
readonly converter?: AttributeConverter<Type, TypeHint>;
|
|
178
|
-
/**
|
|
179
|
-
* Indicates if the property should reflect to an attribute.
|
|
180
|
-
* If `true`, when the property is set, the attribute is set using the
|
|
181
|
-
* attribute name determined according to the rules for the `attribute`
|
|
182
|
-
* property option and the value of the property converted using the rules
|
|
183
|
-
* from the `converter` property option.
|
|
184
|
-
*/
|
|
185
|
-
readonly reflect?: boolean;
|
|
186
|
-
/**
|
|
187
|
-
* A function that indicates if a property should be considered changed when
|
|
188
|
-
* it is set. The function should take the `newValue` and `oldValue` and
|
|
189
|
-
* return `true` if an update should be requested.
|
|
190
|
-
*/
|
|
191
|
-
hasChanged?(value: Type, oldValue: Type): boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Indicates whether an accessor will be created for this property. By
|
|
194
|
-
* default, an accessor will be generated for this property that requests an
|
|
195
|
-
* update when set. If this flag is `true`, no accessor will be created, and
|
|
196
|
-
* it will be the user's responsibility to call
|
|
197
|
-
* `this.requestUpdate(propertyName, oldValue)` to request an update when
|
|
198
|
-
* the property changes.
|
|
199
|
-
*/
|
|
200
|
-
readonly noAccessor?: boolean;
|
|
201
|
-
/**
|
|
202
|
-
* When `true`, uses the initial value of the property as the default value,
|
|
203
|
-
* which changes how attributes are handled:
|
|
204
|
-
* - The initial value does *not* reflect, even if the `reflect` option is `true`.
|
|
205
|
-
* Subsequent changes to the property will reflect, even if they are equal to the
|
|
206
|
-
* default value.
|
|
207
|
-
* - When the attribute is removed, the property is set to the default value
|
|
208
|
-
* - The initial value will not trigger an old value in the `changedProperties` map
|
|
209
|
-
* argument to update lifecycle methods.
|
|
210
|
-
*
|
|
211
|
-
* When set, properties must be initialized, either with a field initializer, or an
|
|
212
|
-
* assignment in the constructor. Not initializing the property may lead to
|
|
213
|
-
* improper handling of subsequent property assignments.
|
|
214
|
-
*
|
|
215
|
-
* While this behavior is opt-in, most properties that reflect to attributes should
|
|
216
|
-
* use `useDefault: true` so that their initial values do not reflect.
|
|
217
|
-
*/
|
|
218
|
-
useDefault?: boolean;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Map of properties to PropertyDeclaration options. For each property an
|
|
222
|
-
* accessor is made, and the property is processed according to the
|
|
223
|
-
* PropertyDeclaration options.
|
|
224
|
-
*/
|
|
225
|
-
export interface PropertyDeclarations {
|
|
226
|
-
readonly [key: string]: PropertyDeclaration;
|
|
227
|
-
}
|
|
228
|
-
export type PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;
|
|
229
|
-
/**
|
|
230
|
-
* A Map of property keys to values.
|
|
231
|
-
*
|
|
232
|
-
* Takes an optional type parameter T, which when specified as a non-any,
|
|
233
|
-
* non-unknown type, will make the Map more strongly-typed, associating the map
|
|
234
|
-
* keys with their corresponding value type on T.
|
|
235
|
-
*
|
|
236
|
-
* Use `PropertyValues<this>` when overriding ReactiveElement.update() and
|
|
237
|
-
* other lifecycle methods in order to get stronger type-checking on keys
|
|
238
|
-
* and values.
|
|
239
|
-
*/
|
|
240
|
-
export type PropertyValues<T = any> = T extends object ? PropertyValueMap<T> : Map<PropertyKey, unknown>;
|
|
241
|
-
/**
|
|
242
|
-
* Do not use, instead prefer {@linkcode PropertyValues}.
|
|
243
|
-
*/
|
|
244
|
-
export interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {
|
|
245
|
-
get<K extends keyof T>(k: K): T[K] | undefined;
|
|
246
|
-
set<K extends keyof T>(key: K, value: T[K]): this;
|
|
247
|
-
has<K extends keyof T>(k: K): boolean;
|
|
248
|
-
delete<K extends keyof T>(k: K): boolean;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* A string representing one of the supported dev mode warning categories.
|
|
252
|
-
*/
|
|
253
|
-
export type WarningKind = "change-in-update" | "migration" | "async-perform-update";
|
|
254
|
-
export type Initializer = (element: ReactiveElement) => void;
|
|
255
|
-
declare global {
|
|
256
|
-
interface SymbolConstructor {
|
|
257
|
-
readonly metadata: unique symbol;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
declare global {
|
|
261
|
-
var litPropertyMetadata: WeakMap<object, Map<PropertyKey, PropertyDeclaration>>;
|
|
262
|
-
}
|
|
263
|
-
declare abstract class ReactiveElement extends HTMLElement implements ReactiveControllerHost {
|
|
264
|
-
/**
|
|
265
|
-
* Read or set all the enabled warning categories for this class.
|
|
266
|
-
*
|
|
267
|
-
* This property is only used in development builds.
|
|
268
|
-
*
|
|
269
|
-
* @nocollapse
|
|
270
|
-
* @category dev-mode
|
|
271
|
-
*/
|
|
272
|
-
static enabledWarnings?: WarningKind[];
|
|
273
|
-
/**
|
|
274
|
-
* Enable the given warning category for this class.
|
|
275
|
-
*
|
|
276
|
-
* This method only exists in development builds, so it should be accessed
|
|
277
|
-
* with a guard like:
|
|
278
|
-
*
|
|
279
|
-
* ```ts
|
|
280
|
-
* // Enable for all ReactiveElement subclasses
|
|
281
|
-
* ReactiveElement.enableWarning?.('migration');
|
|
282
|
-
*
|
|
283
|
-
* // Enable for only MyElement and subclasses
|
|
284
|
-
* MyElement.enableWarning?.('migration');
|
|
285
|
-
* ```
|
|
286
|
-
*
|
|
287
|
-
* @nocollapse
|
|
288
|
-
* @category dev-mode
|
|
289
|
-
*/
|
|
290
|
-
static enableWarning?: (warningKind: WarningKind) => void;
|
|
291
|
-
/**
|
|
292
|
-
* Disable the given warning category for this class.
|
|
293
|
-
*
|
|
294
|
-
* This method only exists in development builds, so it should be accessed
|
|
295
|
-
* with a guard like:
|
|
296
|
-
*
|
|
297
|
-
* ```ts
|
|
298
|
-
* // Disable for all ReactiveElement subclasses
|
|
299
|
-
* ReactiveElement.disableWarning?.('migration');
|
|
300
|
-
*
|
|
301
|
-
* // Disable for only MyElement and subclasses
|
|
302
|
-
* MyElement.disableWarning?.('migration');
|
|
303
|
-
* ```
|
|
304
|
-
*
|
|
305
|
-
* @nocollapse
|
|
306
|
-
* @category dev-mode
|
|
307
|
-
*/
|
|
308
|
-
static disableWarning?: (warningKind: WarningKind) => void;
|
|
309
|
-
/**
|
|
310
|
-
* Adds an initializer function to the class that is called during instance
|
|
311
|
-
* construction.
|
|
312
|
-
*
|
|
313
|
-
* This is useful for code that runs against a `ReactiveElement`
|
|
314
|
-
* subclass, such as a decorator, that needs to do work for each
|
|
315
|
-
* instance, such as setting up a `ReactiveController`.
|
|
316
|
-
*
|
|
317
|
-
* ```ts
|
|
318
|
-
* const myDecorator = (target: typeof ReactiveElement, key: string) => {
|
|
319
|
-
* target.addInitializer((instance: ReactiveElement) => {
|
|
320
|
-
* // This is run during construction of the element
|
|
321
|
-
* new MyController(instance);
|
|
322
|
-
* });
|
|
323
|
-
* }
|
|
324
|
-
* ```
|
|
325
|
-
*
|
|
326
|
-
* Decorating a field will then cause each instance to run an initializer
|
|
327
|
-
* that adds a controller:
|
|
328
|
-
*
|
|
329
|
-
* ```ts
|
|
330
|
-
* class MyElement extends LitElement {
|
|
331
|
-
* @myDecorator foo;
|
|
332
|
-
* }
|
|
333
|
-
* ```
|
|
334
|
-
*
|
|
335
|
-
* Initializers are stored per-constructor. Adding an initializer to a
|
|
336
|
-
* subclass does not add it to a superclass. Since initializers are run in
|
|
337
|
-
* constructors, initializers will run in order of the class hierarchy,
|
|
338
|
-
* starting with superclasses and progressing to the instance's class.
|
|
339
|
-
*
|
|
340
|
-
* @nocollapse
|
|
341
|
-
*/
|
|
342
|
-
static addInitializer(initializer: Initializer): void;
|
|
343
|
-
static _initializers?: Initializer[];
|
|
344
|
-
/**
|
|
345
|
-
* Maps attribute names to properties; for example `foobar` attribute to
|
|
346
|
-
* `fooBar` property. Created lazily on user subclasses when finalizing the
|
|
347
|
-
* class.
|
|
348
|
-
* @nocollapse
|
|
349
|
-
*/
|
|
350
|
-
private static __attributeToPropertyMap;
|
|
351
|
-
/**
|
|
352
|
-
* Marks class as having been finalized, which includes creating properties
|
|
353
|
-
* from `static properties`, but does *not* include all properties created
|
|
354
|
-
* from decorators.
|
|
355
|
-
* @nocollapse
|
|
356
|
-
*/
|
|
357
|
-
protected static finalized: true | undefined;
|
|
358
|
-
/**
|
|
359
|
-
* Memoized list of all element properties, including any superclass
|
|
360
|
-
* properties. Created lazily on user subclasses when finalizing the class.
|
|
361
|
-
*
|
|
362
|
-
* @nocollapse
|
|
363
|
-
* @category properties
|
|
364
|
-
*/
|
|
365
|
-
static elementProperties: PropertyDeclarationMap;
|
|
366
|
-
/**
|
|
367
|
-
* User-supplied object that maps property names to `PropertyDeclaration`
|
|
368
|
-
* objects containing options for configuring reactive properties. When
|
|
369
|
-
* a reactive property is set the element will update and render.
|
|
370
|
-
*
|
|
371
|
-
* By default properties are public fields, and as such, they should be
|
|
372
|
-
* considered as primarily settable by element users, either via attribute or
|
|
373
|
-
* the property itself.
|
|
374
|
-
*
|
|
375
|
-
* Generally, properties that are changed by the element should be private or
|
|
376
|
-
* protected fields and should use the `state: true` option. Properties
|
|
377
|
-
* marked as `state` do not reflect from the corresponding attribute
|
|
378
|
-
*
|
|
379
|
-
* However, sometimes element code does need to set a public property. This
|
|
380
|
-
* should typically only be done in response to user interaction, and an event
|
|
381
|
-
* should be fired informing the user; for example, a checkbox sets its
|
|
382
|
-
* `checked` property when clicked and fires a `changed` event. Mutating
|
|
383
|
-
* public properties should typically not be done for non-primitive (object or
|
|
384
|
-
* array) properties. In other cases when an element needs to manage state, a
|
|
385
|
-
* private property set with the `state: true` option should be used. When
|
|
386
|
-
* needed, state properties can be initialized via public properties to
|
|
387
|
-
* facilitate complex interactions.
|
|
388
|
-
* @nocollapse
|
|
389
|
-
* @category properties
|
|
390
|
-
*/
|
|
391
|
-
static properties: PropertyDeclarations;
|
|
392
|
-
/**
|
|
393
|
-
* Memoized list of all element styles.
|
|
394
|
-
* Created lazily on user subclasses when finalizing the class.
|
|
395
|
-
* @nocollapse
|
|
396
|
-
* @category styles
|
|
397
|
-
*/
|
|
398
|
-
static elementStyles: Array<CSSResultOrNative>;
|
|
399
|
-
/**
|
|
400
|
-
* Array of styles to apply to the element. The styles should be defined
|
|
401
|
-
* using the {@linkcode css} tag function, via constructible stylesheets, or
|
|
402
|
-
* imported from native CSS module scripts.
|
|
403
|
-
*
|
|
404
|
-
* Note on Content Security Policy:
|
|
405
|
-
*
|
|
406
|
-
* Element styles are implemented with `<style>` tags when the browser doesn't
|
|
407
|
-
* support adopted StyleSheets. To use such `<style>` tags with the style-src
|
|
408
|
-
* CSP directive, the style-src value must either include 'unsafe-inline' or
|
|
409
|
-
* `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated
|
|
410
|
-
* nonce.
|
|
411
|
-
*
|
|
412
|
-
* To provide a nonce to use on generated `<style>` elements, set
|
|
413
|
-
* `window.litNonce` to a server-generated nonce in your page's HTML, before
|
|
414
|
-
* loading application code:
|
|
415
|
-
*
|
|
416
|
-
* ```html
|
|
417
|
-
* <script>
|
|
418
|
-
* // Generated and unique per request:
|
|
419
|
-
* window.litNonce = 'a1b2c3d4';
|
|
420
|
-
* </script>
|
|
421
|
-
* ```
|
|
422
|
-
* @nocollapse
|
|
423
|
-
* @category styles
|
|
424
|
-
*/
|
|
425
|
-
static styles?: CSSResultGroup;
|
|
426
|
-
/**
|
|
427
|
-
* Returns a list of attributes corresponding to the registered properties.
|
|
428
|
-
* @nocollapse
|
|
429
|
-
* @category attributes
|
|
430
|
-
*/
|
|
431
|
-
static get observedAttributes(): string[];
|
|
432
|
-
private __instanceProperties?;
|
|
433
|
-
/**
|
|
434
|
-
* Creates a property accessor on the element prototype if one does not exist
|
|
435
|
-
* and stores a {@linkcode PropertyDeclaration} for the property with the
|
|
436
|
-
* given options. The property setter calls the property's `hasChanged`
|
|
437
|
-
* property option or uses a strict identity check to determine whether or not
|
|
438
|
-
* to request an update.
|
|
439
|
-
*
|
|
440
|
-
* This method may be overridden to customize properties; however,
|
|
441
|
-
* when doing so, it's important to call `super.createProperty` to ensure
|
|
442
|
-
* the property is setup correctly. This method calls
|
|
443
|
-
* `getPropertyDescriptor` internally to get a descriptor to install.
|
|
444
|
-
* To customize what properties do when they are get or set, override
|
|
445
|
-
* `getPropertyDescriptor`. To customize the options for a property,
|
|
446
|
-
* implement `createProperty` like this:
|
|
447
|
-
*
|
|
448
|
-
* ```ts
|
|
449
|
-
* static createProperty(name, options) {
|
|
450
|
-
* options = Object.assign(options, {myOption: true});
|
|
451
|
-
* super.createProperty(name, options);
|
|
452
|
-
* }
|
|
453
|
-
* ```
|
|
454
|
-
*
|
|
455
|
-
* @nocollapse
|
|
456
|
-
* @category properties
|
|
457
|
-
*/
|
|
458
|
-
static createProperty(name: PropertyKey, options?: PropertyDeclaration): void;
|
|
459
|
-
/**
|
|
460
|
-
* Returns a property descriptor to be defined on the given named property.
|
|
461
|
-
* If no descriptor is returned, the property will not become an accessor.
|
|
462
|
-
* For example,
|
|
463
|
-
*
|
|
464
|
-
* ```ts
|
|
465
|
-
* class MyElement extends LitElement {
|
|
466
|
-
* static getPropertyDescriptor(name, key, options) {
|
|
467
|
-
* const defaultDescriptor =
|
|
468
|
-
* super.getPropertyDescriptor(name, key, options);
|
|
469
|
-
* const setter = defaultDescriptor.set;
|
|
470
|
-
* return {
|
|
471
|
-
* get: defaultDescriptor.get,
|
|
472
|
-
* set(value) {
|
|
473
|
-
* setter.call(this, value);
|
|
474
|
-
* // custom action.
|
|
475
|
-
* },
|
|
476
|
-
* configurable: true,
|
|
477
|
-
* enumerable: true
|
|
478
|
-
* }
|
|
479
|
-
* }
|
|
480
|
-
* }
|
|
481
|
-
* ```
|
|
482
|
-
*
|
|
483
|
-
* @nocollapse
|
|
484
|
-
* @category properties
|
|
485
|
-
*/
|
|
486
|
-
protected static getPropertyDescriptor(name: PropertyKey, key: string | symbol, options: PropertyDeclaration): PropertyDescriptor | undefined;
|
|
487
|
-
/**
|
|
488
|
-
* Returns the property options associated with the given property.
|
|
489
|
-
* These options are defined with a `PropertyDeclaration` via the `properties`
|
|
490
|
-
* object or the `@property` decorator and are registered in
|
|
491
|
-
* `createProperty(...)`.
|
|
492
|
-
*
|
|
493
|
-
* Note, this method should be considered "final" and not overridden. To
|
|
494
|
-
* customize the options for a given property, override
|
|
495
|
-
* {@linkcode createProperty}.
|
|
496
|
-
*
|
|
497
|
-
* @nocollapse
|
|
498
|
-
* @final
|
|
499
|
-
* @category properties
|
|
500
|
-
*/
|
|
501
|
-
static getPropertyOptions(name: PropertyKey): PropertyDeclaration<unknown, unknown>;
|
|
502
|
-
static [Symbol.metadata]: object & Record<PropertyKey, unknown>;
|
|
503
|
-
/**
|
|
504
|
-
* Initializes static own properties of the class used in bookkeeping
|
|
505
|
-
* for element properties, initializers, etc.
|
|
506
|
-
*
|
|
507
|
-
* Can be called multiple times by code that needs to ensure these
|
|
508
|
-
* properties exist before using them.
|
|
509
|
-
*
|
|
510
|
-
* This method ensures the superclass is finalized so that inherited
|
|
511
|
-
* property metadata can be copied down.
|
|
512
|
-
* @nocollapse
|
|
513
|
-
*/
|
|
514
|
-
private static __prepare;
|
|
515
|
-
/**
|
|
516
|
-
* Finishes setting up the class so that it's ready to be registered
|
|
517
|
-
* as a custom element and instantiated.
|
|
518
|
-
*
|
|
519
|
-
* This method is called by the ReactiveElement.observedAttributes getter.
|
|
520
|
-
* If you override the observedAttributes getter, you must either call
|
|
521
|
-
* super.observedAttributes to trigger finalization, or call finalize()
|
|
522
|
-
* yourself.
|
|
523
|
-
*
|
|
524
|
-
* @nocollapse
|
|
525
|
-
*/
|
|
526
|
-
protected static finalize(): void;
|
|
527
|
-
/**
|
|
528
|
-
* Options used when calling `attachShadow`. Set this property to customize
|
|
529
|
-
* the options for the shadowRoot; for example, to create a closed
|
|
530
|
-
* shadowRoot: `{mode: 'closed'}`.
|
|
531
|
-
*
|
|
532
|
-
* Note, these options are used in `createRenderRoot`. If this method
|
|
533
|
-
* is customized, options should be respected if possible.
|
|
534
|
-
* @nocollapse
|
|
535
|
-
* @category rendering
|
|
536
|
-
*/
|
|
537
|
-
static shadowRootOptions: ShadowRootInit;
|
|
538
|
-
/**
|
|
539
|
-
* Takes the styles the user supplied via the `static styles` property and
|
|
540
|
-
* returns the array of styles to apply to the element.
|
|
541
|
-
* Override this method to integrate into a style management system.
|
|
542
|
-
*
|
|
543
|
-
* Styles are deduplicated preserving the _last_ instance in the list. This
|
|
544
|
-
* is a performance optimization to avoid duplicated styles that can occur
|
|
545
|
-
* especially when composing via subclassing. The last item is kept to try
|
|
546
|
-
* to preserve the cascade order with the assumption that it's most important
|
|
547
|
-
* that last added styles override previous styles.
|
|
548
|
-
*
|
|
549
|
-
* @nocollapse
|
|
550
|
-
* @category styles
|
|
551
|
-
*/
|
|
552
|
-
protected static finalizeStyles(styles?: CSSResultGroup): Array<CSSResultOrNative>;
|
|
553
|
-
/**
|
|
554
|
-
* Node or ShadowRoot into which element DOM should be rendered. Defaults
|
|
555
|
-
* to an open shadowRoot.
|
|
556
|
-
* @category rendering
|
|
557
|
-
*/
|
|
558
|
-
readonly renderRoot: HTMLElement | DocumentFragment;
|
|
559
|
-
/**
|
|
560
|
-
* Returns the property name for the given attribute `name`.
|
|
561
|
-
* @nocollapse
|
|
562
|
-
*/
|
|
563
|
-
private static __attributeNameForProperty;
|
|
564
|
-
private __updatePromise;
|
|
565
|
-
/**
|
|
566
|
-
* True if there is a pending update as a result of calling `requestUpdate()`.
|
|
567
|
-
* Should only be read.
|
|
568
|
-
* @category updates
|
|
569
|
-
*/
|
|
570
|
-
isUpdatePending: boolean;
|
|
571
|
-
/**
|
|
572
|
-
* Is set to `true` after the first update. The element code cannot assume
|
|
573
|
-
* that `renderRoot` exists before the element `hasUpdated`.
|
|
574
|
-
* @category updates
|
|
575
|
-
*/
|
|
576
|
-
hasUpdated: boolean;
|
|
577
|
-
/**
|
|
578
|
-
* Records property default values when the
|
|
579
|
-
* `useDefault` option is used.
|
|
580
|
-
*/
|
|
581
|
-
private __defaultValues?;
|
|
582
|
-
/**
|
|
583
|
-
* Properties that should be reflected when updated.
|
|
584
|
-
*/
|
|
585
|
-
private __reflectingProperties?;
|
|
586
|
-
/**
|
|
587
|
-
* Name of currently reflecting property
|
|
588
|
-
*/
|
|
589
|
-
private __reflectingProperty;
|
|
590
|
-
/**
|
|
591
|
-
* Set of controllers.
|
|
592
|
-
*/
|
|
593
|
-
private __controllers?;
|
|
594
|
-
constructor();
|
|
595
|
-
/**
|
|
596
|
-
* Internal only override point for customizing work done when elements
|
|
597
|
-
* are constructed.
|
|
598
|
-
*/
|
|
599
|
-
private __initialize;
|
|
600
|
-
/**
|
|
601
|
-
* Registers a `ReactiveController` to participate in the element's reactive
|
|
602
|
-
* update cycle. The element automatically calls into any registered
|
|
603
|
-
* controllers during its lifecycle callbacks.
|
|
604
|
-
*
|
|
605
|
-
* If the element is connected when `addController()` is called, the
|
|
606
|
-
* controller's `hostConnected()` callback will be immediately called.
|
|
607
|
-
* @category controllers
|
|
608
|
-
*/
|
|
609
|
-
addController(controller: ReactiveController): void;
|
|
610
|
-
/**
|
|
611
|
-
* Removes a `ReactiveController` from the element.
|
|
612
|
-
* @category controllers
|
|
613
|
-
*/
|
|
614
|
-
removeController(controller: ReactiveController): void;
|
|
615
|
-
/**
|
|
616
|
-
* Fixes any properties set on the instance before upgrade time.
|
|
617
|
-
* Otherwise these would shadow the accessor and break these properties.
|
|
618
|
-
* The properties are stored in a Map which is played back after the
|
|
619
|
-
* constructor runs.
|
|
620
|
-
*/
|
|
621
|
-
private __saveInstanceProperties;
|
|
622
|
-
/**
|
|
623
|
-
* Returns the node into which the element should render and by default
|
|
624
|
-
* creates and returns an open shadowRoot. Implement to customize where the
|
|
625
|
-
* element's DOM is rendered. For example, to render into the element's
|
|
626
|
-
* childNodes, return `this`.
|
|
627
|
-
*
|
|
628
|
-
* @return Returns a node into which to render.
|
|
629
|
-
* @category rendering
|
|
630
|
-
*/
|
|
631
|
-
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
632
|
-
/**
|
|
633
|
-
* On first connection, creates the element's renderRoot, sets up
|
|
634
|
-
* element styling, and enables updating.
|
|
635
|
-
* @category lifecycle
|
|
636
|
-
*/
|
|
637
|
-
connectedCallback(): void;
|
|
638
|
-
/**
|
|
639
|
-
* Note, this method should be considered final and not overridden. It is
|
|
640
|
-
* overridden on the element instance with a function that triggers the first
|
|
641
|
-
* update.
|
|
642
|
-
* @category updates
|
|
643
|
-
*/
|
|
644
|
-
protected enableUpdating(_requestedUpdate: boolean): void;
|
|
645
|
-
/**
|
|
646
|
-
* Allows for `super.disconnectedCallback()` in extensions while
|
|
647
|
-
* reserving the possibility of making non-breaking feature additions
|
|
648
|
-
* when disconnecting at some point in the future.
|
|
649
|
-
* @category lifecycle
|
|
650
|
-
*/
|
|
651
|
-
disconnectedCallback(): void;
|
|
652
|
-
/**
|
|
653
|
-
* Synchronizes property values when attributes change.
|
|
654
|
-
*
|
|
655
|
-
* Specifically, when an attribute is set, the corresponding property is set.
|
|
656
|
-
* You should rarely need to implement this callback. If this method is
|
|
657
|
-
* overridden, `super.attributeChangedCallback(name, _old, value)` must be
|
|
658
|
-
* called.
|
|
659
|
-
*
|
|
660
|
-
* See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)
|
|
661
|
-
* on MDN for more information about the `attributeChangedCallback`.
|
|
662
|
-
* @category attributes
|
|
663
|
-
*/
|
|
664
|
-
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
665
|
-
private __propertyToAttribute;
|
|
666
|
-
/**
|
|
667
|
-
* Requests an update which is processed asynchronously. This should be called
|
|
668
|
-
* when an element should update based on some state not triggered by setting
|
|
669
|
-
* a reactive property. In this case, pass no arguments. It should also be
|
|
670
|
-
* called when manually implementing a property setter. In this case, pass the
|
|
671
|
-
* property `name` and `oldValue` to ensure that any configured property
|
|
672
|
-
* options are honored.
|
|
673
|
-
*
|
|
674
|
-
* @param name name of requesting property
|
|
675
|
-
* @param oldValue old value of requesting property
|
|
676
|
-
* @param options property options to use instead of the previously
|
|
677
|
-
* configured options
|
|
678
|
-
* @category updates
|
|
679
|
-
*/
|
|
680
|
-
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
681
|
-
/**
|
|
682
|
-
* Sets up the element to asynchronously update.
|
|
683
|
-
*/
|
|
684
|
-
private __enqueueUpdate;
|
|
685
|
-
/**
|
|
686
|
-
* Schedules an element update. You can override this method to change the
|
|
687
|
-
* timing of updates by returning a Promise. The update will await the
|
|
688
|
-
* returned Promise, and you should resolve the Promise to allow the update
|
|
689
|
-
* to proceed. If this method is overridden, `super.scheduleUpdate()`
|
|
690
|
-
* must be called.
|
|
691
|
-
*
|
|
692
|
-
* For instance, to schedule updates to occur just before the next frame:
|
|
693
|
-
*
|
|
694
|
-
* ```ts
|
|
695
|
-
* override protected async scheduleUpdate(): Promise<unknown> {
|
|
696
|
-
* await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
697
|
-
* super.scheduleUpdate();
|
|
698
|
-
* }
|
|
699
|
-
* ```
|
|
700
|
-
* @category updates
|
|
701
|
-
*/
|
|
702
|
-
protected scheduleUpdate(): void | Promise<unknown>;
|
|
703
|
-
/**
|
|
704
|
-
* Performs an element update. Note, if an exception is thrown during the
|
|
705
|
-
* update, `firstUpdated` and `updated` will not be called.
|
|
706
|
-
*
|
|
707
|
-
* Call `performUpdate()` to immediately process a pending update. This should
|
|
708
|
-
* generally not be needed, but it can be done in rare cases when you need to
|
|
709
|
-
* update synchronously.
|
|
710
|
-
*
|
|
711
|
-
* @category updates
|
|
712
|
-
*/
|
|
713
|
-
protected performUpdate(): void;
|
|
714
|
-
/**
|
|
715
|
-
* Invoked before `update()` to compute values needed during the update.
|
|
716
|
-
*
|
|
717
|
-
* Implement `willUpdate` to compute property values that depend on other
|
|
718
|
-
* properties and are used in the rest of the update process.
|
|
719
|
-
*
|
|
720
|
-
* ```ts
|
|
721
|
-
* willUpdate(changedProperties) {
|
|
722
|
-
* // only need to check changed properties for an expensive computation.
|
|
723
|
-
* if (changedProperties.has('firstName') || changedProperties.has('lastName')) {
|
|
724
|
-
* this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
|
|
725
|
-
* }
|
|
726
|
-
* }
|
|
727
|
-
*
|
|
728
|
-
* render() {
|
|
729
|
-
* return html`SHA: ${this.sha}`;
|
|
730
|
-
* }
|
|
731
|
-
* ```
|
|
732
|
-
*
|
|
733
|
-
* @category updates
|
|
734
|
-
*/
|
|
735
|
-
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
736
|
-
private __markUpdated;
|
|
737
|
-
/**
|
|
738
|
-
* Returns a Promise that resolves when the element has completed updating.
|
|
739
|
-
* The Promise value is a boolean that is `true` if the element completed the
|
|
740
|
-
* update without triggering another update. The Promise result is `false` if
|
|
741
|
-
* a property was set inside `updated()`. If the Promise is rejected, an
|
|
742
|
-
* exception was thrown during the update.
|
|
743
|
-
*
|
|
744
|
-
* To await additional asynchronous work, override the `getUpdateComplete`
|
|
745
|
-
* method. For example, it is sometimes useful to await a rendered element
|
|
746
|
-
* before fulfilling this Promise. To do this, first await
|
|
747
|
-
* `super.getUpdateComplete()`, then any subsequent state.
|
|
748
|
-
*
|
|
749
|
-
* @return A promise of a boolean that resolves to true if the update completed
|
|
750
|
-
* without triggering another update.
|
|
751
|
-
* @category updates
|
|
752
|
-
*/
|
|
753
|
-
get updateComplete(): Promise<boolean>;
|
|
754
|
-
/**
|
|
755
|
-
* Override point for the `updateComplete` promise.
|
|
756
|
-
*
|
|
757
|
-
* It is not safe to override the `updateComplete` getter directly due to a
|
|
758
|
-
* limitation in TypeScript which means it is not possible to call a
|
|
759
|
-
* superclass getter (e.g. `super.updateComplete.then(...)`) when the target
|
|
760
|
-
* language is ES5 (https://github.com/microsoft/TypeScript/issues/338).
|
|
761
|
-
* This method should be overridden instead. For example:
|
|
762
|
-
*
|
|
763
|
-
* ```ts
|
|
764
|
-
* class MyElement extends LitElement {
|
|
765
|
-
* override async getUpdateComplete() {
|
|
766
|
-
* const result = await super.getUpdateComplete();
|
|
767
|
-
* await this._myChild.updateComplete;
|
|
768
|
-
* return result;
|
|
769
|
-
* }
|
|
770
|
-
* }
|
|
771
|
-
* ```
|
|
772
|
-
*
|
|
773
|
-
* @return A promise of a boolean that resolves to true if the update completed
|
|
774
|
-
* without triggering another update.
|
|
775
|
-
* @category updates
|
|
776
|
-
*/
|
|
777
|
-
protected getUpdateComplete(): Promise<boolean>;
|
|
778
|
-
/**
|
|
779
|
-
* Controls whether or not `update()` should be called when the element requests
|
|
780
|
-
* an update. By default, this method always returns `true`, but this can be
|
|
781
|
-
* customized to control when to update.
|
|
782
|
-
*
|
|
783
|
-
* @param _changedProperties Map of changed properties with old values
|
|
784
|
-
* @category updates
|
|
785
|
-
*/
|
|
786
|
-
protected shouldUpdate(_changedProperties: PropertyValues): boolean;
|
|
787
|
-
/**
|
|
788
|
-
* Updates the element. This method reflects property values to attributes.
|
|
789
|
-
* It can be overridden to render and keep updated element DOM.
|
|
790
|
-
* Setting properties inside this method will *not* trigger
|
|
791
|
-
* another update.
|
|
792
|
-
*
|
|
793
|
-
* @param _changedProperties Map of changed properties with old values
|
|
794
|
-
* @category updates
|
|
795
|
-
*/
|
|
796
|
-
protected update(_changedProperties: PropertyValues): void;
|
|
797
|
-
/**
|
|
798
|
-
* Invoked whenever the element is updated. Implement to perform
|
|
799
|
-
* post-updating tasks via DOM APIs, for example, focusing an element.
|
|
800
|
-
*
|
|
801
|
-
* Setting properties inside this method will trigger the element to update
|
|
802
|
-
* again after this update cycle completes.
|
|
803
|
-
*
|
|
804
|
-
* @param _changedProperties Map of changed properties with old values
|
|
805
|
-
* @category updates
|
|
806
|
-
*/
|
|
807
|
-
protected updated(_changedProperties: PropertyValues): void;
|
|
808
|
-
/**
|
|
809
|
-
* Invoked when the element is first updated. Implement to perform one time
|
|
810
|
-
* work on the element after update.
|
|
811
|
-
*
|
|
812
|
-
* ```ts
|
|
813
|
-
* firstUpdated() {
|
|
814
|
-
* this.renderRoot.getElementById('my-text-area').focus();
|
|
815
|
-
* }
|
|
816
|
-
* ```
|
|
817
|
-
*
|
|
818
|
-
* Setting properties inside this method will trigger the element to update
|
|
819
|
-
* again after this update cycle completes.
|
|
820
|
-
*
|
|
821
|
-
* @param _changedProperties Map of changed properties with old values
|
|
822
|
-
* @category updates
|
|
823
|
-
*/
|
|
824
|
-
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
825
|
-
}
|
|
826
|
-
declare const HTML_RESULT = 1;
|
|
827
|
-
declare const SVG_RESULT = 2;
|
|
828
|
-
declare const MATHML_RESULT = 3;
|
|
829
|
-
export type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;
|
|
830
|
-
/**
|
|
831
|
-
* The return type of the template tag functions, {@linkcode html} and
|
|
832
|
-
* {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.
|
|
833
|
-
*
|
|
834
|
-
* A `TemplateResult` object holds all the information about a template
|
|
835
|
-
* expression required to render it: the template strings, expression values,
|
|
836
|
-
* and type of template (html or svg).
|
|
837
|
-
*
|
|
838
|
-
* `TemplateResult` objects do not create any DOM on their own. To create or
|
|
839
|
-
* update DOM you need to render the `TemplateResult`. See
|
|
840
|
-
* [Rendering](https://lit.dev/docs/components/rendering) for more information.
|
|
841
|
-
*
|
|
842
|
-
*/
|
|
843
|
-
export type UncompiledTemplateResult<T extends ResultType = ResultType> = {
|
|
844
|
-
["_$litType$"]: T;
|
|
845
|
-
strings: TemplateStringsArray;
|
|
846
|
-
values: unknown[];
|
|
847
|
-
};
|
|
848
|
-
/**
|
|
849
|
-
* The return type of the template tag functions, {@linkcode html} and
|
|
850
|
-
* {@linkcode svg}.
|
|
851
|
-
*
|
|
852
|
-
* A `TemplateResult` object holds all the information about a template
|
|
853
|
-
* expression required to render it: the template strings, expression values,
|
|
854
|
-
* and type of template (html or svg).
|
|
855
|
-
*
|
|
856
|
-
* `TemplateResult` objects do not create any DOM on their own. To create or
|
|
857
|
-
* update DOM you need to render the `TemplateResult`. See
|
|
858
|
-
* [Rendering](https://lit.dev/docs/components/rendering) for more information.
|
|
859
|
-
*
|
|
860
|
-
* In Lit 4, this type will be an alias of
|
|
861
|
-
* MaybeCompiledTemplateResult, so that code will get type errors if it assumes
|
|
862
|
-
* that Lit templates are not compiled. When deliberately working with only
|
|
863
|
-
* one, use either {@linkcode CompiledTemplateResult} or
|
|
864
|
-
* {@linkcode UncompiledTemplateResult} explicitly.
|
|
865
|
-
*/
|
|
866
|
-
export type TemplateResult<T extends ResultType = ResultType> = UncompiledTemplateResult<T>;
|
|
867
|
-
export type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;
|
|
868
|
-
declare const nothing: unique symbol;
|
|
869
|
-
/**
|
|
870
|
-
* Object specifying options for controlling lit-html rendering. Note that
|
|
871
|
-
* while `render` may be called multiple times on the same `container` (and
|
|
872
|
-
* `renderBefore` reference node) to efficiently update the rendered content,
|
|
873
|
-
* only the options passed in during the first render are respected during
|
|
874
|
-
* the lifetime of renders to that unique `container` + `renderBefore`
|
|
875
|
-
* combination.
|
|
876
|
-
*/
|
|
877
|
-
export interface RenderOptions {
|
|
878
|
-
/**
|
|
879
|
-
* An object to use as the `this` value for event listeners. It's often
|
|
880
|
-
* useful to set this to the host component rendering a template.
|
|
881
|
-
*/
|
|
882
|
-
host?: object;
|
|
883
|
-
/**
|
|
884
|
-
* A DOM node before which to render content in the container.
|
|
885
|
-
*/
|
|
886
|
-
renderBefore?: ChildNode | null;
|
|
887
|
-
/**
|
|
888
|
-
* Node used for cloning the template (`importNode` will be called on this
|
|
889
|
-
* node). This controls the `ownerDocument` of the rendered DOM, along with
|
|
890
|
-
* any inherited context. Defaults to the global `document`.
|
|
891
|
-
*/
|
|
892
|
-
creationScope?: {
|
|
893
|
-
importNode(node: Node, deep?: boolean): Node;
|
|
894
|
-
};
|
|
895
|
-
/**
|
|
896
|
-
* The initial connected state for the top-level part being rendered. If no
|
|
897
|
-
* `isConnected` option is set, `AsyncDirective`s will be connected by
|
|
898
|
-
* default. Set to `false` if the initial render occurs in a disconnected tree
|
|
899
|
-
* and `AsyncDirective`s should see `isConnected === false` for their initial
|
|
900
|
-
* render. The `part.setConnected()` method must be used subsequent to initial
|
|
901
|
-
* render to change the connected state of the part.
|
|
902
|
-
*/
|
|
903
|
-
isConnected?: boolean;
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
* @description Defines the API version that the SDK should use.
|
|
907
|
-
* - `"legacy"`: Uses the older API version with existing behaviors.
|
|
908
|
-
* - `"2.4"`: Uses the new API version with updated functionalities.
|
|
909
|
-
*
|
|
910
|
-
* If this value is not set, the SDK will default to the predefined version,
|
|
911
|
-
* ensuring backward compatibility.
|
|
912
|
-
*/
|
|
913
|
-
export type APIVersionOption = "legacy" | "2.4";
|
|
914
|
-
declare enum ImplementationType {
|
|
915
|
-
WEB_REDIRECT = "WEB_REDIRECT",
|
|
916
|
-
NATIVE_SDK = "NATIVE_SDK"
|
|
917
|
-
}
|
|
918
|
-
declare enum ProductType {
|
|
919
|
-
DIGITAL = "DIGITAL",
|
|
920
|
-
PHYSICAL = "PHYSICAL",
|
|
921
|
-
SHIPPING_FEE = "SHIPPING_FEE"
|
|
922
|
-
}
|
|
923
|
-
export interface ClientSessionLineItem {
|
|
924
|
-
amount: number;
|
|
925
|
-
description: string;
|
|
926
|
-
discountAmount?: number;
|
|
927
|
-
itemId: string;
|
|
928
|
-
name?: string;
|
|
929
|
-
productType?: ProductType;
|
|
930
|
-
quantity: number;
|
|
931
|
-
taxAmount?: number;
|
|
932
|
-
taxCode?: string;
|
|
933
|
-
}
|
|
934
|
-
export interface ClientSessionShipping {
|
|
935
|
-
amount: number;
|
|
936
|
-
methodId?: string;
|
|
937
|
-
methodName?: string;
|
|
938
|
-
methodDescription?: string;
|
|
939
|
-
}
|
|
940
|
-
export interface ClientSessionFeeItem {
|
|
941
|
-
type?: string;
|
|
942
|
-
description?: string;
|
|
943
|
-
amount: number;
|
|
944
|
-
}
|
|
945
|
-
export interface ClientSessionAddress {
|
|
946
|
-
firstName?: string;
|
|
947
|
-
lastName?: string;
|
|
948
|
-
addressLine1?: string;
|
|
949
|
-
addressLine2?: string;
|
|
950
|
-
city?: string;
|
|
951
|
-
state?: string;
|
|
952
|
-
countryCode?: string;
|
|
953
|
-
postalCode?: string;
|
|
954
|
-
}
|
|
955
|
-
export interface ClientSession {
|
|
956
|
-
orderId?: string;
|
|
957
|
-
currencyCode?: string;
|
|
958
|
-
lineItems?: ClientSessionLineItem[];
|
|
959
|
-
totalAmount?: number;
|
|
960
|
-
customerId?: string;
|
|
961
|
-
orderDetails?: {
|
|
962
|
-
countryCode?: string;
|
|
963
|
-
shipping?: ClientSessionShipping;
|
|
964
|
-
fees?: ClientSessionFeeItem[];
|
|
965
|
-
};
|
|
966
|
-
customer?: {
|
|
967
|
-
emailAddress?: string;
|
|
968
|
-
mobileNumber?: string;
|
|
969
|
-
firstName?: string;
|
|
970
|
-
lastName?: string;
|
|
971
|
-
billingAddress?: ClientSessionAddress;
|
|
972
|
-
shippingAddress?: ClientSessionAddress;
|
|
973
|
-
taxId?: string;
|
|
974
|
-
nationalDocumentId?: string;
|
|
975
|
-
};
|
|
976
|
-
paymentMethod?: {
|
|
977
|
-
options?: Record<string, any>;
|
|
978
|
-
orderedAllowedCardNetworks?: string[];
|
|
979
|
-
vaultOnSuccess?: boolean;
|
|
980
|
-
};
|
|
981
|
-
}
|
|
982
|
-
export interface PaymentMethodDisplayMetadata {
|
|
983
|
-
button: {
|
|
984
|
-
backgroundColor: BackgroundColor;
|
|
985
|
-
borderColor: BorderColor;
|
|
986
|
-
borderWidth: BorderWidth;
|
|
987
|
-
cornerRadius: number;
|
|
988
|
-
iconPositionRelativeToText?: "START" | "END";
|
|
989
|
-
iconUrl: IconUrl;
|
|
990
|
-
text?: string;
|
|
991
|
-
textColor?: TextColor;
|
|
992
|
-
};
|
|
993
|
-
overlay: {
|
|
994
|
-
logo: IconUrl;
|
|
995
|
-
backgroundColor: BackgroundColor;
|
|
996
|
-
};
|
|
997
|
-
popup: {
|
|
998
|
-
width: number;
|
|
999
|
-
height: number;
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
export interface BackgroundColor {
|
|
1003
|
-
colored: string;
|
|
1004
|
-
dark: string;
|
|
1005
|
-
light: string;
|
|
1006
|
-
}
|
|
1007
|
-
export interface BorderColor {
|
|
1008
|
-
dark: string;
|
|
1009
|
-
light: string;
|
|
1010
|
-
}
|
|
1011
|
-
export interface BorderWidth {
|
|
1012
|
-
colored: number;
|
|
1013
|
-
dark: number;
|
|
1014
|
-
light: number;
|
|
1015
|
-
}
|
|
1016
|
-
export interface IconUrl {
|
|
1017
|
-
colored: string;
|
|
1018
|
-
dark: string;
|
|
1019
|
-
light: string;
|
|
1020
|
-
}
|
|
1021
|
-
export interface TextColor {
|
|
1022
|
-
dark: string;
|
|
1023
|
-
light: string;
|
|
1024
|
-
}
|
|
1025
|
-
export interface PaymentMethodConfig {
|
|
1026
|
-
id: string;
|
|
1027
|
-
type: PaymentMethodType;
|
|
1028
|
-
name: string;
|
|
1029
|
-
implementationType: ImplementationType;
|
|
1030
|
-
displayMetadata: PaymentMethodDisplayMetadata;
|
|
1031
|
-
options: {
|
|
1032
|
-
captureVaultedCardCvv?: boolean;
|
|
1033
|
-
clientId?: string;
|
|
1034
|
-
threeDSecureToken?: string;
|
|
1035
|
-
threeDSecureInitUrl?: string;
|
|
1036
|
-
threeDSecureProvider?: string;
|
|
1037
|
-
threeDSecureEnabled?: boolean;
|
|
1038
|
-
};
|
|
1039
|
-
forceRedirect?: boolean;
|
|
1040
|
-
}
|
|
1041
|
-
export type GoatBrand = {
|
|
1042
|
-
assets: {
|
|
1043
|
-
icon: string;
|
|
1044
|
-
};
|
|
1045
|
-
colors: {
|
|
1046
|
-
background: string;
|
|
1047
|
-
main: string;
|
|
1048
|
-
};
|
|
1049
|
-
description: string | null;
|
|
1050
|
-
is_primer_app: boolean;
|
|
1051
|
-
name: string;
|
|
1052
|
-
website: string | null;
|
|
1053
|
-
};
|
|
1054
|
-
export type GoatBrandWithCdn = GoatBrand & {
|
|
1055
|
-
/**
|
|
1056
|
-
* The full CDN URL that can be used directly in applications
|
|
1057
|
-
*/
|
|
1058
|
-
goatCdnUrl: string;
|
|
1059
|
-
};
|
|
24
|
+
export type SdkStateContextType = SdkState | null;
|
|
1060
25
|
declare const PaymentInstrumentType: {
|
|
1061
26
|
readonly WORLDPAY_IDEAL: "WORLDPAY_IDEAL";
|
|
1062
27
|
readonly AUTOMATED_CLEARING_HOUSE: "AUTOMATED_CLEARING_HOUSE";
|
|
@@ -1110,6 +75,7 @@ declare const PaymentInstrumentType: {
|
|
|
1110
75
|
readonly PAY_NL_DIRECT_DEBIT: "PAY_NL_DIRECT_DEBIT";
|
|
1111
76
|
readonly PAY_NL_GIROPAY: "PAY_NL_GIROPAY";
|
|
1112
77
|
readonly PAY_NL_PAYCONIQ: "PAY_NL_PAYCONIQ";
|
|
78
|
+
readonly PAY_NL_RIVERTY: "PAY_NL_RIVERTY";
|
|
1113
79
|
readonly HOOLAH: "HOOLAH";
|
|
1114
80
|
readonly ADYEN_BLIK: "ADYEN_BLIK";
|
|
1115
81
|
readonly ADYEN_VIPPS: "ADYEN_VIPPS";
|
|
@@ -1129,6 +95,8 @@ declare const PaymentInstrumentType: {
|
|
|
1129
95
|
readonly BUCKAROO_IDEAL: "BUCKAROO_IDEAL";
|
|
1130
96
|
readonly ATOME: "ATOME";
|
|
1131
97
|
readonly KLARNA_CUSTOMER_TOKEN: "KLARNA_CUSTOMER_TOKEN";
|
|
98
|
+
readonly DLOCAL_PIX: "DLOCAL_PIX";
|
|
99
|
+
readonly ALMA: "ALMA";
|
|
1132
100
|
};
|
|
1133
101
|
export type PaymentInstrumentType = (typeof PaymentInstrumentType)[keyof typeof PaymentInstrumentType];
|
|
1134
102
|
declare const PaymentMethodType: {
|
|
@@ -1184,6 +152,7 @@ declare const PaymentMethodType: {
|
|
|
1184
152
|
readonly PAY_NL_DIRECT_DEBIT: "PAY_NL_DIRECT_DEBIT";
|
|
1185
153
|
readonly PAY_NL_GIROPAY: "PAY_NL_GIROPAY";
|
|
1186
154
|
readonly PAY_NL_PAYCONIQ: "PAY_NL_PAYCONIQ";
|
|
155
|
+
readonly PAY_NL_RIVERTY: "PAY_NL_RIVERTY";
|
|
1187
156
|
readonly HOOLAH: "HOOLAH";
|
|
1188
157
|
readonly ADYEN_BLIK: "ADYEN_BLIK";
|
|
1189
158
|
readonly ADYEN_MOBILEPAY: "ADYEN_MOBILEPAY";
|
|
@@ -1203,181 +172,217 @@ declare const PaymentMethodType: {
|
|
|
1203
172
|
readonly BUCKAROO_BANCONTACT: "BUCKAROO_BANCONTACT";
|
|
1204
173
|
readonly BUCKAROO_IDEAL: "BUCKAROO_IDEAL";
|
|
1205
174
|
readonly ATOME: "ATOME";
|
|
175
|
+
readonly DLOCAL_PIX: "DLOCAL_PIX";
|
|
176
|
+
readonly ALMA: "ALMA";
|
|
1206
177
|
};
|
|
1207
178
|
export type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType];
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
borderStyle?: string;
|
|
1216
|
-
borderColor?: number | string;
|
|
1217
|
-
borderWidth?: number | string;
|
|
1218
|
-
}
|
|
1219
|
-
export interface TextAlignmentStyle {
|
|
1220
|
-
textAlign?: string;
|
|
1221
|
-
}
|
|
1222
|
-
export interface TextStyle {
|
|
1223
|
-
color?: string;
|
|
1224
|
-
fontFamily?: string;
|
|
1225
|
-
fontWeight?: string;
|
|
1226
|
-
fontSize?: string;
|
|
1227
|
-
fontSmoothing?: string;
|
|
1228
|
-
lineHeight?: string;
|
|
1229
|
-
textTransform?: string;
|
|
1230
|
-
letterSpacing?: string;
|
|
1231
|
-
}
|
|
1232
|
-
export interface BlockStyle extends BorderStyle {
|
|
1233
|
-
background?: string;
|
|
1234
|
-
borderRadius?: number | string;
|
|
1235
|
-
boxShadow?: string;
|
|
1236
|
-
}
|
|
1237
|
-
export type LogoColor = "DARK" | "LIGHT" | "COLORED";
|
|
1238
|
-
export interface LoadingScreenStyle {
|
|
1239
|
-
color?: string;
|
|
1240
|
-
}
|
|
1241
|
-
export interface BaseInputStyle extends TextStyle, BlockStyle {
|
|
1242
|
-
height?: number | string;
|
|
1243
|
-
paddingHorizontal?: number;
|
|
1244
|
-
}
|
|
1245
|
-
export interface InputStyle extends BaseInputStyle {
|
|
1246
|
-
hover?: BaseInputStyle;
|
|
1247
|
-
focus?: BaseInputStyle;
|
|
1248
|
-
placeholder?: BaseInputStyle;
|
|
1249
|
-
webkitAutofill?: BaseInputStyle;
|
|
1250
|
-
selection?: BaseInputStyle;
|
|
1251
|
-
}
|
|
1252
|
-
export interface BaseSubmitButtonStyle extends TextStyle, BlockStyle {
|
|
1253
|
-
}
|
|
1254
|
-
export interface SubmitButtonStyle extends BaseSubmitButtonStyle {
|
|
1255
|
-
hover?: BaseSubmitButtonStyle;
|
|
1256
|
-
focus?: BaseSubmitButtonStyle;
|
|
1257
|
-
}
|
|
1258
|
-
export interface SubmitButtonStyles {
|
|
1259
|
-
base?: SubmitButtonStyle;
|
|
1260
|
-
disabled?: SubmitButtonStyle;
|
|
1261
|
-
loading?: SubmitButtonStyle;
|
|
179
|
+
export type APIVersionOption = "legacy" | "2.4";
|
|
180
|
+
declare enum HeadlessManagerType {
|
|
181
|
+
CARD = "CARD",
|
|
182
|
+
NATIVE = "NATIVE",
|
|
183
|
+
REDIRECT = "REDIRECT",
|
|
184
|
+
KLARNA = "KLARNA",
|
|
185
|
+
ACH = "ACH"
|
|
1262
186
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
error
|
|
187
|
+
declare enum EventTypes {
|
|
188
|
+
CHANGE = "change",
|
|
189
|
+
ERROR = "error",
|
|
190
|
+
FOCUS = "focus",
|
|
191
|
+
BLUR = "blur",
|
|
192
|
+
CLICK = "click",
|
|
193
|
+
CLOSE = "close",
|
|
194
|
+
CONFIRMED_KLARNA_CATEGORY = "CONFIRMED_KLARNA_CATEGORY",
|
|
195
|
+
CONFIRMED_KLARNA_CATEGORY_ERROR = "CONFIRMED_KLARNA_CATEGORY_ERROR",
|
|
196
|
+
KLARNA_SESSION_UPDATE = "KLARNA_SESSION_UPDATE",
|
|
197
|
+
KLARNA_SESSION_REFRESH_ERROR = "KLARNA_SESSION_REFRESH_ERROR"
|
|
1266
198
|
}
|
|
1267
|
-
export interface
|
|
199
|
+
export interface BasePaymentInstrumentData {
|
|
200
|
+
[key: string]: unknown;
|
|
1268
201
|
}
|
|
1269
|
-
export interface
|
|
1270
|
-
|
|
1271
|
-
|
|
202
|
+
export interface ClientSessionLineItem {
|
|
203
|
+
amount: number;
|
|
204
|
+
description: string;
|
|
205
|
+
discountAmount?: number;
|
|
206
|
+
itemId: string;
|
|
207
|
+
name?: string;
|
|
208
|
+
productType?: "DIGITAL" | "PHYSICAL" | "SHIPPING_FEE";
|
|
209
|
+
quantity: number;
|
|
210
|
+
taxAmount?: number;
|
|
211
|
+
taxCode?: string;
|
|
1272
212
|
}
|
|
1273
|
-
export interface
|
|
1274
|
-
|
|
1275
|
-
|
|
213
|
+
export interface ClientSessionShipping {
|
|
214
|
+
amount: number;
|
|
215
|
+
methodId?: string;
|
|
216
|
+
methodName?: string;
|
|
217
|
+
methodDescription?: string;
|
|
1276
218
|
}
|
|
1277
|
-
export interface
|
|
1278
|
-
|
|
1279
|
-
|
|
219
|
+
export interface ClientSessionFeeItem {
|
|
220
|
+
type?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
amount: number;
|
|
1280
223
|
}
|
|
1281
|
-
export interface
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
224
|
+
export interface ClientSessionAddress {
|
|
225
|
+
firstName?: string;
|
|
226
|
+
lastName?: string;
|
|
227
|
+
addressLine1?: string;
|
|
228
|
+
addressLine2?: string;
|
|
229
|
+
city?: string;
|
|
230
|
+
state?: string;
|
|
231
|
+
countryCode?: string;
|
|
232
|
+
postalCode?: string;
|
|
1286
233
|
}
|
|
1287
|
-
export interface
|
|
1288
|
-
|
|
234
|
+
export interface ClientSession {
|
|
235
|
+
orderId?: string;
|
|
236
|
+
currencyCode?: string;
|
|
237
|
+
lineItems?: ClientSessionLineItem[];
|
|
238
|
+
totalAmount?: number;
|
|
239
|
+
customerId?: string;
|
|
240
|
+
orderDetails?: {
|
|
241
|
+
countryCode?: string;
|
|
242
|
+
shipping?: ClientSessionShipping;
|
|
243
|
+
fees?: ClientSessionFeeItem[];
|
|
244
|
+
};
|
|
245
|
+
customer?: {
|
|
246
|
+
emailAddress?: string;
|
|
247
|
+
mobileNumber?: string;
|
|
248
|
+
firstName?: string;
|
|
249
|
+
lastName?: string;
|
|
250
|
+
billingAddress?: ClientSessionAddress;
|
|
251
|
+
shippingAddress?: ClientSessionAddress;
|
|
252
|
+
taxId?: string;
|
|
253
|
+
nationalDocumentId?: string;
|
|
254
|
+
};
|
|
255
|
+
paymentMethod?: {
|
|
256
|
+
options?: Record<string, unknown>;
|
|
257
|
+
orderedAllowedCardNetworks?: string[];
|
|
258
|
+
vaultOnSuccess?: boolean;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
export interface BackgroundColor {
|
|
262
|
+
colored: string;
|
|
263
|
+
dark: string;
|
|
264
|
+
light: string;
|
|
265
|
+
}
|
|
266
|
+
export interface IconUrl {
|
|
267
|
+
colored: string;
|
|
268
|
+
dark: string;
|
|
269
|
+
light: string;
|
|
270
|
+
}
|
|
271
|
+
export interface InputStyles {
|
|
272
|
+
base?: {
|
|
1289
273
|
color?: string;
|
|
274
|
+
fontFamily?: string;
|
|
275
|
+
fontSize?: string;
|
|
276
|
+
fontWeight?: string;
|
|
277
|
+
lineHeight?: string;
|
|
278
|
+
letterSpacing?: string;
|
|
279
|
+
textTransform?: string;
|
|
280
|
+
background?: string;
|
|
281
|
+
borderRadius?: number | string;
|
|
282
|
+
borderColor?: string | number;
|
|
283
|
+
borderWidth?: string | number;
|
|
284
|
+
borderStyle?: string;
|
|
285
|
+
boxShadow?: string;
|
|
286
|
+
height?: number | string;
|
|
287
|
+
paddingHorizontal?: number;
|
|
288
|
+
hover?: Record<string, unknown>;
|
|
289
|
+
focus?: Record<string, unknown>;
|
|
290
|
+
placeholder?: Record<string, unknown>;
|
|
291
|
+
webkitAutofill?: Record<string, unknown>;
|
|
292
|
+
selection?: Record<string, unknown>;
|
|
293
|
+
};
|
|
294
|
+
error?: Record<string, unknown>;
|
|
295
|
+
}
|
|
296
|
+
export interface InputValidationError {
|
|
297
|
+
field?: string;
|
|
298
|
+
name: string;
|
|
299
|
+
error: string;
|
|
300
|
+
message: string;
|
|
301
|
+
}
|
|
302
|
+
export interface Validation {
|
|
303
|
+
valid: boolean;
|
|
304
|
+
validationErrors: InputValidationError[];
|
|
305
|
+
error?: string;
|
|
306
|
+
}
|
|
307
|
+
export interface InputMetadata {
|
|
308
|
+
errorCode: string | null;
|
|
309
|
+
error: string | null;
|
|
310
|
+
valid: boolean;
|
|
311
|
+
active: boolean;
|
|
312
|
+
dirty: boolean;
|
|
313
|
+
touched: boolean;
|
|
314
|
+
submitted: boolean;
|
|
315
|
+
}
|
|
316
|
+
export interface PaymentMethodConfig {
|
|
317
|
+
id: string;
|
|
318
|
+
type: PaymentMethodType;
|
|
319
|
+
name: string;
|
|
320
|
+
implementationType: "WEB_REDIRECT" | "NATIVE_SDK";
|
|
321
|
+
displayMetadata: {
|
|
322
|
+
button: {
|
|
323
|
+
backgroundColor: BackgroundColor;
|
|
324
|
+
borderColor: {
|
|
325
|
+
dark: string;
|
|
326
|
+
light: string;
|
|
327
|
+
};
|
|
328
|
+
borderWidth: {
|
|
329
|
+
colored: number;
|
|
330
|
+
dark: number;
|
|
331
|
+
light: number;
|
|
332
|
+
};
|
|
333
|
+
cornerRadius: number;
|
|
334
|
+
iconPositionRelativeToText?: "START" | "END";
|
|
335
|
+
iconUrl: IconUrl;
|
|
336
|
+
text?: string;
|
|
337
|
+
textColor?: {
|
|
338
|
+
dark: string;
|
|
339
|
+
light: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
overlay: {
|
|
343
|
+
logo: IconUrl;
|
|
344
|
+
backgroundColor: BackgroundColor;
|
|
345
|
+
};
|
|
346
|
+
popup: {
|
|
347
|
+
width: number;
|
|
348
|
+
height: number;
|
|
349
|
+
};
|
|
1290
350
|
};
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
marginTop?: string;
|
|
1299
|
-
}
|
|
1300
|
-
export interface BackButtonStyle {
|
|
1301
|
-
color?: string;
|
|
1302
|
-
}
|
|
1303
|
-
export interface EditButtonStyle {
|
|
1304
|
-
color?: string;
|
|
1305
|
-
background?: string;
|
|
1306
|
-
}
|
|
1307
|
-
export interface SeparatorStyle {
|
|
1308
|
-
color?: string;
|
|
1309
|
-
}
|
|
1310
|
-
export interface ErrorMessageStyle extends BlockStyle, TextStyle {
|
|
1311
|
-
color?: string;
|
|
1312
|
-
}
|
|
1313
|
-
export interface FormSpacings {
|
|
1314
|
-
betweenLabelAndInput?: string;
|
|
1315
|
-
betweenInputs?: string;
|
|
1316
|
-
}
|
|
1317
|
-
export interface FontFace$1 {
|
|
1318
|
-
fontFamily?: string;
|
|
1319
|
-
src?: string;
|
|
1320
|
-
unicodeRange?: string;
|
|
1321
|
-
fontVariant?: string;
|
|
1322
|
-
fontFeatureSettings?: string;
|
|
1323
|
-
fontVariationSettings?: string;
|
|
1324
|
-
fontStretch?: string;
|
|
1325
|
-
fontWeight?: string;
|
|
1326
|
-
fontStyle?: string;
|
|
1327
|
-
}
|
|
1328
|
-
export interface Stylesheet {
|
|
1329
|
-
href: string;
|
|
1330
|
-
}
|
|
1331
|
-
export interface VaultMenuStyle {
|
|
1332
|
-
editButton?: EditButtonStyle & TextStyle;
|
|
1333
|
-
item?: {
|
|
1334
|
-
label?: TextStyle;
|
|
1335
|
-
actionButton?: TextStyle;
|
|
1336
|
-
confirmButton?: BlockStyle & TextStyle;
|
|
351
|
+
options: {
|
|
352
|
+
captureVaultedCardCvv?: boolean;
|
|
353
|
+
clientId?: string;
|
|
354
|
+
threeDSecureToken?: string;
|
|
355
|
+
threeDSecureInitUrl?: string;
|
|
356
|
+
threeDSecureProvider?: string;
|
|
357
|
+
threeDSecureEnabled?: boolean;
|
|
1337
358
|
};
|
|
359
|
+
forceRedirect?: boolean;
|
|
1338
360
|
}
|
|
1339
|
-
export interface
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
};
|
|
361
|
+
export interface PaymentMethodInfo {
|
|
362
|
+
type: PaymentMethodType;
|
|
363
|
+
managerType: HeadlessManagerType;
|
|
1343
364
|
}
|
|
1344
|
-
export
|
|
1345
|
-
|
|
365
|
+
export type CardNetworkType = "american-express" | "diners-club" | "discover" | "elo" | "hiper" | "hipercard" | "interac" | "jcb" | "maestro" | "mastercard" | "mir" | "unionpay" | "private-label" | "visa";
|
|
366
|
+
export interface CardNetworkDetails {
|
|
367
|
+
displayName: string;
|
|
368
|
+
network: string;
|
|
369
|
+
allowed: boolean;
|
|
1346
370
|
}
|
|
1347
|
-
export interface
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
input?: InputStyles;
|
|
1352
|
-
inputLabel?: TextStyle;
|
|
1353
|
-
inputErrorText?: TextStyle & TextAlignmentStyle;
|
|
1354
|
-
formSpacings?: FormSpacings;
|
|
1355
|
-
showMorePaymentMethodsButton?: ShowMorePaymentMethodsButtonStyles;
|
|
1356
|
-
networkError?: NetworkErrorStyles;
|
|
1357
|
-
submitButton?: SubmitButtonStyles;
|
|
1358
|
-
vaultTitle?: TextStyle;
|
|
1359
|
-
savedPaymentMethodButton?: SavedPaymentMethodButtonStyles;
|
|
1360
|
-
paymentMethodButton?: PaymentMethodButtonStyle;
|
|
1361
|
-
errorMessage?: ErrorMessageStyle;
|
|
1362
|
-
smallPrint?: TextStyle;
|
|
1363
|
-
directDebit?: {
|
|
1364
|
-
mandate?: DirectDebitMandateStyle;
|
|
1365
|
-
success?: DirectDebitSuccessStyle;
|
|
371
|
+
export interface CardNetworkChangeEvent {
|
|
372
|
+
detectedCardNetworks: {
|
|
373
|
+
items: CardNetworkDetails[];
|
|
374
|
+
preferred?: CardNetworkDetails;
|
|
1366
375
|
};
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
}
|
|
1373
|
-
declare enum CheckoutUXFlow {
|
|
1374
|
-
CHECKOUT = "CHECKOUT",
|
|
1375
|
-
HEADLESS_CHECKOUT = "HEADLESS_CHECKOUT",
|
|
1376
|
-
MANAGE_PAYMENT_METHODS = "MANAGE_PAYMENT_METHODS"
|
|
376
|
+
selectableCardNetworks?: {
|
|
377
|
+
items: CardNetworkDetails[];
|
|
378
|
+
preferred?: CardNetworkDetails;
|
|
379
|
+
};
|
|
380
|
+
source: "REMOTE" | "LOCAL" | "LOCAL_FALLBACK";
|
|
1377
381
|
}
|
|
1378
|
-
export interface
|
|
1379
|
-
|
|
382
|
+
export interface CardPaymentMethodSubmitValues {
|
|
383
|
+
cardNetwork?: string;
|
|
1380
384
|
}
|
|
385
|
+
export type CardPreferredFlow = "DEDICATED_SCENE" | "EMBEDDED_IN_HOME";
|
|
1381
386
|
export interface PaymentCardInstrumentData extends BasePaymentInstrumentData {
|
|
1382
387
|
last4Digits: string;
|
|
1383
388
|
first6Digits: string;
|
|
@@ -1456,23 +461,18 @@ export type PayPalVaultedMethod = IVaultedPaymentMethod<PayPalInstrumentData, ty
|
|
|
1456
461
|
export type KlarnaVaultedMethod = IVaultedPaymentMethod<KlarnaInstrumentData, typeof PaymentInstrumentType.KLARNA_CUSTOMER_TOKEN, typeof PaymentMethodType.KLARNA>;
|
|
1457
462
|
export type ACHVaultedMethod = IVaultedPaymentMethod<ACHInstrumentData, typeof PaymentInstrumentType.AUTOMATED_CLEARING_HOUSE, typeof PaymentMethodType.STRIPE_ACH>;
|
|
1458
463
|
export type VaultedPaymentMethod = PaymentCardVaultedMethod | PayPalVaultedMethod | KlarnaVaultedMethod | ACHVaultedMethod | IVaultedPaymentMethod;
|
|
1459
|
-
export
|
|
464
|
+
export interface CardSecurityCodeInputOptions {
|
|
1460
465
|
ariaLabel?: string;
|
|
1461
466
|
container: string | Element | HTMLElement;
|
|
1462
467
|
id?: string;
|
|
1463
|
-
name
|
|
468
|
+
name?: string;
|
|
1464
469
|
placeholder?: string;
|
|
1465
470
|
placement?: "append" | "prepend";
|
|
1466
|
-
properties?:
|
|
471
|
+
properties?: unknown;
|
|
1467
472
|
style?: CheckoutStyle;
|
|
1468
|
-
allowedCharactersMap?: Record<string, string>;
|
|
1469
|
-
};
|
|
1470
|
-
export type SecureInputListener = (...args: unknown[]) => void;
|
|
1471
|
-
export type CardSecurityCodeInputOptions = Omit<SecureInputOptions, "allowedCharactersMap" | "name"> & {
|
|
1472
473
|
cardNetwork?: string;
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
export type CvvInput = {
|
|
474
|
+
}
|
|
475
|
+
export interface CvvInput {
|
|
1476
476
|
frame: HTMLIFrameElement | null;
|
|
1477
477
|
readonly metadata: {
|
|
1478
478
|
readonly errorCode: string | null;
|
|
@@ -1485,571 +485,93 @@ export type CvvInput = {
|
|
|
1485
485
|
};
|
|
1486
486
|
focus(): void;
|
|
1487
487
|
blur(): void;
|
|
1488
|
-
addListener(event: "change" | "blur" | "focus", listener:
|
|
1489
|
-
addEventListener(event: "change" | "blur" | "focus", listener:
|
|
1490
|
-
removeListener(event: "change" | "blur" | "focus", listener:
|
|
488
|
+
addListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): (() => void) | undefined;
|
|
489
|
+
addEventListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): (() => void) | undefined;
|
|
490
|
+
removeListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): void;
|
|
1491
491
|
name: string;
|
|
1492
492
|
valueToken: string;
|
|
1493
493
|
remove: () => void;
|
|
1494
|
-
};
|
|
1495
|
-
export type CvvInputOptions = CardSecurityCodeInputOptions;
|
|
1496
|
-
export interface HeadlessVaultManager {
|
|
1497
|
-
fetchVaultedPaymentMethods(): Promise<VaultedPaymentMethod[]>;
|
|
1498
|
-
deleteVaultedPaymentMethod(id: string): Promise<void>;
|
|
1499
|
-
startPaymentFlow(id: string, data?: {
|
|
1500
|
-
cvv?: string;
|
|
1501
|
-
}): Promise<void>;
|
|
1502
|
-
createCvvInput(options: CvvInputOptions): Promise<CvvInput | null>;
|
|
1503
|
-
}
|
|
1504
|
-
declare enum PaymentFlow {
|
|
1505
|
-
DEFAULT = "DEFAULT",
|
|
1506
|
-
PREFER_VAULT = "PREFER_VAULT"
|
|
1507
|
-
}
|
|
1508
|
-
declare enum ThreeDSecureStatus {
|
|
1509
|
-
SUCCESS = "AUTH_SUCCESS",
|
|
1510
|
-
FAILED = "AUTH_FAILED",
|
|
1511
|
-
SKIPPED = "SKIPPED",
|
|
1512
|
-
CHALLENGE = "CHALLENGE"
|
|
1513
|
-
}
|
|
1514
|
-
declare enum ErrorCode {
|
|
1515
|
-
INITIALIZATION_ERROR = "INITIALIZATION_ERROR",
|
|
1516
|
-
NO_PAYMENT_METHODS = "NO_PAYMENT_METHODS",
|
|
1517
|
-
PRIMER_TEARDOWN = "PRIMER_TEARDOWN",
|
|
1518
|
-
PRIMER_SERVER_ERROR = "PRIMER_SERVER_ERROR",
|
|
1519
|
-
THREE_DS_AUTH_FAILED = "THREE_DS_AUTH_FAILED",
|
|
1520
|
-
TOKENIZATION_ERROR = "TOKENIZATION_ERROR",
|
|
1521
|
-
DUPLICATE_PAYMENT_METHOD_ERROR = "DUPLICATE_PAYMENT_METHOD_ERROR",
|
|
1522
|
-
CARD_NUMBER_ERROR = "CARD_NUMBER_ERROR",
|
|
1523
|
-
PAYMENT_METHOD_NOT_SETUP = "PAYMENT_METHOD_NOT_SETUP",
|
|
1524
|
-
PAYMENT_METHOD_NOT_PROVIDED = "PAYMENT_METHOD_NOT_PROVIDED",
|
|
1525
|
-
PAYMENT_METHOD_NOT_COMPATIBLE = "PAYMENT_METHOD_NOT_COMPATIBLE",
|
|
1526
|
-
RESUME_ERROR = "RESUME_ERROR",
|
|
1527
|
-
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
1528
|
-
PAYMENT_FAILED = "PAYMENT_FAILED",
|
|
1529
|
-
PAYMENT_CREATION_ABORTED = "PAYMENT_CREATION_ABORTED",
|
|
1530
|
-
PAYMENT_CREATION_DISABLED = "PAYMENT_CREATION_DISABLED",
|
|
1531
|
-
CLIENT_SESSION_UPDATE_ERROR = "CLIENT_SESSION_UPDATE_ERROR",
|
|
1532
|
-
INVALID_ARGUMENT = "INVALID_ARGUMENT",
|
|
1533
|
-
VAULT_FETCH = "VAULT_FETCH",
|
|
1534
|
-
VAULT_DELETE = "VAULT_DELETE",
|
|
1535
|
-
HEADLESS_VAULT_MANAGER_VALIDATION = "HEADLESS_VAULT_MANAGER_VALIDATION",
|
|
1536
|
-
CARD_FORM_VALIDATION_UNEXPECTED_FIELD = "CARD_FORM_VALIDATION_UNEXPECTED_FIELD",
|
|
1537
|
-
MISSING_FIRST_NAME_OR_LAST_NAME = "MISSING_FIRST_NAME_OR_LAST_NAME",
|
|
1538
|
-
MISSING_EMAIL_ADDRESS = "MISSING_EMAIL_ADDRESS",
|
|
1539
|
-
INVALID_FLOW = "INVALID_FLOW"
|
|
1540
|
-
}
|
|
1541
|
-
declare class SDKError extends Error {
|
|
1542
|
-
isReported: boolean;
|
|
1543
|
-
constructor(message: string, isReported?: boolean);
|
|
1544
|
-
static from(error: unknown, isReported?: boolean): SDKError;
|
|
1545
|
-
markAsReported(): void;
|
|
1546
|
-
}
|
|
1547
|
-
export interface ErrorOptions$1<T = any> {
|
|
1548
|
-
message: string;
|
|
1549
|
-
diagnosticsId?: string;
|
|
1550
|
-
severity?: MessageSeverity;
|
|
1551
|
-
errorId?: string;
|
|
1552
|
-
data?: T;
|
|
1553
|
-
isFromDeveloper?: boolean;
|
|
1554
|
-
}
|
|
1555
|
-
declare class PrimerClientError<T = any> extends SDKError {
|
|
1556
|
-
readonly code: ErrorCode;
|
|
1557
|
-
readonly diagnosticsId: string | null;
|
|
1558
|
-
readonly data?: T;
|
|
1559
|
-
readonly isFromDeveloper: boolean;
|
|
1560
|
-
static fromErrorCode(code: ErrorCode, options: ErrorOptions$1): PrimerClientError;
|
|
1561
|
-
constructor(code: ErrorCode, options: ErrorOptions$1<T>);
|
|
1562
|
-
}
|
|
1563
|
-
export interface CardMetadata {
|
|
1564
|
-
/** @deprecated Use onCardNetworksChange instead. */
|
|
1565
|
-
type: CardNetwork$1 | null;
|
|
1566
|
-
/** @deprecated Use onCardNetworksChange instead. */
|
|
1567
|
-
possibleTypes: string[];
|
|
1568
|
-
cvvLength: number;
|
|
1569
|
-
cardNumberLength: number;
|
|
1570
|
-
}
|
|
1571
|
-
export interface PositionalConfig {
|
|
1572
|
-
container: string | Element;
|
|
1573
|
-
}
|
|
1574
|
-
export interface ApplePayOptions extends PositionalConfig {
|
|
1575
|
-
buttonType?: "plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe";
|
|
1576
|
-
buttonStyle?: "white" | "white-outline" | "black";
|
|
1577
|
-
/**
|
|
1578
|
-
* @deprecated Add `postalAddress` to `billingOptions.requiredBillingContactFields` instead.
|
|
1579
|
-
*/
|
|
1580
|
-
captureBillingAddress?: boolean;
|
|
1581
|
-
billingOptions?: ApplePayBillingOptions;
|
|
1582
|
-
shippingOptions?: ApplePayShippingOptions;
|
|
1583
|
-
}
|
|
1584
|
-
export interface ApplePayBillingOptions {
|
|
1585
|
-
requiredBillingContactFields?: RequiredContactFields[];
|
|
1586
|
-
}
|
|
1587
|
-
export interface ApplePayShippingOptions {
|
|
1588
|
-
requiredShippingContactFields?: RequiredContactFields[];
|
|
1589
|
-
requireShippingMethod?: boolean;
|
|
1590
|
-
}
|
|
1591
|
-
export type RequiredContactFields = "emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName";
|
|
1592
|
-
export interface DirectDebitOptions {
|
|
1593
|
-
customerCountryCode: Alpha2CountryCode;
|
|
1594
|
-
companyName: string;
|
|
1595
|
-
companyAddress: string;
|
|
1596
|
-
customerName?: string;
|
|
1597
|
-
customerEmail?: string;
|
|
1598
|
-
customerAddressLine1?: string;
|
|
1599
|
-
customerAddressLine2?: string;
|
|
1600
|
-
customerCity?: string;
|
|
1601
|
-
customerPostalCode?: string;
|
|
1602
|
-
iban?: string;
|
|
1603
|
-
submitButtonLabels?: {
|
|
1604
|
-
form?: Label;
|
|
1605
|
-
mandate: Label;
|
|
1606
|
-
};
|
|
1607
|
-
}
|
|
1608
|
-
export type GooglePayButtonType =
|
|
1609
|
-
/** @deprecated Set buttonSizeMode to fill instead */
|
|
1610
|
-
"long"
|
|
1611
|
-
/** @deprecated Set buttonSizeMode to static instead */
|
|
1612
|
-
| "short" | "book" | "buy" | "checkout" | "donate" | "order" | "pay" | "plain" | "subscribe";
|
|
1613
|
-
export type GooglePayButtonColor = "default" | "black" | "white";
|
|
1614
|
-
export type GooglePayButtonSizeMode = "fill" | "static";
|
|
1615
|
-
export interface GooglePayShippingAddressParameters {
|
|
1616
|
-
phoneNumberRequired?: boolean;
|
|
1617
|
-
}
|
|
1618
|
-
export interface GooglePayOptions extends PositionalConfig {
|
|
1619
|
-
buttonType?: GooglePayButtonType;
|
|
1620
|
-
buttonColor?: GooglePayButtonColor;
|
|
1621
|
-
buttonSizeMode?: GooglePayButtonSizeMode;
|
|
1622
|
-
onClick?: () => void;
|
|
1623
|
-
captureBillingAddress?: boolean;
|
|
1624
|
-
shippingAddressParameters?: GooglePayShippingAddressParameters;
|
|
1625
|
-
emailRequired?: boolean;
|
|
1626
|
-
requireShippingMethod?: boolean;
|
|
1627
|
-
shadowRoot?: boolean;
|
|
1628
|
-
}
|
|
1629
|
-
export interface PayPalOptions extends PositionalConfig {
|
|
1630
|
-
buttonColor?: "gold" | "blue" | "silver" | "white" | "black";
|
|
1631
|
-
buttonShape?: "pill" | "rect";
|
|
1632
|
-
buttonSize?: "small" | "medium" | "large" | "responsive";
|
|
1633
|
-
buttonHeight?: number;
|
|
1634
|
-
buttonLabel?: "checkout" | "credit" | "pay" | "buynow" | "paypal" | "installment";
|
|
1635
|
-
buttonTagline?: boolean;
|
|
1636
|
-
paymentFlow?: PaymentFlow;
|
|
1637
|
-
onClick?: () => void;
|
|
1638
|
-
}
|
|
1639
|
-
export interface SubmitButtonOptions {
|
|
1640
|
-
amountVisible?: boolean;
|
|
1641
|
-
useBuiltInButton?: boolean;
|
|
1642
|
-
onVisible?: (isVisible: boolean, context: {
|
|
1643
|
-
currentSceneId: string;
|
|
1644
|
-
previousSceneId?: string;
|
|
1645
|
-
}) => void;
|
|
1646
|
-
onContentChange?: (content: string, context: {
|
|
1647
|
-
currentSceneId: string;
|
|
1648
|
-
}) => void;
|
|
1649
|
-
onDisable?: (isDisabled: boolean, context: {
|
|
1650
|
-
currentSceneId: string;
|
|
1651
|
-
}) => void;
|
|
1652
|
-
onLoading?: (isLoading: boolean, context: {
|
|
1653
|
-
currentSceneId: string;
|
|
1654
|
-
}) => void;
|
|
1655
|
-
}
|
|
1656
|
-
export interface ProcessingIndicatorOptions {
|
|
1657
|
-
visible?: boolean;
|
|
1658
|
-
}
|
|
1659
|
-
export interface FormOptions {
|
|
1660
|
-
inputLabelsVisible?: boolean;
|
|
1661
494
|
}
|
|
1662
|
-
export
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
* @deprecated Set it on your Dashboard
|
|
1671
|
-
*/
|
|
1672
|
-
visible?: boolean;
|
|
1673
|
-
placeholder?: Label;
|
|
1674
|
-
};
|
|
1675
|
-
cardNumber?: {
|
|
1676
|
-
placeholder?: Label;
|
|
1677
|
-
};
|
|
1678
|
-
expiryDate?: {
|
|
1679
|
-
placeholder?: Label;
|
|
1680
|
-
};
|
|
1681
|
-
cvv?: {
|
|
1682
|
-
placeholder?: Label;
|
|
495
|
+
export interface Payment {
|
|
496
|
+
id: string;
|
|
497
|
+
orderId: string;
|
|
498
|
+
paymentMethodData?: {
|
|
499
|
+
paymentMethodType: PaymentMethodType;
|
|
500
|
+
reference?: string;
|
|
501
|
+
expiresAt?: string;
|
|
502
|
+
entity?: string;
|
|
1683
503
|
};
|
|
1684
|
-
preferredFlow?: CardPreferredFlow;
|
|
1685
|
-
}
|
|
1686
|
-
export interface ErrorMessageOptions {
|
|
1687
|
-
disabled?: boolean;
|
|
1688
|
-
onErrorMessageShow?: (message: string) => void;
|
|
1689
|
-
onErrorMessageHide?: () => void;
|
|
1690
504
|
}
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
505
|
+
export interface KlarnaPaymentMethodCategory {
|
|
506
|
+
id: string;
|
|
507
|
+
name: string;
|
|
508
|
+
descriptiveAssetUrl: string;
|
|
509
|
+
standardAssetUrl: string;
|
|
1694
510
|
}
|
|
1695
511
|
export interface StripeAchCustomerDetails {
|
|
1696
512
|
emailAddress: string;
|
|
1697
513
|
firstName: string;
|
|
1698
514
|
lastName: string;
|
|
1699
515
|
}
|
|
1700
|
-
export interface
|
|
1701
|
-
publishableKey: string;
|
|
1702
|
-
}
|
|
1703
|
-
export interface StripeOptionsDropInWithFullMandateText extends StripeOptions {
|
|
1704
|
-
mandateData: {
|
|
1705
|
-
fullMandateText: string;
|
|
1706
|
-
merchantName?: never;
|
|
1707
|
-
};
|
|
1708
|
-
}
|
|
1709
|
-
export interface StripeOptionsDropInTextProvidedByPrimer extends StripeOptions {
|
|
1710
|
-
mandateData: {
|
|
1711
|
-
merchantName: string;
|
|
1712
|
-
fullMandateText?: never;
|
|
1713
|
-
};
|
|
1714
|
-
}
|
|
1715
|
-
export type StripeOptionsDropIn = StripeOptionsDropInWithFullMandateText | StripeOptionsDropInTextProvidedByPrimer;
|
|
1716
|
-
type CardNetwork$1 = "american-express" | "diners-club" | "discover" | "elo" | "hiper" | "hipercard" | "interac" | "jcb" | "maestro" | "mastercard" | "mir" | "unionpay" | "private-label" | "visa";
|
|
1717
|
-
export interface CustomizablePaymentMethodButton {
|
|
1718
|
-
logoSrc: string;
|
|
1719
|
-
background: string;
|
|
1720
|
-
logoAlt?: string;
|
|
1721
|
-
text?: string;
|
|
1722
|
-
}
|
|
1723
|
-
export type KlarnaPaymentCategoryType = "pay_now" | "pay_later" | "pay_over_time";
|
|
1724
|
-
export interface KlarnaButtonOptions {
|
|
1725
|
-
text?: string;
|
|
1726
|
-
}
|
|
1727
|
-
export interface AdyenKlarnaOptions {
|
|
1728
|
-
buttonOptions?: KlarnaButtonOptions;
|
|
1729
|
-
}
|
|
1730
|
-
export interface KlarnaOptions {
|
|
1731
|
-
paymentFlow?: PaymentFlow;
|
|
1732
|
-
recurringPaymentDescription?: string;
|
|
1733
|
-
allowedPaymentCategories?: KlarnaPaymentCategoryType[];
|
|
1734
|
-
buttonOptions?: KlarnaButtonOptions;
|
|
1735
|
-
}
|
|
1736
|
-
export type SupportedLocale = string;
|
|
1737
|
-
export type Alpha2CountryCode = string;
|
|
1738
|
-
export type Alpha3CurrencyCode = string;
|
|
1739
|
-
export type Label<T extends Record<string, unknown> = Record<string, unknown>> = string | ((options: {
|
|
1740
|
-
locale: SupportedLocale;
|
|
1741
|
-
} | T) => string);
|
|
1742
|
-
export type ResumeToken = {
|
|
1743
|
-
resumeToken: string;
|
|
1744
|
-
paymentId?: string;
|
|
1745
|
-
};
|
|
1746
|
-
export interface InputValidationError {
|
|
1747
|
-
field?: string;
|
|
1748
|
-
name: string;
|
|
1749
|
-
error: string;
|
|
516
|
+
export interface PrimerClientErrorOptions<T = unknown> {
|
|
1750
517
|
message: string;
|
|
518
|
+
diagnosticsId?: string;
|
|
519
|
+
severity?: "ERROR" | "DEBUG" | "WARN" | "INFO";
|
|
520
|
+
errorId?: string;
|
|
521
|
+
data?: T;
|
|
522
|
+
isFromDeveloper?: boolean;
|
|
1751
523
|
}
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
city?: string;
|
|
1779
|
-
state?: string;
|
|
1780
|
-
countryCode?: Alpha2CountryCode;
|
|
1781
|
-
postalCode?: string;
|
|
1782
|
-
}
|
|
1783
|
-
export interface MonetaryAmount {
|
|
1784
|
-
value: number | string;
|
|
1785
|
-
currency: Alpha3CurrencyCode;
|
|
1786
|
-
}
|
|
1787
|
-
export interface ThreeDSecureOrderDetails {
|
|
1788
|
-
amount: MonetaryAmount;
|
|
1789
|
-
email: string;
|
|
1790
|
-
billingAddress: CustomerAddress;
|
|
1791
|
-
orderId: string;
|
|
1792
|
-
}
|
|
1793
|
-
export interface ThreeDSVerificationOptions {
|
|
1794
|
-
token: string;
|
|
1795
|
-
container: string;
|
|
1796
|
-
order: ThreeDSecureOrderDetails;
|
|
1797
|
-
testScenario?: string;
|
|
1798
|
-
onChallengeStart?: () => void;
|
|
1799
|
-
onChallengeEnd?: () => void;
|
|
1800
|
-
}
|
|
1801
|
-
export interface ThreeDSAuthenticationData {
|
|
1802
|
-
responseCode: ThreeDSecureStatus;
|
|
1803
|
-
reasonCode?: string;
|
|
1804
|
-
reasonText?: string;
|
|
1805
|
-
protocolVersion: string;
|
|
1806
|
-
challengeIssued: boolean;
|
|
1807
|
-
}
|
|
1808
|
-
export interface VaultData {
|
|
1809
|
-
customerId: string;
|
|
1810
|
-
}
|
|
1811
|
-
export type PaymentCardDetails = {
|
|
1812
|
-
last4Digits: string;
|
|
1813
|
-
cardholderName: string;
|
|
1814
|
-
network: string;
|
|
1815
|
-
};
|
|
1816
|
-
export type PayPalBillingAgreementDetails = {
|
|
1817
|
-
paypalBillingAgreementId: string;
|
|
1818
|
-
externalPayerInfo?: ExternalPayerInfo;
|
|
1819
|
-
shippingAddress?: CustomerAddress;
|
|
1820
|
-
};
|
|
1821
|
-
export type GoCardlessDetails = {
|
|
1822
|
-
gocardlessMandateId: string;
|
|
1823
|
-
};
|
|
1824
|
-
export type BasePaymentInstrumentData$1 = Record<string, unknown>;
|
|
1825
|
-
export interface IPaymentMethodToken<T extends BasePaymentInstrumentData$1 = BasePaymentInstrumentData$1, U extends PaymentInstrumentType = PaymentInstrumentType> {
|
|
1826
|
-
token: string;
|
|
1827
|
-
analyticsId: string;
|
|
1828
|
-
tokenType: TokenType;
|
|
1829
|
-
paymentInstrumentData: T;
|
|
1830
|
-
paymentInstrumentType: U;
|
|
1831
|
-
threeDSecureAuthentication: ThreeDSAuthenticationData | null;
|
|
1832
|
-
vaultData: VaultData | null;
|
|
1833
|
-
}
|
|
1834
|
-
export type UnknownPaymentMethodToken = IPaymentMethodToken<BasePaymentInstrumentData$1, PaymentInstrumentType>;
|
|
1835
|
-
export type PaymentCardToken = IPaymentMethodToken<PaymentCardDetails, typeof PaymentInstrumentType.CARD>;
|
|
1836
|
-
export type PayPalBillingAgreementToken = IPaymentMethodToken<PayPalBillingAgreementDetails, typeof PaymentInstrumentType.PAYPAL_VAULTED>;
|
|
1837
|
-
export type GoCardlessToken = IPaymentMethodToken<GoCardlessDetails, typeof PaymentInstrumentType.GO_CARDLESS>;
|
|
1838
|
-
export type IdealPayToken = IPaymentMethodToken<Record<string, never>, typeof PaymentInstrumentType.PAY_NL_IDEAL>;
|
|
1839
|
-
export type PaymentMethodToken = PaymentCardToken | PayPalBillingAgreementToken | GoCardlessToken | IdealPayToken | UnknownPaymentMethodToken;
|
|
1840
|
-
export type CheckSuccessScreenOptions = {
|
|
1841
|
-
type: SuccessScreenType.CHECK;
|
|
1842
|
-
title: Label;
|
|
1843
|
-
};
|
|
1844
|
-
export type PaymentMethodSuccessScreenOptions = {
|
|
1845
|
-
type: SuccessScreenType.PAYMENT_METHOD;
|
|
1846
|
-
};
|
|
1847
|
-
export type SuccessScreenOptions = /* No success screen will be displayed */ false | /* Show the default success screen of the payment method*/ undefined | CheckSuccessScreenOptions | PaymentMethodSuccessScreenOptions;
|
|
1848
|
-
export type VaultOptions = {
|
|
1849
|
-
visible?: boolean;
|
|
1850
|
-
deletionDisabled?: boolean;
|
|
1851
|
-
};
|
|
1852
|
-
export type TransitionType = "SLIDE_UP" | "SLIDE_DOWN" | "SLIDE_HORIZONTAL";
|
|
1853
|
-
export type SceneTransitionOptions = {
|
|
1854
|
-
type: TransitionType;
|
|
1855
|
-
duration: number;
|
|
1856
|
-
isRtlLocale?: boolean;
|
|
1857
|
-
};
|
|
1858
|
-
export type SceneOptions = {
|
|
1859
|
-
onEntering?: (sceneId: string) => void;
|
|
1860
|
-
transition?: SceneTransitionOptions | false;
|
|
1861
|
-
};
|
|
1862
|
-
export type RedirectOptions = {
|
|
1863
|
-
returnUrl?: string;
|
|
1864
|
-
/**
|
|
1865
|
-
* default: false
|
|
1866
|
-
*/
|
|
1867
|
-
forceRedirect?: boolean;
|
|
1868
|
-
};
|
|
1869
|
-
export type AdvancedOptions = {
|
|
1870
|
-
platform?: "STANDALONE" | "MAGENTO";
|
|
1871
|
-
};
|
|
1872
|
-
export type PaymentMethodAction = "PAYMENT_METHOD_SELECTED" | "PAYMENT_METHOD_UNSELECTED";
|
|
1873
|
-
export type PaymentHandling = "AUTO" | "MANUAL";
|
|
1874
|
-
export type PaymentMethodData$1 = AdyenMultibancoPaymentData;
|
|
1875
|
-
export type AdyenMultibancoPaymentData = {
|
|
1876
|
-
paymentMethodType: typeof PaymentMethodType.ADYEN_MULTIBANCO;
|
|
1877
|
-
reference: string;
|
|
1878
|
-
expiresAt: string;
|
|
1879
|
-
entity: string;
|
|
1880
|
-
};
|
|
1881
|
-
export type Payment = {
|
|
1882
|
-
id: string;
|
|
1883
|
-
orderId: string;
|
|
1884
|
-
paymentMethodData?: PaymentMethodData$1;
|
|
1885
|
-
};
|
|
1886
|
-
export interface onBeforePaymentCreateHandler {
|
|
1887
|
-
continuePaymentCreation: () => void;
|
|
1888
|
-
abortPaymentCreation: () => void;
|
|
1889
|
-
}
|
|
1890
|
-
export interface OnCheckoutFailHandler {
|
|
1891
|
-
showErrorMessage: (errorMessage?: string) => void;
|
|
1892
|
-
}
|
|
1893
|
-
export interface PaymentHandlers {
|
|
1894
|
-
onBeforePaymentCreate?: (data: {
|
|
1895
|
-
paymentMethodType?: PaymentMethodType;
|
|
1896
|
-
}, handler: onBeforePaymentCreateHandler) => void;
|
|
1897
|
-
onPaymentCreationStart?: () => void;
|
|
1898
|
-
onCheckoutComplete?: (data: {
|
|
1899
|
-
payment: Payment | null;
|
|
1900
|
-
}) => void;
|
|
1901
|
-
onCheckoutFail?: (error: PrimerClientError, data: {
|
|
1902
|
-
payment?: Payment;
|
|
1903
|
-
}, handler: OnCheckoutFailHandler | undefined) => void;
|
|
1904
|
-
}
|
|
1905
|
-
export type OnTokenizeShouldStart = (data: {
|
|
1906
|
-
paymentMethodType?: PaymentMethodType;
|
|
1907
|
-
}) => boolean | Promise<boolean>;
|
|
1908
|
-
export type OnTokenizeDidNotStart = (reason: string) => void;
|
|
1909
|
-
export type OnTokenizeStart = () => void;
|
|
1910
|
-
export type OnTokenizeError = (error: PrimerClientError) => void;
|
|
1911
|
-
export interface OnTokenizeSuccessHandler {
|
|
1912
|
-
handleSuccess(): any;
|
|
1913
|
-
handleFailure(errorMessage?: string): any;
|
|
1914
|
-
continueWithNewClientToken(clientToken: string): any;
|
|
1915
|
-
}
|
|
1916
|
-
export type OnTokenizeSuccess = (data: PaymentMethodToken, handler: OnTokenizeSuccessHandler) => void | Promise<void>;
|
|
1917
|
-
export interface OnResumeSuccessHandler {
|
|
1918
|
-
handleSuccess(): any;
|
|
1919
|
-
handleFailure(errorMessage?: string): any;
|
|
1920
|
-
continueWithNewClientToken(clientToken: string): any;
|
|
1921
|
-
}
|
|
1922
|
-
export type OnResumeSuccess = (data: ResumeToken, handler: OnResumeSuccessHandler) => void;
|
|
1923
|
-
export type onResumeError = (error: PrimerClientError) => void;
|
|
1924
|
-
export type OnResumePending = (paymentMethodData: PaymentMethodData$1) => void;
|
|
1925
|
-
export interface TokenizationHandlers {
|
|
1926
|
-
onTokenizeShouldStart?: OnTokenizeShouldStart;
|
|
1927
|
-
onTokenizeDidNotStart?: OnTokenizeDidNotStart;
|
|
1928
|
-
onTokenizeStart?: OnTokenizeStart;
|
|
1929
|
-
onTokenizeSuccess?: OnTokenizeSuccess;
|
|
1930
|
-
onTokenizeError?: OnTokenizeError;
|
|
1931
|
-
onResumeSuccess?: OnResumeSuccess;
|
|
1932
|
-
onResumePending?: OnResumePending;
|
|
1933
|
-
onResumeError?: onResumeError;
|
|
1934
|
-
}
|
|
1935
|
-
export interface PaymentMethodHandlers {
|
|
1936
|
-
onPaymentMethodAction?: (paymentMethodAction: PaymentMethodAction, { paymentMethodType, }: {
|
|
1937
|
-
paymentMethodType: PaymentMethodType | string | null;
|
|
1938
|
-
}) => void;
|
|
1939
|
-
}
|
|
1940
|
-
export interface ClientSessionHandlers {
|
|
1941
|
-
onClientSessionUpdate?: (clientSession: ClientSession) => void;
|
|
1942
|
-
onBeforeClientSessionUpdate?: () => void;
|
|
1943
|
-
}
|
|
1944
|
-
export interface VaultManagerOptions extends WithAllowedCardNetworks {
|
|
1945
|
-
uxFlow?: CheckoutUXFlow.MANAGE_PAYMENT_METHODS;
|
|
1946
|
-
container: string | Element;
|
|
1947
|
-
locale?: SupportedLocale;
|
|
1948
|
-
vaultOnly?: boolean;
|
|
1949
|
-
deletionDisabled?: boolean;
|
|
1950
|
-
style?: CheckoutStyle;
|
|
1951
|
-
scene?: SceneOptions;
|
|
1952
|
-
errorMessage?: ErrorMessageOptions;
|
|
1953
|
-
form?: FormOptions;
|
|
1954
|
-
submitButton?: SubmitButtonOptions;
|
|
1955
|
-
processingIndicator?: ProcessingIndicatorOptions;
|
|
1956
|
-
card?: CheckoutCardOptions;
|
|
1957
|
-
threeDSecure?: ThreeDSVerificationOptions;
|
|
1958
|
-
giftCard?: CustomizablePaymentMethodButton;
|
|
1959
|
-
googlePay?: Omit<GooglePayOptions, "container">;
|
|
1960
|
-
directDebit?: DirectDebitOptions;
|
|
1961
|
-
stripe?: StripeOptionsDropIn;
|
|
1962
|
-
paypal?: Omit<PayPalOptions, "container">;
|
|
1963
|
-
onTokenizeShouldStart?: OnTokenizeShouldStart;
|
|
1964
|
-
onTokenizeDidNotStart?: OnTokenizeDidNotStart;
|
|
1965
|
-
onTokenizeStart?: () => void;
|
|
1966
|
-
onTokenizeSuccess?: (data: PaymentMethodToken) => void;
|
|
1967
|
-
onTokenizeError?: (message: PrimerClientError) => void;
|
|
1968
|
-
apiVersion?: APIVersionOption;
|
|
1969
|
-
}
|
|
1970
|
-
export interface UniversalCheckoutOptions extends TokenizationHandlers, PaymentHandlers, PaymentMethodHandlers, ClientSessionHandlers, WithAllowedCardNetworks {
|
|
1971
|
-
uxFlow?: CheckoutUXFlow.CHECKOUT;
|
|
1972
|
-
container: string | Element;
|
|
1973
|
-
locale?: SupportedLocale;
|
|
1974
|
-
style?: CheckoutStyle;
|
|
1975
|
-
scene?: SceneOptions;
|
|
1976
|
-
vault?: VaultOptions;
|
|
1977
|
-
submitButton?: SubmitButtonOptions;
|
|
1978
|
-
processingIndicator?: ProcessingIndicatorOptions;
|
|
1979
|
-
errorMessage?: ErrorMessageOptions;
|
|
1980
|
-
successScreen?: SuccessScreenOptions;
|
|
1981
|
-
form?: FormOptions;
|
|
1982
|
-
allowedPaymentMethods?: PaymentMethodType[];
|
|
1983
|
-
card?: CheckoutCardOptions;
|
|
1984
|
-
redirect?: RedirectOptions;
|
|
1985
|
-
paypal?: Omit<PayPalOptions, "container">;
|
|
1986
|
-
googlePay?: Omit<GooglePayOptions, "container">;
|
|
1987
|
-
applePay?: Omit<ApplePayOptions, "container">;
|
|
1988
|
-
adyenKlarna?: AdyenKlarnaOptions;
|
|
1989
|
-
klarna?: KlarnaOptions;
|
|
1990
|
-
directDebit?: DirectDebitOptions;
|
|
1991
|
-
giftCard?: CustomizablePaymentMethodButton;
|
|
1992
|
-
stripe?: StripeOptionsDropIn;
|
|
1993
|
-
paymentHandling?: PaymentHandling;
|
|
1994
|
-
advanced?: AdvancedOptions;
|
|
1995
|
-
clientSessionCachingEnabled?: boolean;
|
|
1996
|
-
apiVersion?: APIVersionOption;
|
|
1997
|
-
}
|
|
1998
|
-
export interface HeadlessUniversalCheckoutOptions extends TokenizationHandlers, PaymentHandlers, PaymentMethodHandlers, ClientSessionHandlers, WithAllowedCardNetworks {
|
|
1999
|
-
style?: CheckoutStyle;
|
|
2000
|
-
paymentHandling?: PaymentHandling;
|
|
2001
|
-
locale?: SupportedLocale;
|
|
2002
|
-
card?: CheckoutCardOptions;
|
|
2003
|
-
redirect?: RedirectOptions;
|
|
2004
|
-
paypal?: Omit<PayPalOptions, "container">;
|
|
2005
|
-
googlePay?: Omit<GooglePayOptions, "container">;
|
|
2006
|
-
applePay?: Omit<ApplePayOptions, "container">;
|
|
2007
|
-
adyenKlarna?: AdyenKlarnaOptions;
|
|
2008
|
-
klarna?: KlarnaOptions;
|
|
2009
|
-
directDebit?: DirectDebitOptions;
|
|
2010
|
-
giftCard?: CustomizablePaymentMethodButton;
|
|
2011
|
-
stripe?: StripeOptions;
|
|
2012
|
-
onAvailablePaymentMethodsLoad: (paymentMethods: PaymentMethodInfo[]) => void;
|
|
2013
|
-
clientSessionCachingEnabled?: boolean;
|
|
2014
|
-
apiVersion?: APIVersionOption;
|
|
2015
|
-
}
|
|
2016
|
-
export type WithAllowedCardNetworks = {
|
|
2017
|
-
/** @deprecated Use `orderedAllowedCardNetworks` on your Primer Dashboard instead. */
|
|
2018
|
-
allowedCardNetworks?: CardNetwork$1[];
|
|
2019
|
-
};
|
|
2020
|
-
export interface PrimerCheckout {
|
|
2021
|
-
teardown(): void;
|
|
2022
|
-
submit(): void;
|
|
2023
|
-
setPaymentCreationEnabled(isEnabled: boolean): void;
|
|
2024
|
-
setTokenizationEnabled(isEnabled: boolean): void;
|
|
2025
|
-
refreshClientSession(): Promise<boolean>;
|
|
2026
|
-
/**
|
|
2027
|
-
* @deprecated The method should not be used
|
|
2028
|
-
*/
|
|
2029
|
-
setClientToken(): Promise<boolean>;
|
|
2030
|
-
}
|
|
2031
|
-
export type EventListener$1 = (event?: Event) => void;
|
|
2032
|
-
declare enum EventTypes {
|
|
2033
|
-
CHANGE = "change",
|
|
2034
|
-
ERROR = "error",
|
|
2035
|
-
FOCUS = "focus",
|
|
2036
|
-
BLUR = "blur",
|
|
2037
|
-
CLICK = "click",
|
|
2038
|
-
CLOSE = "close",
|
|
2039
|
-
CONFIRMED_KLARNA_CATEGORY = "CONFIRMED_KLARNA_CATEGORY",
|
|
2040
|
-
CONFIRMED_KLARNA_CATEGORY_ERROR = "CONFIRMED_KLARNA_CATEGORY_ERROR",
|
|
2041
|
-
KLARNA_SESSION_UPDATE = "KLARNA_SESSION_UPDATE",
|
|
2042
|
-
KLARNA_SESSION_REFRESH_ERROR = "KLARNA_SESSION_REFRESH_ERROR"
|
|
524
|
+
declare enum ErrorCode {
|
|
525
|
+
INITIALIZATION_ERROR = "INITIALIZATION_ERROR",
|
|
526
|
+
NO_PAYMENT_METHODS = "NO_PAYMENT_METHODS",
|
|
527
|
+
PRIMER_TEARDOWN = "PRIMER_TEARDOWN",
|
|
528
|
+
PRIMER_SERVER_ERROR = "PRIMER_SERVER_ERROR",
|
|
529
|
+
THREE_DS_AUTH_FAILED = "THREE_DS_AUTH_FAILED",
|
|
530
|
+
TOKENIZATION_ERROR = "TOKENIZATION_ERROR",
|
|
531
|
+
DUPLICATE_PAYMENT_METHOD_ERROR = "DUPLICATE_PAYMENT_METHOD_ERROR",
|
|
532
|
+
CARD_NUMBER_ERROR = "CARD_NUMBER_ERROR",
|
|
533
|
+
PAYMENT_METHOD_NOT_SETUP = "PAYMENT_METHOD_NOT_SETUP",
|
|
534
|
+
PAYMENT_METHOD_NOT_PROVIDED = "PAYMENT_METHOD_NOT_PROVIDED",
|
|
535
|
+
PAYMENT_METHOD_NOT_COMPATIBLE = "PAYMENT_METHOD_NOT_COMPATIBLE",
|
|
536
|
+
RESUME_ERROR = "RESUME_ERROR",
|
|
537
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
538
|
+
PAYMENT_FAILED = "PAYMENT_FAILED",
|
|
539
|
+
PAYMENT_CREATION_ABORTED = "PAYMENT_CREATION_ABORTED",
|
|
540
|
+
PAYMENT_CREATION_DISABLED = "PAYMENT_CREATION_DISABLED",
|
|
541
|
+
CLIENT_SESSION_UPDATE_ERROR = "CLIENT_SESSION_UPDATE_ERROR",
|
|
542
|
+
INVALID_ARGUMENT = "INVALID_ARGUMENT",
|
|
543
|
+
VAULT_FETCH = "VAULT_FETCH",
|
|
544
|
+
VAULT_DELETE = "VAULT_DELETE",
|
|
545
|
+
HEADLESS_VAULT_MANAGER_VALIDATION = "HEADLESS_VAULT_MANAGER_VALIDATION",
|
|
546
|
+
CARD_FORM_VALIDATION_UNEXPECTED_FIELD = "CARD_FORM_VALIDATION_UNEXPECTED_FIELD",
|
|
547
|
+
MISSING_FIRST_NAME_OR_LAST_NAME = "MISSING_FIRST_NAME_OR_LAST_NAME",
|
|
548
|
+
MISSING_EMAIL_ADDRESS = "MISSING_EMAIL_ADDRESS",
|
|
549
|
+
INVALID_FLOW = "INVALID_FLOW"
|
|
2043
550
|
}
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
551
|
+
declare class PrimerClientError<T = unknown> extends Error {
|
|
552
|
+
readonly code: ErrorCode;
|
|
553
|
+
readonly diagnosticsId: string | null;
|
|
554
|
+
readonly data?: T;
|
|
555
|
+
readonly isFromDeveloper: boolean;
|
|
556
|
+
constructor(code: ErrorCode, options: PrimerClientErrorOptions<T>);
|
|
557
|
+
static fromErrorCode(code: ErrorCode, options: PrimerClientErrorOptions): PrimerClientError;
|
|
2048
558
|
}
|
|
2049
559
|
export interface IHeadlessHostedInput {
|
|
2050
|
-
getOptions():
|
|
2051
|
-
|
|
2052
|
-
|
|
560
|
+
getOptions(): {
|
|
561
|
+
placeholder?: string;
|
|
562
|
+
ariaLabel?: string;
|
|
563
|
+
style?: CheckoutStyle;
|
|
564
|
+
};
|
|
565
|
+
setOptions(options: {
|
|
566
|
+
placeholder?: string;
|
|
567
|
+
ariaLabel?: string;
|
|
568
|
+
style?: CheckoutStyle;
|
|
569
|
+
}): void;
|
|
570
|
+
render(container: string | Element | null, options: {
|
|
571
|
+
placeholder?: string;
|
|
572
|
+
ariaLabel?: string;
|
|
573
|
+
style?: CheckoutStyle;
|
|
574
|
+
}): Promise<void>;
|
|
2053
575
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2054
576
|
focus(): void;
|
|
2055
577
|
blur(): void;
|
|
@@ -2067,32 +589,10 @@ export interface ICardPaymentMethodManager {
|
|
|
2067
589
|
validate(): Promise<Validation>;
|
|
2068
590
|
reset(): void;
|
|
2069
591
|
}
|
|
2070
|
-
export type CardPaymentMethodSubmitValues = {
|
|
2071
|
-
cardNetwork?: string;
|
|
2072
|
-
};
|
|
2073
|
-
export interface PayPalStyles {
|
|
2074
|
-
buttonColor?: "gold" | "blue" | "silver" | "white" | "black";
|
|
2075
|
-
buttonShape?: "pill" | "rect";
|
|
2076
|
-
buttonSize?: "small" | "medium" | "large" | "responsive";
|
|
2077
|
-
buttonHeight?: number;
|
|
2078
|
-
buttonLabel?: "checkout" | "credit" | "pay" | "buynow" | "paypal" | "installment";
|
|
2079
|
-
buttonTagline?: boolean;
|
|
2080
|
-
}
|
|
2081
|
-
export interface GooglePayStyles {
|
|
2082
|
-
buttonType?: "long" | "short";
|
|
2083
|
-
buttonColor?: "default" | "black" | "white";
|
|
2084
|
-
shadowRoot?: boolean;
|
|
2085
|
-
}
|
|
2086
|
-
export interface ApplePayStyles {
|
|
2087
|
-
buttonType?: "plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe";
|
|
2088
|
-
buttonHeight?: number;
|
|
2089
|
-
buttonStyle?: "white" | "white-outline" | "black";
|
|
2090
|
-
}
|
|
2091
|
-
export interface HeadlessButtonRenderOptions {
|
|
2092
|
-
style?: GooglePayStyles | PayPalStyles | ApplePayStyles | Record<string, unknown>;
|
|
2093
|
-
}
|
|
2094
592
|
export interface IHeadlessPaymentMethodButton {
|
|
2095
|
-
render(containerId: string | Element, options:
|
|
593
|
+
render(containerId: string | Element, options: {
|
|
594
|
+
style?: Record<string, unknown>;
|
|
595
|
+
}): Promise<void>;
|
|
2096
596
|
setDisabled(disabled: boolean): Promise<void>;
|
|
2097
597
|
clean(): void;
|
|
2098
598
|
focus(): void;
|
|
@@ -2107,8 +607,16 @@ export interface IRedirectPaymentMethodManager {
|
|
|
2107
607
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2108
608
|
}
|
|
2109
609
|
export interface IKlarnaPaymentMethodManager {
|
|
2110
|
-
start(paymentPayload:
|
|
2111
|
-
|
|
610
|
+
start(paymentPayload: {
|
|
611
|
+
paymentMethodCategoryId: string;
|
|
612
|
+
}): Promise<{
|
|
613
|
+
outcome: "APPROVED" | "DENIED";
|
|
614
|
+
}>;
|
|
615
|
+
renderCategory(renderCategoryDetails: {
|
|
616
|
+
containerId: string | Element;
|
|
617
|
+
paymentMethodCategoryId: string;
|
|
618
|
+
onHeightChange: (height: number) => void;
|
|
619
|
+
}): Promise<void>;
|
|
2112
620
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2113
621
|
getPaymentMethod(): void;
|
|
2114
622
|
}
|
|
@@ -2120,70 +628,59 @@ export interface IAchPaymentMethodManager {
|
|
|
2120
628
|
declineMandate(): Promise<void>;
|
|
2121
629
|
getPaymentMethod(): void;
|
|
2122
630
|
}
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
631
|
+
export interface HeadlessVaultManager {
|
|
632
|
+
fetchVaultedPaymentMethods(): Promise<VaultedPaymentMethod[]>;
|
|
633
|
+
deleteVaultedPaymentMethod(id: string): Promise<void>;
|
|
634
|
+
startPaymentFlow(id: string, data?: {
|
|
635
|
+
cvv?: string;
|
|
636
|
+
}): Promise<void>;
|
|
637
|
+
createCvvInput(options: CardSecurityCodeInputOptions): Promise<CvvInput | null>;
|
|
2129
638
|
}
|
|
2130
|
-
export type PaymentMethodInfo = {
|
|
2131
|
-
type: PaymentMethodType;
|
|
2132
|
-
managerType: HeadlessManagerType;
|
|
2133
|
-
};
|
|
2134
|
-
export type ButtonPaymentMethodAsset = {
|
|
2135
|
-
backgroundColor: BackgroundColor;
|
|
2136
|
-
iconUrl: IconUrl;
|
|
2137
|
-
/**
|
|
2138
|
-
* @deprecated The property should not be used. Please use displayName or buttonText instead
|
|
2139
|
-
*/
|
|
2140
|
-
paymentMethodName?: string;
|
|
2141
|
-
buttonText?: string;
|
|
2142
|
-
displayName?: string;
|
|
2143
|
-
};
|
|
2144
639
|
export interface IAssetsManager {
|
|
2145
|
-
getCardNetworkAsset(cardNetwork: string): Promise<
|
|
2146
|
-
|
|
640
|
+
getCardNetworkAsset(cardNetwork: string): Promise<{
|
|
641
|
+
cardUrl: string;
|
|
642
|
+
displayName: string;
|
|
643
|
+
}>;
|
|
644
|
+
getPaymentMethodAsset(type: PaymentMethodType): Promise<{
|
|
645
|
+
backgroundColor: BackgroundColor;
|
|
646
|
+
iconUrl: IconUrl;
|
|
647
|
+
paymentMethodName?: string;
|
|
648
|
+
buttonText?: string;
|
|
649
|
+
displayName?: string;
|
|
650
|
+
} | null>;
|
|
651
|
+
}
|
|
652
|
+
export interface HeadlessSDKUtilities {
|
|
653
|
+
getCardNetworkAsset(network: string): {
|
|
654
|
+
cardUrl: string;
|
|
655
|
+
displayName: string;
|
|
656
|
+
};
|
|
657
|
+
getUIOrderAmount(): string | null;
|
|
658
|
+
getCDNAssets(paymentMethodType: PaymentMethodType): Promise<{
|
|
659
|
+
assets: {
|
|
660
|
+
icon: string;
|
|
661
|
+
};
|
|
662
|
+
colors: {
|
|
663
|
+
background: string;
|
|
664
|
+
main: string;
|
|
665
|
+
};
|
|
666
|
+
description: string | null;
|
|
667
|
+
is_primer_app: boolean;
|
|
668
|
+
name: string;
|
|
669
|
+
website: string | null;
|
|
670
|
+
goatCdnUrl: string;
|
|
671
|
+
} | undefined>;
|
|
672
|
+
getPaymentMethodConfiguration(paymentMethodType: PaymentMethodType): PaymentMethodConfig | undefined;
|
|
2147
673
|
}
|
|
2148
|
-
export type CardNetworkAsset = {
|
|
2149
|
-
cardUrl: string;
|
|
2150
|
-
displayName: string;
|
|
2151
|
-
};
|
|
2152
674
|
export interface CardPaymentMethodManagerOptions {
|
|
2153
|
-
|
|
2154
|
-
|
|
675
|
+
onCardMetadataChange?: (metadata: {
|
|
676
|
+
type: CardNetworkType | null;
|
|
677
|
+
possibleTypes: string[];
|
|
678
|
+
cvvLength: number;
|
|
679
|
+
cardNumberLength: number;
|
|
680
|
+
}) => void;
|
|
2155
681
|
onCardNetworksChange?: (event: CardNetworkChangeEvent) => void;
|
|
2156
682
|
onCardNetworksLoading?: () => void;
|
|
2157
683
|
}
|
|
2158
|
-
export type CardNetworkChangeEvent = {
|
|
2159
|
-
detectedCardNetworks: CardNetworks;
|
|
2160
|
-
selectableCardNetworks?: CardNetworks;
|
|
2161
|
-
source: "REMOTE" | "LOCAL" | "LOCAL_FALLBACK";
|
|
2162
|
-
};
|
|
2163
|
-
export type CardNetworks = {
|
|
2164
|
-
items: CardNetworkDetails[];
|
|
2165
|
-
preferred?: CardNetworkDetails;
|
|
2166
|
-
};
|
|
2167
|
-
export type CardNetworkDetails = CardNetworkInfo & {
|
|
2168
|
-
allowed: boolean;
|
|
2169
|
-
};
|
|
2170
|
-
export type CardNetworkInfo = {
|
|
2171
|
-
displayName: string;
|
|
2172
|
-
network: string;
|
|
2173
|
-
};
|
|
2174
|
-
export type BankIssuer = {
|
|
2175
|
-
id: string;
|
|
2176
|
-
name: string;
|
|
2177
|
-
iconUrl: string;
|
|
2178
|
-
disabled: boolean;
|
|
2179
|
-
};
|
|
2180
|
-
export interface FormWithRedirectConfiguration {
|
|
2181
|
-
bankIssuers?: BankIssuer[];
|
|
2182
|
-
error?: PrimerClientError | Error;
|
|
2183
|
-
}
|
|
2184
|
-
export interface FormWithRedirectPaymentMethodManagerOptions {
|
|
2185
|
-
onConfigurationLoad?: (payload: FormWithRedirectConfiguration) => void;
|
|
2186
|
-
}
|
|
2187
684
|
export interface KlarnaPaymentMethodManagerOptions {
|
|
2188
685
|
onPaymentMethodCategoriesChange?: (paymentMethodCategories: KlarnaPaymentMethodCategory[]) => void;
|
|
2189
686
|
onPaymentMethodAction?: (action: string, data: {
|
|
@@ -2194,33 +691,58 @@ export interface KlarnaPaymentMethodManagerOptions {
|
|
|
2194
691
|
export interface AchPaymentMethodManagerOptions {
|
|
2195
692
|
onCollectBankAccountDetailsComplete?: () => void;
|
|
2196
693
|
}
|
|
2197
|
-
export type
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
getCardNetworkAsset(network: string): {
|
|
2216
|
-
cardUrl: string;
|
|
2217
|
-
displayName: string;
|
|
694
|
+
export type PaymentMethodManagerOptions = CardPaymentMethodManagerOptions | KlarnaPaymentMethodManagerOptions | AchPaymentMethodManagerOptions;
|
|
695
|
+
export interface CheckoutStyle {
|
|
696
|
+
fontFaces?: Array<{
|
|
697
|
+
fontFamily?: string;
|
|
698
|
+
src?: string;
|
|
699
|
+
unicodeRange?: string;
|
|
700
|
+
fontVariant?: string;
|
|
701
|
+
fontFeatureSettings?: string;
|
|
702
|
+
fontVariationSettings?: string;
|
|
703
|
+
fontStretch?: string;
|
|
704
|
+
fontWeight?: string;
|
|
705
|
+
fontStyle?: string;
|
|
706
|
+
}>;
|
|
707
|
+
stylesheets?: Array<{
|
|
708
|
+
href: string;
|
|
709
|
+
}>;
|
|
710
|
+
loadingScreen?: {
|
|
711
|
+
color?: string;
|
|
2218
712
|
};
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
713
|
+
input?: InputStyles;
|
|
714
|
+
inputLabel?: Record<string, unknown>;
|
|
715
|
+
inputErrorText?: Record<string, unknown>;
|
|
716
|
+
formSpacings?: {
|
|
717
|
+
betweenLabelAndInput?: string;
|
|
718
|
+
betweenInputs?: string;
|
|
719
|
+
};
|
|
720
|
+
showMorePaymentMethodsButton?: Record<string, unknown>;
|
|
721
|
+
networkError?: Record<string, unknown>;
|
|
722
|
+
submitButton?: Record<string, unknown>;
|
|
723
|
+
vaultTitle?: Record<string, unknown>;
|
|
724
|
+
savedPaymentMethodButton?: Record<string, unknown>;
|
|
725
|
+
paymentMethodButton?: Record<string, unknown>;
|
|
726
|
+
errorMessage?: Record<string, unknown>;
|
|
727
|
+
smallPrint?: Record<string, unknown>;
|
|
728
|
+
directDebit?: Record<string, unknown>;
|
|
729
|
+
vaultMenu?: Record<string, unknown>;
|
|
730
|
+
backButton?: Record<string, unknown>;
|
|
731
|
+
separator?: Record<string, unknown>;
|
|
732
|
+
processingIndicator?: Record<string, unknown>;
|
|
733
|
+
focusCheckoutOnInit?: boolean;
|
|
734
|
+
}
|
|
735
|
+
export interface ThreeDSAuthenticationData {
|
|
736
|
+
responseCode: "AUTH_SUCCESS" | "AUTH_FAILED" | "SKIPPED" | "CHALLENGE";
|
|
737
|
+
reasonCode?: string;
|
|
738
|
+
reasonText?: string;
|
|
739
|
+
protocolVersion: string;
|
|
740
|
+
challengeIssued: boolean;
|
|
741
|
+
}
|
|
742
|
+
export interface VaultData {
|
|
743
|
+
customerId: string;
|
|
2222
744
|
}
|
|
2223
|
-
|
|
745
|
+
type EventListener$1 = (event?: Event) => void;
|
|
2224
746
|
export interface PrimerHeadlessCheckout {
|
|
2225
747
|
createPaymentMethodManager(type: "PAYMENT_CARD", options?: PaymentMethodManagerOptions): Promise<ICardPaymentMethodManager | null>;
|
|
2226
748
|
createPaymentMethodManager(type: "PAYPAL" | "GOOGLE_PAY" | "APPLE_PAY", options?: PaymentMethodManagerOptions): Promise<INativePaymentMethodManager | null>;
|
|
@@ -2229,173 +751,280 @@ export interface PrimerHeadlessCheckout {
|
|
|
2229
751
|
createPaymentMethodManager(type: PaymentMethodType, options?: PaymentMethodManagerOptions): Promise<IRedirectPaymentMethodManager | null>;
|
|
2230
752
|
createVaultManager(): HeadlessVaultManager;
|
|
2231
753
|
getSDKUtilities(): HeadlessSDKUtilities;
|
|
2232
|
-
/**
|
|
2233
|
-
* @deprecated
|
|
2234
|
-
* The options should be set on the `createHeadless` second parameter instead:
|
|
2235
|
-
* ```
|
|
2236
|
-
* Primer.createHeadless('clientToken', options);
|
|
2237
|
-
* ```
|
|
2238
|
-
*/
|
|
2239
754
|
configure: (options: Omit<HeadlessUniversalCheckoutOptions, "clientSessionCachingEnabled">) => void;
|
|
2240
755
|
getAssetsManager(): IAssetsManager;
|
|
2241
756
|
start: () => Promise<void>;
|
|
2242
757
|
refreshClientSession(): Promise<boolean>;
|
|
2243
758
|
}
|
|
2244
|
-
export interface
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
759
|
+
export interface HeadlessUniversalCheckoutOptions {
|
|
760
|
+
style?: CheckoutStyle;
|
|
761
|
+
paymentHandling?: "AUTO" | "MANUAL";
|
|
762
|
+
locale?: string;
|
|
763
|
+
card?: {
|
|
764
|
+
cardholderName?: {
|
|
765
|
+
required?: boolean;
|
|
766
|
+
visible?: boolean;
|
|
767
|
+
placeholder?: string;
|
|
768
|
+
};
|
|
769
|
+
cardNumber?: {
|
|
770
|
+
placeholder?: string;
|
|
771
|
+
};
|
|
772
|
+
expiryDate?: {
|
|
773
|
+
placeholder?: string;
|
|
774
|
+
};
|
|
775
|
+
cvv?: {
|
|
776
|
+
placeholder?: string;
|
|
777
|
+
};
|
|
778
|
+
preferredFlow?: CardPreferredFlow;
|
|
2261
779
|
};
|
|
2262
|
-
|
|
2263
|
-
|
|
780
|
+
redirect?: {
|
|
781
|
+
returnUrl?: string;
|
|
782
|
+
forceRedirect?: boolean;
|
|
2264
783
|
};
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
}
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
};
|
|
2345
|
-
|
|
784
|
+
paypal?: PayPalOptions;
|
|
785
|
+
googlePay?: GooglePayOptions;
|
|
786
|
+
applePay?: ApplePayOptions;
|
|
787
|
+
adyenKlarna?: {
|
|
788
|
+
buttonOptions?: {
|
|
789
|
+
text?: string;
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
klarna?: KlarnaOptions;
|
|
793
|
+
directDebit?: {
|
|
794
|
+
customerCountryCode: string;
|
|
795
|
+
companyName: string;
|
|
796
|
+
companyAddress: string;
|
|
797
|
+
customerName?: string;
|
|
798
|
+
customerEmail?: string;
|
|
799
|
+
customerAddressLine1?: string;
|
|
800
|
+
customerAddressLine2?: string;
|
|
801
|
+
customerCity?: string;
|
|
802
|
+
customerPostalCode?: string;
|
|
803
|
+
iban?: string;
|
|
804
|
+
submitButtonLabels?: {
|
|
805
|
+
form?: string;
|
|
806
|
+
mandate: string;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
giftCard?: {
|
|
810
|
+
logoSrc: string;
|
|
811
|
+
background: string;
|
|
812
|
+
logoAlt?: string;
|
|
813
|
+
text?: string;
|
|
814
|
+
};
|
|
815
|
+
stripe?: {
|
|
816
|
+
publishableKey?: string;
|
|
817
|
+
mandateData?: {
|
|
818
|
+
fullMandateText?: string;
|
|
819
|
+
merchantName?: string;
|
|
820
|
+
};
|
|
821
|
+
} & Record<string, unknown>;
|
|
822
|
+
onAvailablePaymentMethodsLoad: (paymentMethods: PaymentMethodInfo[]) => void;
|
|
823
|
+
clientSessionCachingEnabled?: boolean;
|
|
824
|
+
apiVersion?: APIVersionOption;
|
|
825
|
+
onCheckoutComplete?: (data: {
|
|
826
|
+
payment: Payment | null;
|
|
827
|
+
}) => void;
|
|
828
|
+
onCheckoutFail?: (error: PrimerClientError, data: {
|
|
829
|
+
payment?: Payment;
|
|
830
|
+
}, handler?: {
|
|
831
|
+
showErrorMessage: (errorMessage?: string) => void;
|
|
832
|
+
}) => void;
|
|
833
|
+
onBeforePaymentCreate?: (data: {
|
|
834
|
+
paymentMethodType?: PaymentMethodType;
|
|
835
|
+
}, handler: {
|
|
836
|
+
continuePaymentCreation: () => void;
|
|
837
|
+
abortPaymentCreation: () => void;
|
|
838
|
+
}) => void;
|
|
839
|
+
onPaymentCreationStart?: () => void;
|
|
840
|
+
onPaymentMethodAction?: (data: "PAYMENT_METHOD_SELECTED" | "PAYMENT_METHOD_UNSELECTED", handler: {
|
|
841
|
+
paymentMethodType: PaymentMethodType | null;
|
|
842
|
+
}) => void;
|
|
843
|
+
onClientSessionUpdate?: (clientSession: ClientSession) => void;
|
|
844
|
+
onBeforeClientSessionUpdate?: () => void;
|
|
845
|
+
onTokenizeShouldStart?: (data: {
|
|
846
|
+
paymentMethodType?: PaymentMethodType;
|
|
847
|
+
}) => boolean | Promise<boolean>;
|
|
848
|
+
onTokenizeDidNotStart?: (reason: string) => void;
|
|
849
|
+
onTokenizeStart?: () => void;
|
|
850
|
+
onTokenizeSuccess?: (data: PaymentMethodToken, handler: {
|
|
851
|
+
handleSuccess(): unknown;
|
|
852
|
+
handleFailure(errorMessage?: string): unknown;
|
|
853
|
+
continueWithNewClientToken(clientToken: string): unknown;
|
|
854
|
+
}) => void | Promise<void>;
|
|
855
|
+
onTokenizeError?: (error: PrimerClientError) => void;
|
|
856
|
+
onResumeSuccess?: (data: {
|
|
857
|
+
resumeToken: string;
|
|
858
|
+
paymentId?: string;
|
|
859
|
+
}, handler: {
|
|
860
|
+
handleSuccess(): unknown;
|
|
861
|
+
handleFailure(errorMessage?: string): unknown;
|
|
862
|
+
continueWithNewClientToken(clientToken: string): unknown;
|
|
863
|
+
}) => void;
|
|
864
|
+
onResumePending?: (paymentMethodData: {
|
|
865
|
+
paymentMethodType: PaymentMethodType;
|
|
866
|
+
reference?: string;
|
|
867
|
+
expiresAt?: string;
|
|
868
|
+
entity?: string;
|
|
869
|
+
}) => void;
|
|
870
|
+
onResumeError?: (error: PrimerClientError) => void;
|
|
871
|
+
}
|
|
872
|
+
export interface PaymentMethodToken {
|
|
873
|
+
token: string;
|
|
874
|
+
analyticsId: string;
|
|
875
|
+
tokenType: "SINGLE_USE" | "MULTI_USE";
|
|
876
|
+
paymentInstrumentData: BasePaymentInstrumentData;
|
|
877
|
+
paymentInstrumentType: PaymentInstrumentType;
|
|
878
|
+
threeDSecureAuthentication: ThreeDSAuthenticationData | null;
|
|
879
|
+
vaultData: VaultData | null;
|
|
880
|
+
}
|
|
881
|
+
export interface ApplePayOptions {
|
|
882
|
+
container?: string | Element;
|
|
883
|
+
buttonType?: "plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe";
|
|
884
|
+
buttonStyle?: "white" | "white-outline" | "black";
|
|
885
|
+
captureBillingAddress?: boolean;
|
|
886
|
+
billingOptions?: {
|
|
887
|
+
requiredBillingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
888
|
+
};
|
|
889
|
+
shippingOptions?: {
|
|
890
|
+
requiredShippingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
891
|
+
requireShippingMethod?: boolean;
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
export interface GooglePayOptions {
|
|
895
|
+
container?: string | Element;
|
|
896
|
+
buttonType?: "long" | "short" | "book" | "buy" | "checkout" | "donate" | "order" | "pay" | "plain" | "subscribe";
|
|
897
|
+
buttonColor?: "default" | "black" | "white";
|
|
898
|
+
buttonSizeMode?: "fill" | "static";
|
|
899
|
+
onClick?: () => void;
|
|
900
|
+
captureBillingAddress?: boolean;
|
|
901
|
+
shippingAddressParameters?: {
|
|
902
|
+
phoneNumberRequired?: boolean;
|
|
903
|
+
};
|
|
904
|
+
emailRequired?: boolean;
|
|
905
|
+
requireShippingMethod?: boolean;
|
|
906
|
+
shadowRoot?: boolean;
|
|
907
|
+
}
|
|
908
|
+
export interface PayPalOptions {
|
|
909
|
+
container?: string | Element;
|
|
910
|
+
buttonColor?: "gold" | "blue" | "silver" | "white" | "black";
|
|
911
|
+
buttonShape?: "pill" | "rect";
|
|
912
|
+
buttonSize?: "small" | "medium" | "large" | "responsive";
|
|
913
|
+
buttonHeight?: number;
|
|
914
|
+
buttonLabel?: "checkout" | "credit" | "pay" | "buynow" | "paypal" | "installment";
|
|
915
|
+
buttonTagline?: boolean;
|
|
916
|
+
paymentFlow?: "DEFAULT" | "PREFER_VAULT";
|
|
917
|
+
onClick?: () => void;
|
|
918
|
+
}
|
|
919
|
+
export interface KlarnaOptions {
|
|
920
|
+
paymentFlow?: "DEFAULT" | "PREFER_VAULT";
|
|
921
|
+
recurringPaymentDescription?: string;
|
|
922
|
+
allowedPaymentCategories?: Array<"pay_now" | "pay_later" | "pay_over_time">;
|
|
923
|
+
buttonOptions?: {
|
|
924
|
+
text?: string;
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* PrimerCheckoutOptions defines the configuration options for the Primer checkout.
|
|
929
|
+
* This is an explicit definition of the options rather than a mapped type to make
|
|
930
|
+
* the type more predictable and easier to maintain.
|
|
931
|
+
*/
|
|
932
|
+
export interface PrimerCheckoutOptions {
|
|
933
|
+
clientToken?: string;
|
|
934
|
+
locale?: string;
|
|
935
|
+
apiVersion?: APIVersionOption;
|
|
936
|
+
card?: {
|
|
937
|
+
cardholderName?: {
|
|
938
|
+
required?: boolean;
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
applePay?: Omit<ApplePayOptions, "container"> & {
|
|
942
|
+
captureBillingAddress?: boolean;
|
|
943
|
+
billingOptions?: {
|
|
944
|
+
requiredBillingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
945
|
+
};
|
|
946
|
+
shippingOptions?: {
|
|
947
|
+
requiredShippingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
948
|
+
requireShippingMethod?: boolean;
|
|
949
|
+
};
|
|
950
|
+
};
|
|
951
|
+
googlePay?: Omit<GooglePayOptions, "container">;
|
|
952
|
+
paypal?: Omit<PayPalOptions, "container">;
|
|
953
|
+
klarna?: KlarnaOptions;
|
|
954
|
+
threeDsOptions?: {
|
|
955
|
+
enabled?: boolean;
|
|
956
|
+
preferred?: boolean;
|
|
957
|
+
};
|
|
958
|
+
vault?: {
|
|
959
|
+
enabled: boolean;
|
|
960
|
+
showEmptyState?: boolean;
|
|
961
|
+
};
|
|
962
|
+
stripe?: {
|
|
963
|
+
mandateData: {
|
|
964
|
+
fullMandateText?: string;
|
|
965
|
+
merchantName?: string;
|
|
966
|
+
};
|
|
967
|
+
publishableKey?: string;
|
|
968
|
+
} & Record<string, unknown>;
|
|
969
|
+
submitButton?: {
|
|
970
|
+
amountVisible?: boolean;
|
|
971
|
+
};
|
|
972
|
+
sdkCore?: boolean;
|
|
973
|
+
disabledPayments?: boolean;
|
|
974
|
+
}
|
|
2346
975
|
export type InitializedManager = {
|
|
2347
|
-
type: typeof PaymentMethodType
|
|
976
|
+
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
2348
977
|
manager: IAchPaymentMethodManager;
|
|
2349
978
|
} | {
|
|
2350
|
-
type: typeof PaymentMethodType
|
|
979
|
+
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
2351
980
|
manager: ICardPaymentMethodManager;
|
|
2352
981
|
} | {
|
|
2353
|
-
type: typeof PaymentMethodType
|
|
982
|
+
type: typeof PaymentMethodType.KLARNA;
|
|
2354
983
|
manager: IKlarnaPaymentMethodManager;
|
|
2355
984
|
} | {
|
|
2356
985
|
type: RedirectPaymentMethodTypes;
|
|
2357
986
|
manager: IRedirectPaymentMethodManager;
|
|
2358
987
|
} | {
|
|
2359
|
-
type: typeof PaymentMethodType
|
|
988
|
+
type: typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
2360
989
|
manager: INativePaymentMethodManager;
|
|
2361
990
|
};
|
|
2362
|
-
export type ManagerByType<T extends PaymentMethodType
|
|
991
|
+
export type ManagerByType<T extends PaymentMethodType> = Extract<InitializedManager, {
|
|
2363
992
|
type: T;
|
|
2364
993
|
}>;
|
|
2365
|
-
export interface InitializedManagersMap extends Map<PaymentMethodType
|
|
2366
|
-
get<T extends PaymentMethodType
|
|
994
|
+
export interface InitializedManagersMap extends Map<PaymentMethodType, InitializedManager> {
|
|
995
|
+
get<T extends PaymentMethodType>(key: T): ManagerByType<T> | undefined;
|
|
2367
996
|
}
|
|
2368
|
-
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType
|
|
2369
|
-
export type DynamicPaymentMethodTypes = typeof PaymentMethodType
|
|
2370
|
-
export type NativePaymentMethodTypes = typeof PaymentMethodType
|
|
997
|
+
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType, typeof PaymentMethodType.STRIPE_ACH | typeof PaymentMethodType.PAYMENT_CARD | typeof PaymentMethodType.KLARNA | typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY>;
|
|
998
|
+
export type DynamicPaymentMethodTypes = typeof PaymentMethodType.STRIPE_ACH;
|
|
999
|
+
export type NativePaymentMethodTypes = typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
2371
1000
|
export type RedirectPaymentMethod = {
|
|
2372
1001
|
type: RedirectPaymentMethodTypes;
|
|
2373
1002
|
managerType: HeadlessManagerType.REDIRECT;
|
|
2374
1003
|
};
|
|
2375
1004
|
export type InitializedPaymentMethod = {
|
|
2376
|
-
type: typeof PaymentMethodType
|
|
1005
|
+
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
2377
1006
|
managerType: HeadlessManagerType.ACH;
|
|
2378
1007
|
} | {
|
|
2379
|
-
type: typeof PaymentMethodType
|
|
1008
|
+
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
2380
1009
|
managerType: HeadlessManagerType.CARD;
|
|
2381
1010
|
} | {
|
|
2382
|
-
type: typeof PaymentMethodType
|
|
1011
|
+
type: typeof PaymentMethodType.KLARNA;
|
|
2383
1012
|
managerType: HeadlessManagerType.KLARNA;
|
|
2384
1013
|
} | {
|
|
2385
|
-
type: typeof PaymentMethodType
|
|
1014
|
+
type: typeof PaymentMethodType.PAYPAL;
|
|
2386
1015
|
managerType: HeadlessManagerType.NATIVE;
|
|
2387
1016
|
} | {
|
|
2388
|
-
type: typeof PaymentMethodType
|
|
1017
|
+
type: typeof PaymentMethodType.GOOGLE_PAY;
|
|
2389
1018
|
managerType: HeadlessManagerType.NATIVE;
|
|
2390
1019
|
} | {
|
|
2391
|
-
type: typeof PaymentMethodType
|
|
1020
|
+
type: typeof PaymentMethodType.APPLE_PAY;
|
|
2392
1021
|
managerType: HeadlessManagerType.NATIVE;
|
|
2393
1022
|
} | RedirectPaymentMethod;
|
|
2394
|
-
export type PaymentMethodByType<T extends PaymentMethodType
|
|
1023
|
+
export type PaymentMethodByType<T extends PaymentMethodType> = Extract<InitializedPaymentMethod, {
|
|
2395
1024
|
type: T;
|
|
2396
1025
|
}>;
|
|
2397
|
-
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType
|
|
2398
|
-
get<T extends PaymentMethodType
|
|
1026
|
+
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType, InitializedPaymentMethod> {
|
|
1027
|
+
get<T extends PaymentMethodType>(key: T): PaymentMethodByType<T> | undefined;
|
|
2399
1028
|
}
|
|
2400
1029
|
export interface AssetsConfig {
|
|
2401
1030
|
backgroundColor: string;
|
|
@@ -2406,7 +1035,7 @@ export declare class InitializedPayments {
|
|
|
2406
1035
|
private readonly _methods;
|
|
2407
1036
|
constructor(map: InitializedPaymentMethodMap);
|
|
2408
1037
|
get<T extends RedirectPaymentMethodTypes>(type: T): RedirectPaymentMethod | undefined;
|
|
2409
|
-
get<T extends (typeof PaymentMethodType
|
|
1038
|
+
get<T extends (typeof PaymentMethodType)[keyof typeof PaymentMethodType]>(type: T): PaymentMethodByType<T> | undefined;
|
|
2410
1039
|
toArray(): InitializedPaymentMethod[];
|
|
2411
1040
|
size(): number;
|
|
2412
1041
|
}
|
|
@@ -2474,16 +1103,20 @@ export interface CardSubmitSuccessPayload {
|
|
|
2474
1103
|
result: unknown;
|
|
2475
1104
|
}
|
|
2476
1105
|
export interface CardSubmitErrorsPayload {
|
|
2477
|
-
errors: unknown
|
|
1106
|
+
errors: unknown;
|
|
1107
|
+
}
|
|
1108
|
+
export interface CardSubmitPayload {
|
|
1109
|
+
source?: string;
|
|
2478
1110
|
}
|
|
2479
1111
|
export interface PrimeAchErrorPayload {
|
|
2480
1112
|
error: Error;
|
|
2481
1113
|
}
|
|
2482
1114
|
export interface PrimerEvents {
|
|
2483
|
-
"primer:state-change": CustomEvent<
|
|
1115
|
+
"primer:state-change": CustomEvent<SdkStateContextType>;
|
|
2484
1116
|
"primer:methods-update": CustomEvent<InitializedPayments>;
|
|
2485
1117
|
"primer:ready": CustomEvent<PrimerJS>;
|
|
2486
|
-
"primer:card-network-change": CustomEvent<
|
|
1118
|
+
"primer:card-network-change": CustomEvent<CardNetworksContextType>;
|
|
1119
|
+
"primer:card-submit": CustomEvent<CardSubmitPayload>;
|
|
2487
1120
|
"primer:card-success": CustomEvent<CardSubmitSuccessPayload>;
|
|
2488
1121
|
"primer:card-error": CustomEvent<CardSubmitErrorsPayload>;
|
|
2489
1122
|
"primer-ach-error": CustomEvent<PrimeAchErrorPayload>;
|
|
@@ -2503,15 +1136,16 @@ declare class PrimerEventsController implements ReactiveController {
|
|
|
2503
1136
|
* @param detail - The payload for the event.
|
|
2504
1137
|
*/
|
|
2505
1138
|
dispatchEvent<K extends keyof PrimerEvents>(type: K, detail: PrimerEvents[K]["detail"]): void;
|
|
2506
|
-
dispatchSdkState(sdkState:
|
|
1139
|
+
dispatchSdkState(sdkState: SdkStateContextType): void;
|
|
2507
1140
|
dispatchPaymentMethods(paymentMethods: InitializedPayments): void;
|
|
2508
1141
|
dispatchCheckoutInitialized(checkoutInstance: PrimerJS): void;
|
|
2509
|
-
dispatchCardNetworkChange(network:
|
|
1142
|
+
dispatchCardNetworkChange(network: CardNetworksContextType): void;
|
|
1143
|
+
dispatchCardSubmit(source?: string): void;
|
|
2510
1144
|
dispatchFormSubmitSuccess(result: unknown): void;
|
|
2511
1145
|
dispatchFormSubmitErrors(errors: unknown): void;
|
|
2512
1146
|
}
|
|
2513
|
-
export type
|
|
2514
|
-
export type
|
|
1147
|
+
export type HeadlessUnitilsContextType = HeadlessSDKUtilities | null;
|
|
1148
|
+
export type KlarnaCategoriesContextType = {
|
|
2515
1149
|
categories: KlarnaPaymentMethodCategory[];
|
|
2516
1150
|
isLoading: boolean;
|
|
2517
1151
|
};
|
|
@@ -2552,6 +1186,7 @@ declare class CompositeStateController<Host extends ReactiveControllerHost> impl
|
|
|
2552
1186
|
export interface VaultManagerInitOptions {
|
|
2553
1187
|
vaultEnabled?: boolean;
|
|
2554
1188
|
captureVaultedCardCvv?: boolean;
|
|
1189
|
+
showEmptyState?: boolean;
|
|
2555
1190
|
}
|
|
2556
1191
|
/**
|
|
2557
1192
|
* Core state interface for vault manager
|
|
@@ -2563,6 +1198,7 @@ export interface VaultManagerState {
|
|
|
2563
1198
|
isUpdating: boolean;
|
|
2564
1199
|
vaultedPaymentMethods: VaultedPaymentMethod[];
|
|
2565
1200
|
cvvRecapture: boolean;
|
|
1201
|
+
showEmptyState: boolean;
|
|
2566
1202
|
createCvvInput: ((options: CardSecurityCodeInputOptions) => Promise<CvvInput | null>) | null;
|
|
2567
1203
|
deleteVaultedPaymentMethod: (paymentMethodId: string) => Promise<void>;
|
|
2568
1204
|
startVaultedPaymentFlow: (options?: {
|
|
@@ -2606,7 +1242,7 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
|
|
|
2606
1242
|
* Fetch vaulted payment methods from the server
|
|
2607
1243
|
*/
|
|
2608
1244
|
fetchVaultedPaymentMethods(initialLoad?: boolean): Promise<VaultedPaymentMethod[]>;
|
|
2609
|
-
createCvvInput(options: CardSecurityCodeInputOptions)
|
|
1245
|
+
createCvvInput: (options: CardSecurityCodeInputOptions) => Promise<CvvInput | null>;
|
|
2610
1246
|
/**
|
|
2611
1247
|
* Delete a vaulted payment method by ID
|
|
2612
1248
|
*/
|
|
@@ -2630,13 +1266,13 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
|
|
|
2630
1266
|
* Context for core vault manager functionality
|
|
2631
1267
|
* Contains properties that don't change frequently and relate to vault functionality
|
|
2632
1268
|
*/
|
|
2633
|
-
export type
|
|
1269
|
+
export type VaultManagerContextType = VaultManagerState | null;
|
|
2634
1270
|
/**
|
|
2635
1271
|
* Context for vault manager CVV-specific state
|
|
2636
1272
|
* Contains properties specifically related to CVV input functionality
|
|
2637
1273
|
* Further separated to minimize re-renders related to frequently changing CVV input state
|
|
2638
1274
|
*/
|
|
2639
|
-
export type
|
|
1275
|
+
export type VaultItemContextType = VaultManagerItemState | null;
|
|
2640
1276
|
declare class SDKContextController implements ReactiveController {
|
|
2641
1277
|
host: PrimerCheckoutType;
|
|
2642
1278
|
private sdkStateProvider;
|
|
@@ -2655,7 +1291,7 @@ declare class SDKContextController implements ReactiveController {
|
|
|
2655
1291
|
* Updates the SDK state context.
|
|
2656
1292
|
* @param value The new SDK state.
|
|
2657
1293
|
*/
|
|
2658
|
-
setSdkState(value:
|
|
1294
|
+
setSdkState(value: SdkStateContextType): void;
|
|
2659
1295
|
/**
|
|
2660
1296
|
* Updates the payment methods context.
|
|
2661
1297
|
* @param value The new payment methods data.
|
|
@@ -2666,13 +1302,13 @@ declare class SDKContextController implements ReactiveController {
|
|
|
2666
1302
|
* @param value The new payment manager mapping.
|
|
2667
1303
|
*/
|
|
2668
1304
|
setPaymentManagers(value: InitializedManagersMap): void;
|
|
2669
|
-
setCardNetworks(value:
|
|
2670
|
-
setVaultManager(value:
|
|
2671
|
-
setKlarnaCategories(value:
|
|
1305
|
+
setCardNetworks(value: CardNetworksContextType): void;
|
|
1306
|
+
setVaultManager(value: VaultManagerContextType): void;
|
|
1307
|
+
setKlarnaCategories(value: KlarnaCategoriesContextType): void;
|
|
2672
1308
|
setClientOptions(value: PrimerCheckoutOptions | null): void;
|
|
2673
|
-
setHeadlessUtils(value:
|
|
1309
|
+
setHeadlessUtils(value: HeadlessUnitilsContextType): void;
|
|
2674
1310
|
setComputedStyles(value: CSSStyleDeclaration): void;
|
|
2675
|
-
setVaultManagerCvv(value:
|
|
1311
|
+
setVaultManagerCvv(value: VaultItemContextType): void;
|
|
2676
1312
|
}
|
|
2677
1313
|
export type SdkStateAction = {
|
|
2678
1314
|
type: "START_PROCESSING";
|
|
@@ -2712,6 +1348,10 @@ declare class SdkStateController extends ReactiveStateController<PrimerCheckoutT
|
|
|
2712
1348
|
resetError(): void;
|
|
2713
1349
|
forceCompleteLoading(): void;
|
|
2714
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* PrimerCheckoutType defines the interface for the primer-checkout component implementation.
|
|
1353
|
+
* This includes both the properties and controllers needed for internal functionality.
|
|
1354
|
+
*/
|
|
2715
1355
|
export interface PrimerCheckoutType extends ReactiveControllerHost, LitElement {
|
|
2716
1356
|
requestUpdate: ReactiveControllerHost["requestUpdate"];
|
|
2717
1357
|
customStyles: string;
|
|
@@ -2742,7 +1382,7 @@ declare class CardNetworkController implements ReactiveController {
|
|
|
2742
1382
|
*
|
|
2743
1383
|
* @param event - The card network change event
|
|
2744
1384
|
*/
|
|
2745
|
-
processCardNetworkChangeEvent(event: CardNetworkChangeEvent):
|
|
1385
|
+
processCardNetworkChangeEvent(event: CardNetworkChangeEvent): void;
|
|
2746
1386
|
}
|
|
2747
1387
|
declare class StyleProcessingController implements ReactiveController {
|
|
2748
1388
|
host: ReactiveControllerHost & LitElement;
|
|
@@ -2799,146 +1439,6 @@ declare class StyleProcessingController implements ReactiveController {
|
|
|
2799
1439
|
*/
|
|
2800
1440
|
hostDisconnected(): void;
|
|
2801
1441
|
}
|
|
2802
|
-
interface ReactiveControllerHost$1 {
|
|
2803
|
-
/**
|
|
2804
|
-
* Adds a controller to the host, which sets up the controller's lifecycle
|
|
2805
|
-
* methods to be called with the host's lifecycle.
|
|
2806
|
-
*/
|
|
2807
|
-
addController(controller: ReactiveController$1): void;
|
|
2808
|
-
/**
|
|
2809
|
-
* Removes a controller from the host.
|
|
2810
|
-
*/
|
|
2811
|
-
removeController(controller: ReactiveController$1): void;
|
|
2812
|
-
/**
|
|
2813
|
-
* Requests a host update which is processed asynchronously. The update can
|
|
2814
|
-
* be waited on via the `updateComplete` property.
|
|
2815
|
-
*/
|
|
2816
|
-
requestUpdate(): void;
|
|
2817
|
-
/**
|
|
2818
|
-
* Returns a Promise that resolves when the host has completed updating.
|
|
2819
|
-
* The Promise value is a boolean that is `true` if the element completed the
|
|
2820
|
-
* update without triggering another update. The Promise result is `false` if
|
|
2821
|
-
* a property was set inside `updated()`. If the Promise is rejected, an
|
|
2822
|
-
* exception was thrown during the update.
|
|
2823
|
-
*
|
|
2824
|
-
* @return A promise of a boolean that indicates if the update resolved
|
|
2825
|
-
* without triggering another update.
|
|
2826
|
-
*/
|
|
2827
|
-
readonly updateComplete: Promise<boolean>;
|
|
2828
|
-
}
|
|
2829
|
-
interface ReactiveController$1 {
|
|
2830
|
-
/**
|
|
2831
|
-
* Called when the host is connected to the component tree. For custom
|
|
2832
|
-
* element hosts, this corresponds to the `connectedCallback()` lifecycle,
|
|
2833
|
-
* which is only called when the component is connected to the document.
|
|
2834
|
-
*/
|
|
2835
|
-
hostConnected?(): void;
|
|
2836
|
-
/**
|
|
2837
|
-
* Called when the host is disconnected from the component tree. For custom
|
|
2838
|
-
* element hosts, this corresponds to the `disconnectedCallback()` lifecycle,
|
|
2839
|
-
* which is called the host or an ancestor component is disconnected from the
|
|
2840
|
-
* document.
|
|
2841
|
-
*/
|
|
2842
|
-
hostDisconnected?(): void;
|
|
2843
|
-
/**
|
|
2844
|
-
* Called during the client-side host update, just before the host calls
|
|
2845
|
-
* its own update.
|
|
2846
|
-
*
|
|
2847
|
-
* Code in `update()` can depend on the DOM as it is not called in
|
|
2848
|
-
* server-side rendering.
|
|
2849
|
-
*/
|
|
2850
|
-
hostUpdate?(): void;
|
|
2851
|
-
/**
|
|
2852
|
-
* Called after a host update, just before the host calls firstUpdated and
|
|
2853
|
-
* updated. It is not called in server-side rendering.
|
|
2854
|
-
*
|
|
2855
|
-
*/
|
|
2856
|
-
hostUpdated?(): void;
|
|
2857
|
-
}
|
|
2858
|
-
interface ComplexAttributeConverter$1<Type = unknown, TypeHint = unknown> {
|
|
2859
|
-
/**
|
|
2860
|
-
* Called to convert an attribute value to a property
|
|
2861
|
-
* value.
|
|
2862
|
-
*/
|
|
2863
|
-
fromAttribute?(value: string | null, type?: TypeHint): Type;
|
|
2864
|
-
/**
|
|
2865
|
-
* Called to convert a property value to an attribute
|
|
2866
|
-
* value.
|
|
2867
|
-
*
|
|
2868
|
-
* It returns unknown instead of string, to be compatible with
|
|
2869
|
-
* https://github.com/WICG/trusted-types (and similar efforts).
|
|
2870
|
-
*/
|
|
2871
|
-
toAttribute?(value: Type, type?: TypeHint): unknown;
|
|
2872
|
-
}
|
|
2873
|
-
type AttributeConverter$1<Type = unknown, TypeHint = unknown> = ComplexAttributeConverter$1<Type> | ((value: string | null, type?: TypeHint) => Type);
|
|
2874
|
-
interface PropertyDeclaration$1<Type = unknown, TypeHint = unknown> {
|
|
2875
|
-
/**
|
|
2876
|
-
* When set to `true`, indicates the property is internal private state. The
|
|
2877
|
-
* property should not be set by users. When using TypeScript, this property
|
|
2878
|
-
* should be marked as `private` or `protected`, and it is also a common
|
|
2879
|
-
* practice to use a leading `_` in the name. The property is not added to
|
|
2880
|
-
* `observedAttributes`.
|
|
2881
|
-
*/
|
|
2882
|
-
readonly state?: boolean;
|
|
2883
|
-
/**
|
|
2884
|
-
* Indicates how and whether the property becomes an observed attribute.
|
|
2885
|
-
* If the value is `false`, the property is not added to `observedAttributes`.
|
|
2886
|
-
* If true or absent, the lowercased property name is observed (e.g. `fooBar`
|
|
2887
|
-
* becomes `foobar`). If a string, the string value is observed (e.g
|
|
2888
|
-
* `attribute: 'foo-bar'`).
|
|
2889
|
-
*/
|
|
2890
|
-
readonly attribute?: boolean | string;
|
|
2891
|
-
/**
|
|
2892
|
-
* Indicates the type of the property. This is used only as a hint for the
|
|
2893
|
-
* `converter` to determine how to convert the attribute
|
|
2894
|
-
* to/from a property.
|
|
2895
|
-
*/
|
|
2896
|
-
readonly type?: TypeHint;
|
|
2897
|
-
/**
|
|
2898
|
-
* Indicates how to convert the attribute to/from a property. If this value
|
|
2899
|
-
* is a function, it is used to convert the attribute value a the property
|
|
2900
|
-
* value. If it's an object, it can have keys for `fromAttribute` and
|
|
2901
|
-
* `toAttribute`. If no `toAttribute` function is provided and
|
|
2902
|
-
* `reflect` is set to `true`, the property value is set directly to the
|
|
2903
|
-
* attribute. A default `converter` is used if none is provided; it supports
|
|
2904
|
-
* `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,
|
|
2905
|
-
* when a property changes and the converter is used to update the attribute,
|
|
2906
|
-
* the property is never updated again as a result of the attribute changing,
|
|
2907
|
-
* and vice versa.
|
|
2908
|
-
*/
|
|
2909
|
-
readonly converter?: AttributeConverter$1<Type, TypeHint>;
|
|
2910
|
-
/**
|
|
2911
|
-
* Indicates if the property should reflect to an attribute.
|
|
2912
|
-
* If `true`, when the property is set, the attribute is set using the
|
|
2913
|
-
* attribute name determined according to the rules for the `attribute`
|
|
2914
|
-
* property option and the value of the property converted using the rules
|
|
2915
|
-
* from the `converter` property option.
|
|
2916
|
-
*/
|
|
2917
|
-
readonly reflect?: boolean;
|
|
2918
|
-
/**
|
|
2919
|
-
* A function that indicates if a property should be considered changed when
|
|
2920
|
-
* it is set. The function should take the `newValue` and `oldValue` and
|
|
2921
|
-
* return `true` if an update should be requested.
|
|
2922
|
-
*/
|
|
2923
|
-
hasChanged?(value: Type, oldValue: Type): boolean;
|
|
2924
|
-
/**
|
|
2925
|
-
* Indicates whether an accessor will be created for this property. By
|
|
2926
|
-
* default, an accessor will be generated for this property that requests an
|
|
2927
|
-
* update when set. If this flag is `true`, no accessor will be created, and
|
|
2928
|
-
* it will be the user's responsibility to call
|
|
2929
|
-
* `this.requestUpdate(propertyName, oldValue)` to request an update when
|
|
2930
|
-
* the property changes.
|
|
2931
|
-
*/
|
|
2932
|
-
readonly noAccessor?: boolean;
|
|
2933
|
-
}
|
|
2934
|
-
declare global {
|
|
2935
|
-
interface SymbolConstructor {
|
|
2936
|
-
readonly metadata: unique symbol;
|
|
2937
|
-
}
|
|
2938
|
-
}
|
|
2939
|
-
declare global {
|
|
2940
|
-
var litPropertyMetadata: WeakMap<object, Map<PropertyKey, PropertyDeclaration$1>>;
|
|
2941
|
-
}
|
|
2942
1442
|
declare const sourceLocale = `en`;
|
|
2943
1443
|
declare const targetLocales = [
|
|
2944
1444
|
`ar`,
|
|
@@ -2989,6 +1489,16 @@ declare const targetLocales = [
|
|
|
2989
1489
|
`zh-TW`,
|
|
2990
1490
|
] as const;
|
|
2991
1491
|
export type LocaleCode = typeof sourceLocale | (typeof targetLocales)[number];
|
|
1492
|
+
declare global {
|
|
1493
|
+
interface HTMLElementTagNameMap {
|
|
1494
|
+
"primer-checkout": PrimerCheckoutComponent;
|
|
1495
|
+
}
|
|
1496
|
+
type PublicPrimerEvents = Omit<PrimerEvents, "primer-ach-error" | "primer-ach-bank-details-collected" | "primer-ach-mandate-confirmed" | "primer-ach-mandate-declined">;
|
|
1497
|
+
interface DocumentEventMap extends PublicPrimerEvents {
|
|
1498
|
+
}
|
|
1499
|
+
interface HTMLElementEventMap extends PublicPrimerEvents {
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
2992
1502
|
declare class AchPaymentEventsController implements ReactiveController {
|
|
2993
1503
|
host: PrimerCheckoutComponent;
|
|
2994
1504
|
constructor(host: PrimerCheckoutComponent);
|
|
@@ -3014,6 +1524,7 @@ export declare class PrimerCheckoutComponent extends LitElement implements Prime
|
|
|
3014
1524
|
customStyles: string;
|
|
3015
1525
|
clientToken: string;
|
|
3016
1526
|
options: PrimerCheckoutOptions;
|
|
1527
|
+
disableLoader: boolean;
|
|
3017
1528
|
/**
|
|
3018
1529
|
* Whether the component has completed initialization and loading
|
|
3019
1530
|
* This is used to control the CSS-only loader visibility
|
|
@@ -3098,18 +1609,18 @@ declare class SpinnerComponent extends LitElement {
|
|
|
3098
1609
|
* Size of the spinner
|
|
3099
1610
|
* Available values: 'small', 'medium', 'large' or a custom number as string
|
|
3100
1611
|
*/
|
|
3101
|
-
size: SpinnerSize
|
|
1612
|
+
size: SpinnerSize;
|
|
3102
1613
|
/**
|
|
3103
1614
|
* Whether to use compact mode (minimal margins)
|
|
3104
1615
|
* Useful when embedding in inputs
|
|
3105
1616
|
*/
|
|
3106
1617
|
compact: boolean;
|
|
3107
|
-
static styles: CSSResult[];
|
|
1618
|
+
static styles: import("lit").CSSResult[];
|
|
3108
1619
|
/**
|
|
3109
1620
|
* Get the actual size value in pixels
|
|
3110
1621
|
*/
|
|
3111
1622
|
private getSize;
|
|
3112
|
-
render(): TemplateResult<1>;
|
|
1623
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3113
1624
|
}
|
|
3114
1625
|
declare global {
|
|
3115
1626
|
interface HTMLElementTagNameMap {
|
|
@@ -3126,7 +1637,7 @@ declare global {
|
|
|
3126
1637
|
* - Sets proper cursor styling to indicate text input functionality
|
|
3127
1638
|
*/
|
|
3128
1639
|
declare class InputWrapperComponent extends LitElement {
|
|
3129
|
-
static styles: CSSResult[];
|
|
1640
|
+
static styles: import("lit").CSSResult[];
|
|
3130
1641
|
focusWithin: boolean;
|
|
3131
1642
|
hasError: boolean;
|
|
3132
1643
|
private inputSlot;
|
|
@@ -3142,7 +1653,7 @@ declare class InputWrapperComponent extends LitElement {
|
|
|
3142
1653
|
* @returns The primer-input element or null if not found
|
|
3143
1654
|
*/
|
|
3144
1655
|
private findSlottedPrimerInput;
|
|
3145
|
-
render(): TemplateResult<1>;
|
|
1656
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3146
1657
|
}
|
|
3147
1658
|
declare global {
|
|
3148
1659
|
interface HTMLElementTagNameMap {
|
|
@@ -3156,7 +1667,7 @@ declare global {
|
|
|
3156
1667
|
* @slot - Default slot for label text content
|
|
3157
1668
|
*/
|
|
3158
1669
|
declare class InputLabelComponent extends LitElement {
|
|
3159
|
-
static styles: CSSResult[];
|
|
1670
|
+
static styles: import("lit").CSSResult[];
|
|
3160
1671
|
/**
|
|
3161
1672
|
* ID of the form control this label is associated with
|
|
3162
1673
|
*/
|
|
@@ -3165,7 +1676,7 @@ declare class InputLabelComponent extends LitElement {
|
|
|
3165
1676
|
* Whether the label should appear disabled
|
|
3166
1677
|
*/
|
|
3167
1678
|
disabled: boolean;
|
|
3168
|
-
render(): TemplateResult<1>;
|
|
1679
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3169
1680
|
}
|
|
3170
1681
|
declare global {
|
|
3171
1682
|
interface HTMLElementTagNameMap {
|
|
@@ -3177,7 +1688,7 @@ declare global {
|
|
|
3177
1688
|
*/
|
|
3178
1689
|
export type ButtonSelectionState = "default" | "checked";
|
|
3179
1690
|
declare class ButtonComponent extends LitElement {
|
|
3180
|
-
static styles: CSSResult[];
|
|
1691
|
+
static styles: import("lit").CSSResult[];
|
|
3181
1692
|
variant: "primary" | "secondary" | "tertiary";
|
|
3182
1693
|
disabled: boolean;
|
|
3183
1694
|
/**
|
|
@@ -3196,6 +1707,10 @@ declare class ButtonComponent extends LitElement {
|
|
|
3196
1707
|
* Indicates if this button is selectable/checkable
|
|
3197
1708
|
*/
|
|
3198
1709
|
selectable: boolean;
|
|
1710
|
+
/**
|
|
1711
|
+
* Indicates if wraps the slot in a flex container
|
|
1712
|
+
*/
|
|
1713
|
+
flex: boolean;
|
|
3199
1714
|
/**
|
|
3200
1715
|
* Event handler for button click
|
|
3201
1716
|
* If selectable, it will toggle between checked and default states
|
|
@@ -3209,7 +1724,7 @@ declare class ButtonComponent extends LitElement {
|
|
|
3209
1724
|
* Renders the spinner when in loading state
|
|
3210
1725
|
*/
|
|
3211
1726
|
private renderSpinner;
|
|
3212
|
-
render(): TemplateResult<1>;
|
|
1727
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3213
1728
|
}
|
|
3214
1729
|
declare global {
|
|
3215
1730
|
interface HTMLElementTagNameMap {
|
|
@@ -3223,7 +1738,7 @@ declare global {
|
|
|
3223
1738
|
* @slot - Default slot for error message content
|
|
3224
1739
|
*/
|
|
3225
1740
|
declare class InputErrorComponent extends LitElement {
|
|
3226
|
-
static styles: CSSResult[];
|
|
1741
|
+
static styles: import("lit").CSSResult[];
|
|
3227
1742
|
/**
|
|
3228
1743
|
* ID of the form control this error message is associated with
|
|
3229
1744
|
*/
|
|
@@ -3232,7 +1747,7 @@ declare class InputErrorComponent extends LitElement {
|
|
|
3232
1747
|
* Whether the error is currently active/visible
|
|
3233
1748
|
*/
|
|
3234
1749
|
active: boolean;
|
|
3235
|
-
render(): TemplateResult<1>;
|
|
1750
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3236
1751
|
}
|
|
3237
1752
|
declare global {
|
|
3238
1753
|
interface HTMLElementTagNameMap {
|
|
@@ -3242,12 +1757,12 @@ declare global {
|
|
|
3242
1757
|
export type IconName = keyof typeof icons;
|
|
3243
1758
|
declare const icons: Record<string, SVGTemplateResult>;
|
|
3244
1759
|
declare class PrimerIconComponent extends LitElement {
|
|
3245
|
-
static styles: CSSResult[];
|
|
1760
|
+
static styles: import("lit").CSSResult[];
|
|
3246
1761
|
color: string;
|
|
3247
1762
|
size: "lg" | "md" | "sm";
|
|
3248
1763
|
/** The name of the icon to draw - available names can be found under library.ts file */
|
|
3249
1764
|
name?: IconName;
|
|
3250
|
-
render(): TemplateResult<1>;
|
|
1765
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3251
1766
|
}
|
|
3252
1767
|
declare global {
|
|
3253
1768
|
interface HTMLElementTagNameMap {
|
|
@@ -3255,10 +1770,10 @@ declare global {
|
|
|
3255
1770
|
}
|
|
3256
1771
|
}
|
|
3257
1772
|
declare class PrimerCheckoutStateComponent extends LitElement {
|
|
3258
|
-
static styles: CSSResult[];
|
|
1773
|
+
static styles: import("lit").CSSResult[];
|
|
3259
1774
|
type: "complete" | "failure";
|
|
3260
1775
|
description?: string;
|
|
3261
|
-
render(): TemplateResult<1>;
|
|
1776
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3262
1777
|
}
|
|
3263
1778
|
declare global {
|
|
3264
1779
|
interface HTMLElementTagNameMap {
|
|
@@ -3294,7 +1809,7 @@ export type InputEventMap = {
|
|
|
3294
1809
|
* @csspart input - The native input element
|
|
3295
1810
|
*/
|
|
3296
1811
|
declare class InputComponent extends LitElement {
|
|
3297
|
-
static styles: CSSResult[];
|
|
1812
|
+
static styles: import("lit").CSSResult[];
|
|
3298
1813
|
private inputElement;
|
|
3299
1814
|
value: string;
|
|
3300
1815
|
placeholder: string;
|
|
@@ -3310,7 +1825,9 @@ declare class InputComponent extends LitElement {
|
|
|
3310
1825
|
max: string;
|
|
3311
1826
|
step: string;
|
|
3312
1827
|
autocomplete: string;
|
|
3313
|
-
|
|
1828
|
+
private _id;
|
|
1829
|
+
get id(): string;
|
|
1830
|
+
set id(value: string);
|
|
3314
1831
|
private hasFocus;
|
|
3315
1832
|
private hasError;
|
|
3316
1833
|
/**
|
|
@@ -3366,7 +1883,7 @@ declare class InputComponent extends LitElement {
|
|
|
3366
1883
|
* Report the validity of the input element
|
|
3367
1884
|
*/
|
|
3368
1885
|
reportValidity(): boolean;
|
|
3369
|
-
render(): TemplateResult<1>;
|
|
1886
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3370
1887
|
/**
|
|
3371
1888
|
* Type safe event dispatcher - allows consumers to use proper types
|
|
3372
1889
|
* when listening to events from this component
|
|
@@ -3397,7 +1914,7 @@ export type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
|
3397
1914
|
* Uses CSS Grid for smooth animation and incorporates the primary button.
|
|
3398
1915
|
*/
|
|
3399
1916
|
declare class CollapsableComponent extends LitElement {
|
|
3400
|
-
static styles: CSSResult[];
|
|
1917
|
+
static styles: import("lit").CSSResult[];
|
|
3401
1918
|
/**
|
|
3402
1919
|
* The header text for the collapsable
|
|
3403
1920
|
*/
|
|
@@ -3446,7 +1963,7 @@ declare class CollapsableComponent extends LitElement {
|
|
|
3446
1963
|
* Collapse the collapsable programmatically
|
|
3447
1964
|
*/
|
|
3448
1965
|
collapse(): void;
|
|
3449
|
-
render(): TemplateResult<1>;
|
|
1966
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3450
1967
|
}
|
|
3451
1968
|
declare global {
|
|
3452
1969
|
interface HTMLElementTagNameMap {
|
|
@@ -3471,7 +1988,8 @@ declare global {
|
|
|
3471
1988
|
* @csspart error-content - The error text content
|
|
3472
1989
|
*/
|
|
3473
1990
|
declare class ErrorMessageComponent extends LitElement {
|
|
3474
|
-
static styles: CSSResult[];
|
|
1991
|
+
static styles: import("lit").CSSResult[];
|
|
1992
|
+
constructor();
|
|
3475
1993
|
/**
|
|
3476
1994
|
* The error message text to display
|
|
3477
1995
|
*/
|
|
@@ -3484,7 +2002,9 @@ declare class ErrorMessageComponent extends LitElement {
|
|
|
3484
2002
|
* Accessibility role for the error message
|
|
3485
2003
|
* Defaults to "alert" for proper screen reader announcements
|
|
3486
2004
|
*/
|
|
3487
|
-
|
|
2005
|
+
private _role;
|
|
2006
|
+
get role(): string;
|
|
2007
|
+
set role(value: string);
|
|
3488
2008
|
/**
|
|
3489
2009
|
* Internal state to track animation state
|
|
3490
2010
|
* This helps manage proper animations with DOM presence/absence
|
|
@@ -3495,7 +2015,7 @@ declare class ErrorMessageComponent extends LitElement {
|
|
|
3495
2015
|
* Handle visibility changes with proper animation timing
|
|
3496
2016
|
*/
|
|
3497
2017
|
private handleVisibilityChange;
|
|
3498
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2018
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3499
2019
|
}
|
|
3500
2020
|
declare global {
|
|
3501
2021
|
interface HTMLElementTagNameMap {
|
|
@@ -3503,8 +2023,9 @@ declare global {
|
|
|
3503
2023
|
}
|
|
3504
2024
|
}
|
|
3505
2025
|
declare class PortalComponent extends LitElement {
|
|
3506
|
-
static styles: CSSResult[];
|
|
3507
|
-
|
|
2026
|
+
static styles: import("lit").CSSResult[];
|
|
2027
|
+
private _id;
|
|
2028
|
+
get id(): string;
|
|
3508
2029
|
getContainer(): HTMLDivElement;
|
|
3509
2030
|
/**
|
|
3510
2031
|
* Proxies the events sent from the portalled content and
|
|
@@ -3516,7 +2037,7 @@ declare class PortalComponent extends LitElement {
|
|
|
3516
2037
|
private _setupEventListeners;
|
|
3517
2038
|
disconnectedCallback(): void;
|
|
3518
2039
|
private _handleSlotChange;
|
|
3519
|
-
render(): TemplateResult<1>;
|
|
2040
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3520
2041
|
}
|
|
3521
2042
|
declare global {
|
|
3522
2043
|
interface HTMLElementTagNameMap {
|
|
@@ -3524,9 +2045,9 @@ declare global {
|
|
|
3524
2045
|
}
|
|
3525
2046
|
}
|
|
3526
2047
|
declare class DialogComponent extends LitElement {
|
|
3527
|
-
static styles: CSSResult[];
|
|
2048
|
+
static styles: import("lit").CSSResult[];
|
|
3528
2049
|
private _handleCloseClick;
|
|
3529
|
-
render(): TemplateResult<1>;
|
|
2050
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3530
2051
|
}
|
|
3531
2052
|
declare global {
|
|
3532
2053
|
interface HTMLElementTagNameMap {
|
|
@@ -3543,43 +2064,45 @@ declare global {
|
|
|
3543
2064
|
* [ Continue with Klarna ] --> opens a Klarna popup
|
|
3544
2065
|
*/
|
|
3545
2066
|
declare class PrimerKlarnaComponent extends LitElement {
|
|
3546
|
-
static styles: CSSResult[];
|
|
2067
|
+
static styles: import("lit").CSSResult[];
|
|
3547
2068
|
paymentManagers: InitializedManagersMap;
|
|
3548
|
-
sdkState:
|
|
3549
|
-
headlessUtils:
|
|
3550
|
-
klarnaCategories:
|
|
2069
|
+
sdkState: SdkStateContextType;
|
|
2070
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
2071
|
+
klarnaCategories: KlarnaCategoriesContextType | null;
|
|
2072
|
+
disabled: boolean;
|
|
3551
2073
|
private selectedCategory;
|
|
3552
2074
|
private isExpanded;
|
|
3553
2075
|
private headerAriaLabel;
|
|
3554
2076
|
private klarnaContainer;
|
|
3555
2077
|
private _paymentMethodManagerTask;
|
|
3556
|
-
toggleExpand()
|
|
2078
|
+
toggleExpand: () => void;
|
|
3557
2079
|
startKlarnaPayment(): Promise<void>;
|
|
3558
2080
|
renderSelectedCategory(): Promise<void>;
|
|
3559
2081
|
selectCategory(category: string): void;
|
|
3560
2082
|
updated(changedProperties: Map<string, unknown>): void;
|
|
3561
|
-
renderCategorySelection(): TemplateResult<1>;
|
|
3562
|
-
renderExpandedContent(): TemplateResult<1>;
|
|
3563
|
-
render(): typeof nothing | TemplateResult<1> | undefined;
|
|
2083
|
+
renderCategorySelection(): import("lit-html").TemplateResult<1>;
|
|
2084
|
+
renderExpandedContent(): import("lit-html").TemplateResult<1>;
|
|
2085
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1> | undefined;
|
|
3564
2086
|
}
|
|
3565
2087
|
declare global {
|
|
3566
2088
|
interface HTMLElementTagNameMap {
|
|
3567
2089
|
"primer-klarna": PrimerKlarnaComponent;
|
|
3568
2090
|
}
|
|
3569
2091
|
}
|
|
3570
|
-
export type
|
|
2092
|
+
export type PaymentMethodsContextType = InitializedPayments | null;
|
|
3571
2093
|
declare class PaymentMethodComponent extends LitElement {
|
|
3572
|
-
static styles: CSSResult[];
|
|
3573
|
-
type: PaymentMethodType
|
|
3574
|
-
|
|
3575
|
-
|
|
2094
|
+
static styles: import("lit").CSSResult[];
|
|
2095
|
+
type: PaymentMethodType | undefined;
|
|
2096
|
+
disabled: boolean;
|
|
2097
|
+
paymentMethods: PaymentMethodsContextType;
|
|
2098
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3576
2099
|
}
|
|
3577
2100
|
declare global {
|
|
3578
2101
|
interface HTMLElementTagNameMap {
|
|
3579
2102
|
"primer-payment-method": PaymentMethodComponent;
|
|
3580
2103
|
}
|
|
3581
2104
|
}
|
|
3582
|
-
export type
|
|
2105
|
+
export type ClientOptionsContextType = PrimerCheckoutOptions | null;
|
|
3583
2106
|
export type AchField = "firstName" | "lastName" | "emailAddress";
|
|
3584
2107
|
export interface AchFormState {
|
|
3585
2108
|
value: string;
|
|
@@ -3611,12 +2134,12 @@ declare class AchPaymentFormControler implements ReactiveController {
|
|
|
3611
2134
|
hostDisconnected(): void;
|
|
3612
2135
|
}
|
|
3613
2136
|
declare class AchPaymentComponent extends LitElement {
|
|
3614
|
-
static styles: CSSResult[];
|
|
2137
|
+
static styles: import("lit").CSSResult[];
|
|
3615
2138
|
protected readonly formController: AchPaymentFormControler;
|
|
3616
2139
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
3617
2140
|
paymentManagers: InitializedManagersMap;
|
|
3618
|
-
sdkState:
|
|
3619
|
-
clientOptions:
|
|
2141
|
+
sdkState: SdkStateContextType | undefined;
|
|
2142
|
+
clientOptions: ClientOptionsContextType | undefined;
|
|
3620
2143
|
screen: "form" | "mandate";
|
|
3621
2144
|
private isSubmitting;
|
|
3622
2145
|
private _paymentMethodManagerTask;
|
|
@@ -3637,11 +2160,11 @@ declare global {
|
|
|
3637
2160
|
}
|
|
3638
2161
|
}
|
|
3639
2162
|
declare class DynamicPaymentComponent extends LitElement {
|
|
3640
|
-
static styles: CSSResult[];
|
|
2163
|
+
static styles: import("lit").CSSResult[];
|
|
3641
2164
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
3642
2165
|
paymentManagers: InitializedManagersMap;
|
|
3643
|
-
sdkState:
|
|
3644
|
-
headlessUtils:
|
|
2166
|
+
sdkState: SdkStateContextType;
|
|
2167
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3645
2168
|
open: boolean;
|
|
3646
2169
|
private _paymentMethodManagerTask;
|
|
3647
2170
|
private _getAssetsTask;
|
|
@@ -3653,8 +2176,8 @@ declare class DynamicPaymentComponent extends LitElement {
|
|
|
3653
2176
|
private _legacyGetButtonLabel;
|
|
3654
2177
|
private _setupTasks;
|
|
3655
2178
|
start(): void;
|
|
3656
|
-
renderDialog(): typeof nothing | TemplateResult<1>;
|
|
3657
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2179
|
+
renderDialog(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2180
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3658
2181
|
}
|
|
3659
2182
|
declare global {
|
|
3660
2183
|
interface HTMLElementTagNameMap {
|
|
@@ -3662,11 +2185,12 @@ declare global {
|
|
|
3662
2185
|
}
|
|
3663
2186
|
}
|
|
3664
2187
|
declare class RedirectPaymentComponent extends LitElement {
|
|
3665
|
-
static styles: CSSResult[];
|
|
2188
|
+
static styles: import("lit").CSSResult[];
|
|
3666
2189
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
2190
|
+
disabled: boolean;
|
|
3667
2191
|
paymentManagers: InitializedManagersMap;
|
|
3668
|
-
sdkState:
|
|
3669
|
-
headlessUtils:
|
|
2192
|
+
sdkState: SdkStateContextType;
|
|
2193
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3670
2194
|
private _paymentMethodManagerTask;
|
|
3671
2195
|
/**
|
|
3672
2196
|
* Based on packages/primer-sdk-web/src/payment-methods/Button.tsx
|
|
@@ -3676,7 +2200,7 @@ declare class RedirectPaymentComponent extends LitElement {
|
|
|
3676
2200
|
private _getAssetsTask;
|
|
3677
2201
|
private _setupTasks;
|
|
3678
2202
|
startRedirectPayment(): void;
|
|
3679
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2203
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3680
2204
|
}
|
|
3681
2205
|
declare global {
|
|
3682
2206
|
interface HTMLElementTagNameMap {
|
|
@@ -3693,7 +2217,7 @@ export interface VaultManagerEvents {
|
|
|
3693
2217
|
toggleEditMode: CustomEvent<boolean>;
|
|
3694
2218
|
closeError: CustomEvent<void>;
|
|
3695
2219
|
vaultPaymentError: CustomEvent<{
|
|
3696
|
-
error:
|
|
2220
|
+
error: unknown;
|
|
3697
2221
|
}>;
|
|
3698
2222
|
}
|
|
3699
2223
|
/**
|
|
@@ -3711,11 +2235,13 @@ export interface VaultManagerEventMap {
|
|
|
3711
2235
|
* VaultManagerComponent - displays and manages saved payment methods
|
|
3712
2236
|
*/
|
|
3713
2237
|
declare class VaultManagerComponent extends LitElement {
|
|
3714
|
-
static styles: CSSResult[];
|
|
2238
|
+
static styles: import("lit").CSSResult[];
|
|
3715
2239
|
constructor();
|
|
3716
2240
|
addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
3717
2241
|
removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
3718
|
-
vaultManagerContext:
|
|
2242
|
+
vaultManagerContext: VaultManagerContextType;
|
|
2243
|
+
vaultItemContext: VaultItemContextType;
|
|
2244
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3719
2245
|
/**
|
|
3720
2246
|
* Whether we're in edit mode
|
|
3721
2247
|
*/
|
|
@@ -3736,6 +2262,10 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3736
2262
|
* Animation duration override
|
|
3737
2263
|
*/
|
|
3738
2264
|
animationDuration: number;
|
|
2265
|
+
/**
|
|
2266
|
+
* Asset config for the payment method being deleted
|
|
2267
|
+
*/
|
|
2268
|
+
private deleteAssetConfig;
|
|
3739
2269
|
/**
|
|
3740
2270
|
* Get base animation configuration with current settings
|
|
3741
2271
|
*/
|
|
@@ -3787,7 +2317,7 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3787
2317
|
/**
|
|
3788
2318
|
* Main render method
|
|
3789
2319
|
*/
|
|
3790
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2320
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3791
2321
|
}
|
|
3792
2322
|
/**
|
|
3793
2323
|
* VaultPaymentMethodItemComponent - displays a single payment method
|
|
@@ -3797,7 +2327,7 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3797
2327
|
* Always renders the primer-button for consistent UI and improved accessibility
|
|
3798
2328
|
*/
|
|
3799
2329
|
declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
3800
|
-
static styles: CSSResult[];
|
|
2330
|
+
static styles: import("lit").CSSResult[];
|
|
3801
2331
|
/**
|
|
3802
2332
|
* Strongly typed event declarations
|
|
3803
2333
|
*/
|
|
@@ -3806,9 +2336,9 @@ declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
|
3806
2336
|
/**
|
|
3807
2337
|
* Consume the vault manager context
|
|
3808
2338
|
*/
|
|
3809
|
-
vaultManagerContext:
|
|
3810
|
-
vaultItemContext:
|
|
3811
|
-
headlessUtils:
|
|
2339
|
+
vaultManagerContext: VaultManagerContextType;
|
|
2340
|
+
vaultItemContext: VaultItemContextType;
|
|
2341
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3812
2342
|
/**
|
|
3813
2343
|
* The payment method to display
|
|
3814
2344
|
*/
|
|
@@ -3831,14 +2361,10 @@ declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
|
3831
2361
|
* Dispatch delete event
|
|
3832
2362
|
*/
|
|
3833
2363
|
private handleDeleteClick;
|
|
3834
|
-
/**
|
|
3835
|
-
* Builds the common content template shared between modes
|
|
3836
|
-
*/
|
|
3837
|
-
private renderPaymentMethodContent;
|
|
3838
2364
|
/**
|
|
3839
2365
|
* Render method
|
|
3840
2366
|
*/
|
|
3841
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2367
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3842
2368
|
}
|
|
3843
2369
|
declare global {
|
|
3844
2370
|
interface HTMLElementTagNameMap {
|
|
@@ -3849,7 +2375,7 @@ declare global {
|
|
|
3849
2375
|
* VaultManagerHeaderComponent - displays the header for the vault manager
|
|
3850
2376
|
*/
|
|
3851
2377
|
declare class VaultManagerHeaderComponent extends LitElement {
|
|
3852
|
-
static styles: CSSResult[];
|
|
2378
|
+
static styles: import("lit").CSSResult[];
|
|
3853
2379
|
/**
|
|
3854
2380
|
* Strongly typed event declarations
|
|
3855
2381
|
*/
|
|
@@ -3870,7 +2396,7 @@ declare class VaultManagerHeaderComponent extends LitElement {
|
|
|
3870
2396
|
/**
|
|
3871
2397
|
* Render method
|
|
3872
2398
|
*/
|
|
3873
|
-
protected render(): TemplateResult<1>;
|
|
2399
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3874
2400
|
}
|
|
3875
2401
|
declare global {
|
|
3876
2402
|
interface HTMLElementTagNameMap {
|
|
@@ -3881,7 +2407,7 @@ declare global {
|
|
|
3881
2407
|
* VaultDeleteConfirmationComponent - displays confirmation UI for deleting a payment method
|
|
3882
2408
|
*/
|
|
3883
2409
|
declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
3884
|
-
static styles: CSSResult[];
|
|
2410
|
+
static styles: import("lit").CSSResult[];
|
|
3885
2411
|
/**
|
|
3886
2412
|
* Strongly typed event declarations
|
|
3887
2413
|
*/
|
|
@@ -3902,7 +2428,7 @@ declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
|
3902
2428
|
/**
|
|
3903
2429
|
* Consume the vault manager context to access payment method info
|
|
3904
2430
|
*/
|
|
3905
|
-
vaultManager:
|
|
2431
|
+
vaultManager: VaultManagerContextType;
|
|
3906
2432
|
/**
|
|
3907
2433
|
* Handle confirm click
|
|
3908
2434
|
*/
|
|
@@ -3914,7 +2440,7 @@ declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
|
3914
2440
|
/**
|
|
3915
2441
|
* Render method
|
|
3916
2442
|
*/
|
|
3917
|
-
protected render(): TemplateResult<1>;
|
|
2443
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3918
2444
|
}
|
|
3919
2445
|
declare global {
|
|
3920
2446
|
interface HTMLElementTagNameMap {
|
|
@@ -3925,11 +2451,11 @@ declare global {
|
|
|
3925
2451
|
* VaultEmptyStateComponent - displays when no payment methods are available
|
|
3926
2452
|
*/
|
|
3927
2453
|
declare class VaultEmptyStateComponent extends LitElement {
|
|
3928
|
-
static styles: CSSResult[];
|
|
2454
|
+
static styles: import("lit").CSSResult[];
|
|
3929
2455
|
/**
|
|
3930
2456
|
* Render method
|
|
3931
2457
|
*/
|
|
3932
|
-
protected render(): TemplateResult<1>;
|
|
2458
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3933
2459
|
}
|
|
3934
2460
|
declare global {
|
|
3935
2461
|
interface HTMLElementTagNameMap {
|
|
@@ -3940,7 +2466,7 @@ declare global {
|
|
|
3940
2466
|
* VaultErrorMessageComponent - displays error messages with improved visuals
|
|
3941
2467
|
*/
|
|
3942
2468
|
declare class VaultErrorMessageComponent extends LitElement {
|
|
3943
|
-
static styles: CSSResult[];
|
|
2469
|
+
static styles: import("lit").CSSResult[];
|
|
3944
2470
|
/**
|
|
3945
2471
|
* Strongly typed event declarations
|
|
3946
2472
|
*/
|
|
@@ -3957,7 +2483,7 @@ declare class VaultErrorMessageComponent extends LitElement {
|
|
|
3957
2483
|
/**
|
|
3958
2484
|
* Render method
|
|
3959
2485
|
*/
|
|
3960
|
-
protected render(): TemplateResult<1>;
|
|
2486
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3961
2487
|
}
|
|
3962
2488
|
declare global {
|
|
3963
2489
|
interface HTMLElementTagNameMap {
|
|
@@ -3970,7 +2496,7 @@ declare global {
|
|
|
3970
2496
|
* Integrates with the vault manager context to handle payment submission.
|
|
3971
2497
|
*/
|
|
3972
2498
|
declare class VaultPaymentSubmitComponent extends LitElement {
|
|
3973
|
-
static styles: CSSResult[];
|
|
2499
|
+
static styles: import("lit").CSSResult[];
|
|
3974
2500
|
private readonly _userAssignedProps;
|
|
3975
2501
|
private _internalButtonText;
|
|
3976
2502
|
/**
|
|
@@ -3979,10 +2505,10 @@ declare class VaultPaymentSubmitComponent extends LitElement {
|
|
|
3979
2505
|
*/
|
|
3980
2506
|
get buttonText(): string;
|
|
3981
2507
|
set buttonText(value: string);
|
|
3982
|
-
headlessInstance:
|
|
3983
|
-
sdkState:
|
|
3984
|
-
vaultItemContext:
|
|
3985
|
-
vaultManager:
|
|
2508
|
+
headlessInstance: HeadlessUnitilsContextType;
|
|
2509
|
+
sdkState: SdkStateContextType;
|
|
2510
|
+
vaultItemContext: VaultItemContextType;
|
|
2511
|
+
vaultManager: VaultManagerContextType;
|
|
3986
2512
|
clientOptions: PrimerCheckoutOptions | null;
|
|
3987
2513
|
/**
|
|
3988
2514
|
* The button variant to use.
|
|
@@ -4005,7 +2531,7 @@ declare class VaultPaymentSubmitComponent extends LitElement {
|
|
|
4005
2531
|
* Computed property to determine if the button should be disabled
|
|
4006
2532
|
*/
|
|
4007
2533
|
private get isButtonDisabled();
|
|
4008
|
-
render(): TemplateResult<1>;
|
|
2534
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4009
2535
|
}
|
|
4010
2536
|
declare global {
|
|
4011
2537
|
interface HTMLElementTagNameMap {
|
|
@@ -4018,22 +2544,23 @@ declare global {
|
|
|
4018
2544
|
* Uses dedicated CVV context to minimize re-renders
|
|
4019
2545
|
*/
|
|
4020
2546
|
declare class VaultCvvInputComponent extends LitElement {
|
|
4021
|
-
static styles: CSSResult[];
|
|
2547
|
+
static styles: import("lit").CSSResult[];
|
|
4022
2548
|
/**
|
|
4023
2549
|
* Form context for checking form dirty state
|
|
4024
2550
|
*/
|
|
4025
|
-
vaultManagerFormContext:
|
|
2551
|
+
vaultManagerFormContext: VaultManagerContextType;
|
|
4026
2552
|
/**
|
|
4027
2553
|
* CVV-specific context for dedicated CVV handling
|
|
4028
2554
|
* Separated to minimize re-renders on frequent CVV input changes
|
|
4029
2555
|
*/
|
|
4030
|
-
vaultManagerCvvContext:
|
|
2556
|
+
vaultManagerCvvContext: VaultItemContextType;
|
|
4031
2557
|
computedStyles: CSSStyleDeclaration | null;
|
|
4032
2558
|
paymentMethod: PaymentCardVaultedMethod | null;
|
|
4033
2559
|
private cvvError;
|
|
4034
2560
|
private cvvInputIsDirty;
|
|
4035
2561
|
private cvvInputIsBlurred;
|
|
4036
2562
|
private cvvInput;
|
|
2563
|
+
private isFocused;
|
|
4037
2564
|
/**
|
|
4038
2565
|
* Unique ID for the CVV input container
|
|
4039
2566
|
*/
|
|
@@ -4046,16 +2573,62 @@ declare class VaultCvvInputComponent extends LitElement {
|
|
|
4046
2573
|
*/
|
|
4047
2574
|
onCvvInputChange(): void;
|
|
4048
2575
|
onBlur(): void;
|
|
2576
|
+
onFocus(): void;
|
|
4049
2577
|
/**
|
|
4050
2578
|
* Main render method
|
|
4051
2579
|
*/
|
|
4052
|
-
protected render(): symbol | TemplateResult<1> | undefined;
|
|
2580
|
+
protected render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
4053
2581
|
}
|
|
4054
2582
|
declare global {
|
|
4055
2583
|
interface HTMLElementTagNameMap {
|
|
4056
2584
|
"primer-vault-cvv-input": VaultCvvInputComponent;
|
|
4057
2585
|
}
|
|
4058
2586
|
}
|
|
2587
|
+
export interface CardPaymentMethodDisplay {
|
|
2588
|
+
type: "card";
|
|
2589
|
+
cardholderName: string;
|
|
2590
|
+
last4: string;
|
|
2591
|
+
expiresDate: string;
|
|
2592
|
+
network: string;
|
|
2593
|
+
description: string;
|
|
2594
|
+
}
|
|
2595
|
+
export interface OtherPaymentMethodDisplay {
|
|
2596
|
+
type: "other";
|
|
2597
|
+
fullName?: string;
|
|
2598
|
+
paymentMethodType?: "ACH" | "PayPal" | "Klarna";
|
|
2599
|
+
email?: string;
|
|
2600
|
+
last4?: string;
|
|
2601
|
+
bankName?: string;
|
|
2602
|
+
accountType?: string;
|
|
2603
|
+
description: string;
|
|
2604
|
+
}
|
|
2605
|
+
export type AssetConfig = ({
|
|
2606
|
+
icon: string;
|
|
2607
|
+
} & CardPaymentMethodDisplay & {
|
|
2608
|
+
shouldShowCVV: boolean;
|
|
2609
|
+
}) | ({
|
|
2610
|
+
icon: string;
|
|
2611
|
+
} & OtherPaymentMethodDisplay & {
|
|
2612
|
+
shouldShowCVV: boolean;
|
|
2613
|
+
});
|
|
2614
|
+
/**
|
|
2615
|
+
* PaymentMethodContentComponent - renders payment method information with icon and details
|
|
2616
|
+
* This component encapsulates the display logic and styles for payment method content
|
|
2617
|
+
* so it can be reused across different containers without style conflicts
|
|
2618
|
+
*/
|
|
2619
|
+
export declare class PaymentMethodContentComponent extends LitElement {
|
|
2620
|
+
static styles: import("lit").CSSResult[];
|
|
2621
|
+
/**
|
|
2622
|
+
* The asset configuration containing icon and display data
|
|
2623
|
+
*/
|
|
2624
|
+
assetConfig: AssetConfig | null;
|
|
2625
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2626
|
+
}
|
|
2627
|
+
declare global {
|
|
2628
|
+
interface HTMLElementTagNameMap {
|
|
2629
|
+
"primer-payment-method-content": PaymentMethodContentComponent;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
4059
2632
|
declare global {
|
|
4060
2633
|
interface HTMLElementTagNameMap {
|
|
4061
2634
|
"primer-vault-manager": VaultManagerComponent;
|
|
@@ -4066,8 +2639,9 @@ declare global {
|
|
|
4066
2639
|
* It handles form submission, validation, and provides context to child components.
|
|
4067
2640
|
*/
|
|
4068
2641
|
declare class CardFormComponent extends LitElement {
|
|
4069
|
-
static styles: CSSResult[];
|
|
2642
|
+
static styles: import("lit").CSSResult[];
|
|
4070
2643
|
hideLabels: boolean;
|
|
2644
|
+
disabled: boolean;
|
|
4071
2645
|
updated(changedProperties: Map<string, unknown>): void;
|
|
4072
2646
|
/**
|
|
4073
2647
|
* Tracks whether custom content has been provided via slot
|
|
@@ -4120,10 +2694,11 @@ declare class CardFormComponent extends LitElement {
|
|
|
4120
2694
|
* Handles both native form submissions and custom events
|
|
4121
2695
|
*/
|
|
4122
2696
|
private handleFormSubmit;
|
|
4123
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2697
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4124
2698
|
}
|
|
4125
2699
|
export interface CardFormContext {
|
|
4126
2700
|
cardNumberInput: IHeadlessHostedInput;
|
|
2701
|
+
cardHolderNameInput?: IHeadlessHostedInput;
|
|
4127
2702
|
expiryInput: IHeadlessHostedInput;
|
|
4128
2703
|
cvvInput: IHeadlessHostedInput;
|
|
4129
2704
|
setCardholderName: (val: string) => void;
|
|
@@ -4132,6 +2707,7 @@ export interface CardFormContext {
|
|
|
4132
2707
|
submit: (values?: CardPaymentMethodSubmitValues) => Promise<void>;
|
|
4133
2708
|
errors?: Validation["validationErrors"];
|
|
4134
2709
|
hideLabels?: boolean;
|
|
2710
|
+
disabled?: boolean;
|
|
4135
2711
|
}
|
|
4136
2712
|
/**
|
|
4137
2713
|
* A shared type that ensures the host of a HostedInputController contains
|
|
@@ -4148,218 +2724,6 @@ export interface HostedInputHost extends ReactiveControllerHost, LitElement {
|
|
|
4148
2724
|
label: string;
|
|
4149
2725
|
requestUpdate: ReactiveControllerHost["requestUpdate"];
|
|
4150
2726
|
}
|
|
4151
|
-
interface ReactiveControllerHost$1 {
|
|
4152
|
-
/**
|
|
4153
|
-
* Adds a controller to the host, which sets up the controller's lifecycle
|
|
4154
|
-
* methods to be called with the host's lifecycle.
|
|
4155
|
-
*/
|
|
4156
|
-
addController(controller: ReactiveController$1): void;
|
|
4157
|
-
/**
|
|
4158
|
-
* Removes a controller from the host.
|
|
4159
|
-
*/
|
|
4160
|
-
removeController(controller: ReactiveController$1): void;
|
|
4161
|
-
/**
|
|
4162
|
-
* Requests a host update which is processed asynchronously. The update can
|
|
4163
|
-
* be waited on via the `updateComplete` property.
|
|
4164
|
-
*/
|
|
4165
|
-
requestUpdate(): void;
|
|
4166
|
-
/**
|
|
4167
|
-
* Returns a Promise that resolves when the host has completed updating.
|
|
4168
|
-
* The Promise value is a boolean that is `true` if the element completed the
|
|
4169
|
-
* update without triggering another update. The Promise result is `false` if
|
|
4170
|
-
* a property was set inside `updated()`. If the Promise is rejected, an
|
|
4171
|
-
* exception was thrown during the update.
|
|
4172
|
-
*
|
|
4173
|
-
* @return A promise of a boolean that indicates if the update resolved
|
|
4174
|
-
* without triggering another update.
|
|
4175
|
-
*/
|
|
4176
|
-
readonly updateComplete: Promise<boolean>;
|
|
4177
|
-
}
|
|
4178
|
-
interface ReactiveController$1 {
|
|
4179
|
-
/**
|
|
4180
|
-
* Called when the host is connected to the component tree. For custom
|
|
4181
|
-
* element hosts, this corresponds to the `connectedCallback()` lifecycle,
|
|
4182
|
-
* which is only called when the component is connected to the document.
|
|
4183
|
-
*/
|
|
4184
|
-
hostConnected?(): void;
|
|
4185
|
-
/**
|
|
4186
|
-
* Called when the host is disconnected from the component tree. For custom
|
|
4187
|
-
* element hosts, this corresponds to the `disconnectedCallback()` lifecycle,
|
|
4188
|
-
* which is called the host or an ancestor component is disconnected from the
|
|
4189
|
-
* document.
|
|
4190
|
-
*/
|
|
4191
|
-
hostDisconnected?(): void;
|
|
4192
|
-
/**
|
|
4193
|
-
* Called during the client-side host update, just before the host calls
|
|
4194
|
-
* its own update.
|
|
4195
|
-
*
|
|
4196
|
-
* Code in `update()` can depend on the DOM as it is not called in
|
|
4197
|
-
* server-side rendering.
|
|
4198
|
-
*/
|
|
4199
|
-
hostUpdate?(): void;
|
|
4200
|
-
/**
|
|
4201
|
-
* Called after a host update, just before the host calls firstUpdated and
|
|
4202
|
-
* updated. It is not called in server-side rendering.
|
|
4203
|
-
*
|
|
4204
|
-
*/
|
|
4205
|
-
hostUpdated?(): void;
|
|
4206
|
-
}
|
|
4207
|
-
export interface TaskFunctionOptions {
|
|
4208
|
-
signal: AbortSignal;
|
|
4209
|
-
}
|
|
4210
|
-
export type TaskFunction<D extends ReadonlyArray<unknown>, R = unknown> = (args: D, options: TaskFunctionOptions) => R | typeof initialState | Promise<R | typeof initialState>;
|
|
4211
|
-
export type ArgsFunction<D extends ReadonlyArray<unknown>> = () => D;
|
|
4212
|
-
declare const TaskStatus: {
|
|
4213
|
-
readonly INITIAL: 0;
|
|
4214
|
-
readonly PENDING: 1;
|
|
4215
|
-
readonly COMPLETE: 2;
|
|
4216
|
-
readonly ERROR: 3;
|
|
4217
|
-
};
|
|
4218
|
-
declare const initialState: unique symbol;
|
|
4219
|
-
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus];
|
|
4220
|
-
export type StatusRenderer<R> = {
|
|
4221
|
-
initial?: () => unknown;
|
|
4222
|
-
pending?: () => unknown;
|
|
4223
|
-
complete?: (value: R) => unknown;
|
|
4224
|
-
error?: (error: unknown) => unknown;
|
|
4225
|
-
};
|
|
4226
|
-
export interface TaskConfig<T extends ReadonlyArray<unknown>, R> {
|
|
4227
|
-
task: TaskFunction<T, R>;
|
|
4228
|
-
args?: ArgsFunction<T>;
|
|
4229
|
-
/**
|
|
4230
|
-
* Determines if the task is run automatically when arguments change after a
|
|
4231
|
-
* host update. Default to `true`.
|
|
4232
|
-
*
|
|
4233
|
-
* If `true`, the task checks arguments during the host update (after
|
|
4234
|
-
* `willUpdate()` and before `update()` in Lit) and runs if they change. For
|
|
4235
|
-
* a task to see argument changes they must be done in `willUpdate()` or
|
|
4236
|
-
* earlier. The host element can see task status changes caused by its own
|
|
4237
|
-
* current update.
|
|
4238
|
-
*
|
|
4239
|
-
* If `'afterUpdate'`, the task checks arguments and runs _after_ the host
|
|
4240
|
-
* update. This means that the task can see host changes done in update, such
|
|
4241
|
-
* as rendered DOM. The host element can not see task status changes caused
|
|
4242
|
-
* by its own update, so the task must trigger a second host update to make
|
|
4243
|
-
* those changes renderable.
|
|
4244
|
-
*
|
|
4245
|
-
* Note: `'afterUpdate'` is unlikely to be SSR compatible in the future.
|
|
4246
|
-
*
|
|
4247
|
-
* If `false`, the task is not run automatically, and must be run with the
|
|
4248
|
-
* {@linkcode run} method.
|
|
4249
|
-
*/
|
|
4250
|
-
autoRun?: boolean | "afterUpdate";
|
|
4251
|
-
/**
|
|
4252
|
-
* A function that determines if the current arg and previous args arrays are
|
|
4253
|
-
* equal. If the argsEqual function returns true, the task will not auto-run.
|
|
4254
|
-
*
|
|
4255
|
-
* The default is {@linkcode shallowArrayEquals}. {@linkcode deepArrayEquals}
|
|
4256
|
-
* is also available.
|
|
4257
|
-
*/
|
|
4258
|
-
argsEqual?: (oldArgs: T, newArgs: T) => boolean;
|
|
4259
|
-
/**
|
|
4260
|
-
* If initialValue is provided, the task is initialized to the COMPLETE
|
|
4261
|
-
* status and the value is set to initialData.
|
|
4262
|
-
*
|
|
4263
|
-
* Initial args should be coherent with the initialValue, since they are
|
|
4264
|
-
* assumed to be the args that would produce that value. When autoRun is
|
|
4265
|
-
* `true` the task will not auto-run again until the args change.
|
|
4266
|
-
*/
|
|
4267
|
-
initialValue?: R;
|
|
4268
|
-
onComplete?: (value: R) => unknown;
|
|
4269
|
-
onError?: (error: unknown) => unknown;
|
|
4270
|
-
}
|
|
4271
|
-
declare class Task<const T extends ReadonlyArray<unknown> = ReadonlyArray<unknown>, const R = unknown> {
|
|
4272
|
-
private _previousArgs?;
|
|
4273
|
-
private _task;
|
|
4274
|
-
private _argsFn?;
|
|
4275
|
-
private _argsEqual;
|
|
4276
|
-
private _callId;
|
|
4277
|
-
private _host;
|
|
4278
|
-
private _value?;
|
|
4279
|
-
private _error?;
|
|
4280
|
-
private _abortController?;
|
|
4281
|
-
private _onComplete?;
|
|
4282
|
-
private _onError?;
|
|
4283
|
-
private _status;
|
|
4284
|
-
/**
|
|
4285
|
-
* Determines if the task is run automatically when arguments change after a
|
|
4286
|
-
* host update. Default to `true`.
|
|
4287
|
-
*
|
|
4288
|
-
* @see {@link TaskConfig.autoRun} for more information.
|
|
4289
|
-
*/
|
|
4290
|
-
autoRun: boolean | "afterUpdate";
|
|
4291
|
-
/**
|
|
4292
|
-
* A Promise that resolve when the current task run is complete.
|
|
4293
|
-
*
|
|
4294
|
-
* If a new task run is started while a previous run is pending, the Promise
|
|
4295
|
-
* is kept and only resolved when the new run is completed.
|
|
4296
|
-
*/
|
|
4297
|
-
get taskComplete(): Promise<R>;
|
|
4298
|
-
private _resolveTaskComplete?;
|
|
4299
|
-
private _rejectTaskComplete?;
|
|
4300
|
-
private _taskComplete?;
|
|
4301
|
-
constructor(host: ReactiveControllerHost$1, task: TaskConfig<T, R>);
|
|
4302
|
-
constructor(host: ReactiveControllerHost$1, task: TaskFunction<T, R>, args?: ArgsFunction<T>);
|
|
4303
|
-
hostUpdate(): void;
|
|
4304
|
-
hostUpdated(): void;
|
|
4305
|
-
private _getArgs;
|
|
4306
|
-
/**
|
|
4307
|
-
* Determines if the task should run when it's triggered because of a
|
|
4308
|
-
* host update, and runs the task if it should.
|
|
4309
|
-
*
|
|
4310
|
-
* A task should run when its arguments change from the previous run, based on
|
|
4311
|
-
* the args equality function.
|
|
4312
|
-
*
|
|
4313
|
-
* This method is side-effectful: it stores the new args as the previous args.
|
|
4314
|
-
*/
|
|
4315
|
-
private _performTask;
|
|
4316
|
-
/**
|
|
4317
|
-
* Runs a task manually.
|
|
4318
|
-
*
|
|
4319
|
-
* This can be useful for running tasks in response to events as opposed to
|
|
4320
|
-
* automatically running when host element state changes.
|
|
4321
|
-
*
|
|
4322
|
-
* @param args an optional set of arguments to use for this task run. If args
|
|
4323
|
-
* is not given, the args function is called to get the arguments for
|
|
4324
|
-
* this run.
|
|
4325
|
-
*/
|
|
4326
|
-
run(args?: T): Promise<void>;
|
|
4327
|
-
/**
|
|
4328
|
-
* Aborts the currently pending task run by aborting the AbortSignal
|
|
4329
|
-
* passed to the task function.
|
|
4330
|
-
*
|
|
4331
|
-
* Aborting a task does nothing if the task is not running: ie, in the
|
|
4332
|
-
* complete, error, or initial states.
|
|
4333
|
-
*
|
|
4334
|
-
* Aborting a task does not automatically cancel the task function. The task
|
|
4335
|
-
* function must be written to accept the AbortSignal and either forward it
|
|
4336
|
-
* to other APIs like `fetch()`, or handle cancellation manually by using
|
|
4337
|
-
* [`signal.throwIfAborted()`]{@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted}
|
|
4338
|
-
* or the
|
|
4339
|
-
* [`abort`]{@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_event}
|
|
4340
|
-
* event.
|
|
4341
|
-
*
|
|
4342
|
-
* @param reason The reason for aborting. Passed to
|
|
4343
|
-
* `AbortController.abort()`.
|
|
4344
|
-
*/
|
|
4345
|
-
abort(reason?: unknown): void;
|
|
4346
|
-
/**
|
|
4347
|
-
* The result of the previous task run, if it resolved.
|
|
4348
|
-
*
|
|
4349
|
-
* Is `undefined` if the task has not run yet, or if the previous run errored.
|
|
4350
|
-
*/
|
|
4351
|
-
get value(): R | undefined;
|
|
4352
|
-
/**
|
|
4353
|
-
* The error from the previous task run, if it rejected.
|
|
4354
|
-
*
|
|
4355
|
-
* Is `undefined` if the task has not run yet, or if the previous run
|
|
4356
|
-
* completed successfully.
|
|
4357
|
-
*/
|
|
4358
|
-
get error(): unknown;
|
|
4359
|
-
get status(): TaskStatus;
|
|
4360
|
-
render<T extends StatusRenderer<R>>(renderer: T): MaybeReturnType<T["initial"]> | MaybeReturnType<T["pending"]> | MaybeReturnType<T["complete"]> | MaybeReturnType<T["error"]>;
|
|
4361
|
-
}
|
|
4362
|
-
export type MaybeReturnType<F> = F extends (...args: never[]) => infer R ? R : undefined;
|
|
4363
2727
|
/**
|
|
4364
2728
|
* Available input types for hosted inputs.
|
|
4365
2729
|
*/
|
|
@@ -4518,13 +2882,13 @@ declare abstract class AbstractCardInputComponent extends LitElement implements
|
|
|
4518
2882
|
/**
|
|
4519
2883
|
* Common rendering logic for all card input components
|
|
4520
2884
|
*/
|
|
4521
|
-
protected renderInput(): typeof nothing | TemplateResult<1>;
|
|
2885
|
+
protected renderInput(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4522
2886
|
}
|
|
4523
2887
|
/**
|
|
4524
2888
|
* Card number input component with dynamic card network detection and selection
|
|
4525
2889
|
*/
|
|
4526
2890
|
declare class InputCardNumberComponent extends AbstractCardInputComponent {
|
|
4527
|
-
static styles: CSSResult[];
|
|
2891
|
+
static styles: import("lit").CSSResult[];
|
|
4528
2892
|
/**
|
|
4529
2893
|
* Configuration for this input component
|
|
4530
2894
|
*/
|
|
@@ -4537,8 +2901,8 @@ declare class InputCardNumberComponent extends AbstractCardInputComponent {
|
|
|
4537
2901
|
/**
|
|
4538
2902
|
* Override the renderInput method to include the network selector
|
|
4539
2903
|
*/
|
|
4540
|
-
protected renderInput(): typeof nothing | TemplateResult<1>;
|
|
4541
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2904
|
+
protected renderInput(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2905
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4542
2906
|
}
|
|
4543
2907
|
declare global {
|
|
4544
2908
|
interface HTMLElementTagNameMap {
|
|
@@ -4546,10 +2910,10 @@ declare global {
|
|
|
4546
2910
|
}
|
|
4547
2911
|
}
|
|
4548
2912
|
declare class InputCvvComponent extends AbstractCardInputComponent {
|
|
4549
|
-
static styles: CSSResult[];
|
|
2913
|
+
static styles: import("lit").CSSResult[];
|
|
4550
2914
|
protected readonly config: InputComponentConfig;
|
|
4551
2915
|
constructor();
|
|
4552
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2916
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4553
2917
|
}
|
|
4554
2918
|
declare global {
|
|
4555
2919
|
interface HTMLElementTagNameMap {
|
|
@@ -4557,10 +2921,10 @@ declare global {
|
|
|
4557
2921
|
}
|
|
4558
2922
|
}
|
|
4559
2923
|
declare class InputCardExpiryComponent extends AbstractCardInputComponent {
|
|
4560
|
-
static styles: CSSResult[];
|
|
2924
|
+
static styles: import("lit").CSSResult[];
|
|
4561
2925
|
protected readonly config: InputComponentConfig;
|
|
4562
2926
|
constructor();
|
|
4563
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2927
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4564
2928
|
}
|
|
4565
2929
|
declare global {
|
|
4566
2930
|
interface HTMLElementTagNameMap {
|
|
@@ -4568,11 +2932,11 @@ declare global {
|
|
|
4568
2932
|
}
|
|
4569
2933
|
}
|
|
4570
2934
|
declare class InputCardHolderNameComponent extends AbstractCardInputComponent {
|
|
4571
|
-
static styles: CSSResult[];
|
|
2935
|
+
static styles: import("lit").CSSResult[];
|
|
4572
2936
|
protected readonly config: InputComponentConfig;
|
|
4573
2937
|
constructor();
|
|
4574
2938
|
private handleInput;
|
|
4575
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2939
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4576
2940
|
}
|
|
4577
2941
|
declare global {
|
|
4578
2942
|
interface HTMLElementTagNameMap {
|
|
@@ -4584,7 +2948,7 @@ declare global {
|
|
|
4584
2948
|
* Provides a consistent submit button with translation support.
|
|
4585
2949
|
*/
|
|
4586
2950
|
declare class CardFormSubmitComponent extends LitElement {
|
|
4587
|
-
static styles: CSSResult[];
|
|
2951
|
+
static styles: import("lit").CSSResult[];
|
|
4588
2952
|
private readonly _userAssignedProps;
|
|
4589
2953
|
private _internalButtonText;
|
|
4590
2954
|
/**
|
|
@@ -4593,9 +2957,10 @@ declare class CardFormSubmitComponent extends LitElement {
|
|
|
4593
2957
|
*/
|
|
4594
2958
|
get buttonText(): string;
|
|
4595
2959
|
set buttonText(value: string);
|
|
4596
|
-
headlessInstance:
|
|
4597
|
-
clientOptions:
|
|
4598
|
-
sdkState:
|
|
2960
|
+
headlessInstance: HeadlessUnitilsContextType;
|
|
2961
|
+
clientOptions: ClientOptionsContextType;
|
|
2962
|
+
sdkState: SdkStateContextType;
|
|
2963
|
+
cardFormContext: CardFormContext | null;
|
|
4599
2964
|
/**
|
|
4600
2965
|
* The button variant to use.
|
|
4601
2966
|
* @default "primary"
|
|
@@ -4607,7 +2972,7 @@ declare class CardFormSubmitComponent extends LitElement {
|
|
|
4607
2972
|
*/
|
|
4608
2973
|
disabled: boolean;
|
|
4609
2974
|
private handleClick;
|
|
4610
|
-
render(): TemplateResult<1>;
|
|
2975
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4611
2976
|
}
|
|
4612
2977
|
declare global {
|
|
4613
2978
|
interface HTMLElementTagNameMap {
|
|
@@ -4621,12 +2986,12 @@ declare global {
|
|
|
4621
2986
|
* @fires network-selected - Dispatched when a network is selected with the network name as detail
|
|
4622
2987
|
*/
|
|
4623
2988
|
declare class CardNetworkSelectorComponent extends LitElement {
|
|
4624
|
-
static styles: CSSResult[];
|
|
2989
|
+
static styles: import("lit").CSSResult[];
|
|
4625
2990
|
/**
|
|
4626
2991
|
* Card networks context from provider
|
|
4627
2992
|
*/
|
|
4628
|
-
cardNetworks:
|
|
4629
|
-
headlessUtils:
|
|
2993
|
+
cardNetworks: CardNetworksContextType;
|
|
2994
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
4630
2995
|
private selectedCardNetwork;
|
|
4631
2996
|
/**
|
|
4632
2997
|
* Internal state to track if dropdown is open
|
|
@@ -4707,7 +3072,7 @@ declare class CardNetworkSelectorComponent extends LitElement {
|
|
|
4707
3072
|
* Lifecycle: Remove all event listeners when disconnected
|
|
4708
3073
|
*/
|
|
4709
3074
|
disconnectedCallback(): void;
|
|
4710
|
-
render(): TemplateResult<1>;
|
|
3075
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4711
3076
|
}
|
|
4712
3077
|
declare global {
|
|
4713
3078
|
interface HTMLElementTagNameMap {
|
|
@@ -4724,12 +3089,12 @@ declare global {
|
|
|
4724
3089
|
* Utilizes the collapsable component for smooth transitions
|
|
4725
3090
|
*/
|
|
4726
3091
|
declare class ShowOtherPaymentsComponent extends LitElement {
|
|
4727
|
-
static styles: CSSResult[];
|
|
3092
|
+
static styles: import("lit").CSSResult[];
|
|
4728
3093
|
/**
|
|
4729
3094
|
* Consume the vault manager context to interact with vault state
|
|
4730
3095
|
*/
|
|
4731
|
-
vaultManager:
|
|
4732
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
3096
|
+
vaultManager: VaultManagerContextType;
|
|
3097
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4733
3098
|
}
|
|
4734
3099
|
declare global {
|
|
4735
3100
|
interface HTMLElementTagNameMap {
|
|
@@ -4741,13 +3106,16 @@ declare global {
|
|
|
4741
3106
|
* with proper height calculations based on design system variables.
|
|
4742
3107
|
*/
|
|
4743
3108
|
declare class NativePaymentComponent extends LitElement {
|
|
4744
|
-
static styles: CSSResult[];
|
|
3109
|
+
static styles: import("lit").CSSResult[];
|
|
4745
3110
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
4746
3111
|
paymentManagers: InitializedManagersMap;
|
|
4747
3112
|
computedStyles: CSSStyleDeclaration | null;
|
|
3113
|
+
disabled: boolean;
|
|
4748
3114
|
private _buttonId;
|
|
4749
3115
|
private loadManagerTask;
|
|
3116
|
+
private nativeButtonTask;
|
|
4750
3117
|
constructor();
|
|
3118
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
4751
3119
|
/**
|
|
4752
3120
|
* Calculates the button height based on CSS variables
|
|
4753
3121
|
* Mirrors the calculation used in the host styles
|
|
@@ -4758,7 +3126,13 @@ declare class NativePaymentComponent extends LitElement {
|
|
|
4758
3126
|
*/
|
|
4759
3127
|
private createRenderOptions;
|
|
4760
3128
|
protected updated(changedProperties: PropertyValues): void;
|
|
4761
|
-
|
|
3129
|
+
/**
|
|
3130
|
+
* Updates the disabled overlay based on the current disabled state
|
|
3131
|
+
*/
|
|
3132
|
+
private updateDisabledOverlay;
|
|
3133
|
+
private updateGooglePayOverlay;
|
|
3134
|
+
private updateRegularOverlay;
|
|
3135
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
4762
3136
|
}
|
|
4763
3137
|
declare global {
|
|
4764
3138
|
interface HTMLElementTagNameMap {
|
|
@@ -4766,7 +3140,7 @@ declare global {
|
|
|
4766
3140
|
}
|
|
4767
3141
|
}
|
|
4768
3142
|
declare class PrimerCheckoutCompleteComponent extends LitElement {
|
|
4769
|
-
render(): TemplateResult<1>;
|
|
3143
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4770
3144
|
}
|
|
4771
3145
|
declare global {
|
|
4772
3146
|
interface HTMLElementTagNameMap {
|
|
@@ -4774,8 +3148,8 @@ declare global {
|
|
|
4774
3148
|
}
|
|
4775
3149
|
}
|
|
4776
3150
|
declare class PrimerCheckoutErrorComponent extends LitElement {
|
|
4777
|
-
sdkState:
|
|
4778
|
-
render(): TemplateResult<1>;
|
|
3151
|
+
sdkState: SdkStateContextType;
|
|
3152
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4779
3153
|
}
|
|
4780
3154
|
declare global {
|
|
4781
3155
|
interface HTMLElementTagNameMap {
|
|
@@ -4791,12 +3165,12 @@ declare global {
|
|
|
4791
3165
|
* and how they are displayed based on the current SDK state.
|
|
4792
3166
|
*/
|
|
4793
3167
|
declare class ErrorMessageContainerComponent extends LitElement {
|
|
4794
|
-
static styles: CSSResult[];
|
|
3168
|
+
static styles: import("lit").CSSResult[];
|
|
4795
3169
|
/**
|
|
4796
3170
|
* Consume the SDK state context
|
|
4797
3171
|
* This automatically subscribes to changes in the SDK state
|
|
4798
3172
|
*/
|
|
4799
|
-
protected sdkState?:
|
|
3173
|
+
protected sdkState?: SdkStateContextType;
|
|
4800
3174
|
showProcessingErrors: boolean;
|
|
4801
3175
|
/**
|
|
4802
3176
|
* Determine if an error should be shown
|
|
@@ -4805,7 +3179,7 @@ declare class ErrorMessageContainerComponent extends LitElement {
|
|
|
4805
3179
|
* @returns Boolean indicating whether an error should be shown
|
|
4806
3180
|
*/
|
|
4807
3181
|
private get shouldShowError();
|
|
4808
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
3182
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4809
3183
|
}
|
|
4810
3184
|
declare global {
|
|
4811
3185
|
interface HTMLElementTagNameMap {
|
|
@@ -4813,16 +3187,17 @@ declare global {
|
|
|
4813
3187
|
}
|
|
4814
3188
|
}
|
|
4815
3189
|
declare class PrimerMainComponent extends LitElement {
|
|
4816
|
-
static styles: CSSResult[];
|
|
3190
|
+
static styles: import("lit").CSSResult[];
|
|
4817
3191
|
private hasAssignedContent;
|
|
4818
3192
|
/**
|
|
4819
3193
|
* Inline slotchange event listener.
|
|
4820
3194
|
* Uses assignedNodes with flatten to detect if the slot has any nodes.
|
|
4821
3195
|
*/
|
|
4822
3196
|
private onSlotChange;
|
|
4823
|
-
paymentMethods:
|
|
4824
|
-
sdkState:
|
|
4825
|
-
|
|
3197
|
+
paymentMethods: PaymentMethodsContextType;
|
|
3198
|
+
sdkState: SdkStateContextType;
|
|
3199
|
+
clientOptions: ClientOptionsContextType;
|
|
3200
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4826
3201
|
}
|
|
4827
3202
|
declare global {
|
|
4828
3203
|
interface HTMLElementTagNameMap {
|
|
@@ -4831,9 +3206,8 @@ declare global {
|
|
|
4831
3206
|
}
|
|
4832
3207
|
/**
|
|
4833
3208
|
* Main function to load the Primer SDK with all required dependencies and styles
|
|
4834
|
-
* @returns {Promise<void>} A promise that resolves when loading is complete
|
|
4835
3209
|
*/
|
|
4836
|
-
export declare function loadPrimer():
|
|
3210
|
+
export declare function loadPrimer(): void;
|
|
4837
3211
|
|
|
4838
3212
|
export {
|
|
4839
3213
|
AchPaymentComponent as AchPayment,
|