@huelder/hytale-types 1.0.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/bridge.d.ts +189 -0
- package/generated/.gitkeep +3 -0
- package/generated/hytale-api.d.ts +60924 -0
- package/index.d.ts +52 -0
- package/package.json +28 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hytale/types - TypeScript type definitions for Hytale modding
|
|
3
|
+
*
|
|
4
|
+
* This package provides two sets of types:
|
|
5
|
+
*
|
|
6
|
+
* 1. BRIDGE API (bridge.d.ts)
|
|
7
|
+
* The global `Hytale` object with commands, events, logging.
|
|
8
|
+
* This is what you use for most mod development.
|
|
9
|
+
*
|
|
10
|
+
* 2. RAW JAVA API (generated/hytale-api.d.ts)
|
|
11
|
+
* 5,218 classes from HytaleServer.jar for advanced usage.
|
|
12
|
+
* Access via Java.type('com.hypixel.hytale...').
|
|
13
|
+
*
|
|
14
|
+
* @example Bridge API
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Register a command
|
|
17
|
+
* Hytale.commands.register({
|
|
18
|
+
* name: 'hello',
|
|
19
|
+
* execute: (ctx) => ctx.reply('Hello!')
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* // Subscribe to events
|
|
23
|
+
* Hytale.events.on('playerJoin', (event) => {
|
|
24
|
+
* console.log('Player joined!');
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Log messages
|
|
28
|
+
* Hytale.log('Info message');
|
|
29
|
+
* Hytale.warn('Warning message');
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Raw Java API
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Access Java classes directly
|
|
35
|
+
* const HytaleServer = Java.type('com.hypixel.hytale.server.core.HytaleServer');
|
|
36
|
+
* const server = HytaleServer.get();
|
|
37
|
+
* console.log('Server: ' + server.getServerName());
|
|
38
|
+
*
|
|
39
|
+
* const Message = Java.type('com.hypixel.hytale.server.core.Message');
|
|
40
|
+
* const msg = Message.parse('Hello <color=red>World</color>!');
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Regenerate Java API types:
|
|
44
|
+
* mvn compile exec:java@generate-typescript
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
// Bridge API types (global Hytale object)
|
|
48
|
+
/// <reference path="./bridge.d.ts" />
|
|
49
|
+
|
|
50
|
+
// Raw Java API types (for Java.type() usage)
|
|
51
|
+
// These provide IntelliSense for the underlying Hytale Java classes
|
|
52
|
+
/// <reference path="./generated/hytale-api.d.ts" />
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@huelder/hytale-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript type definitions for Hytale Server API",
|
|
5
|
+
"main": "",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.d.ts",
|
|
9
|
+
"bridge.d.ts",
|
|
10
|
+
"generated/**/*"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"hytale",
|
|
14
|
+
"typescript",
|
|
15
|
+
"types",
|
|
16
|
+
"modding",
|
|
17
|
+
"graaljs"
|
|
18
|
+
],
|
|
19
|
+
"author": "hueldera",
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/huelder/hytale-typescript-runtime"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
}
|
|
28
|
+
}
|