@primer-io/primer-js 0.2.0 → 0.3.0
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 +1314 -843
- package/dist/jsx/index.d.ts +85 -87
- package/dist/primer-loader.d.ts +852 -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";
|
|
@@ -1205,179 +170,213 @@ declare const PaymentMethodType: {
|
|
|
1205
170
|
readonly ATOME: "ATOME";
|
|
1206
171
|
};
|
|
1207
172
|
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;
|
|
173
|
+
export type APIVersionOption = "legacy" | "2.4";
|
|
174
|
+
declare enum HeadlessManagerType {
|
|
175
|
+
CARD = "CARD",
|
|
176
|
+
NATIVE = "NATIVE",
|
|
177
|
+
REDIRECT = "REDIRECT",
|
|
178
|
+
KLARNA = "KLARNA",
|
|
179
|
+
ACH = "ACH"
|
|
1262
180
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
error
|
|
181
|
+
declare enum EventTypes {
|
|
182
|
+
CHANGE = "change",
|
|
183
|
+
ERROR = "error",
|
|
184
|
+
FOCUS = "focus",
|
|
185
|
+
BLUR = "blur",
|
|
186
|
+
CLICK = "click",
|
|
187
|
+
CLOSE = "close",
|
|
188
|
+
CONFIRMED_KLARNA_CATEGORY = "CONFIRMED_KLARNA_CATEGORY",
|
|
189
|
+
CONFIRMED_KLARNA_CATEGORY_ERROR = "CONFIRMED_KLARNA_CATEGORY_ERROR",
|
|
190
|
+
KLARNA_SESSION_UPDATE = "KLARNA_SESSION_UPDATE",
|
|
191
|
+
KLARNA_SESSION_REFRESH_ERROR = "KLARNA_SESSION_REFRESH_ERROR"
|
|
1266
192
|
}
|
|
1267
|
-
export interface
|
|
193
|
+
export interface BasePaymentInstrumentData {
|
|
194
|
+
[key: string]: unknown;
|
|
1268
195
|
}
|
|
1269
|
-
export interface
|
|
1270
|
-
|
|
1271
|
-
|
|
196
|
+
export interface ClientSessionLineItem {
|
|
197
|
+
amount: number;
|
|
198
|
+
description: string;
|
|
199
|
+
discountAmount?: number;
|
|
200
|
+
itemId: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
productType?: "DIGITAL" | "PHYSICAL" | "SHIPPING_FEE";
|
|
203
|
+
quantity: number;
|
|
204
|
+
taxAmount?: number;
|
|
205
|
+
taxCode?: string;
|
|
1272
206
|
}
|
|
1273
|
-
export interface
|
|
1274
|
-
|
|
1275
|
-
|
|
207
|
+
export interface ClientSessionShipping {
|
|
208
|
+
amount: number;
|
|
209
|
+
methodId?: string;
|
|
210
|
+
methodName?: string;
|
|
211
|
+
methodDescription?: string;
|
|
1276
212
|
}
|
|
1277
|
-
export interface
|
|
1278
|
-
|
|
1279
|
-
|
|
213
|
+
export interface ClientSessionFeeItem {
|
|
214
|
+
type?: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
amount: number;
|
|
1280
217
|
}
|
|
1281
|
-
export interface
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
218
|
+
export interface ClientSessionAddress {
|
|
219
|
+
firstName?: string;
|
|
220
|
+
lastName?: string;
|
|
221
|
+
addressLine1?: string;
|
|
222
|
+
addressLine2?: string;
|
|
223
|
+
city?: string;
|
|
224
|
+
state?: string;
|
|
225
|
+
countryCode?: string;
|
|
226
|
+
postalCode?: string;
|
|
1286
227
|
}
|
|
1287
|
-
export interface
|
|
1288
|
-
|
|
228
|
+
export interface ClientSession {
|
|
229
|
+
orderId?: string;
|
|
230
|
+
currencyCode?: string;
|
|
231
|
+
lineItems?: ClientSessionLineItem[];
|
|
232
|
+
totalAmount?: number;
|
|
233
|
+
customerId?: string;
|
|
234
|
+
orderDetails?: {
|
|
235
|
+
countryCode?: string;
|
|
236
|
+
shipping?: ClientSessionShipping;
|
|
237
|
+
fees?: ClientSessionFeeItem[];
|
|
238
|
+
};
|
|
239
|
+
customer?: {
|
|
240
|
+
emailAddress?: string;
|
|
241
|
+
mobileNumber?: string;
|
|
242
|
+
firstName?: string;
|
|
243
|
+
lastName?: string;
|
|
244
|
+
billingAddress?: ClientSessionAddress;
|
|
245
|
+
shippingAddress?: ClientSessionAddress;
|
|
246
|
+
taxId?: string;
|
|
247
|
+
nationalDocumentId?: string;
|
|
248
|
+
};
|
|
249
|
+
paymentMethod?: {
|
|
250
|
+
options?: Record<string, unknown>;
|
|
251
|
+
orderedAllowedCardNetworks?: string[];
|
|
252
|
+
vaultOnSuccess?: boolean;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export interface BackgroundColor {
|
|
256
|
+
colored: string;
|
|
257
|
+
dark: string;
|
|
258
|
+
light: string;
|
|
259
|
+
}
|
|
260
|
+
export interface IconUrl {
|
|
261
|
+
colored: string;
|
|
262
|
+
dark: string;
|
|
263
|
+
light: string;
|
|
264
|
+
}
|
|
265
|
+
export interface InputStyles {
|
|
266
|
+
base?: {
|
|
1289
267
|
color?: string;
|
|
268
|
+
fontFamily?: string;
|
|
269
|
+
fontSize?: string;
|
|
270
|
+
fontWeight?: string;
|
|
271
|
+
lineHeight?: string;
|
|
272
|
+
letterSpacing?: string;
|
|
273
|
+
textTransform?: string;
|
|
274
|
+
background?: string;
|
|
275
|
+
borderRadius?: number | string;
|
|
276
|
+
borderColor?: string | number;
|
|
277
|
+
borderWidth?: string | number;
|
|
278
|
+
borderStyle?: string;
|
|
279
|
+
boxShadow?: string;
|
|
280
|
+
height?: number | string;
|
|
281
|
+
paddingHorizontal?: number;
|
|
282
|
+
hover?: Record<string, unknown>;
|
|
283
|
+
focus?: Record<string, unknown>;
|
|
284
|
+
placeholder?: Record<string, unknown>;
|
|
285
|
+
webkitAutofill?: Record<string, unknown>;
|
|
286
|
+
selection?: Record<string, unknown>;
|
|
287
|
+
};
|
|
288
|
+
error?: Record<string, unknown>;
|
|
289
|
+
}
|
|
290
|
+
export interface InputValidationError {
|
|
291
|
+
field?: string;
|
|
292
|
+
name: string;
|
|
293
|
+
error: string;
|
|
294
|
+
message: string;
|
|
295
|
+
}
|
|
296
|
+
export interface Validation {
|
|
297
|
+
valid: boolean;
|
|
298
|
+
validationErrors: InputValidationError[];
|
|
299
|
+
error?: string;
|
|
300
|
+
}
|
|
301
|
+
export interface InputMetadata {
|
|
302
|
+
errorCode: string | null;
|
|
303
|
+
error: string | null;
|
|
304
|
+
valid: boolean;
|
|
305
|
+
active: boolean;
|
|
306
|
+
dirty: boolean;
|
|
307
|
+
touched: boolean;
|
|
308
|
+
submitted: boolean;
|
|
309
|
+
}
|
|
310
|
+
export interface PaymentMethodConfig {
|
|
311
|
+
id: string;
|
|
312
|
+
type: PaymentMethodType;
|
|
313
|
+
name: string;
|
|
314
|
+
implementationType: "WEB_REDIRECT" | "NATIVE_SDK";
|
|
315
|
+
displayMetadata: {
|
|
316
|
+
button: {
|
|
317
|
+
backgroundColor: BackgroundColor;
|
|
318
|
+
borderColor: {
|
|
319
|
+
dark: string;
|
|
320
|
+
light: string;
|
|
321
|
+
};
|
|
322
|
+
borderWidth: {
|
|
323
|
+
colored: number;
|
|
324
|
+
dark: number;
|
|
325
|
+
light: number;
|
|
326
|
+
};
|
|
327
|
+
cornerRadius: number;
|
|
328
|
+
iconPositionRelativeToText?: "START" | "END";
|
|
329
|
+
iconUrl: IconUrl;
|
|
330
|
+
text?: string;
|
|
331
|
+
textColor?: {
|
|
332
|
+
dark: string;
|
|
333
|
+
light: string;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
overlay: {
|
|
337
|
+
logo: IconUrl;
|
|
338
|
+
backgroundColor: BackgroundColor;
|
|
339
|
+
};
|
|
340
|
+
popup: {
|
|
341
|
+
width: number;
|
|
342
|
+
height: number;
|
|
343
|
+
};
|
|
1290
344
|
};
|
|
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;
|
|
345
|
+
options: {
|
|
346
|
+
captureVaultedCardCvv?: boolean;
|
|
347
|
+
clientId?: string;
|
|
348
|
+
threeDSecureToken?: string;
|
|
349
|
+
threeDSecureInitUrl?: string;
|
|
350
|
+
threeDSecureProvider?: string;
|
|
351
|
+
threeDSecureEnabled?: boolean;
|
|
1337
352
|
};
|
|
353
|
+
forceRedirect?: boolean;
|
|
1338
354
|
}
|
|
1339
|
-
export interface
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
};
|
|
355
|
+
export interface PaymentMethodInfo {
|
|
356
|
+
type: PaymentMethodType;
|
|
357
|
+
managerType: HeadlessManagerType;
|
|
1343
358
|
}
|
|
1344
|
-
export
|
|
1345
|
-
|
|
359
|
+
export type CardNetworkType = "american-express" | "diners-club" | "discover" | "elo" | "hiper" | "hipercard" | "interac" | "jcb" | "maestro" | "mastercard" | "mir" | "unionpay" | "private-label" | "visa";
|
|
360
|
+
export interface CardNetworkDetails {
|
|
361
|
+
displayName: string;
|
|
362
|
+
network: string;
|
|
363
|
+
allowed: boolean;
|
|
1346
364
|
}
|
|
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;
|
|
365
|
+
export interface CardNetworkChangeEvent {
|
|
366
|
+
detectedCardNetworks: {
|
|
367
|
+
items: CardNetworkDetails[];
|
|
368
|
+
preferred?: CardNetworkDetails;
|
|
1366
369
|
};
|
|
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"
|
|
370
|
+
selectableCardNetworks?: {
|
|
371
|
+
items: CardNetworkDetails[];
|
|
372
|
+
preferred?: CardNetworkDetails;
|
|
373
|
+
};
|
|
374
|
+
source: "REMOTE" | "LOCAL" | "LOCAL_FALLBACK";
|
|
1377
375
|
}
|
|
1378
|
-
export interface
|
|
1379
|
-
|
|
376
|
+
export interface CardPaymentMethodSubmitValues {
|
|
377
|
+
cardNetwork?: string;
|
|
1380
378
|
}
|
|
379
|
+
export type CardPreferredFlow = "DEDICATED_SCENE" | "EMBEDDED_IN_HOME";
|
|
1381
380
|
export interface PaymentCardInstrumentData extends BasePaymentInstrumentData {
|
|
1382
381
|
last4Digits: string;
|
|
1383
382
|
first6Digits: string;
|
|
@@ -1456,23 +455,18 @@ export type PayPalVaultedMethod = IVaultedPaymentMethod<PayPalInstrumentData, ty
|
|
|
1456
455
|
export type KlarnaVaultedMethod = IVaultedPaymentMethod<KlarnaInstrumentData, typeof PaymentInstrumentType.KLARNA_CUSTOMER_TOKEN, typeof PaymentMethodType.KLARNA>;
|
|
1457
456
|
export type ACHVaultedMethod = IVaultedPaymentMethod<ACHInstrumentData, typeof PaymentInstrumentType.AUTOMATED_CLEARING_HOUSE, typeof PaymentMethodType.STRIPE_ACH>;
|
|
1458
457
|
export type VaultedPaymentMethod = PaymentCardVaultedMethod | PayPalVaultedMethod | KlarnaVaultedMethod | ACHVaultedMethod | IVaultedPaymentMethod;
|
|
1459
|
-
export
|
|
458
|
+
export interface CardSecurityCodeInputOptions {
|
|
1460
459
|
ariaLabel?: string;
|
|
1461
460
|
container: string | Element | HTMLElement;
|
|
1462
461
|
id?: string;
|
|
1463
|
-
name
|
|
462
|
+
name?: string;
|
|
1464
463
|
placeholder?: string;
|
|
1465
464
|
placement?: "append" | "prepend";
|
|
1466
|
-
properties?:
|
|
465
|
+
properties?: unknown;
|
|
1467
466
|
style?: CheckoutStyle;
|
|
1468
|
-
allowedCharactersMap?: Record<string, string>;
|
|
1469
|
-
};
|
|
1470
|
-
export type SecureInputListener = (...args: unknown[]) => void;
|
|
1471
|
-
export type CardSecurityCodeInputOptions = Omit<SecureInputOptions, "allowedCharactersMap" | "name"> & {
|
|
1472
467
|
cardNetwork?: string;
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
export type CvvInput = {
|
|
468
|
+
}
|
|
469
|
+
export interface CvvInput {
|
|
1476
470
|
frame: HTMLIFrameElement | null;
|
|
1477
471
|
readonly metadata: {
|
|
1478
472
|
readonly errorCode: string | null;
|
|
@@ -1485,571 +479,93 @@ export type CvvInput = {
|
|
|
1485
479
|
};
|
|
1486
480
|
focus(): void;
|
|
1487
481
|
blur(): void;
|
|
1488
|
-
addListener(event: "change" | "blur" | "focus", listener:
|
|
1489
|
-
addEventListener(event: "change" | "blur" | "focus", listener:
|
|
1490
|
-
removeListener(event: "change" | "blur" | "focus", listener:
|
|
482
|
+
addListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): (() => void) | undefined;
|
|
483
|
+
addEventListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): (() => void) | undefined;
|
|
484
|
+
removeListener(event: "change" | "blur" | "focus", listener: (...args: unknown[]) => void): void;
|
|
1491
485
|
name: string;
|
|
1492
486
|
valueToken: string;
|
|
1493
487
|
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
488
|
}
|
|
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;
|
|
489
|
+
export interface Payment {
|
|
490
|
+
id: string;
|
|
491
|
+
orderId: string;
|
|
492
|
+
paymentMethodData?: {
|
|
493
|
+
paymentMethodType: PaymentMethodType;
|
|
494
|
+
reference?: string;
|
|
495
|
+
expiresAt?: string;
|
|
496
|
+
entity?: string;
|
|
1683
497
|
};
|
|
1684
|
-
preferredFlow?: CardPreferredFlow;
|
|
1685
|
-
}
|
|
1686
|
-
export interface ErrorMessageOptions {
|
|
1687
|
-
disabled?: boolean;
|
|
1688
|
-
onErrorMessageShow?: (message: string) => void;
|
|
1689
|
-
onErrorMessageHide?: () => void;
|
|
1690
498
|
}
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
499
|
+
export interface KlarnaPaymentMethodCategory {
|
|
500
|
+
id: string;
|
|
501
|
+
name: string;
|
|
502
|
+
descriptiveAssetUrl: string;
|
|
503
|
+
standardAssetUrl: string;
|
|
1694
504
|
}
|
|
1695
505
|
export interface StripeAchCustomerDetails {
|
|
1696
506
|
emailAddress: string;
|
|
1697
507
|
firstName: string;
|
|
1698
508
|
lastName: string;
|
|
1699
509
|
}
|
|
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;
|
|
510
|
+
export interface PrimerClientErrorOptions<T = unknown> {
|
|
1750
511
|
message: string;
|
|
512
|
+
diagnosticsId?: string;
|
|
513
|
+
severity?: "ERROR" | "DEBUG" | "WARN" | "INFO";
|
|
514
|
+
errorId?: string;
|
|
515
|
+
data?: T;
|
|
516
|
+
isFromDeveloper?: boolean;
|
|
1751
517
|
}
|
|
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"
|
|
518
|
+
declare enum ErrorCode {
|
|
519
|
+
INITIALIZATION_ERROR = "INITIALIZATION_ERROR",
|
|
520
|
+
NO_PAYMENT_METHODS = "NO_PAYMENT_METHODS",
|
|
521
|
+
PRIMER_TEARDOWN = "PRIMER_TEARDOWN",
|
|
522
|
+
PRIMER_SERVER_ERROR = "PRIMER_SERVER_ERROR",
|
|
523
|
+
THREE_DS_AUTH_FAILED = "THREE_DS_AUTH_FAILED",
|
|
524
|
+
TOKENIZATION_ERROR = "TOKENIZATION_ERROR",
|
|
525
|
+
DUPLICATE_PAYMENT_METHOD_ERROR = "DUPLICATE_PAYMENT_METHOD_ERROR",
|
|
526
|
+
CARD_NUMBER_ERROR = "CARD_NUMBER_ERROR",
|
|
527
|
+
PAYMENT_METHOD_NOT_SETUP = "PAYMENT_METHOD_NOT_SETUP",
|
|
528
|
+
PAYMENT_METHOD_NOT_PROVIDED = "PAYMENT_METHOD_NOT_PROVIDED",
|
|
529
|
+
PAYMENT_METHOD_NOT_COMPATIBLE = "PAYMENT_METHOD_NOT_COMPATIBLE",
|
|
530
|
+
RESUME_ERROR = "RESUME_ERROR",
|
|
531
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
532
|
+
PAYMENT_FAILED = "PAYMENT_FAILED",
|
|
533
|
+
PAYMENT_CREATION_ABORTED = "PAYMENT_CREATION_ABORTED",
|
|
534
|
+
PAYMENT_CREATION_DISABLED = "PAYMENT_CREATION_DISABLED",
|
|
535
|
+
CLIENT_SESSION_UPDATE_ERROR = "CLIENT_SESSION_UPDATE_ERROR",
|
|
536
|
+
INVALID_ARGUMENT = "INVALID_ARGUMENT",
|
|
537
|
+
VAULT_FETCH = "VAULT_FETCH",
|
|
538
|
+
VAULT_DELETE = "VAULT_DELETE",
|
|
539
|
+
HEADLESS_VAULT_MANAGER_VALIDATION = "HEADLESS_VAULT_MANAGER_VALIDATION",
|
|
540
|
+
CARD_FORM_VALIDATION_UNEXPECTED_FIELD = "CARD_FORM_VALIDATION_UNEXPECTED_FIELD",
|
|
541
|
+
MISSING_FIRST_NAME_OR_LAST_NAME = "MISSING_FIRST_NAME_OR_LAST_NAME",
|
|
542
|
+
MISSING_EMAIL_ADDRESS = "MISSING_EMAIL_ADDRESS",
|
|
543
|
+
INVALID_FLOW = "INVALID_FLOW"
|
|
2043
544
|
}
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
545
|
+
declare class PrimerClientError<T = unknown> extends Error {
|
|
546
|
+
readonly code: ErrorCode;
|
|
547
|
+
readonly diagnosticsId: string | null;
|
|
548
|
+
readonly data?: T;
|
|
549
|
+
readonly isFromDeveloper: boolean;
|
|
550
|
+
constructor(code: ErrorCode, options: PrimerClientErrorOptions<T>);
|
|
551
|
+
static fromErrorCode(code: ErrorCode, options: PrimerClientErrorOptions): PrimerClientError;
|
|
2048
552
|
}
|
|
2049
553
|
export interface IHeadlessHostedInput {
|
|
2050
|
-
getOptions():
|
|
2051
|
-
|
|
2052
|
-
|
|
554
|
+
getOptions(): {
|
|
555
|
+
placeholder?: string;
|
|
556
|
+
ariaLabel?: string;
|
|
557
|
+
style?: CheckoutStyle;
|
|
558
|
+
};
|
|
559
|
+
setOptions(options: {
|
|
560
|
+
placeholder?: string;
|
|
561
|
+
ariaLabel?: string;
|
|
562
|
+
style?: CheckoutStyle;
|
|
563
|
+
}): void;
|
|
564
|
+
render(container: string | Element | null, options: {
|
|
565
|
+
placeholder?: string;
|
|
566
|
+
ariaLabel?: string;
|
|
567
|
+
style?: CheckoutStyle;
|
|
568
|
+
}): Promise<void>;
|
|
2053
569
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2054
570
|
focus(): void;
|
|
2055
571
|
blur(): void;
|
|
@@ -2067,32 +583,10 @@ export interface ICardPaymentMethodManager {
|
|
|
2067
583
|
validate(): Promise<Validation>;
|
|
2068
584
|
reset(): void;
|
|
2069
585
|
}
|
|
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
586
|
export interface IHeadlessPaymentMethodButton {
|
|
2095
|
-
render(containerId: string | Element, options:
|
|
587
|
+
render(containerId: string | Element, options: {
|
|
588
|
+
style?: Record<string, unknown>;
|
|
589
|
+
}): Promise<void>;
|
|
2096
590
|
setDisabled(disabled: boolean): Promise<void>;
|
|
2097
591
|
clean(): void;
|
|
2098
592
|
focus(): void;
|
|
@@ -2107,8 +601,16 @@ export interface IRedirectPaymentMethodManager {
|
|
|
2107
601
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2108
602
|
}
|
|
2109
603
|
export interface IKlarnaPaymentMethodManager {
|
|
2110
|
-
start(paymentPayload:
|
|
2111
|
-
|
|
604
|
+
start(paymentPayload: {
|
|
605
|
+
paymentMethodCategoryId: string;
|
|
606
|
+
}): Promise<{
|
|
607
|
+
outcome: "APPROVED" | "DENIED";
|
|
608
|
+
}>;
|
|
609
|
+
renderCategory(renderCategoryDetails: {
|
|
610
|
+
containerId: string | Element;
|
|
611
|
+
paymentMethodCategoryId: string;
|
|
612
|
+
onHeightChange: (height: number) => void;
|
|
613
|
+
}): Promise<void>;
|
|
2112
614
|
addEventListener(event: EventTypes, callback: EventListener$1): void;
|
|
2113
615
|
getPaymentMethod(): void;
|
|
2114
616
|
}
|
|
@@ -2120,70 +622,59 @@ export interface IAchPaymentMethodManager {
|
|
|
2120
622
|
declineMandate(): Promise<void>;
|
|
2121
623
|
getPaymentMethod(): void;
|
|
2122
624
|
}
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
625
|
+
export interface HeadlessVaultManager {
|
|
626
|
+
fetchVaultedPaymentMethods(): Promise<VaultedPaymentMethod[]>;
|
|
627
|
+
deleteVaultedPaymentMethod(id: string): Promise<void>;
|
|
628
|
+
startPaymentFlow(id: string, data?: {
|
|
629
|
+
cvv?: string;
|
|
630
|
+
}): Promise<void>;
|
|
631
|
+
createCvvInput(options: CardSecurityCodeInputOptions): Promise<CvvInput | null>;
|
|
2129
632
|
}
|
|
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
633
|
export interface IAssetsManager {
|
|
2145
|
-
getCardNetworkAsset(cardNetwork: string): Promise<
|
|
2146
|
-
|
|
634
|
+
getCardNetworkAsset(cardNetwork: string): Promise<{
|
|
635
|
+
cardUrl: string;
|
|
636
|
+
displayName: string;
|
|
637
|
+
}>;
|
|
638
|
+
getPaymentMethodAsset(type: PaymentMethodType): Promise<{
|
|
639
|
+
backgroundColor: BackgroundColor;
|
|
640
|
+
iconUrl: IconUrl;
|
|
641
|
+
paymentMethodName?: string;
|
|
642
|
+
buttonText?: string;
|
|
643
|
+
displayName?: string;
|
|
644
|
+
} | null>;
|
|
645
|
+
}
|
|
646
|
+
export interface HeadlessSDKUtilities {
|
|
647
|
+
getCardNetworkAsset(network: string): {
|
|
648
|
+
cardUrl: string;
|
|
649
|
+
displayName: string;
|
|
650
|
+
};
|
|
651
|
+
getUIOrderAmount(): string | null;
|
|
652
|
+
getCDNAssets(paymentMethodType: PaymentMethodType): Promise<{
|
|
653
|
+
assets: {
|
|
654
|
+
icon: string;
|
|
655
|
+
};
|
|
656
|
+
colors: {
|
|
657
|
+
background: string;
|
|
658
|
+
main: string;
|
|
659
|
+
};
|
|
660
|
+
description: string | null;
|
|
661
|
+
is_primer_app: boolean;
|
|
662
|
+
name: string;
|
|
663
|
+
website: string | null;
|
|
664
|
+
goatCdnUrl: string;
|
|
665
|
+
} | undefined>;
|
|
666
|
+
getPaymentMethodConfiguration(paymentMethodType: PaymentMethodType): PaymentMethodConfig | undefined;
|
|
2147
667
|
}
|
|
2148
|
-
export type CardNetworkAsset = {
|
|
2149
|
-
cardUrl: string;
|
|
2150
|
-
displayName: string;
|
|
2151
|
-
};
|
|
2152
668
|
export interface CardPaymentMethodManagerOptions {
|
|
2153
|
-
|
|
2154
|
-
|
|
669
|
+
onCardMetadataChange?: (metadata: {
|
|
670
|
+
type: CardNetworkType | null;
|
|
671
|
+
possibleTypes: string[];
|
|
672
|
+
cvvLength: number;
|
|
673
|
+
cardNumberLength: number;
|
|
674
|
+
}) => void;
|
|
2155
675
|
onCardNetworksChange?: (event: CardNetworkChangeEvent) => void;
|
|
2156
676
|
onCardNetworksLoading?: () => void;
|
|
2157
677
|
}
|
|
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
678
|
export interface KlarnaPaymentMethodManagerOptions {
|
|
2188
679
|
onPaymentMethodCategoriesChange?: (paymentMethodCategories: KlarnaPaymentMethodCategory[]) => void;
|
|
2189
680
|
onPaymentMethodAction?: (action: string, data: {
|
|
@@ -2194,33 +685,58 @@ export interface KlarnaPaymentMethodManagerOptions {
|
|
|
2194
685
|
export interface AchPaymentMethodManagerOptions {
|
|
2195
686
|
onCollectBankAccountDetailsComplete?: () => void;
|
|
2196
687
|
}
|
|
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;
|
|
688
|
+
export type PaymentMethodManagerOptions = CardPaymentMethodManagerOptions | KlarnaPaymentMethodManagerOptions | AchPaymentMethodManagerOptions;
|
|
689
|
+
export interface CheckoutStyle {
|
|
690
|
+
fontFaces?: Array<{
|
|
691
|
+
fontFamily?: string;
|
|
692
|
+
src?: string;
|
|
693
|
+
unicodeRange?: string;
|
|
694
|
+
fontVariant?: string;
|
|
695
|
+
fontFeatureSettings?: string;
|
|
696
|
+
fontVariationSettings?: string;
|
|
697
|
+
fontStretch?: string;
|
|
698
|
+
fontWeight?: string;
|
|
699
|
+
fontStyle?: string;
|
|
700
|
+
}>;
|
|
701
|
+
stylesheets?: Array<{
|
|
702
|
+
href: string;
|
|
703
|
+
}>;
|
|
704
|
+
loadingScreen?: {
|
|
705
|
+
color?: string;
|
|
2218
706
|
};
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
707
|
+
input?: InputStyles;
|
|
708
|
+
inputLabel?: Record<string, unknown>;
|
|
709
|
+
inputErrorText?: Record<string, unknown>;
|
|
710
|
+
formSpacings?: {
|
|
711
|
+
betweenLabelAndInput?: string;
|
|
712
|
+
betweenInputs?: string;
|
|
713
|
+
};
|
|
714
|
+
showMorePaymentMethodsButton?: Record<string, unknown>;
|
|
715
|
+
networkError?: Record<string, unknown>;
|
|
716
|
+
submitButton?: Record<string, unknown>;
|
|
717
|
+
vaultTitle?: Record<string, unknown>;
|
|
718
|
+
savedPaymentMethodButton?: Record<string, unknown>;
|
|
719
|
+
paymentMethodButton?: Record<string, unknown>;
|
|
720
|
+
errorMessage?: Record<string, unknown>;
|
|
721
|
+
smallPrint?: Record<string, unknown>;
|
|
722
|
+
directDebit?: Record<string, unknown>;
|
|
723
|
+
vaultMenu?: Record<string, unknown>;
|
|
724
|
+
backButton?: Record<string, unknown>;
|
|
725
|
+
separator?: Record<string, unknown>;
|
|
726
|
+
processingIndicator?: Record<string, unknown>;
|
|
727
|
+
focusCheckoutOnInit?: boolean;
|
|
728
|
+
}
|
|
729
|
+
export interface ThreeDSAuthenticationData {
|
|
730
|
+
responseCode: "AUTH_SUCCESS" | "AUTH_FAILED" | "SKIPPED" | "CHALLENGE";
|
|
731
|
+
reasonCode?: string;
|
|
732
|
+
reasonText?: string;
|
|
733
|
+
protocolVersion: string;
|
|
734
|
+
challengeIssued: boolean;
|
|
735
|
+
}
|
|
736
|
+
export interface VaultData {
|
|
737
|
+
customerId: string;
|
|
2222
738
|
}
|
|
2223
|
-
|
|
739
|
+
type EventListener$1 = (event?: Event) => void;
|
|
2224
740
|
export interface PrimerHeadlessCheckout {
|
|
2225
741
|
createPaymentMethodManager(type: "PAYMENT_CARD", options?: PaymentMethodManagerOptions): Promise<ICardPaymentMethodManager | null>;
|
|
2226
742
|
createPaymentMethodManager(type: "PAYPAL" | "GOOGLE_PAY" | "APPLE_PAY", options?: PaymentMethodManagerOptions): Promise<INativePaymentMethodManager | null>;
|
|
@@ -2229,173 +745,280 @@ export interface PrimerHeadlessCheckout {
|
|
|
2229
745
|
createPaymentMethodManager(type: PaymentMethodType, options?: PaymentMethodManagerOptions): Promise<IRedirectPaymentMethodManager | null>;
|
|
2230
746
|
createVaultManager(): HeadlessVaultManager;
|
|
2231
747
|
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
748
|
configure: (options: Omit<HeadlessUniversalCheckoutOptions, "clientSessionCachingEnabled">) => void;
|
|
2240
749
|
getAssetsManager(): IAssetsManager;
|
|
2241
750
|
start: () => Promise<void>;
|
|
2242
751
|
refreshClientSession(): Promise<boolean>;
|
|
2243
752
|
}
|
|
2244
|
-
export interface
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
753
|
+
export interface HeadlessUniversalCheckoutOptions {
|
|
754
|
+
style?: CheckoutStyle;
|
|
755
|
+
paymentHandling?: "AUTO" | "MANUAL";
|
|
756
|
+
locale?: string;
|
|
757
|
+
card?: {
|
|
758
|
+
cardholderName?: {
|
|
759
|
+
required?: boolean;
|
|
760
|
+
visible?: boolean;
|
|
761
|
+
placeholder?: string;
|
|
762
|
+
};
|
|
763
|
+
cardNumber?: {
|
|
764
|
+
placeholder?: string;
|
|
765
|
+
};
|
|
766
|
+
expiryDate?: {
|
|
767
|
+
placeholder?: string;
|
|
768
|
+
};
|
|
769
|
+
cvv?: {
|
|
770
|
+
placeholder?: string;
|
|
771
|
+
};
|
|
772
|
+
preferredFlow?: CardPreferredFlow;
|
|
2261
773
|
};
|
|
2262
|
-
|
|
2263
|
-
|
|
774
|
+
redirect?: {
|
|
775
|
+
returnUrl?: string;
|
|
776
|
+
forceRedirect?: boolean;
|
|
2264
777
|
};
|
|
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
|
-
|
|
778
|
+
paypal?: PayPalOptions;
|
|
779
|
+
googlePay?: GooglePayOptions;
|
|
780
|
+
applePay?: ApplePayOptions;
|
|
781
|
+
adyenKlarna?: {
|
|
782
|
+
buttonOptions?: {
|
|
783
|
+
text?: string;
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
klarna?: KlarnaOptions;
|
|
787
|
+
directDebit?: {
|
|
788
|
+
customerCountryCode: string;
|
|
789
|
+
companyName: string;
|
|
790
|
+
companyAddress: string;
|
|
791
|
+
customerName?: string;
|
|
792
|
+
customerEmail?: string;
|
|
793
|
+
customerAddressLine1?: string;
|
|
794
|
+
customerAddressLine2?: string;
|
|
795
|
+
customerCity?: string;
|
|
796
|
+
customerPostalCode?: string;
|
|
797
|
+
iban?: string;
|
|
798
|
+
submitButtonLabels?: {
|
|
799
|
+
form?: string;
|
|
800
|
+
mandate: string;
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
giftCard?: {
|
|
804
|
+
logoSrc: string;
|
|
805
|
+
background: string;
|
|
806
|
+
logoAlt?: string;
|
|
807
|
+
text?: string;
|
|
808
|
+
};
|
|
809
|
+
stripe?: {
|
|
810
|
+
publishableKey?: string;
|
|
811
|
+
mandateData?: {
|
|
812
|
+
fullMandateText?: string;
|
|
813
|
+
merchantName?: string;
|
|
814
|
+
};
|
|
815
|
+
} & Record<string, unknown>;
|
|
816
|
+
onAvailablePaymentMethodsLoad: (paymentMethods: PaymentMethodInfo[]) => void;
|
|
817
|
+
clientSessionCachingEnabled?: boolean;
|
|
818
|
+
apiVersion?: APIVersionOption;
|
|
819
|
+
onCheckoutComplete?: (data: {
|
|
820
|
+
payment: Payment | null;
|
|
821
|
+
}) => void;
|
|
822
|
+
onCheckoutFail?: (error: PrimerClientError, data: {
|
|
823
|
+
payment?: Payment;
|
|
824
|
+
}, handler?: {
|
|
825
|
+
showErrorMessage: (errorMessage?: string) => void;
|
|
826
|
+
}) => void;
|
|
827
|
+
onBeforePaymentCreate?: (data: {
|
|
828
|
+
paymentMethodType?: PaymentMethodType;
|
|
829
|
+
}, handler: {
|
|
830
|
+
continuePaymentCreation: () => void;
|
|
831
|
+
abortPaymentCreation: () => void;
|
|
832
|
+
}) => void;
|
|
833
|
+
onPaymentCreationStart?: () => void;
|
|
834
|
+
onPaymentMethodAction?: (data: "PAYMENT_METHOD_SELECTED" | "PAYMENT_METHOD_UNSELECTED", handler: {
|
|
835
|
+
paymentMethodType: PaymentMethodType | null;
|
|
836
|
+
}) => void;
|
|
837
|
+
onClientSessionUpdate?: (clientSession: ClientSession) => void;
|
|
838
|
+
onBeforeClientSessionUpdate?: () => void;
|
|
839
|
+
onTokenizeShouldStart?: (data: {
|
|
840
|
+
paymentMethodType?: PaymentMethodType;
|
|
841
|
+
}) => boolean | Promise<boolean>;
|
|
842
|
+
onTokenizeDidNotStart?: (reason: string) => void;
|
|
843
|
+
onTokenizeStart?: () => void;
|
|
844
|
+
onTokenizeSuccess?: (data: PaymentMethodToken, handler: {
|
|
845
|
+
handleSuccess(): unknown;
|
|
846
|
+
handleFailure(errorMessage?: string): unknown;
|
|
847
|
+
continueWithNewClientToken(clientToken: string): unknown;
|
|
848
|
+
}) => void | Promise<void>;
|
|
849
|
+
onTokenizeError?: (error: PrimerClientError) => void;
|
|
850
|
+
onResumeSuccess?: (data: {
|
|
851
|
+
resumeToken: string;
|
|
852
|
+
paymentId?: string;
|
|
853
|
+
}, handler: {
|
|
854
|
+
handleSuccess(): unknown;
|
|
855
|
+
handleFailure(errorMessage?: string): unknown;
|
|
856
|
+
continueWithNewClientToken(clientToken: string): unknown;
|
|
857
|
+
}) => void;
|
|
858
|
+
onResumePending?: (paymentMethodData: {
|
|
859
|
+
paymentMethodType: PaymentMethodType;
|
|
860
|
+
reference?: string;
|
|
861
|
+
expiresAt?: string;
|
|
862
|
+
entity?: string;
|
|
863
|
+
}) => void;
|
|
864
|
+
onResumeError?: (error: PrimerClientError) => void;
|
|
865
|
+
}
|
|
866
|
+
export interface PaymentMethodToken {
|
|
867
|
+
token: string;
|
|
868
|
+
analyticsId: string;
|
|
869
|
+
tokenType: "SINGLE_USE" | "MULTI_USE";
|
|
870
|
+
paymentInstrumentData: BasePaymentInstrumentData;
|
|
871
|
+
paymentInstrumentType: PaymentInstrumentType;
|
|
872
|
+
threeDSecureAuthentication: ThreeDSAuthenticationData | null;
|
|
873
|
+
vaultData: VaultData | null;
|
|
874
|
+
}
|
|
875
|
+
export interface ApplePayOptions {
|
|
876
|
+
container?: string | Element;
|
|
877
|
+
buttonType?: "plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe";
|
|
878
|
+
buttonStyle?: "white" | "white-outline" | "black";
|
|
879
|
+
captureBillingAddress?: boolean;
|
|
880
|
+
billingOptions?: {
|
|
881
|
+
requiredBillingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
882
|
+
};
|
|
883
|
+
shippingOptions?: {
|
|
884
|
+
requiredShippingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
885
|
+
requireShippingMethod?: boolean;
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
export interface GooglePayOptions {
|
|
889
|
+
container?: string | Element;
|
|
890
|
+
buttonType?: "long" | "short" | "book" | "buy" | "checkout" | "donate" | "order" | "pay" | "plain" | "subscribe";
|
|
891
|
+
buttonColor?: "default" | "black" | "white";
|
|
892
|
+
buttonSizeMode?: "fill" | "static";
|
|
893
|
+
onClick?: () => void;
|
|
894
|
+
captureBillingAddress?: boolean;
|
|
895
|
+
shippingAddressParameters?: {
|
|
896
|
+
phoneNumberRequired?: boolean;
|
|
897
|
+
};
|
|
898
|
+
emailRequired?: boolean;
|
|
899
|
+
requireShippingMethod?: boolean;
|
|
900
|
+
shadowRoot?: boolean;
|
|
901
|
+
}
|
|
902
|
+
export interface PayPalOptions {
|
|
903
|
+
container?: string | Element;
|
|
904
|
+
buttonColor?: "gold" | "blue" | "silver" | "white" | "black";
|
|
905
|
+
buttonShape?: "pill" | "rect";
|
|
906
|
+
buttonSize?: "small" | "medium" | "large" | "responsive";
|
|
907
|
+
buttonHeight?: number;
|
|
908
|
+
buttonLabel?: "checkout" | "credit" | "pay" | "buynow" | "paypal" | "installment";
|
|
909
|
+
buttonTagline?: boolean;
|
|
910
|
+
paymentFlow?: "DEFAULT" | "PREFER_VAULT";
|
|
911
|
+
onClick?: () => void;
|
|
912
|
+
}
|
|
913
|
+
export interface KlarnaOptions {
|
|
914
|
+
paymentFlow?: "DEFAULT" | "PREFER_VAULT";
|
|
915
|
+
recurringPaymentDescription?: string;
|
|
916
|
+
allowedPaymentCategories?: Array<"pay_now" | "pay_later" | "pay_over_time">;
|
|
917
|
+
buttonOptions?: {
|
|
918
|
+
text?: string;
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* PrimerCheckoutOptions defines the configuration options for the Primer checkout.
|
|
923
|
+
* This is an explicit definition of the options rather than a mapped type to make
|
|
924
|
+
* the type more predictable and easier to maintain.
|
|
925
|
+
*/
|
|
926
|
+
export interface PrimerCheckoutOptions {
|
|
927
|
+
clientToken?: string;
|
|
928
|
+
locale?: string;
|
|
929
|
+
apiVersion?: APIVersionOption;
|
|
930
|
+
card?: {
|
|
931
|
+
cardholderName?: {
|
|
932
|
+
required?: boolean;
|
|
933
|
+
};
|
|
934
|
+
};
|
|
935
|
+
applePay?: Omit<ApplePayOptions, "container"> & {
|
|
936
|
+
captureBillingAddress?: boolean;
|
|
937
|
+
billingOptions?: {
|
|
938
|
+
requiredBillingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
939
|
+
};
|
|
940
|
+
shippingOptions?: {
|
|
941
|
+
requiredShippingContactFields?: Array<"emailAddress" | "name" | "phoneNumber" | "postalAddress" | "phoneticName">;
|
|
942
|
+
requireShippingMethod?: boolean;
|
|
943
|
+
};
|
|
944
|
+
};
|
|
945
|
+
googlePay?: Omit<GooglePayOptions, "container">;
|
|
946
|
+
paypal?: Omit<PayPalOptions, "container">;
|
|
947
|
+
klarna?: KlarnaOptions;
|
|
948
|
+
threeDsOptions?: {
|
|
949
|
+
enabled?: boolean;
|
|
950
|
+
preferred?: boolean;
|
|
951
|
+
};
|
|
952
|
+
vault?: {
|
|
953
|
+
enabled: boolean;
|
|
954
|
+
showEmptyState?: boolean;
|
|
955
|
+
};
|
|
956
|
+
stripe?: {
|
|
957
|
+
mandateData: {
|
|
958
|
+
fullMandateText?: string;
|
|
959
|
+
merchantName?: string;
|
|
960
|
+
};
|
|
961
|
+
publishableKey?: string;
|
|
962
|
+
} & Record<string, unknown>;
|
|
963
|
+
submitButton?: {
|
|
964
|
+
amountVisible?: boolean;
|
|
965
|
+
};
|
|
966
|
+
sdkCore?: boolean;
|
|
967
|
+
disabledPayments?: boolean;
|
|
968
|
+
}
|
|
2346
969
|
export type InitializedManager = {
|
|
2347
|
-
type: typeof PaymentMethodType
|
|
970
|
+
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
2348
971
|
manager: IAchPaymentMethodManager;
|
|
2349
972
|
} | {
|
|
2350
|
-
type: typeof PaymentMethodType
|
|
973
|
+
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
2351
974
|
manager: ICardPaymentMethodManager;
|
|
2352
975
|
} | {
|
|
2353
|
-
type: typeof PaymentMethodType
|
|
976
|
+
type: typeof PaymentMethodType.KLARNA;
|
|
2354
977
|
manager: IKlarnaPaymentMethodManager;
|
|
2355
978
|
} | {
|
|
2356
979
|
type: RedirectPaymentMethodTypes;
|
|
2357
980
|
manager: IRedirectPaymentMethodManager;
|
|
2358
981
|
} | {
|
|
2359
|
-
type: typeof PaymentMethodType
|
|
982
|
+
type: typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
2360
983
|
manager: INativePaymentMethodManager;
|
|
2361
984
|
};
|
|
2362
|
-
export type ManagerByType<T extends PaymentMethodType
|
|
985
|
+
export type ManagerByType<T extends PaymentMethodType> = Extract<InitializedManager, {
|
|
2363
986
|
type: T;
|
|
2364
987
|
}>;
|
|
2365
|
-
export interface InitializedManagersMap extends Map<PaymentMethodType
|
|
2366
|
-
get<T extends PaymentMethodType
|
|
988
|
+
export interface InitializedManagersMap extends Map<PaymentMethodType, InitializedManager> {
|
|
989
|
+
get<T extends PaymentMethodType>(key: T): ManagerByType<T> | undefined;
|
|
2367
990
|
}
|
|
2368
|
-
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType
|
|
2369
|
-
export type DynamicPaymentMethodTypes = typeof PaymentMethodType
|
|
2370
|
-
export type NativePaymentMethodTypes = typeof PaymentMethodType
|
|
991
|
+
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>;
|
|
992
|
+
export type DynamicPaymentMethodTypes = typeof PaymentMethodType.STRIPE_ACH;
|
|
993
|
+
export type NativePaymentMethodTypes = typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
2371
994
|
export type RedirectPaymentMethod = {
|
|
2372
995
|
type: RedirectPaymentMethodTypes;
|
|
2373
996
|
managerType: HeadlessManagerType.REDIRECT;
|
|
2374
997
|
};
|
|
2375
998
|
export type InitializedPaymentMethod = {
|
|
2376
|
-
type: typeof PaymentMethodType
|
|
999
|
+
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
2377
1000
|
managerType: HeadlessManagerType.ACH;
|
|
2378
1001
|
} | {
|
|
2379
|
-
type: typeof PaymentMethodType
|
|
1002
|
+
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
2380
1003
|
managerType: HeadlessManagerType.CARD;
|
|
2381
1004
|
} | {
|
|
2382
|
-
type: typeof PaymentMethodType
|
|
1005
|
+
type: typeof PaymentMethodType.KLARNA;
|
|
2383
1006
|
managerType: HeadlessManagerType.KLARNA;
|
|
2384
1007
|
} | {
|
|
2385
|
-
type: typeof PaymentMethodType
|
|
1008
|
+
type: typeof PaymentMethodType.PAYPAL;
|
|
2386
1009
|
managerType: HeadlessManagerType.NATIVE;
|
|
2387
1010
|
} | {
|
|
2388
|
-
type: typeof PaymentMethodType
|
|
1011
|
+
type: typeof PaymentMethodType.GOOGLE_PAY;
|
|
2389
1012
|
managerType: HeadlessManagerType.NATIVE;
|
|
2390
1013
|
} | {
|
|
2391
|
-
type: typeof PaymentMethodType
|
|
1014
|
+
type: typeof PaymentMethodType.APPLE_PAY;
|
|
2392
1015
|
managerType: HeadlessManagerType.NATIVE;
|
|
2393
1016
|
} | RedirectPaymentMethod;
|
|
2394
|
-
export type PaymentMethodByType<T extends PaymentMethodType
|
|
1017
|
+
export type PaymentMethodByType<T extends PaymentMethodType> = Extract<InitializedPaymentMethod, {
|
|
2395
1018
|
type: T;
|
|
2396
1019
|
}>;
|
|
2397
|
-
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType
|
|
2398
|
-
get<T extends PaymentMethodType
|
|
1020
|
+
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType, InitializedPaymentMethod> {
|
|
1021
|
+
get<T extends PaymentMethodType>(key: T): PaymentMethodByType<T> | undefined;
|
|
2399
1022
|
}
|
|
2400
1023
|
export interface AssetsConfig {
|
|
2401
1024
|
backgroundColor: string;
|
|
@@ -2406,7 +1029,7 @@ export declare class InitializedPayments {
|
|
|
2406
1029
|
private readonly _methods;
|
|
2407
1030
|
constructor(map: InitializedPaymentMethodMap);
|
|
2408
1031
|
get<T extends RedirectPaymentMethodTypes>(type: T): RedirectPaymentMethod | undefined;
|
|
2409
|
-
get<T extends (typeof PaymentMethodType
|
|
1032
|
+
get<T extends (typeof PaymentMethodType)[keyof typeof PaymentMethodType]>(type: T): PaymentMethodByType<T> | undefined;
|
|
2410
1033
|
toArray(): InitializedPaymentMethod[];
|
|
2411
1034
|
size(): number;
|
|
2412
1035
|
}
|
|
@@ -2474,16 +1097,20 @@ export interface CardSubmitSuccessPayload {
|
|
|
2474
1097
|
result: unknown;
|
|
2475
1098
|
}
|
|
2476
1099
|
export interface CardSubmitErrorsPayload {
|
|
2477
|
-
errors: unknown
|
|
1100
|
+
errors: unknown;
|
|
1101
|
+
}
|
|
1102
|
+
export interface CardSubmitPayload {
|
|
1103
|
+
source?: string;
|
|
2478
1104
|
}
|
|
2479
1105
|
export interface PrimeAchErrorPayload {
|
|
2480
1106
|
error: Error;
|
|
2481
1107
|
}
|
|
2482
1108
|
export interface PrimerEvents {
|
|
2483
|
-
"primer:state-change": CustomEvent<
|
|
1109
|
+
"primer:state-change": CustomEvent<SdkStateContextType>;
|
|
2484
1110
|
"primer:methods-update": CustomEvent<InitializedPayments>;
|
|
2485
1111
|
"primer:ready": CustomEvent<PrimerJS>;
|
|
2486
|
-
"primer:card-network-change": CustomEvent<
|
|
1112
|
+
"primer:card-network-change": CustomEvent<CardNetworksContextType>;
|
|
1113
|
+
"primer:card-submit": CustomEvent<CardSubmitPayload>;
|
|
2487
1114
|
"primer:card-success": CustomEvent<CardSubmitSuccessPayload>;
|
|
2488
1115
|
"primer:card-error": CustomEvent<CardSubmitErrorsPayload>;
|
|
2489
1116
|
"primer-ach-error": CustomEvent<PrimeAchErrorPayload>;
|
|
@@ -2503,15 +1130,16 @@ declare class PrimerEventsController implements ReactiveController {
|
|
|
2503
1130
|
* @param detail - The payload for the event.
|
|
2504
1131
|
*/
|
|
2505
1132
|
dispatchEvent<K extends keyof PrimerEvents>(type: K, detail: PrimerEvents[K]["detail"]): void;
|
|
2506
|
-
dispatchSdkState(sdkState:
|
|
1133
|
+
dispatchSdkState(sdkState: SdkStateContextType): void;
|
|
2507
1134
|
dispatchPaymentMethods(paymentMethods: InitializedPayments): void;
|
|
2508
1135
|
dispatchCheckoutInitialized(checkoutInstance: PrimerJS): void;
|
|
2509
|
-
dispatchCardNetworkChange(network:
|
|
1136
|
+
dispatchCardNetworkChange(network: CardNetworksContextType): void;
|
|
1137
|
+
dispatchCardSubmit(source?: string): void;
|
|
2510
1138
|
dispatchFormSubmitSuccess(result: unknown): void;
|
|
2511
1139
|
dispatchFormSubmitErrors(errors: unknown): void;
|
|
2512
1140
|
}
|
|
2513
|
-
export type
|
|
2514
|
-
export type
|
|
1141
|
+
export type HeadlessUnitilsContextType = HeadlessSDKUtilities | null;
|
|
1142
|
+
export type KlarnaCategoriesContextType = {
|
|
2515
1143
|
categories: KlarnaPaymentMethodCategory[];
|
|
2516
1144
|
isLoading: boolean;
|
|
2517
1145
|
};
|
|
@@ -2552,6 +1180,7 @@ declare class CompositeStateController<Host extends ReactiveControllerHost> impl
|
|
|
2552
1180
|
export interface VaultManagerInitOptions {
|
|
2553
1181
|
vaultEnabled?: boolean;
|
|
2554
1182
|
captureVaultedCardCvv?: boolean;
|
|
1183
|
+
showEmptyState?: boolean;
|
|
2555
1184
|
}
|
|
2556
1185
|
/**
|
|
2557
1186
|
* Core state interface for vault manager
|
|
@@ -2563,6 +1192,7 @@ export interface VaultManagerState {
|
|
|
2563
1192
|
isUpdating: boolean;
|
|
2564
1193
|
vaultedPaymentMethods: VaultedPaymentMethod[];
|
|
2565
1194
|
cvvRecapture: boolean;
|
|
1195
|
+
showEmptyState: boolean;
|
|
2566
1196
|
createCvvInput: ((options: CardSecurityCodeInputOptions) => Promise<CvvInput | null>) | null;
|
|
2567
1197
|
deleteVaultedPaymentMethod: (paymentMethodId: string) => Promise<void>;
|
|
2568
1198
|
startVaultedPaymentFlow: (options?: {
|
|
@@ -2606,7 +1236,7 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
|
|
|
2606
1236
|
* Fetch vaulted payment methods from the server
|
|
2607
1237
|
*/
|
|
2608
1238
|
fetchVaultedPaymentMethods(initialLoad?: boolean): Promise<VaultedPaymentMethod[]>;
|
|
2609
|
-
createCvvInput(options: CardSecurityCodeInputOptions)
|
|
1239
|
+
createCvvInput: (options: CardSecurityCodeInputOptions) => Promise<CvvInput | null>;
|
|
2610
1240
|
/**
|
|
2611
1241
|
* Delete a vaulted payment method by ID
|
|
2612
1242
|
*/
|
|
@@ -2630,13 +1260,13 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
|
|
|
2630
1260
|
* Context for core vault manager functionality
|
|
2631
1261
|
* Contains properties that don't change frequently and relate to vault functionality
|
|
2632
1262
|
*/
|
|
2633
|
-
export type
|
|
1263
|
+
export type VaultManagerContextType = VaultManagerState | null;
|
|
2634
1264
|
/**
|
|
2635
1265
|
* Context for vault manager CVV-specific state
|
|
2636
1266
|
* Contains properties specifically related to CVV input functionality
|
|
2637
1267
|
* Further separated to minimize re-renders related to frequently changing CVV input state
|
|
2638
1268
|
*/
|
|
2639
|
-
export type
|
|
1269
|
+
export type VaultItemContextType = VaultManagerItemState | null;
|
|
2640
1270
|
declare class SDKContextController implements ReactiveController {
|
|
2641
1271
|
host: PrimerCheckoutType;
|
|
2642
1272
|
private sdkStateProvider;
|
|
@@ -2655,7 +1285,7 @@ declare class SDKContextController implements ReactiveController {
|
|
|
2655
1285
|
* Updates the SDK state context.
|
|
2656
1286
|
* @param value The new SDK state.
|
|
2657
1287
|
*/
|
|
2658
|
-
setSdkState(value:
|
|
1288
|
+
setSdkState(value: SdkStateContextType): void;
|
|
2659
1289
|
/**
|
|
2660
1290
|
* Updates the payment methods context.
|
|
2661
1291
|
* @param value The new payment methods data.
|
|
@@ -2666,13 +1296,13 @@ declare class SDKContextController implements ReactiveController {
|
|
|
2666
1296
|
* @param value The new payment manager mapping.
|
|
2667
1297
|
*/
|
|
2668
1298
|
setPaymentManagers(value: InitializedManagersMap): void;
|
|
2669
|
-
setCardNetworks(value:
|
|
2670
|
-
setVaultManager(value:
|
|
2671
|
-
setKlarnaCategories(value:
|
|
1299
|
+
setCardNetworks(value: CardNetworksContextType): void;
|
|
1300
|
+
setVaultManager(value: VaultManagerContextType): void;
|
|
1301
|
+
setKlarnaCategories(value: KlarnaCategoriesContextType): void;
|
|
2672
1302
|
setClientOptions(value: PrimerCheckoutOptions | null): void;
|
|
2673
|
-
setHeadlessUtils(value:
|
|
1303
|
+
setHeadlessUtils(value: HeadlessUnitilsContextType): void;
|
|
2674
1304
|
setComputedStyles(value: CSSStyleDeclaration): void;
|
|
2675
|
-
setVaultManagerCvv(value:
|
|
1305
|
+
setVaultManagerCvv(value: VaultItemContextType): void;
|
|
2676
1306
|
}
|
|
2677
1307
|
export type SdkStateAction = {
|
|
2678
1308
|
type: "START_PROCESSING";
|
|
@@ -2712,6 +1342,10 @@ declare class SdkStateController extends ReactiveStateController<PrimerCheckoutT
|
|
|
2712
1342
|
resetError(): void;
|
|
2713
1343
|
forceCompleteLoading(): void;
|
|
2714
1344
|
}
|
|
1345
|
+
/**
|
|
1346
|
+
* PrimerCheckoutType defines the interface for the primer-checkout component implementation.
|
|
1347
|
+
* This includes both the properties and controllers needed for internal functionality.
|
|
1348
|
+
*/
|
|
2715
1349
|
export interface PrimerCheckoutType extends ReactiveControllerHost, LitElement {
|
|
2716
1350
|
requestUpdate: ReactiveControllerHost["requestUpdate"];
|
|
2717
1351
|
customStyles: string;
|
|
@@ -2742,7 +1376,7 @@ declare class CardNetworkController implements ReactiveController {
|
|
|
2742
1376
|
*
|
|
2743
1377
|
* @param event - The card network change event
|
|
2744
1378
|
*/
|
|
2745
|
-
processCardNetworkChangeEvent(event: CardNetworkChangeEvent):
|
|
1379
|
+
processCardNetworkChangeEvent(event: CardNetworkChangeEvent): void;
|
|
2746
1380
|
}
|
|
2747
1381
|
declare class StyleProcessingController implements ReactiveController {
|
|
2748
1382
|
host: ReactiveControllerHost & LitElement;
|
|
@@ -2799,146 +1433,6 @@ declare class StyleProcessingController implements ReactiveController {
|
|
|
2799
1433
|
*/
|
|
2800
1434
|
hostDisconnected(): void;
|
|
2801
1435
|
}
|
|
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
1436
|
declare const sourceLocale = `en`;
|
|
2943
1437
|
declare const targetLocales = [
|
|
2944
1438
|
`ar`,
|
|
@@ -2989,6 +1483,16 @@ declare const targetLocales = [
|
|
|
2989
1483
|
`zh-TW`,
|
|
2990
1484
|
] as const;
|
|
2991
1485
|
export type LocaleCode = typeof sourceLocale | (typeof targetLocales)[number];
|
|
1486
|
+
declare global {
|
|
1487
|
+
interface HTMLElementTagNameMap {
|
|
1488
|
+
"primer-checkout": PrimerCheckoutComponent;
|
|
1489
|
+
}
|
|
1490
|
+
type PublicPrimerEvents = Omit<PrimerEvents, "primer-ach-error" | "primer-ach-bank-details-collected" | "primer-ach-mandate-confirmed" | "primer-ach-mandate-declined">;
|
|
1491
|
+
interface DocumentEventMap extends PublicPrimerEvents {
|
|
1492
|
+
}
|
|
1493
|
+
interface HTMLElementEventMap extends PublicPrimerEvents {
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
2992
1496
|
declare class AchPaymentEventsController implements ReactiveController {
|
|
2993
1497
|
host: PrimerCheckoutComponent;
|
|
2994
1498
|
constructor(host: PrimerCheckoutComponent);
|
|
@@ -3014,6 +1518,7 @@ export declare class PrimerCheckoutComponent extends LitElement implements Prime
|
|
|
3014
1518
|
customStyles: string;
|
|
3015
1519
|
clientToken: string;
|
|
3016
1520
|
options: PrimerCheckoutOptions;
|
|
1521
|
+
disableLoader: boolean;
|
|
3017
1522
|
/**
|
|
3018
1523
|
* Whether the component has completed initialization and loading
|
|
3019
1524
|
* This is used to control the CSS-only loader visibility
|
|
@@ -3098,18 +1603,18 @@ declare class SpinnerComponent extends LitElement {
|
|
|
3098
1603
|
* Size of the spinner
|
|
3099
1604
|
* Available values: 'small', 'medium', 'large' or a custom number as string
|
|
3100
1605
|
*/
|
|
3101
|
-
size: SpinnerSize
|
|
1606
|
+
size: SpinnerSize;
|
|
3102
1607
|
/**
|
|
3103
1608
|
* Whether to use compact mode (minimal margins)
|
|
3104
1609
|
* Useful when embedding in inputs
|
|
3105
1610
|
*/
|
|
3106
1611
|
compact: boolean;
|
|
3107
|
-
static styles: CSSResult[];
|
|
1612
|
+
static styles: import("lit").CSSResult[];
|
|
3108
1613
|
/**
|
|
3109
1614
|
* Get the actual size value in pixels
|
|
3110
1615
|
*/
|
|
3111
1616
|
private getSize;
|
|
3112
|
-
render(): TemplateResult<1>;
|
|
1617
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3113
1618
|
}
|
|
3114
1619
|
declare global {
|
|
3115
1620
|
interface HTMLElementTagNameMap {
|
|
@@ -3126,7 +1631,7 @@ declare global {
|
|
|
3126
1631
|
* - Sets proper cursor styling to indicate text input functionality
|
|
3127
1632
|
*/
|
|
3128
1633
|
declare class InputWrapperComponent extends LitElement {
|
|
3129
|
-
static styles: CSSResult[];
|
|
1634
|
+
static styles: import("lit").CSSResult[];
|
|
3130
1635
|
focusWithin: boolean;
|
|
3131
1636
|
hasError: boolean;
|
|
3132
1637
|
private inputSlot;
|
|
@@ -3142,7 +1647,7 @@ declare class InputWrapperComponent extends LitElement {
|
|
|
3142
1647
|
* @returns The primer-input element or null if not found
|
|
3143
1648
|
*/
|
|
3144
1649
|
private findSlottedPrimerInput;
|
|
3145
|
-
render(): TemplateResult<1>;
|
|
1650
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3146
1651
|
}
|
|
3147
1652
|
declare global {
|
|
3148
1653
|
interface HTMLElementTagNameMap {
|
|
@@ -3156,7 +1661,7 @@ declare global {
|
|
|
3156
1661
|
* @slot - Default slot for label text content
|
|
3157
1662
|
*/
|
|
3158
1663
|
declare class InputLabelComponent extends LitElement {
|
|
3159
|
-
static styles: CSSResult[];
|
|
1664
|
+
static styles: import("lit").CSSResult[];
|
|
3160
1665
|
/**
|
|
3161
1666
|
* ID of the form control this label is associated with
|
|
3162
1667
|
*/
|
|
@@ -3165,7 +1670,7 @@ declare class InputLabelComponent extends LitElement {
|
|
|
3165
1670
|
* Whether the label should appear disabled
|
|
3166
1671
|
*/
|
|
3167
1672
|
disabled: boolean;
|
|
3168
|
-
render(): TemplateResult<1>;
|
|
1673
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3169
1674
|
}
|
|
3170
1675
|
declare global {
|
|
3171
1676
|
interface HTMLElementTagNameMap {
|
|
@@ -3177,7 +1682,7 @@ declare global {
|
|
|
3177
1682
|
*/
|
|
3178
1683
|
export type ButtonSelectionState = "default" | "checked";
|
|
3179
1684
|
declare class ButtonComponent extends LitElement {
|
|
3180
|
-
static styles: CSSResult[];
|
|
1685
|
+
static styles: import("lit").CSSResult[];
|
|
3181
1686
|
variant: "primary" | "secondary" | "tertiary";
|
|
3182
1687
|
disabled: boolean;
|
|
3183
1688
|
/**
|
|
@@ -3196,6 +1701,10 @@ declare class ButtonComponent extends LitElement {
|
|
|
3196
1701
|
* Indicates if this button is selectable/checkable
|
|
3197
1702
|
*/
|
|
3198
1703
|
selectable: boolean;
|
|
1704
|
+
/**
|
|
1705
|
+
* Indicates if wraps the slot in a flex container
|
|
1706
|
+
*/
|
|
1707
|
+
flex: boolean;
|
|
3199
1708
|
/**
|
|
3200
1709
|
* Event handler for button click
|
|
3201
1710
|
* If selectable, it will toggle between checked and default states
|
|
@@ -3209,7 +1718,7 @@ declare class ButtonComponent extends LitElement {
|
|
|
3209
1718
|
* Renders the spinner when in loading state
|
|
3210
1719
|
*/
|
|
3211
1720
|
private renderSpinner;
|
|
3212
|
-
render(): TemplateResult<1>;
|
|
1721
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3213
1722
|
}
|
|
3214
1723
|
declare global {
|
|
3215
1724
|
interface HTMLElementTagNameMap {
|
|
@@ -3223,7 +1732,7 @@ declare global {
|
|
|
3223
1732
|
* @slot - Default slot for error message content
|
|
3224
1733
|
*/
|
|
3225
1734
|
declare class InputErrorComponent extends LitElement {
|
|
3226
|
-
static styles: CSSResult[];
|
|
1735
|
+
static styles: import("lit").CSSResult[];
|
|
3227
1736
|
/**
|
|
3228
1737
|
* ID of the form control this error message is associated with
|
|
3229
1738
|
*/
|
|
@@ -3232,7 +1741,7 @@ declare class InputErrorComponent extends LitElement {
|
|
|
3232
1741
|
* Whether the error is currently active/visible
|
|
3233
1742
|
*/
|
|
3234
1743
|
active: boolean;
|
|
3235
|
-
render(): TemplateResult<1>;
|
|
1744
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3236
1745
|
}
|
|
3237
1746
|
declare global {
|
|
3238
1747
|
interface HTMLElementTagNameMap {
|
|
@@ -3242,12 +1751,12 @@ declare global {
|
|
|
3242
1751
|
export type IconName = keyof typeof icons;
|
|
3243
1752
|
declare const icons: Record<string, SVGTemplateResult>;
|
|
3244
1753
|
declare class PrimerIconComponent extends LitElement {
|
|
3245
|
-
static styles: CSSResult[];
|
|
1754
|
+
static styles: import("lit").CSSResult[];
|
|
3246
1755
|
color: string;
|
|
3247
1756
|
size: "lg" | "md" | "sm";
|
|
3248
1757
|
/** The name of the icon to draw - available names can be found under library.ts file */
|
|
3249
1758
|
name?: IconName;
|
|
3250
|
-
render(): TemplateResult<1>;
|
|
1759
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3251
1760
|
}
|
|
3252
1761
|
declare global {
|
|
3253
1762
|
interface HTMLElementTagNameMap {
|
|
@@ -3255,10 +1764,10 @@ declare global {
|
|
|
3255
1764
|
}
|
|
3256
1765
|
}
|
|
3257
1766
|
declare class PrimerCheckoutStateComponent extends LitElement {
|
|
3258
|
-
static styles: CSSResult[];
|
|
1767
|
+
static styles: import("lit").CSSResult[];
|
|
3259
1768
|
type: "complete" | "failure";
|
|
3260
1769
|
description?: string;
|
|
3261
|
-
render(): TemplateResult<1>;
|
|
1770
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3262
1771
|
}
|
|
3263
1772
|
declare global {
|
|
3264
1773
|
interface HTMLElementTagNameMap {
|
|
@@ -3294,7 +1803,7 @@ export type InputEventMap = {
|
|
|
3294
1803
|
* @csspart input - The native input element
|
|
3295
1804
|
*/
|
|
3296
1805
|
declare class InputComponent extends LitElement {
|
|
3297
|
-
static styles: CSSResult[];
|
|
1806
|
+
static styles: import("lit").CSSResult[];
|
|
3298
1807
|
private inputElement;
|
|
3299
1808
|
value: string;
|
|
3300
1809
|
placeholder: string;
|
|
@@ -3310,7 +1819,9 @@ declare class InputComponent extends LitElement {
|
|
|
3310
1819
|
max: string;
|
|
3311
1820
|
step: string;
|
|
3312
1821
|
autocomplete: string;
|
|
3313
|
-
|
|
1822
|
+
private _id;
|
|
1823
|
+
get id(): string;
|
|
1824
|
+
set id(value: string);
|
|
3314
1825
|
private hasFocus;
|
|
3315
1826
|
private hasError;
|
|
3316
1827
|
/**
|
|
@@ -3366,7 +1877,7 @@ declare class InputComponent extends LitElement {
|
|
|
3366
1877
|
* Report the validity of the input element
|
|
3367
1878
|
*/
|
|
3368
1879
|
reportValidity(): boolean;
|
|
3369
|
-
render(): TemplateResult<1>;
|
|
1880
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3370
1881
|
/**
|
|
3371
1882
|
* Type safe event dispatcher - allows consumers to use proper types
|
|
3372
1883
|
* when listening to events from this component
|
|
@@ -3397,7 +1908,7 @@ export type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
|
3397
1908
|
* Uses CSS Grid for smooth animation and incorporates the primary button.
|
|
3398
1909
|
*/
|
|
3399
1910
|
declare class CollapsableComponent extends LitElement {
|
|
3400
|
-
static styles: CSSResult[];
|
|
1911
|
+
static styles: import("lit").CSSResult[];
|
|
3401
1912
|
/**
|
|
3402
1913
|
* The header text for the collapsable
|
|
3403
1914
|
*/
|
|
@@ -3446,7 +1957,7 @@ declare class CollapsableComponent extends LitElement {
|
|
|
3446
1957
|
* Collapse the collapsable programmatically
|
|
3447
1958
|
*/
|
|
3448
1959
|
collapse(): void;
|
|
3449
|
-
render(): TemplateResult<1>;
|
|
1960
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3450
1961
|
}
|
|
3451
1962
|
declare global {
|
|
3452
1963
|
interface HTMLElementTagNameMap {
|
|
@@ -3471,7 +1982,8 @@ declare global {
|
|
|
3471
1982
|
* @csspart error-content - The error text content
|
|
3472
1983
|
*/
|
|
3473
1984
|
declare class ErrorMessageComponent extends LitElement {
|
|
3474
|
-
static styles: CSSResult[];
|
|
1985
|
+
static styles: import("lit").CSSResult[];
|
|
1986
|
+
constructor();
|
|
3475
1987
|
/**
|
|
3476
1988
|
* The error message text to display
|
|
3477
1989
|
*/
|
|
@@ -3484,7 +1996,9 @@ declare class ErrorMessageComponent extends LitElement {
|
|
|
3484
1996
|
* Accessibility role for the error message
|
|
3485
1997
|
* Defaults to "alert" for proper screen reader announcements
|
|
3486
1998
|
*/
|
|
3487
|
-
|
|
1999
|
+
private _role;
|
|
2000
|
+
get role(): string;
|
|
2001
|
+
set role(value: string);
|
|
3488
2002
|
/**
|
|
3489
2003
|
* Internal state to track animation state
|
|
3490
2004
|
* This helps manage proper animations with DOM presence/absence
|
|
@@ -3495,7 +2009,7 @@ declare class ErrorMessageComponent extends LitElement {
|
|
|
3495
2009
|
* Handle visibility changes with proper animation timing
|
|
3496
2010
|
*/
|
|
3497
2011
|
private handleVisibilityChange;
|
|
3498
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2012
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3499
2013
|
}
|
|
3500
2014
|
declare global {
|
|
3501
2015
|
interface HTMLElementTagNameMap {
|
|
@@ -3503,8 +2017,9 @@ declare global {
|
|
|
3503
2017
|
}
|
|
3504
2018
|
}
|
|
3505
2019
|
declare class PortalComponent extends LitElement {
|
|
3506
|
-
static styles: CSSResult[];
|
|
3507
|
-
|
|
2020
|
+
static styles: import("lit").CSSResult[];
|
|
2021
|
+
private _id;
|
|
2022
|
+
get id(): string;
|
|
3508
2023
|
getContainer(): HTMLDivElement;
|
|
3509
2024
|
/**
|
|
3510
2025
|
* Proxies the events sent from the portalled content and
|
|
@@ -3516,7 +2031,7 @@ declare class PortalComponent extends LitElement {
|
|
|
3516
2031
|
private _setupEventListeners;
|
|
3517
2032
|
disconnectedCallback(): void;
|
|
3518
2033
|
private _handleSlotChange;
|
|
3519
|
-
render(): TemplateResult<1>;
|
|
2034
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3520
2035
|
}
|
|
3521
2036
|
declare global {
|
|
3522
2037
|
interface HTMLElementTagNameMap {
|
|
@@ -3524,9 +2039,9 @@ declare global {
|
|
|
3524
2039
|
}
|
|
3525
2040
|
}
|
|
3526
2041
|
declare class DialogComponent extends LitElement {
|
|
3527
|
-
static styles: CSSResult[];
|
|
2042
|
+
static styles: import("lit").CSSResult[];
|
|
3528
2043
|
private _handleCloseClick;
|
|
3529
|
-
render(): TemplateResult<1>;
|
|
2044
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3530
2045
|
}
|
|
3531
2046
|
declare global {
|
|
3532
2047
|
interface HTMLElementTagNameMap {
|
|
@@ -3543,43 +2058,45 @@ declare global {
|
|
|
3543
2058
|
* [ Continue with Klarna ] --> opens a Klarna popup
|
|
3544
2059
|
*/
|
|
3545
2060
|
declare class PrimerKlarnaComponent extends LitElement {
|
|
3546
|
-
static styles: CSSResult[];
|
|
2061
|
+
static styles: import("lit").CSSResult[];
|
|
3547
2062
|
paymentManagers: InitializedManagersMap;
|
|
3548
|
-
sdkState:
|
|
3549
|
-
headlessUtils:
|
|
3550
|
-
klarnaCategories:
|
|
2063
|
+
sdkState: SdkStateContextType;
|
|
2064
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
2065
|
+
klarnaCategories: KlarnaCategoriesContextType | null;
|
|
2066
|
+
disabled: boolean;
|
|
3551
2067
|
private selectedCategory;
|
|
3552
2068
|
private isExpanded;
|
|
3553
2069
|
private headerAriaLabel;
|
|
3554
2070
|
private klarnaContainer;
|
|
3555
2071
|
private _paymentMethodManagerTask;
|
|
3556
|
-
toggleExpand()
|
|
2072
|
+
toggleExpand: () => void;
|
|
3557
2073
|
startKlarnaPayment(): Promise<void>;
|
|
3558
2074
|
renderSelectedCategory(): Promise<void>;
|
|
3559
2075
|
selectCategory(category: string): void;
|
|
3560
2076
|
updated(changedProperties: Map<string, unknown>): void;
|
|
3561
|
-
renderCategorySelection(): TemplateResult<1>;
|
|
3562
|
-
renderExpandedContent(): TemplateResult<1>;
|
|
3563
|
-
render(): typeof nothing | TemplateResult<1> | undefined;
|
|
2077
|
+
renderCategorySelection(): import("lit-html").TemplateResult<1>;
|
|
2078
|
+
renderExpandedContent(): import("lit-html").TemplateResult<1>;
|
|
2079
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1> | undefined;
|
|
3564
2080
|
}
|
|
3565
2081
|
declare global {
|
|
3566
2082
|
interface HTMLElementTagNameMap {
|
|
3567
2083
|
"primer-klarna": PrimerKlarnaComponent;
|
|
3568
2084
|
}
|
|
3569
2085
|
}
|
|
3570
|
-
export type
|
|
2086
|
+
export type PaymentMethodsContextType = InitializedPayments | null;
|
|
3571
2087
|
declare class PaymentMethodComponent extends LitElement {
|
|
3572
|
-
static styles: CSSResult[];
|
|
3573
|
-
type: PaymentMethodType
|
|
3574
|
-
|
|
3575
|
-
|
|
2088
|
+
static styles: import("lit").CSSResult[];
|
|
2089
|
+
type: PaymentMethodType | undefined;
|
|
2090
|
+
disabled: boolean;
|
|
2091
|
+
paymentMethods: PaymentMethodsContextType;
|
|
2092
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3576
2093
|
}
|
|
3577
2094
|
declare global {
|
|
3578
2095
|
interface HTMLElementTagNameMap {
|
|
3579
2096
|
"primer-payment-method": PaymentMethodComponent;
|
|
3580
2097
|
}
|
|
3581
2098
|
}
|
|
3582
|
-
export type
|
|
2099
|
+
export type ClientOptionsContextType = PrimerCheckoutOptions | null;
|
|
3583
2100
|
export type AchField = "firstName" | "lastName" | "emailAddress";
|
|
3584
2101
|
export interface AchFormState {
|
|
3585
2102
|
value: string;
|
|
@@ -3611,12 +2128,12 @@ declare class AchPaymentFormControler implements ReactiveController {
|
|
|
3611
2128
|
hostDisconnected(): void;
|
|
3612
2129
|
}
|
|
3613
2130
|
declare class AchPaymentComponent extends LitElement {
|
|
3614
|
-
static styles: CSSResult[];
|
|
2131
|
+
static styles: import("lit").CSSResult[];
|
|
3615
2132
|
protected readonly formController: AchPaymentFormControler;
|
|
3616
2133
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
3617
2134
|
paymentManagers: InitializedManagersMap;
|
|
3618
|
-
sdkState:
|
|
3619
|
-
clientOptions:
|
|
2135
|
+
sdkState: SdkStateContextType | undefined;
|
|
2136
|
+
clientOptions: ClientOptionsContextType | undefined;
|
|
3620
2137
|
screen: "form" | "mandate";
|
|
3621
2138
|
private isSubmitting;
|
|
3622
2139
|
private _paymentMethodManagerTask;
|
|
@@ -3637,11 +2154,11 @@ declare global {
|
|
|
3637
2154
|
}
|
|
3638
2155
|
}
|
|
3639
2156
|
declare class DynamicPaymentComponent extends LitElement {
|
|
3640
|
-
static styles: CSSResult[];
|
|
2157
|
+
static styles: import("lit").CSSResult[];
|
|
3641
2158
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
3642
2159
|
paymentManagers: InitializedManagersMap;
|
|
3643
|
-
sdkState:
|
|
3644
|
-
headlessUtils:
|
|
2160
|
+
sdkState: SdkStateContextType;
|
|
2161
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3645
2162
|
open: boolean;
|
|
3646
2163
|
private _paymentMethodManagerTask;
|
|
3647
2164
|
private _getAssetsTask;
|
|
@@ -3653,8 +2170,8 @@ declare class DynamicPaymentComponent extends LitElement {
|
|
|
3653
2170
|
private _legacyGetButtonLabel;
|
|
3654
2171
|
private _setupTasks;
|
|
3655
2172
|
start(): void;
|
|
3656
|
-
renderDialog(): typeof nothing | TemplateResult<1>;
|
|
3657
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2173
|
+
renderDialog(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2174
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3658
2175
|
}
|
|
3659
2176
|
declare global {
|
|
3660
2177
|
interface HTMLElementTagNameMap {
|
|
@@ -3662,11 +2179,12 @@ declare global {
|
|
|
3662
2179
|
}
|
|
3663
2180
|
}
|
|
3664
2181
|
declare class RedirectPaymentComponent extends LitElement {
|
|
3665
|
-
static styles: CSSResult[];
|
|
2182
|
+
static styles: import("lit").CSSResult[];
|
|
3666
2183
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
2184
|
+
disabled: boolean;
|
|
3667
2185
|
paymentManagers: InitializedManagersMap;
|
|
3668
|
-
sdkState:
|
|
3669
|
-
headlessUtils:
|
|
2186
|
+
sdkState: SdkStateContextType;
|
|
2187
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3670
2188
|
private _paymentMethodManagerTask;
|
|
3671
2189
|
/**
|
|
3672
2190
|
* Based on packages/primer-sdk-web/src/payment-methods/Button.tsx
|
|
@@ -3676,7 +2194,7 @@ declare class RedirectPaymentComponent extends LitElement {
|
|
|
3676
2194
|
private _getAssetsTask;
|
|
3677
2195
|
private _setupTasks;
|
|
3678
2196
|
startRedirectPayment(): void;
|
|
3679
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2197
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3680
2198
|
}
|
|
3681
2199
|
declare global {
|
|
3682
2200
|
interface HTMLElementTagNameMap {
|
|
@@ -3693,7 +2211,7 @@ export interface VaultManagerEvents {
|
|
|
3693
2211
|
toggleEditMode: CustomEvent<boolean>;
|
|
3694
2212
|
closeError: CustomEvent<void>;
|
|
3695
2213
|
vaultPaymentError: CustomEvent<{
|
|
3696
|
-
error:
|
|
2214
|
+
error: unknown;
|
|
3697
2215
|
}>;
|
|
3698
2216
|
}
|
|
3699
2217
|
/**
|
|
@@ -3711,11 +2229,13 @@ export interface VaultManagerEventMap {
|
|
|
3711
2229
|
* VaultManagerComponent - displays and manages saved payment methods
|
|
3712
2230
|
*/
|
|
3713
2231
|
declare class VaultManagerComponent extends LitElement {
|
|
3714
|
-
static styles: CSSResult[];
|
|
2232
|
+
static styles: import("lit").CSSResult[];
|
|
3715
2233
|
constructor();
|
|
3716
2234
|
addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
3717
2235
|
removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
3718
|
-
vaultManagerContext:
|
|
2236
|
+
vaultManagerContext: VaultManagerContextType;
|
|
2237
|
+
vaultItemContext: VaultItemContextType;
|
|
2238
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3719
2239
|
/**
|
|
3720
2240
|
* Whether we're in edit mode
|
|
3721
2241
|
*/
|
|
@@ -3736,6 +2256,10 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3736
2256
|
* Animation duration override
|
|
3737
2257
|
*/
|
|
3738
2258
|
animationDuration: number;
|
|
2259
|
+
/**
|
|
2260
|
+
* Asset config for the payment method being deleted
|
|
2261
|
+
*/
|
|
2262
|
+
private deleteAssetConfig;
|
|
3739
2263
|
/**
|
|
3740
2264
|
* Get base animation configuration with current settings
|
|
3741
2265
|
*/
|
|
@@ -3787,7 +2311,7 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3787
2311
|
/**
|
|
3788
2312
|
* Main render method
|
|
3789
2313
|
*/
|
|
3790
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2314
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
3791
2315
|
}
|
|
3792
2316
|
/**
|
|
3793
2317
|
* VaultPaymentMethodItemComponent - displays a single payment method
|
|
@@ -3797,7 +2321,7 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
3797
2321
|
* Always renders the primer-button for consistent UI and improved accessibility
|
|
3798
2322
|
*/
|
|
3799
2323
|
declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
3800
|
-
static styles: CSSResult[];
|
|
2324
|
+
static styles: import("lit").CSSResult[];
|
|
3801
2325
|
/**
|
|
3802
2326
|
* Strongly typed event declarations
|
|
3803
2327
|
*/
|
|
@@ -3806,9 +2330,9 @@ declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
|
3806
2330
|
/**
|
|
3807
2331
|
* Consume the vault manager context
|
|
3808
2332
|
*/
|
|
3809
|
-
vaultManagerContext:
|
|
3810
|
-
vaultItemContext:
|
|
3811
|
-
headlessUtils:
|
|
2333
|
+
vaultManagerContext: VaultManagerContextType;
|
|
2334
|
+
vaultItemContext: VaultItemContextType;
|
|
2335
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
3812
2336
|
/**
|
|
3813
2337
|
* The payment method to display
|
|
3814
2338
|
*/
|
|
@@ -3831,14 +2355,10 @@ declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
|
3831
2355
|
* Dispatch delete event
|
|
3832
2356
|
*/
|
|
3833
2357
|
private handleDeleteClick;
|
|
3834
|
-
/**
|
|
3835
|
-
* Builds the common content template shared between modes
|
|
3836
|
-
*/
|
|
3837
|
-
private renderPaymentMethodContent;
|
|
3838
2358
|
/**
|
|
3839
2359
|
* Render method
|
|
3840
2360
|
*/
|
|
3841
|
-
render(): symbol | TemplateResult<1> | undefined;
|
|
2361
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3842
2362
|
}
|
|
3843
2363
|
declare global {
|
|
3844
2364
|
interface HTMLElementTagNameMap {
|
|
@@ -3849,7 +2369,7 @@ declare global {
|
|
|
3849
2369
|
* VaultManagerHeaderComponent - displays the header for the vault manager
|
|
3850
2370
|
*/
|
|
3851
2371
|
declare class VaultManagerHeaderComponent extends LitElement {
|
|
3852
|
-
static styles: CSSResult[];
|
|
2372
|
+
static styles: import("lit").CSSResult[];
|
|
3853
2373
|
/**
|
|
3854
2374
|
* Strongly typed event declarations
|
|
3855
2375
|
*/
|
|
@@ -3870,7 +2390,7 @@ declare class VaultManagerHeaderComponent extends LitElement {
|
|
|
3870
2390
|
/**
|
|
3871
2391
|
* Render method
|
|
3872
2392
|
*/
|
|
3873
|
-
protected render(): TemplateResult<1>;
|
|
2393
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3874
2394
|
}
|
|
3875
2395
|
declare global {
|
|
3876
2396
|
interface HTMLElementTagNameMap {
|
|
@@ -3881,7 +2401,7 @@ declare global {
|
|
|
3881
2401
|
* VaultDeleteConfirmationComponent - displays confirmation UI for deleting a payment method
|
|
3882
2402
|
*/
|
|
3883
2403
|
declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
3884
|
-
static styles: CSSResult[];
|
|
2404
|
+
static styles: import("lit").CSSResult[];
|
|
3885
2405
|
/**
|
|
3886
2406
|
* Strongly typed event declarations
|
|
3887
2407
|
*/
|
|
@@ -3902,7 +2422,7 @@ declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
|
3902
2422
|
/**
|
|
3903
2423
|
* Consume the vault manager context to access payment method info
|
|
3904
2424
|
*/
|
|
3905
|
-
vaultManager:
|
|
2425
|
+
vaultManager: VaultManagerContextType;
|
|
3906
2426
|
/**
|
|
3907
2427
|
* Handle confirm click
|
|
3908
2428
|
*/
|
|
@@ -3914,7 +2434,7 @@ declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
|
3914
2434
|
/**
|
|
3915
2435
|
* Render method
|
|
3916
2436
|
*/
|
|
3917
|
-
protected render(): TemplateResult<1>;
|
|
2437
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3918
2438
|
}
|
|
3919
2439
|
declare global {
|
|
3920
2440
|
interface HTMLElementTagNameMap {
|
|
@@ -3925,11 +2445,11 @@ declare global {
|
|
|
3925
2445
|
* VaultEmptyStateComponent - displays when no payment methods are available
|
|
3926
2446
|
*/
|
|
3927
2447
|
declare class VaultEmptyStateComponent extends LitElement {
|
|
3928
|
-
static styles: CSSResult[];
|
|
2448
|
+
static styles: import("lit").CSSResult[];
|
|
3929
2449
|
/**
|
|
3930
2450
|
* Render method
|
|
3931
2451
|
*/
|
|
3932
|
-
protected render(): TemplateResult<1>;
|
|
2452
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3933
2453
|
}
|
|
3934
2454
|
declare global {
|
|
3935
2455
|
interface HTMLElementTagNameMap {
|
|
@@ -3940,7 +2460,7 @@ declare global {
|
|
|
3940
2460
|
* VaultErrorMessageComponent - displays error messages with improved visuals
|
|
3941
2461
|
*/
|
|
3942
2462
|
declare class VaultErrorMessageComponent extends LitElement {
|
|
3943
|
-
static styles: CSSResult[];
|
|
2463
|
+
static styles: import("lit").CSSResult[];
|
|
3944
2464
|
/**
|
|
3945
2465
|
* Strongly typed event declarations
|
|
3946
2466
|
*/
|
|
@@ -3957,7 +2477,7 @@ declare class VaultErrorMessageComponent extends LitElement {
|
|
|
3957
2477
|
/**
|
|
3958
2478
|
* Render method
|
|
3959
2479
|
*/
|
|
3960
|
-
protected render(): TemplateResult<1>;
|
|
2480
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
3961
2481
|
}
|
|
3962
2482
|
declare global {
|
|
3963
2483
|
interface HTMLElementTagNameMap {
|
|
@@ -3970,7 +2490,7 @@ declare global {
|
|
|
3970
2490
|
* Integrates with the vault manager context to handle payment submission.
|
|
3971
2491
|
*/
|
|
3972
2492
|
declare class VaultPaymentSubmitComponent extends LitElement {
|
|
3973
|
-
static styles: CSSResult[];
|
|
2493
|
+
static styles: import("lit").CSSResult[];
|
|
3974
2494
|
private readonly _userAssignedProps;
|
|
3975
2495
|
private _internalButtonText;
|
|
3976
2496
|
/**
|
|
@@ -3979,10 +2499,10 @@ declare class VaultPaymentSubmitComponent extends LitElement {
|
|
|
3979
2499
|
*/
|
|
3980
2500
|
get buttonText(): string;
|
|
3981
2501
|
set buttonText(value: string);
|
|
3982
|
-
headlessInstance:
|
|
3983
|
-
sdkState:
|
|
3984
|
-
vaultItemContext:
|
|
3985
|
-
vaultManager:
|
|
2502
|
+
headlessInstance: HeadlessUnitilsContextType;
|
|
2503
|
+
sdkState: SdkStateContextType;
|
|
2504
|
+
vaultItemContext: VaultItemContextType;
|
|
2505
|
+
vaultManager: VaultManagerContextType;
|
|
3986
2506
|
clientOptions: PrimerCheckoutOptions | null;
|
|
3987
2507
|
/**
|
|
3988
2508
|
* The button variant to use.
|
|
@@ -4005,7 +2525,7 @@ declare class VaultPaymentSubmitComponent extends LitElement {
|
|
|
4005
2525
|
* Computed property to determine if the button should be disabled
|
|
4006
2526
|
*/
|
|
4007
2527
|
private get isButtonDisabled();
|
|
4008
|
-
render(): TemplateResult<1>;
|
|
2528
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4009
2529
|
}
|
|
4010
2530
|
declare global {
|
|
4011
2531
|
interface HTMLElementTagNameMap {
|
|
@@ -4018,22 +2538,23 @@ declare global {
|
|
|
4018
2538
|
* Uses dedicated CVV context to minimize re-renders
|
|
4019
2539
|
*/
|
|
4020
2540
|
declare class VaultCvvInputComponent extends LitElement {
|
|
4021
|
-
static styles: CSSResult[];
|
|
2541
|
+
static styles: import("lit").CSSResult[];
|
|
4022
2542
|
/**
|
|
4023
2543
|
* Form context for checking form dirty state
|
|
4024
2544
|
*/
|
|
4025
|
-
vaultManagerFormContext:
|
|
2545
|
+
vaultManagerFormContext: VaultManagerContextType;
|
|
4026
2546
|
/**
|
|
4027
2547
|
* CVV-specific context for dedicated CVV handling
|
|
4028
2548
|
* Separated to minimize re-renders on frequent CVV input changes
|
|
4029
2549
|
*/
|
|
4030
|
-
vaultManagerCvvContext:
|
|
2550
|
+
vaultManagerCvvContext: VaultItemContextType;
|
|
4031
2551
|
computedStyles: CSSStyleDeclaration | null;
|
|
4032
2552
|
paymentMethod: PaymentCardVaultedMethod | null;
|
|
4033
2553
|
private cvvError;
|
|
4034
2554
|
private cvvInputIsDirty;
|
|
4035
2555
|
private cvvInputIsBlurred;
|
|
4036
2556
|
private cvvInput;
|
|
2557
|
+
private isFocused;
|
|
4037
2558
|
/**
|
|
4038
2559
|
* Unique ID for the CVV input container
|
|
4039
2560
|
*/
|
|
@@ -4046,16 +2567,62 @@ declare class VaultCvvInputComponent extends LitElement {
|
|
|
4046
2567
|
*/
|
|
4047
2568
|
onCvvInputChange(): void;
|
|
4048
2569
|
onBlur(): void;
|
|
2570
|
+
onFocus(): void;
|
|
4049
2571
|
/**
|
|
4050
2572
|
* Main render method
|
|
4051
2573
|
*/
|
|
4052
|
-
protected render(): symbol | TemplateResult<1> | undefined;
|
|
2574
|
+
protected render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
4053
2575
|
}
|
|
4054
2576
|
declare global {
|
|
4055
2577
|
interface HTMLElementTagNameMap {
|
|
4056
2578
|
"primer-vault-cvv-input": VaultCvvInputComponent;
|
|
4057
2579
|
}
|
|
4058
2580
|
}
|
|
2581
|
+
export interface CardPaymentMethodDisplay {
|
|
2582
|
+
type: "card";
|
|
2583
|
+
cardholderName: string;
|
|
2584
|
+
last4: string;
|
|
2585
|
+
expiresDate: string;
|
|
2586
|
+
network: string;
|
|
2587
|
+
description: string;
|
|
2588
|
+
}
|
|
2589
|
+
export interface OtherPaymentMethodDisplay {
|
|
2590
|
+
type: "other";
|
|
2591
|
+
fullName?: string;
|
|
2592
|
+
paymentMethodType?: "ACH" | "PayPal" | "Klarna";
|
|
2593
|
+
email?: string;
|
|
2594
|
+
last4?: string;
|
|
2595
|
+
bankName?: string;
|
|
2596
|
+
accountType?: string;
|
|
2597
|
+
description: string;
|
|
2598
|
+
}
|
|
2599
|
+
export type AssetConfig = ({
|
|
2600
|
+
icon: string;
|
|
2601
|
+
} & CardPaymentMethodDisplay & {
|
|
2602
|
+
shouldShowCVV: boolean;
|
|
2603
|
+
}) | ({
|
|
2604
|
+
icon: string;
|
|
2605
|
+
} & OtherPaymentMethodDisplay & {
|
|
2606
|
+
shouldShowCVV: boolean;
|
|
2607
|
+
});
|
|
2608
|
+
/**
|
|
2609
|
+
* PaymentMethodContentComponent - renders payment method information with icon and details
|
|
2610
|
+
* This component encapsulates the display logic and styles for payment method content
|
|
2611
|
+
* so it can be reused across different containers without style conflicts
|
|
2612
|
+
*/
|
|
2613
|
+
export declare class PaymentMethodContentComponent extends LitElement {
|
|
2614
|
+
static styles: import("lit").CSSResult[];
|
|
2615
|
+
/**
|
|
2616
|
+
* The asset configuration containing icon and display data
|
|
2617
|
+
*/
|
|
2618
|
+
assetConfig: AssetConfig | null;
|
|
2619
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2620
|
+
}
|
|
2621
|
+
declare global {
|
|
2622
|
+
interface HTMLElementTagNameMap {
|
|
2623
|
+
"primer-payment-method-content": PaymentMethodContentComponent;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
4059
2626
|
declare global {
|
|
4060
2627
|
interface HTMLElementTagNameMap {
|
|
4061
2628
|
"primer-vault-manager": VaultManagerComponent;
|
|
@@ -4066,8 +2633,9 @@ declare global {
|
|
|
4066
2633
|
* It handles form submission, validation, and provides context to child components.
|
|
4067
2634
|
*/
|
|
4068
2635
|
declare class CardFormComponent extends LitElement {
|
|
4069
|
-
static styles: CSSResult[];
|
|
2636
|
+
static styles: import("lit").CSSResult[];
|
|
4070
2637
|
hideLabels: boolean;
|
|
2638
|
+
disabled: boolean;
|
|
4071
2639
|
updated(changedProperties: Map<string, unknown>): void;
|
|
4072
2640
|
/**
|
|
4073
2641
|
* Tracks whether custom content has been provided via slot
|
|
@@ -4120,10 +2688,11 @@ declare class CardFormComponent extends LitElement {
|
|
|
4120
2688
|
* Handles both native form submissions and custom events
|
|
4121
2689
|
*/
|
|
4122
2690
|
private handleFormSubmit;
|
|
4123
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2691
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4124
2692
|
}
|
|
4125
2693
|
export interface CardFormContext {
|
|
4126
2694
|
cardNumberInput: IHeadlessHostedInput;
|
|
2695
|
+
cardHolderNameInput?: IHeadlessHostedInput;
|
|
4127
2696
|
expiryInput: IHeadlessHostedInput;
|
|
4128
2697
|
cvvInput: IHeadlessHostedInput;
|
|
4129
2698
|
setCardholderName: (val: string) => void;
|
|
@@ -4132,6 +2701,7 @@ export interface CardFormContext {
|
|
|
4132
2701
|
submit: (values?: CardPaymentMethodSubmitValues) => Promise<void>;
|
|
4133
2702
|
errors?: Validation["validationErrors"];
|
|
4134
2703
|
hideLabels?: boolean;
|
|
2704
|
+
disabled?: boolean;
|
|
4135
2705
|
}
|
|
4136
2706
|
/**
|
|
4137
2707
|
* A shared type that ensures the host of a HostedInputController contains
|
|
@@ -4148,218 +2718,6 @@ export interface HostedInputHost extends ReactiveControllerHost, LitElement {
|
|
|
4148
2718
|
label: string;
|
|
4149
2719
|
requestUpdate: ReactiveControllerHost["requestUpdate"];
|
|
4150
2720
|
}
|
|
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
2721
|
/**
|
|
4364
2722
|
* Available input types for hosted inputs.
|
|
4365
2723
|
*/
|
|
@@ -4518,13 +2876,13 @@ declare abstract class AbstractCardInputComponent extends LitElement implements
|
|
|
4518
2876
|
/**
|
|
4519
2877
|
* Common rendering logic for all card input components
|
|
4520
2878
|
*/
|
|
4521
|
-
protected renderInput(): typeof nothing | TemplateResult<1>;
|
|
2879
|
+
protected renderInput(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4522
2880
|
}
|
|
4523
2881
|
/**
|
|
4524
2882
|
* Card number input component with dynamic card network detection and selection
|
|
4525
2883
|
*/
|
|
4526
2884
|
declare class InputCardNumberComponent extends AbstractCardInputComponent {
|
|
4527
|
-
static styles: CSSResult[];
|
|
2885
|
+
static styles: import("lit").CSSResult[];
|
|
4528
2886
|
/**
|
|
4529
2887
|
* Configuration for this input component
|
|
4530
2888
|
*/
|
|
@@ -4537,8 +2895,8 @@ declare class InputCardNumberComponent extends AbstractCardInputComponent {
|
|
|
4537
2895
|
/**
|
|
4538
2896
|
* Override the renderInput method to include the network selector
|
|
4539
2897
|
*/
|
|
4540
|
-
protected renderInput(): typeof nothing | TemplateResult<1>;
|
|
4541
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2898
|
+
protected renderInput(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
2899
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4542
2900
|
}
|
|
4543
2901
|
declare global {
|
|
4544
2902
|
interface HTMLElementTagNameMap {
|
|
@@ -4546,10 +2904,10 @@ declare global {
|
|
|
4546
2904
|
}
|
|
4547
2905
|
}
|
|
4548
2906
|
declare class InputCvvComponent extends AbstractCardInputComponent {
|
|
4549
|
-
static styles: CSSResult[];
|
|
2907
|
+
static styles: import("lit").CSSResult[];
|
|
4550
2908
|
protected readonly config: InputComponentConfig;
|
|
4551
2909
|
constructor();
|
|
4552
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2910
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4553
2911
|
}
|
|
4554
2912
|
declare global {
|
|
4555
2913
|
interface HTMLElementTagNameMap {
|
|
@@ -4557,10 +2915,10 @@ declare global {
|
|
|
4557
2915
|
}
|
|
4558
2916
|
}
|
|
4559
2917
|
declare class InputCardExpiryComponent extends AbstractCardInputComponent {
|
|
4560
|
-
static styles: CSSResult[];
|
|
2918
|
+
static styles: import("lit").CSSResult[];
|
|
4561
2919
|
protected readonly config: InputComponentConfig;
|
|
4562
2920
|
constructor();
|
|
4563
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2921
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4564
2922
|
}
|
|
4565
2923
|
declare global {
|
|
4566
2924
|
interface HTMLElementTagNameMap {
|
|
@@ -4568,11 +2926,11 @@ declare global {
|
|
|
4568
2926
|
}
|
|
4569
2927
|
}
|
|
4570
2928
|
declare class InputCardHolderNameComponent extends AbstractCardInputComponent {
|
|
4571
|
-
static styles: CSSResult[];
|
|
2929
|
+
static styles: import("lit").CSSResult[];
|
|
4572
2930
|
protected readonly config: InputComponentConfig;
|
|
4573
2931
|
constructor();
|
|
4574
2932
|
private handleInput;
|
|
4575
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
2933
|
+
render(): typeof import("lit-html").nothing | import("lit-html").TemplateResult<1>;
|
|
4576
2934
|
}
|
|
4577
2935
|
declare global {
|
|
4578
2936
|
interface HTMLElementTagNameMap {
|
|
@@ -4584,7 +2942,7 @@ declare global {
|
|
|
4584
2942
|
* Provides a consistent submit button with translation support.
|
|
4585
2943
|
*/
|
|
4586
2944
|
declare class CardFormSubmitComponent extends LitElement {
|
|
4587
|
-
static styles: CSSResult[];
|
|
2945
|
+
static styles: import("lit").CSSResult[];
|
|
4588
2946
|
private readonly _userAssignedProps;
|
|
4589
2947
|
private _internalButtonText;
|
|
4590
2948
|
/**
|
|
@@ -4593,9 +2951,10 @@ declare class CardFormSubmitComponent extends LitElement {
|
|
|
4593
2951
|
*/
|
|
4594
2952
|
get buttonText(): string;
|
|
4595
2953
|
set buttonText(value: string);
|
|
4596
|
-
headlessInstance:
|
|
4597
|
-
clientOptions:
|
|
4598
|
-
sdkState:
|
|
2954
|
+
headlessInstance: HeadlessUnitilsContextType;
|
|
2955
|
+
clientOptions: ClientOptionsContextType;
|
|
2956
|
+
sdkState: SdkStateContextType;
|
|
2957
|
+
cardFormContext: CardFormContext | null;
|
|
4599
2958
|
/**
|
|
4600
2959
|
* The button variant to use.
|
|
4601
2960
|
* @default "primary"
|
|
@@ -4607,7 +2966,7 @@ declare class CardFormSubmitComponent extends LitElement {
|
|
|
4607
2966
|
*/
|
|
4608
2967
|
disabled: boolean;
|
|
4609
2968
|
private handleClick;
|
|
4610
|
-
render(): TemplateResult<1>;
|
|
2969
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4611
2970
|
}
|
|
4612
2971
|
declare global {
|
|
4613
2972
|
interface HTMLElementTagNameMap {
|
|
@@ -4621,12 +2980,12 @@ declare global {
|
|
|
4621
2980
|
* @fires network-selected - Dispatched when a network is selected with the network name as detail
|
|
4622
2981
|
*/
|
|
4623
2982
|
declare class CardNetworkSelectorComponent extends LitElement {
|
|
4624
|
-
static styles: CSSResult[];
|
|
2983
|
+
static styles: import("lit").CSSResult[];
|
|
4625
2984
|
/**
|
|
4626
2985
|
* Card networks context from provider
|
|
4627
2986
|
*/
|
|
4628
|
-
cardNetworks:
|
|
4629
|
-
headlessUtils:
|
|
2987
|
+
cardNetworks: CardNetworksContextType;
|
|
2988
|
+
headlessUtils: HeadlessUnitilsContextType;
|
|
4630
2989
|
private selectedCardNetwork;
|
|
4631
2990
|
/**
|
|
4632
2991
|
* Internal state to track if dropdown is open
|
|
@@ -4707,7 +3066,7 @@ declare class CardNetworkSelectorComponent extends LitElement {
|
|
|
4707
3066
|
* Lifecycle: Remove all event listeners when disconnected
|
|
4708
3067
|
*/
|
|
4709
3068
|
disconnectedCallback(): void;
|
|
4710
|
-
render(): TemplateResult<1>;
|
|
3069
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4711
3070
|
}
|
|
4712
3071
|
declare global {
|
|
4713
3072
|
interface HTMLElementTagNameMap {
|
|
@@ -4724,12 +3083,12 @@ declare global {
|
|
|
4724
3083
|
* Utilizes the collapsable component for smooth transitions
|
|
4725
3084
|
*/
|
|
4726
3085
|
declare class ShowOtherPaymentsComponent extends LitElement {
|
|
4727
|
-
static styles: CSSResult[];
|
|
3086
|
+
static styles: import("lit").CSSResult[];
|
|
4728
3087
|
/**
|
|
4729
3088
|
* Consume the vault manager context to interact with vault state
|
|
4730
3089
|
*/
|
|
4731
|
-
vaultManager:
|
|
4732
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
3090
|
+
vaultManager: VaultManagerContextType;
|
|
3091
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4733
3092
|
}
|
|
4734
3093
|
declare global {
|
|
4735
3094
|
interface HTMLElementTagNameMap {
|
|
@@ -4741,13 +3100,16 @@ declare global {
|
|
|
4741
3100
|
* with proper height calculations based on design system variables.
|
|
4742
3101
|
*/
|
|
4743
3102
|
declare class NativePaymentComponent extends LitElement {
|
|
4744
|
-
static styles: CSSResult[];
|
|
3103
|
+
static styles: import("lit").CSSResult[];
|
|
4745
3104
|
paymentMethod: InitializedPaymentMethod | undefined;
|
|
4746
3105
|
paymentManagers: InitializedManagersMap;
|
|
4747
3106
|
computedStyles: CSSStyleDeclaration | null;
|
|
3107
|
+
disabled: boolean;
|
|
4748
3108
|
private _buttonId;
|
|
4749
3109
|
private loadManagerTask;
|
|
3110
|
+
private nativeButtonTask;
|
|
4750
3111
|
constructor();
|
|
3112
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
4751
3113
|
/**
|
|
4752
3114
|
* Calculates the button height based on CSS variables
|
|
4753
3115
|
* Mirrors the calculation used in the host styles
|
|
@@ -4758,7 +3120,13 @@ declare class NativePaymentComponent extends LitElement {
|
|
|
4758
3120
|
*/
|
|
4759
3121
|
private createRenderOptions;
|
|
4760
3122
|
protected updated(changedProperties: PropertyValues): void;
|
|
4761
|
-
|
|
3123
|
+
/**
|
|
3124
|
+
* Updates the disabled overlay based on the current disabled state
|
|
3125
|
+
*/
|
|
3126
|
+
private updateDisabledOverlay;
|
|
3127
|
+
private updateGooglePayOverlay;
|
|
3128
|
+
private updateRegularOverlay;
|
|
3129
|
+
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
4762
3130
|
}
|
|
4763
3131
|
declare global {
|
|
4764
3132
|
interface HTMLElementTagNameMap {
|
|
@@ -4766,7 +3134,7 @@ declare global {
|
|
|
4766
3134
|
}
|
|
4767
3135
|
}
|
|
4768
3136
|
declare class PrimerCheckoutCompleteComponent extends LitElement {
|
|
4769
|
-
render(): TemplateResult<1>;
|
|
3137
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4770
3138
|
}
|
|
4771
3139
|
declare global {
|
|
4772
3140
|
interface HTMLElementTagNameMap {
|
|
@@ -4774,8 +3142,8 @@ declare global {
|
|
|
4774
3142
|
}
|
|
4775
3143
|
}
|
|
4776
3144
|
declare class PrimerCheckoutErrorComponent extends LitElement {
|
|
4777
|
-
sdkState:
|
|
4778
|
-
render(): TemplateResult<1>;
|
|
3145
|
+
sdkState: SdkStateContextType;
|
|
3146
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4779
3147
|
}
|
|
4780
3148
|
declare global {
|
|
4781
3149
|
interface HTMLElementTagNameMap {
|
|
@@ -4791,12 +3159,12 @@ declare global {
|
|
|
4791
3159
|
* and how they are displayed based on the current SDK state.
|
|
4792
3160
|
*/
|
|
4793
3161
|
declare class ErrorMessageContainerComponent extends LitElement {
|
|
4794
|
-
static styles: CSSResult[];
|
|
3162
|
+
static styles: import("lit").CSSResult[];
|
|
4795
3163
|
/**
|
|
4796
3164
|
* Consume the SDK state context
|
|
4797
3165
|
* This automatically subscribes to changes in the SDK state
|
|
4798
3166
|
*/
|
|
4799
|
-
protected sdkState?:
|
|
3167
|
+
protected sdkState?: SdkStateContextType;
|
|
4800
3168
|
showProcessingErrors: boolean;
|
|
4801
3169
|
/**
|
|
4802
3170
|
* Determine if an error should be shown
|
|
@@ -4805,7 +3173,7 @@ declare class ErrorMessageContainerComponent extends LitElement {
|
|
|
4805
3173
|
* @returns Boolean indicating whether an error should be shown
|
|
4806
3174
|
*/
|
|
4807
3175
|
private get shouldShowError();
|
|
4808
|
-
render(): typeof nothing | TemplateResult<1>;
|
|
3176
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
4809
3177
|
}
|
|
4810
3178
|
declare global {
|
|
4811
3179
|
interface HTMLElementTagNameMap {
|
|
@@ -4813,16 +3181,17 @@ declare global {
|
|
|
4813
3181
|
}
|
|
4814
3182
|
}
|
|
4815
3183
|
declare class PrimerMainComponent extends LitElement {
|
|
4816
|
-
static styles: CSSResult[];
|
|
3184
|
+
static styles: import("lit").CSSResult[];
|
|
4817
3185
|
private hasAssignedContent;
|
|
4818
3186
|
/**
|
|
4819
3187
|
* Inline slotchange event listener.
|
|
4820
3188
|
* Uses assignedNodes with flatten to detect if the slot has any nodes.
|
|
4821
3189
|
*/
|
|
4822
3190
|
private onSlotChange;
|
|
4823
|
-
paymentMethods:
|
|
4824
|
-
sdkState:
|
|
4825
|
-
|
|
3191
|
+
paymentMethods: PaymentMethodsContextType;
|
|
3192
|
+
sdkState: SdkStateContextType;
|
|
3193
|
+
clientOptions: ClientOptionsContextType;
|
|
3194
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4826
3195
|
}
|
|
4827
3196
|
declare global {
|
|
4828
3197
|
interface HTMLElementTagNameMap {
|
|
@@ -4831,9 +3200,8 @@ declare global {
|
|
|
4831
3200
|
}
|
|
4832
3201
|
/**
|
|
4833
3202
|
* 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
3203
|
*/
|
|
4836
|
-
export declare function loadPrimer():
|
|
3204
|
+
export declare function loadPrimer(): void;
|
|
4837
3205
|
|
|
4838
3206
|
export {
|
|
4839
3207
|
AchPaymentComponent as AchPayment,
|