prismarine-windows 2.4.1 → 2.4.4

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.
Files changed (3) hide show
  1. package/HISTORY.md +9 -0
  2. package/index.d.ts +36 -6
  3. package/package.json +3 -3
package/HISTORY.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 2.4.4
2
+ * update mcdata
3
+
4
+ ## 2.4.3
5
+ * fixed typescript typings
6
+
7
+ ## 2.4.2
8
+ * Fixed Exporting correctly and better window typings (#49)
9
+
1
10
  ### 2.4.1
2
11
  * revert avoid emitting references
3
12
 
package/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  import {EventEmitter} from 'events';
5
5
  import {Item} from 'prismarine-item';
6
6
 
7
- declare class Window extends EventEmitter {
7
+ export class Window extends EventEmitter {
8
8
  constructor (id: number, type: number | string, title: string, slotCount: number, inventorySlotsRange: { start: number, end: number }, craftingResultSlot: number, requiresConfirmation: boolean);
9
9
 
10
10
  /**
@@ -129,7 +129,7 @@ declare class Window extends EventEmitter {
129
129
  * Return the id of the first empty slot in the inventory, start looking in the hotbar first if the flag is set
130
130
  * @param hotbarFirst DEFAULT: true
131
131
  */
132
- firstEmptyInventorySlot(hotbarFirst: boolean): number | null;
132
+ firstEmptyInventorySlot(hotbarFirst?: boolean): number | null;
133
133
 
134
134
  /**
135
135
  * Returns how many item you have of the given type, between slots start and end
@@ -189,12 +189,12 @@ declare class Window extends EventEmitter {
189
189
  */
190
190
  clear(blockId?: number, count?: number): void;
191
191
  }
192
- declare interface Click {
192
+ export interface Click {
193
193
  mode: number;
194
194
  mouseButton: number;
195
195
  slot: number;
196
196
  }
197
- declare interface WindowInfo {
197
+ export interface WindowInfo {
198
198
  type: number | string;
199
199
  inventory: { start: number, end: number };
200
200
  slots: number;
@@ -202,9 +202,39 @@ declare interface WindowInfo {
202
202
  requireConfirmation: boolean;
203
203
  }
204
204
 
205
- declare interface WindowsExports {
205
+ export interface WindowsExports {
206
206
  createWindow(id: number, type: number | string, title: string, slotCount?: number): Window;
207
207
  Window: typeof Window;
208
- windows: {[key: string]: WindowInfo};
208
+ windows: {[key in WindowName]: WindowInfo};
209
209
  }
210
+
210
211
  export declare function loader(mcVersion: string): WindowsExports;
212
+
213
+ export default loader;
214
+
215
+ export type WindowName =
216
+ 'minecraft:inventory' |
217
+ 'minecraft:generic_9x1' |
218
+ 'minecraft:generic_9x2' |
219
+ 'minecraft:generic_9x3' |
220
+ 'minecraft:generic_9x4' |
221
+ 'minecraft:generic_9x5' |
222
+ 'minecraft:generic_9x6' |
223
+ 'minecraft:generic_3x3' |
224
+ 'minecraft:anvil' |
225
+ 'minecraft:beacon' |
226
+ 'minecraft:blast_furnace' |
227
+ 'minecraft:brewing_stand' |
228
+ 'minecraft:crafting' |
229
+ 'minecraft:enchantment' |
230
+ 'minecraft:furnace' |
231
+ 'minecraft:grindstone' |
232
+ 'minecraft:hopper' |
233
+ 'minecraft:lectern' |
234
+ 'minecraft:loom' |
235
+ 'minecraft:merchant' |
236
+ 'minecraft:shulker_box' |
237
+ 'minecraft:smithing' |
238
+ 'minecraft:smoker' |
239
+ 'minecraft:cartography' |
240
+ 'minecraft:stonecutter'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismarine-windows",
3
- "version": "2.4.1",
3
+ "version": "2.4.4",
4
4
  "description": "Represent minecraft windows",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,11 +13,11 @@
13
13
  "url": "git+ssh://git@github.com/PrismarineJS/prismarine-windows.git"
14
14
  },
15
15
  "dependencies": {
16
- "minecraft-data": "^2.74.0",
16
+ "minecraft-data": "^3.0.0",
17
17
  "prismarine-item": "^1.5.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "^16.0.0",
20
+ "@types/node": "^17.0.4",
21
21
  "standard": "^16.0.3"
22
22
  },
23
23
  "keywords": [