dredless 0.3.1 → 0.4.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.
@@ -322,7 +322,7 @@ interface ClientSnapshot {
322
322
  currentWorldId: number | null;
323
323
  worlds: WorldSnapshot[];
324
324
  cpuLoad: number | null;
325
- inventory: InventoryState | null;
325
+ inventory: InventoryState;
326
326
  puiPanels: PuiEvent[];
327
327
  commsPanels: CommsEvent[];
328
328
  currentCommsPanel: CommsEvent | null;
@@ -493,7 +493,7 @@ const EquipmentSlot = { Head: "head", Face: "face", Body: "body", Back: "back",
493
493
  type EquipmentSlot = typeof EquipmentSlot[keyof typeof EquipmentSlot];
494
494
 
495
495
  interface InventoryDomain {
496
- state(): InventoryState | null;
496
+ state(): InventoryState;
497
497
  hotbarSize(): number;
498
498
  allSlots(): InventorySlotHandle[];
499
499
  slot(ref: InventorySlotRef): InventorySlotHandle;
@@ -1320,7 +1320,7 @@ interface HelmHandle extends MachineHandle {
1320
1320
  occupied: boolean | undefined;
1321
1321
  }
1322
1322
 
1323
- interface DoorHandle extends MachineHandle {
1323
+ interface DoorHandle extends EntityHandle {
1324
1324
  state: DoorSummary | null;
1325
1325
  rank: number | undefined;
1326
1326
  open: boolean | undefined;
@@ -2131,7 +2131,7 @@ chat-command path used by its chat commands, so client.sendChatMessage() can
2131
2131
  send executable chat commands as well as ordinary chat text. For example:
2132
2132
 
2133
2133
  ```js
2134
- client.sendChatMessage("/help");
2134
+ client.sendChatMessage("/save");
2135
2135
  ```
2136
2136
 
2137
2137
  ### Comms helpers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dredless",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "A fully-featured and from-scratch headless drednot.io client implementation written in pure js.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/certainhuman/dredless#readme",
@@ -144,7 +144,7 @@ export class DredlessClient extends EventBus {
144
144
  this.inventory = new InventoryDomain(this);
145
145
  this.management = new ShipManagementDomain(this);
146
146
  this.cpuLoad = null;
147
- this.inventoryState = null;
147
+ this.inventoryState = normalizeInventoryEvent({type: "inventory", general_slots: 5});
148
148
  this.puiPanels = new Map();
149
149
  this.commsPanels = new Map();
150
150
  this.currentCommsPanel = null;
package/src/index.d.ts CHANGED
@@ -612,7 +612,7 @@ export interface ShipManagementDomain {
612
612
  }
613
613
 
614
614
  export interface InventoryDomain {
615
- state(): InventoryState | null;
615
+ state(): InventoryState;
616
616
 
617
617
  hotbarSize(): number;
618
618
 
@@ -1114,7 +1114,7 @@ export interface HelmHandle extends MachineHandle {
1114
1114
  occupied: boolean | undefined;
1115
1115
  }
1116
1116
 
1117
- export interface DoorHandle extends MachineHandle {
1117
+ export interface DoorHandle extends EntityHandle {
1118
1118
  state: DoorSummary | null;
1119
1119
  rank: number | undefined;
1120
1120
  open: boolean | undefined;
@@ -1180,7 +1180,7 @@ export interface ClientSnapshot {
1180
1180
  currentWorldId: number | null;
1181
1181
  worlds: WorldSnapshot[];
1182
1182
  cpuLoad: number | null;
1183
- inventory: InventoryState | null;
1183
+ inventory: InventoryState;
1184
1184
  puiPanels: PuiEvent[];
1185
1185
  commsPanels: CommsEvent[];
1186
1186
  currentCommsPanel: CommsEvent | null;
@@ -1763,7 +1763,6 @@ export interface BotSummary {
1763
1763
  export interface FabricatorSummary {
1764
1764
  entity: number;
1765
1765
  type: FabricatorType | null;
1766
- typeIndex: number | null;
1767
1766
  typeIndex: number | null;
1768
1767
  state: ModelRecord;
1769
1768
  rows: { itemId: number | null; itemName: string | null; count: number | null }[];