@battle-racing/br-common-lib 2.4.1 → 3.0.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/constants/hardware/index.d.ts +2 -0
- package/dist/constants/hardware/index.js +2 -0
- package/dist/constants/hardware/screen-status.d.ts +7 -0
- package/dist/constants/hardware/screen-status.js +8 -0
- package/dist/constants/hardware/screen-view.d.ts +9 -0
- package/dist/constants/hardware/screen-view.js +12 -0
- package/dist/types/hardware/KartHardwareState.d.ts +2 -0
- package/dist/types/hardware/screen/ScreenModuleStatus.d.ts +6 -0
- package/dist/types/hardware/screen/ScreenModuleStatus.js +2 -0
- package/dist/types/hardware/screen/ScreenStatus.d.ts +3 -0
- package/dist/types/hardware/screen/ScreenStatus.js +2 -0
- package/dist/types/hardware/screen/ScreenView.d.ts +3 -1
- package/dist/types/hardware/screen/index.d.ts +2 -0
- package/dist/types/hardware/screen/index.js +2 -0
- package/dist/types/response/Response.d.ts +2 -2
- package/dist/types/response/SuccesResponse.d.ts +1 -1
- package/dist/types/response/SuccessResponse.d.ts +5 -0
- package/dist/types/response/SuccessResponse.js +2 -0
- package/dist/types/response/index.d.ts +1 -1
- package/dist/types/socket/SocketHardwareOnDataEventsParams.d.ts +2 -1
- package/dist/types/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +4 -1
- package/package.json +1 -1
- package/src/constants/hardware/index.ts +2 -0
- package/src/constants/hardware/screen-status.ts +6 -0
- package/src/constants/hardware/screen-view.ts +9 -0
- package/src/types/hardware/KartHardwareState.ts +2 -0
- package/src/types/hardware/screen/ScreenModuleStatus.ts +7 -0
- package/src/types/hardware/screen/ScreenStatus.ts +4 -0
- package/src/types/hardware/screen/ScreenView.ts +4 -1
- package/src/types/hardware/screen/index.ts +2 -0
- package/src/types/response/Response.ts +2 -2
- package/src/types/response/{SuccesResponse.ts → SuccessResponse.ts} +1 -1
- package/src/types/response/index.ts +1 -1
- package/src/types/socket/SocketHardwareOnDataEventsParams.ts +2 -0
- package/src/types/socket/serverToClient/SocketKartServerToClientEventsParams.ts +1 -1
|
@@ -20,4 +20,6 @@ __exportStar(require("./flag-media-name"), exports);
|
|
|
20
20
|
__exportStar(require("./flag-status"), exports);
|
|
21
21
|
__exportStar(require("./lights-effect"), exports);
|
|
22
22
|
__exportStar(require("./rgb-status"), exports);
|
|
23
|
+
__exportStar(require("./screen-status"), exports);
|
|
24
|
+
__exportStar(require("./screen-view"), exports);
|
|
23
25
|
__exportStar(require("./speed-status"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCREEN_STATUS = void 0;
|
|
4
|
+
const base_hardware_status_1 = require("./base-hardware-status");
|
|
5
|
+
exports.SCREEN_STATUS = {
|
|
6
|
+
...base_hardware_status_1.BASE_HARDWARE_STATUS,
|
|
7
|
+
DEBUG: 'Debug',
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SCREEN_VIEW: {
|
|
2
|
+
readonly HOME: "Home";
|
|
3
|
+
readonly COUNTDOWN: "Countdown";
|
|
4
|
+
readonly RACE: "Race";
|
|
5
|
+
readonly GAME_SUMMARY: "GameSummary";
|
|
6
|
+
readonly INSTRUCTION_VIDEO: "InstructionVideo";
|
|
7
|
+
readonly BATTLE: "Battle";
|
|
8
|
+
readonly DEBUG: "Debug";
|
|
9
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCREEN_VIEW = void 0;
|
|
4
|
+
exports.SCREEN_VIEW = {
|
|
5
|
+
HOME: 'Home',
|
|
6
|
+
COUNTDOWN: 'Countdown',
|
|
7
|
+
RACE: 'Race',
|
|
8
|
+
GAME_SUMMARY: 'GameSummary',
|
|
9
|
+
INSTRUCTION_VIDEO: 'InstructionVideo',
|
|
10
|
+
BATTLE: 'Battle',
|
|
11
|
+
DEBUG: 'Debug',
|
|
12
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { FlagStatus } from './flag';
|
|
2
2
|
import type { RGBStatus } from './rgb';
|
|
3
|
+
import type { ScreenStatus } from './screen';
|
|
3
4
|
import type { SpeedStatus } from './speed';
|
|
4
5
|
export type KartHardwareState = {
|
|
5
6
|
speed: SpeedStatus | null;
|
|
6
7
|
rgb: RGBStatus | null;
|
|
7
8
|
flag: FlagStatus | null;
|
|
9
|
+
screen: ScreenStatus | null;
|
|
8
10
|
isConnectedToServer: boolean;
|
|
9
11
|
isSteeringWheelPressed: boolean;
|
|
10
12
|
};
|
|
@@ -4,7 +4,9 @@ export * from './ScreenDebugViewInput';
|
|
|
4
4
|
export * from './ScreenFinishViewInput';
|
|
5
5
|
export * from './ScreenGameTimeLeft';
|
|
6
6
|
export * from './ScreenHomeViewInput';
|
|
7
|
+
export * from './ScreenModuleStatus';
|
|
7
8
|
export * from './ScreenRaceViewConfig';
|
|
9
|
+
export * from './ScreenStatus';
|
|
8
10
|
export * from './ScreenUpdateGameViewInput';
|
|
9
11
|
export * from './ScreenView';
|
|
10
12
|
export * from './ScreenViewBaseConfig';
|
|
@@ -20,7 +20,9 @@ __exportStar(require("./ScreenDebugViewInput"), exports);
|
|
|
20
20
|
__exportStar(require("./ScreenFinishViewInput"), exports);
|
|
21
21
|
__exportStar(require("./ScreenGameTimeLeft"), exports);
|
|
22
22
|
__exportStar(require("./ScreenHomeViewInput"), exports);
|
|
23
|
+
__exportStar(require("./ScreenModuleStatus"), exports);
|
|
23
24
|
__exportStar(require("./ScreenRaceViewConfig"), exports);
|
|
25
|
+
__exportStar(require("./ScreenStatus"), exports);
|
|
24
26
|
__exportStar(require("./ScreenUpdateGameViewInput"), exports);
|
|
25
27
|
__exportStar(require("./ScreenView"), exports);
|
|
26
28
|
__exportStar(require("./ScreenViewBaseConfig"), exports);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ErrorResponse } from './ErrorResponse';
|
|
2
|
-
import type {
|
|
3
|
-
export type Response<T> =
|
|
2
|
+
import type { SuccessResponse } from './SuccessResponse';
|
|
3
|
+
export type Response<T> = SuccessResponse<T> | ErrorResponse;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BallSensorDiskThrowerModuleStatus, DiskSensorBallShooterModuleStatus, EmergencyModuleStatus, FlagModuleStatus, RGBModuleStatus, SpeedModuleStatus, StarLaserModuleStatus, SteeringWheelModuleStatus } from '../hardware';
|
|
1
|
+
import type { BallSensorDiskThrowerModuleStatus, DiskSensorBallShooterModuleStatus, EmergencyModuleStatus, FlagModuleStatus, RGBModuleStatus, ScreenModuleStatus, SpeedModuleStatus, StarLaserModuleStatus, SteeringWheelModuleStatus } from '../hardware';
|
|
2
2
|
/** Data that are triggered from Hardware Modules of Kart */
|
|
3
3
|
export type SocketHardwareOnDataEventsParams = {
|
|
4
4
|
'hardware:disk-sensor-ball-shooter:onModuleStatus': DiskSensorBallShooterModuleStatus;
|
|
@@ -9,6 +9,7 @@ export type SocketHardwareOnDataEventsParams = {
|
|
|
9
9
|
'hardware:left-star-back-laser:onModuleStatus': StarLaserModuleStatus;
|
|
10
10
|
'hardware:right-star-front-laser:onModuleStatus': StarLaserModuleStatus;
|
|
11
11
|
'hardware:steering-wheel:onModuleStatus': SteeringWheelModuleStatus;
|
|
12
|
+
'hardware:screen:onModuleStatus': ScreenModuleStatus;
|
|
12
13
|
};
|
|
13
14
|
/** Data that are triggered from Hardware Modules of Game Track */
|
|
14
15
|
export type SocketGameTrackHardwareOnDataEventsParams = {
|
|
@@ -14,7 +14,10 @@ export interface SocketKartEventsParams {
|
|
|
14
14
|
'kart:updated': {
|
|
15
15
|
kart: Kart;
|
|
16
16
|
};
|
|
17
|
-
'kart:init:response': Response<
|
|
17
|
+
'kart:init:response': Response<{
|
|
18
|
+
kart: Kart;
|
|
19
|
+
gameTrack: GameTrack;
|
|
20
|
+
}>;
|
|
18
21
|
/** Whenever the Game Track config changed */
|
|
19
22
|
'kart:gameTrack:updated': {
|
|
20
23
|
gameTrack: GameTrack;
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { FlagStatus } from './flag';
|
|
2
2
|
import type { RGBStatus } from './rgb';
|
|
3
|
+
import type { ScreenStatus } from './screen';
|
|
3
4
|
import type { SpeedStatus } from './speed';
|
|
4
5
|
|
|
5
6
|
export type KartHardwareState = {
|
|
6
7
|
speed: SpeedStatus | null;
|
|
7
8
|
rgb: RGBStatus | null;
|
|
8
9
|
flag: FlagStatus | null;
|
|
10
|
+
screen: ScreenStatus | null;
|
|
9
11
|
isConnectedToServer: boolean;
|
|
10
12
|
isSteeringWheelPressed: boolean;
|
|
11
13
|
};
|
|
@@ -4,7 +4,9 @@ export * from './ScreenDebugViewInput';
|
|
|
4
4
|
export * from './ScreenFinishViewInput';
|
|
5
5
|
export * from './ScreenGameTimeLeft';
|
|
6
6
|
export * from './ScreenHomeViewInput';
|
|
7
|
+
export * from './ScreenModuleStatus';
|
|
7
8
|
export * from './ScreenRaceViewConfig';
|
|
9
|
+
export * from './ScreenStatus';
|
|
8
10
|
export * from './ScreenUpdateGameViewInput';
|
|
9
11
|
export * from './ScreenView';
|
|
10
12
|
export * from './ScreenViewBaseConfig';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ErrorResponse } from './ErrorResponse';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SuccessResponse } from './SuccessResponse';
|
|
3
3
|
|
|
4
|
-
export type Response<T> =
|
|
4
|
+
export type Response<T> = SuccessResponse<T> | ErrorResponse;
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
EmergencyModuleStatus,
|
|
5
5
|
FlagModuleStatus,
|
|
6
6
|
RGBModuleStatus,
|
|
7
|
+
ScreenModuleStatus,
|
|
7
8
|
SpeedModuleStatus,
|
|
8
9
|
StarLaserModuleStatus,
|
|
9
10
|
SteeringWheelModuleStatus,
|
|
@@ -19,6 +20,7 @@ export type SocketHardwareOnDataEventsParams = {
|
|
|
19
20
|
'hardware:left-star-back-laser:onModuleStatus': StarLaserModuleStatus;
|
|
20
21
|
'hardware:right-star-front-laser:onModuleStatus': StarLaserModuleStatus;
|
|
21
22
|
'hardware:steering-wheel:onModuleStatus': SteeringWheelModuleStatus;
|
|
23
|
+
'hardware:screen:onModuleStatus': ScreenModuleStatus;
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
/** Data that are triggered from Hardware Modules of Game Track */
|
|
@@ -17,7 +17,7 @@ export type SocketKartPowerUpEventsParams = {
|
|
|
17
17
|
export interface SocketKartEventsParams {
|
|
18
18
|
'kart:updated': { kart: Kart };
|
|
19
19
|
// Response from server
|
|
20
|
-
'kart:init:response': Response<Kart>;
|
|
20
|
+
'kart:init:response': Response<{ kart: Kart; gameTrack: GameTrack }>;
|
|
21
21
|
/** Whenever the Game Track config changed */
|
|
22
22
|
'kart:gameTrack:updated': { gameTrack: GameTrack };
|
|
23
23
|
/** When the physical button of the game track is pressed */
|