@oasiz/sdk 1.2.0 → 1.3.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/index.d.cts CHANGED
@@ -1,4 +1,24 @@
1
1
  type HapticType = "light" | "medium" | "heavy" | "success" | "error";
2
+ type LogOverlayLevel = "debug" | "log" | "info" | "warn" | "error";
3
+ interface LogOverlayEntry {
4
+ id: number;
5
+ level: LogOverlayLevel;
6
+ message: string;
7
+ timestamp: number;
8
+ }
9
+ interface LogOverlayOptions {
10
+ collapsed?: boolean;
11
+ enabled?: boolean;
12
+ maxEntries?: number;
13
+ title?: string;
14
+ }
15
+ interface LogOverlayHandle {
16
+ clear: () => void;
17
+ destroy: () => void;
18
+ hide: () => void;
19
+ isVisible: () => boolean;
20
+ show: () => void;
21
+ }
2
22
  interface ScoreAnchor {
3
23
  raw: number;
4
24
  normalized: 100 | 300 | 600 | 950;
@@ -10,6 +30,8 @@ type GameState = Record<string, unknown>;
10
30
 
11
31
  declare function triggerHaptic(type: HapticType): void;
12
32
 
33
+ declare function enableLogOverlay(options?: LogOverlayOptions): LogOverlayHandle;
34
+
13
35
  interface ShareRoomCodeOptions {
14
36
  inviteOverride?: boolean;
15
37
  }
@@ -49,6 +71,7 @@ declare const oasiz: {
49
71
  submitScore: typeof submitScore;
50
72
  emitScoreConfig: typeof emitScoreConfig;
51
73
  triggerHaptic: typeof triggerHaptic;
74
+ enableLogOverlay: typeof enableLogOverlay;
52
75
  loadGameState: typeof loadGameState;
53
76
  saveGameState: typeof saveGameState;
54
77
  flushGameState: typeof flushGameState;
@@ -65,4 +88,4 @@ declare const oasiz: {
65
88
  readonly playerAvatar: string | undefined;
66
89
  };
67
90
 
68
- export { type GameState, type HapticType, type ScoreAnchor, type ScoreConfig, type ShareRoomCodeOptions, type Unsubscribe, emitScoreConfig, flushGameState, getGameId, getPlayerAvatar, getPlayerName, getRoomCode, leaveGame, loadGameState, oasiz, onBackButton, onLeaveGame, onPause, onResume, openInviteModal, saveGameState, shareRoomCode, submitScore, triggerHaptic };
91
+ export { type GameState, type HapticType, type LogOverlayEntry, type LogOverlayHandle, type LogOverlayLevel, type LogOverlayOptions, type ScoreAnchor, type ScoreConfig, type ShareRoomCodeOptions, type Unsubscribe, emitScoreConfig, enableLogOverlay, flushGameState, getGameId, getPlayerAvatar, getPlayerName, getRoomCode, leaveGame, loadGameState, oasiz, onBackButton, onLeaveGame, onPause, onResume, openInviteModal, saveGameState, shareRoomCode, submitScore, triggerHaptic };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,24 @@
1
1
  type HapticType = "light" | "medium" | "heavy" | "success" | "error";
2
+ type LogOverlayLevel = "debug" | "log" | "info" | "warn" | "error";
3
+ interface LogOverlayEntry {
4
+ id: number;
5
+ level: LogOverlayLevel;
6
+ message: string;
7
+ timestamp: number;
8
+ }
9
+ interface LogOverlayOptions {
10
+ collapsed?: boolean;
11
+ enabled?: boolean;
12
+ maxEntries?: number;
13
+ title?: string;
14
+ }
15
+ interface LogOverlayHandle {
16
+ clear: () => void;
17
+ destroy: () => void;
18
+ hide: () => void;
19
+ isVisible: () => boolean;
20
+ show: () => void;
21
+ }
2
22
  interface ScoreAnchor {
3
23
  raw: number;
4
24
  normalized: 100 | 300 | 600 | 950;
@@ -10,6 +30,8 @@ type GameState = Record<string, unknown>;
10
30
 
11
31
  declare function triggerHaptic(type: HapticType): void;
12
32
 
33
+ declare function enableLogOverlay(options?: LogOverlayOptions): LogOverlayHandle;
34
+
13
35
  interface ShareRoomCodeOptions {
14
36
  inviteOverride?: boolean;
15
37
  }
@@ -49,6 +71,7 @@ declare const oasiz: {
49
71
  submitScore: typeof submitScore;
50
72
  emitScoreConfig: typeof emitScoreConfig;
51
73
  triggerHaptic: typeof triggerHaptic;
74
+ enableLogOverlay: typeof enableLogOverlay;
52
75
  loadGameState: typeof loadGameState;
53
76
  saveGameState: typeof saveGameState;
54
77
  flushGameState: typeof flushGameState;
@@ -65,4 +88,4 @@ declare const oasiz: {
65
88
  readonly playerAvatar: string | undefined;
66
89
  };
67
90
 
68
- export { type GameState, type HapticType, type ScoreAnchor, type ScoreConfig, type ShareRoomCodeOptions, type Unsubscribe, emitScoreConfig, flushGameState, getGameId, getPlayerAvatar, getPlayerName, getRoomCode, leaveGame, loadGameState, oasiz, onBackButton, onLeaveGame, onPause, onResume, openInviteModal, saveGameState, shareRoomCode, submitScore, triggerHaptic };
91
+ export { type GameState, type HapticType, type LogOverlayEntry, type LogOverlayHandle, type LogOverlayLevel, type LogOverlayOptions, type ScoreAnchor, type ScoreConfig, type ShareRoomCodeOptions, type Unsubscribe, emitScoreConfig, enableLogOverlay, flushGameState, getGameId, getPlayerAvatar, getPlayerName, getRoomCode, leaveGame, loadGameState, oasiz, onBackButton, onLeaveGame, onPause, onResume, openInviteModal, saveGameState, shareRoomCode, submitScore, triggerHaptic };