@etsoo/shared 1.2.38 → 1.2.40

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.
@@ -18,7 +18,12 @@ test('Tests for IdLabelType', () => {
18
18
  });
19
19
 
20
20
  test('Tests for Bigint Type', () => {
21
- const item: DataTypes.IdLabelItem<bigint> = {
21
+ type BigintType = {
22
+ id: bigint;
23
+ label: string;
24
+ };
25
+
26
+ const item: BigintType = {
22
27
  id: 9007199254740999n,
23
28
  label: 'Etsoo'
24
29
  };
@@ -29,7 +34,7 @@ test('Tests for Bigint Type', () => {
29
34
  const itemBack = JSON.parse(
30
35
  json,
31
36
  DataTypes.jsonBigintReceiver('id')
32
- ) as DataTypes.IdLabelItem<bigint>;
37
+ ) as BigintType;
33
38
  expect(itemBack.id).toBe(9007199254740999n);
34
39
  });
35
40
 
@@ -1,5 +1,15 @@
1
1
  import { Keyboard } from '../src/Keyboard';
2
2
 
3
+ test('Tests for KeyboardEvent.key', () => {
4
+ const event = new KeyboardEvent('keydown', { key: ' ' });
5
+ const callback = (e: KeyboardEvent) => {
6
+ expect(e.key).toBe(Keyboard.Keys.Space);
7
+ };
8
+ window.addEventListener('keydown', callback);
9
+ window.dispatchEvent(event);
10
+ window.removeEventListener('keydown', callback);
11
+ });
12
+
3
13
  test('Tests for isTypingContent', () => {
4
14
  expect(Keyboard.isTypingContent(Keyboard.Keys.A)).toBeTruthy();
5
15
  expect(Keyboard.isTypingContent(Keyboard.Keys.Ampersand)).toBeTruthy();
@@ -418,7 +418,7 @@ export declare namespace DataTypes {
418
418
  /**
419
419
  * Number and string combination id type
420
420
  */
421
- export type IdType = number | bigint | string;
421
+ export type IdType = number | string;
422
422
  /**
423
423
  * List item with number id type
424
424
  */
@@ -15,7 +15,7 @@ export declare namespace Keyboard {
15
15
  Pause = "Pause",
16
16
  CapsLock = "CapsLock",
17
17
  Escape = "Escape",
18
- Space = "",
18
+ Space = " ",
19
19
  PageUp = "PageUp",
20
20
  PageDown = "PageDown",
21
21
  End = "End",
@@ -20,7 +20,7 @@ var Keyboard;
20
20
  Keys["Pause"] = "Pause";
21
21
  Keys["CapsLock"] = "CapsLock";
22
22
  Keys["Escape"] = "Escape";
23
- Keys["Space"] = "";
23
+ Keys["Space"] = " ";
24
24
  Keys["PageUp"] = "PageUp";
25
25
  Keys["PageDown"] = "PageDown";
26
26
  Keys["End"] = "End";
@@ -418,7 +418,7 @@ export declare namespace DataTypes {
418
418
  /**
419
419
  * Number and string combination id type
420
420
  */
421
- export type IdType = number | bigint | string;
421
+ export type IdType = number | string;
422
422
  /**
423
423
  * List item with number id type
424
424
  */
@@ -15,7 +15,7 @@ export declare namespace Keyboard {
15
15
  Pause = "Pause",
16
16
  CapsLock = "CapsLock",
17
17
  Escape = "Escape",
18
- Space = "",
18
+ Space = " ",
19
19
  PageUp = "PageUp",
20
20
  PageDown = "PageDown",
21
21
  End = "End",
@@ -17,7 +17,7 @@ export var Keyboard;
17
17
  Keys["Pause"] = "Pause";
18
18
  Keys["CapsLock"] = "CapsLock";
19
19
  Keys["Escape"] = "Escape";
20
- Keys["Space"] = "";
20
+ Keys["Space"] = " ";
21
21
  Keys["PageUp"] = "PageUp";
22
22
  Keys["PageDown"] = "PageDown";
23
23
  Keys["End"] = "End";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.2.38",
3
+ "version": "1.2.40",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/DataTypes.ts CHANGED
@@ -805,7 +805,7 @@ export namespace DataTypes {
805
805
  /**
806
806
  * Number and string combination id type
807
807
  */
808
- export type IdType = number | bigint | string;
808
+ export type IdType = number | string;
809
809
 
810
810
  /**
811
811
  * List item with number id type
package/src/Keyboard.ts CHANGED
@@ -15,7 +15,7 @@ export namespace Keyboard {
15
15
  Pause = 'Pause',
16
16
  CapsLock = 'CapsLock',
17
17
  Escape = 'Escape',
18
- Space = '',
18
+ Space = ' ',
19
19
  PageUp = 'PageUp',
20
20
  PageDown = 'PageDown',
21
21
  End = 'End',