@ksaa-nlp/gamehub-sdk 0.1.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.
@@ -0,0 +1,67 @@
1
+ namespace GameHub {
2
+ /**
3
+ * Optional metadata attached to a score submission.
4
+ */
5
+ export interface ScoreMetadata {
6
+ matchResult?: MatchResultPayload;
7
+ level?: number;
8
+ duration?: number;
9
+ custom?: Record<string, any>;
10
+ [key: string]: any;
11
+ }
12
+
13
+ /** Payload sent via {@link GameHubSDK.notifyComplete}. */
14
+ export interface GameCompleteData {
15
+ score?: number;
16
+ status?: string;
17
+ meta?: Record<string, any>;
18
+ }
19
+
20
+ /** Payload sent via {@link GameHubSDK.logEvent}. */
21
+ export interface EventData {
22
+ category?: string;
23
+ label?: string;
24
+ value?: number;
25
+ properties?: Record<string, any>;
26
+ }
27
+
28
+ /** Options accepted by {@link GameHubSDK.getQuestions}. */
29
+ export interface QuestionOptions {
30
+ difficulty?: 'easy' | 'medium' | 'hard' | string;
31
+ category?: string | number;
32
+ limit?: number;
33
+ }
34
+
35
+ /** A single question as returned by {@link GameHubSDK.getQuestions}. */
36
+ export interface Question {
37
+ id: string;
38
+ difficulty?: 'easy' | 'medium' | 'hard' | string;
39
+ category?: string;
40
+ prompt: string;
41
+ choices: string[];
42
+ answer: string | number;
43
+ explanation?: string;
44
+ points: number;
45
+ }
46
+
47
+ /** Result returned by `startSession`. */
48
+ export interface StartSessionResult {
49
+ success: boolean;
50
+ token?: string | null;
51
+ error?: string;
52
+ }
53
+
54
+ /** Result returned by `submitScore` / `submitMatchScore`. */
55
+ export interface SubmitScoreResult {
56
+ success: boolean;
57
+ accepted?: boolean;
58
+ timeTaken?: number;
59
+ error?: string;
60
+ /**
61
+ * `true` when the SDK intentionally skipped the network call (e.g. the
62
+ * current peer is not the host in an online match, or is a view-only
63
+ * guest). Treat this as "not-an-error" — the host will submit instead.
64
+ */
65
+ skipped?: boolean;
66
+ }
67
+ }