@basis-theory/basis-theory-js 4.18.0 → 4.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "4.18.0",
3
+ "version": "4.19.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,23 +1,14 @@
1
- import type { Brand, FieldError, ListenableKey, Targeted } from './shared';
1
+ import type { CardMetadata, ElementMetadata, ListenableKey, Targeted } from './shared';
2
2
  type EventType = 'ready' | 'change' | 'focus' | 'blur' | 'keydown';
3
3
  interface BaseEvent<T extends EventType> {
4
4
  type: T;
5
5
  }
6
6
  type ReadyEvent = BaseEvent<'ready'>;
7
- type ChangeEvent = BaseEvent<'change'> & {
8
- empty: boolean;
9
- complete: boolean;
10
- valid?: boolean;
11
- maskSatisfied?: boolean;
12
- errors?: FieldError[];
13
- };
14
- type CardChangeEvent = ChangeEvent & {
15
- cardBrand: Brand;
16
- cardLast4?: string;
17
- cardBin?: string;
18
- };
7
+ type ChangeEvent = BaseEvent<'change'> & ElementMetadata;
8
+ type BlurEvent = BaseEvent<'blur'> & ElementMetadata;
9
+ type CardChangeEvent = ChangeEvent & CardMetadata;
19
10
  type InputFocusEvent = BaseEvent<'focus'> & Targeted;
20
- type InputBlurEvent = BaseEvent<'blur'> & Targeted;
11
+ type InputBlurEvent = BlurEvent & Targeted;
21
12
  type InputKeydownEvent = BaseEvent<'keydown'> & Targeted & {
22
13
  key: ListenableKey;
23
14
  } & Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'shiftKey' | 'metaKey'>;
@@ -18,15 +18,15 @@ interface PropertyError {
18
18
  }
19
19
  interface ElementMetadata {
20
20
  complete: boolean;
21
- valid: boolean;
22
- maskSatisfied?: boolean;
23
21
  empty: boolean;
24
22
  errors?: FieldError[] | Omit<FieldError, 'targetId'>[];
23
+ maskSatisfied?: boolean;
24
+ valid: boolean;
25
25
  }
26
26
  interface CardMetadata {
27
+ cardBin?: string;
27
28
  cardBrand: Brand;
28
29
  cardLast4?: string;
29
- cardBin?: string;
30
30
  }
31
31
  /**
32
32
  * Card brands type