com.superfive.js 1.0.0 → 1.0.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/main.d.ts ADDED
@@ -0,0 +1,63 @@
1
+ import type { PlatformMessage } from './types.ts';
2
+ /**
3
+ * Check if the game is running in the SuperFive platform
4
+ *
5
+ * @returns True if the game is in platform mode, false otherwise
6
+ */
7
+ export declare function isInPlatformMode(): boolean;
8
+ /**
9
+ * Check if the game should start muted
10
+ *
11
+ * @returns True if the game should start muted, false otherwise
12
+ */
13
+ export declare function startMuted(): boolean;
14
+ /**
15
+ * Get the difficulty of the game
16
+ *
17
+ * The difficulty is a number between 0 and 2
18
+ * - 0: Easy
19
+ * - 1: Medium
20
+ * - 2: Hard
21
+ *
22
+ * @returns The difficulty of the game as a number between 0 and 2
23
+ */
24
+ export declare function getDifficulty(): number;
25
+ /**
26
+ * Subscribe to the platform's messages to handle platform events
27
+ *
28
+ * @returns void
29
+ */
30
+ export declare function subscribeToPlatformMessages(): void;
31
+ /**
32
+ * Unsubscribe from the platform's messages
33
+ *
34
+ * @returns void
35
+ */
36
+ export declare function unsubscribeFromPlatformMessages(): void;
37
+ /**
38
+ * Send a message to the platform
39
+ *
40
+ * @param type The type of the message
41
+ * @param payload The payload of the message
42
+ * @returns void
43
+ */
44
+ export declare function sendPlatformMessage(type: PlatformMessage['type'], payload?: any): void;
45
+ /**
46
+ * Send a message to the platform to indicate that the game is ready (loaded and ready to play)
47
+ *
48
+ * @returns void
49
+ */
50
+ export declare function sendReady(): void;
51
+ /**
52
+ * Send a message to the platform to indicate that the game is won
53
+ *
54
+ * @returns void
55
+ */
56
+ export declare function sendWin(): void;
57
+ /**
58
+ * Send a message to the platform to indicate that the game is lost
59
+ *
60
+ * @returns void
61
+ */
62
+ export declare function sendLose(): void;
63
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAMD;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AA0BD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAItF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAE/B"}
@@ -0,0 +1,5 @@
1
+ export interface PlatformMessage {
2
+ type: 'game_ready' | 'game_won' | 'game_lost' | 'game_restart' | 'game_mute';
3
+ payload?: any;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC;IAC7E,OAAO,CAAC,EAAE,GAAG,CAAC;CACf"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.superfive.js",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",
@@ -20,10 +20,10 @@
20
20
  "homepage": "https://superfive.io",
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "https://github.com/dibulo/superfive-js-api.git"
23
+ "url": "https://github.com/Dibulo/com.superfive.js.git"
24
24
  },
25
25
  "bugs": {
26
- "url": "https://github.com/dibulo/superfive-js-api/issues"
26
+ "url": "https://github.com/Dibulo/com.superfive.js/issues"
27
27
  },
28
28
  "keywords": [
29
29
  "superfive",