@battle-racing/br-common-lib 6.2.0-rc.0 → 6.2.0-rc.2
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/__deprecated__/constants/hardware/screen-view.d.ts +1 -0
- package/dist/__deprecated__/constants/hardware/screen-view.js +1 -0
- package/dist/data/all-tutorial-steps.d.ts +2 -0
- package/dist/data/all-tutorial-steps.js +379 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.js +1 -0
- package/dist/domains/hardware/ModuleStatus.schema.d.ts +1 -0
- package/dist/domains/hardware/screen/Screen.const.d.ts +1 -0
- package/dist/domains/hardware/screen/Screen.const.js +1 -0
- package/dist/domains/hardware/screen/Screen.schema.d.ts +2 -0
- package/dist/domains/socket/clientToServer/SocketKartClientToServerEventsParams.d.ts +3 -0
- package/dist/domains/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +3 -0
- package/dist/domains/tutorial/Tutorial.const.d.ts +30 -0
- package/dist/domains/tutorial/Tutorial.const.js +31 -1
- package/dist/domains/tutorial/Tutorial.schema.d.ts +139 -0
- package/dist/domains/tutorial/Tutorial.schema.js +56 -1
- package/dist/domains/tutorial/Tutorial.types.d.ts +10 -1
- package/dist/domains/tutorial/TutorialConfig.schema.d.ts +2781 -0
- package/dist/domains/tutorial/TutorialConfig.schema.js +43 -0
- package/dist/domains/tutorial/TutorialConfig.types.d.ts +9 -0
- package/dist/domains/tutorial/TutorialConfig.types.js +2 -0
- package/dist/domains/tutorial/index.d.ts +2 -0
- package/dist/domains/tutorial/index.js +2 -0
- package/package.json +1 -1
- package/src/__deprecated__/constants/hardware/screen-view.ts +1 -0
- package/src/data/all-tutorial-steps.ts +388 -0
- package/src/data/index.ts +1 -1
- package/src/domains/hardware/screen/Screen.const.ts +1 -0
- package/src/domains/socket/clientToServer/SocketKartClientToServerEventsParams.ts +3 -0
- package/src/domains/socket/serverToClient/SocketKartServerToClientEventsParams.ts +3 -0
- package/src/domains/tutorial/Tutorial.const.ts +36 -0
- package/src/domains/tutorial/Tutorial.schema.ts +74 -1
- package/src/domains/tutorial/Tutorial.types.ts +21 -1
- package/src/domains/tutorial/TutorialConfig.schema.ts +52 -0
- package/src/domains/tutorial/TutorialConfig.types.ts +18 -0
- package/src/domains/tutorial/index.ts +2 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { allCommandsConfigSchema } from '../command/Command.schema';
|
|
3
|
+
import { TUTORIAL_LISTEN_EVENT_ON } from './Tutorial.const';
|
|
4
|
+
import {
|
|
5
|
+
tutorialLogicalCheckpointSchema,
|
|
6
|
+
tutorialPhaseIdSchema,
|
|
7
|
+
tutorialScreenStepSchema,
|
|
8
|
+
tutorialSteeringWheelButtonSchema,
|
|
9
|
+
} from './Tutorial.schema';
|
|
10
|
+
|
|
11
|
+
export const tutorialTimeoutListenEventSchema = z.object({
|
|
12
|
+
on: z.literal(TUTORIAL_LISTEN_EVENT_ON.TIMEOUT),
|
|
13
|
+
durationMs: z.number().int().positive(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const tutorialWheelButtonListenEventSchema = z.object({
|
|
17
|
+
on: z.literal(TUTORIAL_LISTEN_EVENT_ON.WHEEL_BUTTON),
|
|
18
|
+
button: tutorialSteeringWheelButtonSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const tutorialCheckpointListenEventSchema = z.object({
|
|
22
|
+
on: z.literal(TUTORIAL_LISTEN_EVENT_ON.CHECKPOINT),
|
|
23
|
+
checkpoint: tutorialLogicalCheckpointSchema,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const tutorialListenEventSchema = z.discriminatedUnion('on', [
|
|
27
|
+
tutorialTimeoutListenEventSchema,
|
|
28
|
+
tutorialWheelButtonListenEventSchema,
|
|
29
|
+
tutorialCheckpointListenEventSchema,
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
export const tutorialStepConfigSchema = z.object({
|
|
33
|
+
id: z.string().min(1),
|
|
34
|
+
index: z.number().int().nonnegative(),
|
|
35
|
+
name: z.string().min(1),
|
|
36
|
+
screenStep: tutorialScreenStepSchema,
|
|
37
|
+
listenEvent: tutorialListenEventSchema,
|
|
38
|
+
triggerCommands: z.array(allCommandsConfigSchema),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const tutorialPhaseConfigSchema = z.object({
|
|
42
|
+
id: tutorialPhaseIdSchema,
|
|
43
|
+
name: z.string().min(1),
|
|
44
|
+
index: z.number().int().nonnegative(),
|
|
45
|
+
steps: z.array(tutorialStepConfigSchema).min(1),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const tutorialMasterConfigSchema = z.object({
|
|
49
|
+
id: z.string().min(1),
|
|
50
|
+
name: z.string().min(1),
|
|
51
|
+
phases: z.array(tutorialPhaseConfigSchema).min(1),
|
|
52
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
tutorialCheckpointListenEventSchema,
|
|
4
|
+
tutorialListenEventSchema,
|
|
5
|
+
tutorialMasterConfigSchema,
|
|
6
|
+
tutorialPhaseConfigSchema,
|
|
7
|
+
tutorialStepConfigSchema,
|
|
8
|
+
tutorialTimeoutListenEventSchema,
|
|
9
|
+
tutorialWheelButtonListenEventSchema,
|
|
10
|
+
} from './TutorialConfig.schema';
|
|
11
|
+
|
|
12
|
+
export type TutorialTimeoutListenEvent = z.infer<typeof tutorialTimeoutListenEventSchema>;
|
|
13
|
+
export type TutorialWheelButtonListenEvent = z.infer<typeof tutorialWheelButtonListenEventSchema>;
|
|
14
|
+
export type TutorialCheckpointListenEvent = z.infer<typeof tutorialCheckpointListenEventSchema>;
|
|
15
|
+
export type TutorialListenEvent = z.infer<typeof tutorialListenEventSchema>;
|
|
16
|
+
export type TutorialStepConfig = z.infer<typeof tutorialStepConfigSchema>;
|
|
17
|
+
export type TutorialPhaseConfig = z.infer<typeof tutorialPhaseConfigSchema>;
|
|
18
|
+
export type TutorialMasterConfig = z.infer<typeof tutorialMasterConfigSchema>;
|