@scoreboardmax/api-types 1.0.11 → 1.0.12
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/README.md +42 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# ScoreboardMax API
|
|
1
|
+
# ScoreboardMax API Types & Constants
|
|
2
2
|
|
|
3
|
-
This package provides TypeScript
|
|
3
|
+
This package provides TypeScript types and runtime constants for developers integrating with the ScoreboardMax API. All definitions are automatically generated from the official ScoreboardMax API source code to ensure accuracy and consistency.
|
|
4
4
|
|
|
5
5
|
**API Documentation:** [https://scoreboardmax.com/api/docs](https://scoreboardmax.com/api/docs)
|
|
6
6
|
|
|
@@ -24,18 +24,55 @@ bun add @scoreboardmax/api-types
|
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### TypeScript
|
|
28
28
|
```typescript
|
|
29
|
-
|
|
29
|
+
// Import types for API requests and responses
|
|
30
|
+
import { ScoreboardRequest, ScoreboardResponse, ScoreboardType } from "@scoreboardmax/api-types";
|
|
31
|
+
|
|
32
|
+
// Import runtime constants and enums
|
|
33
|
+
import { WebsocketOperation, WebsocketMessageType } from "@scoreboardmax/api-types";
|
|
34
|
+
|
|
35
|
+
// Use in your application
|
|
36
|
+
const request: ScoreboardRequest = {
|
|
37
|
+
name: "Varsity Football",
|
|
38
|
+
type: ScoreboardType.Basketball,
|
|
39
|
+
data: { /* ... */ }
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Runtime constants work in conditionals
|
|
43
|
+
if (operation === WebsocketOperation.SendHeartbeat) {
|
|
44
|
+
// Handle heartbeat
|
|
45
|
+
}
|
|
30
46
|
```
|
|
31
47
|
|
|
48
|
+
### JavaScript
|
|
49
|
+
```javascript
|
|
50
|
+
// CommonJS
|
|
51
|
+
const { WebsocketOperation, ScoreboardType } = require("@scoreboardmax/api-types");
|
|
52
|
+
|
|
53
|
+
// ES6 modules
|
|
54
|
+
import { WebsocketOperation, ScoreboardType } from "@scoreboardmax/api-types";
|
|
55
|
+
|
|
56
|
+
// Use runtime constants
|
|
57
|
+
if (body.operation === WebsocketOperation.GetConnectionId) {
|
|
58
|
+
// Handle connection request
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## What's Included
|
|
63
|
+
|
|
64
|
+
- **TypeScript Types**: Interfaces for API requests and responses
|
|
65
|
+
- **Runtime Constants**: Enums for operations, message types, and scoreboard types
|
|
66
|
+
- **Full Type Safety**: Complete IntelliSense support for TypeScript projects
|
|
67
|
+
- **Universal Compatibility**: Works with both CommonJS and ES6 module systems
|
|
68
|
+
|
|
32
69
|
## Contributing
|
|
33
70
|
|
|
34
71
|
This package is automatically generated from the ScoreboardMax API schema. If you find issues with the types:
|
|
35
72
|
|
|
36
73
|
1. Check if the issue exists in the API documentation
|
|
37
74
|
2. Report issues at: [GitHub Issues](https://github.com/scoreboardmax/api-types/issues)
|
|
38
|
-
3. For API-related issues, [contact ScoreboardMax support
|
|
75
|
+
3. For API-related issues, [contact ScoreboardMax support](https://scoreboardmax.com/#contact)
|
|
39
76
|
|
|
40
77
|
## License
|
|
41
78
|
|