@starfish-codes/hellgate 3.5.3 → 3.6.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.
@@ -17,6 +17,7 @@ type ChangeEvent<Value> = BaseEvent<'change', {
17
17
  complete: boolean;
18
18
  valid?: boolean;
19
19
  error?: string;
20
+ errorCode?: CardValidationError;
20
21
  value: Value extends never ? never : Value | null;
21
22
  }>;
22
23
  type InputFocusEvent = BaseEvent<'focus'>;
@@ -39,11 +40,18 @@ interface Subscription {
39
40
  export type { BaseElementEvents, BaseEvent, CardElementEvents, ChangeEvent, ElementEventListener, EventType, FindByType, InputBlurEvent, InputFocusEvent, InputKeydownEvent, ReadyEvent, Subscription, };
40
41
  export type ElementType = 'card' | 'cardNumber' | 'cardExpirationDate' | 'cardVerificationCode' | 'text';
41
42
  export declare const ELEMENT_TYPES: ElementType[];
43
+ export declare enum CardValidationError {
44
+ NOT_COMPLETE = "NOT_COMPLETE",
45
+ SCHEME_NOT_SUPPORTED = "SCHEME_NOT_SUPPORTED",
46
+ LUHN_CHECK_FAILED = "LUHN_CHECK_FAILED",
47
+ INVALID_EXPIRY_DATE = "INVALID_EXPIRY_DATE"
48
+ }
42
49
  export type ElementMetadata = {
43
50
  complete: boolean;
44
51
  valid: boolean;
45
52
  empty: boolean;
46
53
  error?: string;
54
+ errorCode?: CardValidationError;
47
55
  };
48
56
  export interface BaseElement<UpdateOptions, ElementEvents, Value> {
49
57
  value: Value | null;