-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared.ts
70 lines (58 loc) · 1.19 KB
/
shared.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import {
AUTOCOMPLETE_VALUES,
CARD_BRANDS,
CARD_ICON_POSITIONS,
} from '@/elements/constants';
type FieldErrorType = 'incomplete' | 'invalid';
type ConfigErrorType =
| 'missing-configuration'
| 'missing-permission'
| 'invalid-configuration';
interface ConfigError {
type: ConfigErrorType;
message: string;
}
interface Targeted {
targetId: string;
}
type ListenableKey = 'Escape' | 'Enter';
interface FieldError {
targetId: string;
type: FieldErrorType;
}
interface PropertyError {
type: FieldErrorType;
}
/**
* Card brands type
*/
type Brand = typeof CARD_BRANDS[number];
/**
* Icon position for card number element
*/
type CardIconPosition = typeof CARD_ICON_POSITIONS[number];
/**
* Values for the element input autocomplete attribute
*/
type AutoCompleteValue = typeof AUTOCOMPLETE_VALUES[number];
/**
* Type used for detokenization responses stored on Data Elements
*/
type DataElementReference = {
correlationId: string;
elementId: string;
path: string;
};
export type {
FieldErrorType,
ConfigErrorType,
ConfigError,
Targeted,
ListenableKey,
FieldError,
PropertyError,
Brand,
CardIconPosition,
AutoCompleteValue,
DataElementReference,
};