@shipload/sdk 2.0.0-rc6 → 2.0.0-rc8

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/lib/shipload.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _wharfkit_antelope from '@wharfkit/antelope';
2
- import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt8, TimePoint, UInt16, Int64, UInt16Type, UInt8Type, TimePointType, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
2
+ import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt8, UInt16, TimePoint, Int64, UInt16Type, UInt8Type, TimePointType, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
3
3
  import * as _wharfkit_contract from '@wharfkit/contract';
4
4
  import { Contract as Contract$2, PartialBy, ContractArgs, ActionOptions, Table } from '@wharfkit/contract';
5
5
  import { ChainDefinition } from '@wharfkit/session';
@@ -158,10 +158,36 @@ declare namespace platform {
158
158
  declare const abiBlob: Blob;
159
159
  declare const abi: ABI;
160
160
  declare namespace Types {
161
+ class addmodule extends Struct {
162
+ entity_type: Name;
163
+ entity_id: UInt64;
164
+ module_index: UInt8;
165
+ module_cargo_id: UInt64;
166
+ target_cargo_id: UInt64;
167
+ }
161
168
  class advance extends Struct {
162
169
  reveal: string;
163
170
  commit: Checksum256;
164
171
  }
172
+ class cargo_seed extends Struct {
173
+ item_id: UInt16;
174
+ seed: UInt64;
175
+ }
176
+ class module_entry extends Struct {
177
+ type: UInt8;
178
+ installed?: cargo_seed;
179
+ }
180
+ class cargo_item extends Struct {
181
+ item_id: UInt16;
182
+ quantity: UInt32;
183
+ seed?: UInt64;
184
+ modules: module_entry[];
185
+ }
186
+ class blend extends Struct {
187
+ entity_type: Name;
188
+ id: UInt64;
189
+ inputs: cargo_item[];
190
+ }
165
191
  class cancel extends Struct {
166
192
  entity_type: Name;
167
193
  id: UInt64;
@@ -179,17 +205,13 @@ declare namespace Types {
179
205
  entitygroup?: UInt64;
180
206
  group_members?: entity_ref[];
181
207
  }
182
- class cargo_item extends Struct {
183
- item_id: UInt16;
184
- quantity: UInt32;
185
- seed?: UInt64;
186
- }
187
208
  class cargo_row extends Struct {
188
209
  id: UInt64;
189
210
  entity_id: UInt64;
190
211
  item_id: UInt64;
191
212
  quantity: UInt64;
192
213
  seed: UInt64;
214
+ modules: module_entry[];
193
215
  }
194
216
  class cleanrsvp extends Struct {
195
217
  epoch: UInt64;
@@ -203,44 +225,12 @@ declare namespace Types {
203
225
  class commit extends Struct {
204
226
  commit: Checksum256;
205
227
  }
206
- class movement_stats extends Struct {
207
- thrust: UInt32;
208
- drain: UInt16;
209
- }
210
- class energy_stats extends Struct {
211
- capacity: UInt16;
212
- recharge: UInt16;
213
- }
214
228
  class loader_stats extends Struct {
215
229
  mass: UInt32;
216
230
  thrust: UInt16;
217
231
  quantity: UInt8;
218
232
  }
219
- class extractor_stats extends Struct {
220
- rate: UInt16;
221
- drain: UInt16;
222
- efficiency: UInt16;
223
- depth: UInt16;
224
- drill: UInt16;
225
- }
226
- class warp_stats extends Struct {
227
- range: UInt32;
228
- }
229
- class crafter_stats extends Struct {
230
- speed: UInt16;
231
- drain: UInt16;
232
- }
233
233
  class entity_defaults extends Struct {
234
- ship_hullmass: UInt32;
235
- ship_capacity: UInt32;
236
- ship_energy: UInt16;
237
- ship_z: UInt16;
238
- ship_engines: movement_stats;
239
- ship_generator: energy_stats;
240
- ship_loaders: loader_stats;
241
- ship_extractor: extractor_stats;
242
- ship_warp: warp_stats;
243
- ship_crafter: crafter_stats;
244
234
  warehouse_capacity: UInt32;
245
235
  warehouse_z: UInt16;
246
236
  warehouse_loaders: loader_stats;
@@ -296,6 +286,10 @@ declare namespace Types {
296
286
  quantity: UInt32;
297
287
  inputs: cargo_item[];
298
288
  }
289
+ class crafter_stats extends Struct {
290
+ speed: UInt16;
291
+ drain: UInt16;
292
+ }
299
293
  class createentity extends Struct {
300
294
  owner: Name;
301
295
  entity_type: Name;
@@ -313,10 +307,27 @@ declare namespace Types {
313
307
  class enable extends Struct {
314
308
  enabled: boolean;
315
309
  }
310
+ class energy_stats extends Struct {
311
+ capacity: UInt16;
312
+ recharge: UInt16;
313
+ }
316
314
  class entity_current_state extends Struct {
317
315
  coordinates: coordinates;
318
316
  energy: UInt16;
319
317
  }
318
+ class movement_stats extends Struct {
319
+ thrust: UInt32;
320
+ drain: UInt16;
321
+ }
322
+ class extractor_stats extends Struct {
323
+ rate: UInt16;
324
+ drain: UInt16;
325
+ depth: UInt16;
326
+ drill: UInt16;
327
+ }
328
+ class warp_stats extends Struct {
329
+ range: UInt32;
330
+ }
320
331
  class entity_info extends Struct {
321
332
  type: Name;
322
333
  id: UInt64;
@@ -396,8 +407,6 @@ declare namespace Types {
396
407
  class getplayer extends Struct {
397
408
  account: Name;
398
409
  }
399
- class getstarter extends Struct {
400
- }
401
410
  class getstratum extends Struct {
402
411
  x: Int64;
403
412
  y: Int64;
@@ -521,6 +530,12 @@ declare namespace Types {
521
530
  stat2: UInt16;
522
531
  stat3: UInt16;
523
532
  }
533
+ class rmmodule extends Struct {
534
+ entity_type: Name;
535
+ entity_id: UInt64;
536
+ module_index: UInt8;
537
+ target_cargo_id: UInt64;
538
+ }
524
539
  class salt extends Struct {
525
540
  salt: UInt64;
526
541
  }
@@ -533,16 +548,17 @@ declare namespace Types {
533
548
  owner: Name;
534
549
  name: string;
535
550
  coordinates: coordinates;
536
- hullmass: UInt32;
537
- capacity: UInt32;
538
- energy: UInt16;
551
+ hullmass?: UInt32;
552
+ capacity?: UInt32;
553
+ energy?: UInt16;
539
554
  cargomass: UInt32;
540
- engines: movement_stats;
541
- generator: energy_stats;
542
- loaders: loader_stats;
555
+ engines?: movement_stats;
556
+ generator?: energy_stats;
557
+ loaders?: loader_stats;
543
558
  extractor?: extractor_stats;
544
559
  warp?: warp_stats;
545
560
  crafter?: crafter_stats;
561
+ modules: module_entry[];
546
562
  schedule?: schedule;
547
563
  }
548
564
  class spawncargo extends Struct {
@@ -550,8 +566,11 @@ declare namespace Types {
550
566
  item_id: UInt64;
551
567
  quantity: UInt64;
552
568
  }
553
- class starter_info extends Struct {
554
- ship: entity_info;
569
+ class spawnseeded extends Struct {
570
+ entity_id: UInt64;
571
+ item_id: UInt64;
572
+ quantity: UInt64;
573
+ seed: UInt64;
555
574
  }
556
575
  class state_row extends Struct {
557
576
  enabled: boolean;
@@ -592,7 +611,6 @@ declare namespace Types {
592
611
  class types_row extends Struct {
593
612
  id: UInt64;
594
613
  entity_summary_type: entity_summary;
595
- starter_info_type: starter_info;
596
614
  game_config_type: game_config;
597
615
  }
598
616
  class warehouse_row extends Struct {
@@ -646,22 +664,26 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
646
664
  type TableNames = keyof TableTypes;
647
665
  declare namespace ActionParams {
648
666
  namespace Type {
667
+ interface cargo_item {
668
+ item_id: UInt16Type;
669
+ quantity: UInt32Type;
670
+ seed?: UInt64Type;
671
+ modules: Type.module_entry[];
672
+ }
673
+ interface module_entry {
674
+ type: UInt8Type;
675
+ installed?: Type.cargo_seed;
676
+ }
677
+ interface cargo_seed {
678
+ item_id: UInt16Type;
679
+ seed: UInt64Type;
680
+ }
649
681
  interface game_config {
650
682
  version: UInt32Type;
651
683
  defaults: Type.entity_defaults;
652
684
  items: Type.item_def[];
653
685
  }
654
686
  interface entity_defaults {
655
- ship_hullmass: UInt32Type;
656
- ship_capacity: UInt32Type;
657
- ship_energy: UInt16Type;
658
- ship_z: UInt16Type;
659
- ship_engines: Type.movement_stats;
660
- ship_generator: Type.energy_stats;
661
- ship_loaders: Type.loader_stats;
662
- ship_extractor: Type.extractor_stats;
663
- ship_warp: Type.warp_stats;
664
- ship_crafter: Type.crafter_stats;
665
687
  warehouse_capacity: UInt32Type;
666
688
  warehouse_z: UInt16Type;
667
689
  warehouse_loaders: Type.loader_stats;
@@ -669,42 +691,15 @@ declare namespace ActionParams {
669
691
  container_capacity: UInt32Type;
670
692
  container_z: UInt16Type;
671
693
  }
672
- interface movement_stats {
673
- thrust: UInt32Type;
674
- drain: UInt16Type;
675
- }
676
- interface energy_stats {
677
- capacity: UInt16Type;
678
- recharge: UInt16Type;
679
- }
680
694
  interface loader_stats {
681
695
  mass: UInt32Type;
682
696
  thrust: UInt16Type;
683
697
  quantity: UInt8Type;
684
698
  }
685
- interface extractor_stats {
686
- rate: UInt16Type;
687
- drain: UInt16Type;
688
- efficiency: UInt16Type;
689
- depth: UInt16Type;
690
- drill: UInt16Type;
691
- }
692
- interface warp_stats {
693
- range: UInt32Type;
694
- }
695
- interface crafter_stats {
696
- speed: UInt16Type;
697
- drain: UInt16Type;
698
- }
699
699
  interface item_def {
700
700
  id: UInt16Type;
701
701
  mass: UInt32Type;
702
702
  }
703
- interface cargo_item {
704
- item_id: UInt16Type;
705
- quantity: UInt32Type;
706
- seed?: UInt64Type;
707
- }
708
703
  interface entity_ref {
709
704
  entity_type: NameType;
710
705
  entity_id: UInt64Type;
@@ -736,10 +731,22 @@ declare namespace ActionParams {
736
731
  z?: UInt16Type;
737
732
  }
738
733
  }
734
+ interface addmodule {
735
+ entity_type: NameType;
736
+ entity_id: UInt64Type;
737
+ module_index: UInt8Type;
738
+ module_cargo_id: UInt64Type;
739
+ target_cargo_id: UInt64Type;
740
+ }
739
741
  interface advance {
740
742
  reveal: string;
741
743
  commit: Checksum256Type;
742
744
  }
745
+ interface blend {
746
+ entity_type: NameType;
747
+ id: UInt64Type;
748
+ inputs: Type.cargo_item[];
749
+ }
743
750
  interface cancel {
744
751
  entity_type: NameType;
745
752
  id: UInt64Type;
@@ -818,8 +825,6 @@ declare namespace ActionParams {
818
825
  interface getplayer {
819
826
  account: NameType;
820
827
  }
821
- interface getstarter {
822
- }
823
828
  interface getstratum {
824
829
  x: Int64Type;
825
830
  y: Int64Type;
@@ -859,6 +864,12 @@ declare namespace ActionParams {
859
864
  id: UInt64Type;
860
865
  count?: UInt64Type;
861
866
  }
867
+ interface rmmodule {
868
+ entity_type: NameType;
869
+ entity_id: UInt64Type;
870
+ module_index: UInt8Type;
871
+ target_cargo_id: UInt64Type;
872
+ }
862
873
  interface salt {
863
874
  salt: UInt64Type;
864
875
  }
@@ -867,6 +878,12 @@ declare namespace ActionParams {
867
878
  item_id: UInt64Type;
868
879
  quantity: UInt64Type;
869
880
  }
881
+ interface spawnseeded {
882
+ entity_id: UInt64Type;
883
+ item_id: UInt64Type;
884
+ quantity: UInt64Type;
885
+ seed: UInt64Type;
886
+ }
870
887
  interface transfer {
871
888
  source_type: NameType;
872
889
  source_id: UInt64Type;
@@ -894,7 +911,9 @@ declare namespace ActionParams {
894
911
  }
895
912
  }
896
913
  interface ActionNameParams {
914
+ addmodule: ActionParams.addmodule;
897
915
  advance: ActionParams.advance;
916
+ blend: ActionParams.blend;
898
917
  cancel: ActionParams.cancel;
899
918
  cleanrsvp: ActionParams.cleanrsvp;
900
919
  cleartable: ActionParams.cleartable;
@@ -913,7 +932,6 @@ interface ActionNameParams {
913
932
  getlocdata: ActionParams.getlocdata;
914
933
  getnearby: ActionParams.getnearby;
915
934
  getplayer: ActionParams.getplayer;
916
- getstarter: ActionParams.getstarter;
917
935
  getstratum: ActionParams.getstratum;
918
936
  getsummaries: ActionParams.getsummaries;
919
937
  grouptravel: ActionParams.grouptravel;
@@ -924,8 +942,10 @@ interface ActionNameParams {
924
942
  notify: ActionParams.notify;
925
943
  recharge: ActionParams.recharge;
926
944
  resolve: ActionParams.resolve;
945
+ rmmodule: ActionParams.rmmodule;
927
946
  salt: ActionParams.salt;
928
947
  spawncargo: ActionParams.spawncargo;
948
+ spawnseeded: ActionParams.spawnseeded;
929
949
  transfer: ActionParams.transfer;
930
950
  travel: ActionParams.travel;
931
951
  warp: ActionParams.warp;
@@ -946,7 +966,6 @@ interface ActionReturnValues {
946
966
  getlocdata: Types.location_derived;
947
967
  getnearby: Types.nearby_info;
948
968
  getplayer: Types.player_info;
949
- getstarter: Types.starter_info;
950
969
  getstratum: Types.stratum_data;
951
970
  getsummaries: Types.entity_summary[];
952
971
  grouptravel: Types.task_results;
@@ -1043,17 +1062,6 @@ declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this
1043
1062
  declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
1044
1063
 
1045
1064
  declare const PRECISION = 10000;
1046
- declare const INITIAL_SHIP_GENERATOR_CAPACITY = 350;
1047
- declare const INITIAL_SHIP_DRAIN = 25;
1048
- declare const INITIAL_SHIP_ENERGY = 350;
1049
- declare const INITIAL_SHIP_HULLMASS = 100000;
1050
- declare const INITIAL_SHIP_CAPACITY = 500000;
1051
- declare const INITIAL_SHIP_Z = 800;
1052
- declare const INITIAL_SHIP_RECHARGE = 10;
1053
- declare const INITIAL_SHIP_THRUST = 250;
1054
- declare const INITIAL_LOADER_MASS = 1000;
1055
- declare const INITIAL_LOADER_QUANTITY = 1;
1056
- declare const INITIAL_LOADER_THRUST = 1;
1057
1065
  declare const WAREHOUSE_Z = 500;
1058
1066
  declare const INITIAL_WAREHOUSE_CAPACITY = 10000000;
1059
1067
  declare const CONTAINER_Z = 300;
@@ -1062,10 +1070,7 @@ declare const INITIAL_CONTAINER_CAPACITY = 2000000;
1062
1070
  declare const TRAVEL_MAX_DURATION = 86400;
1063
1071
  declare const MIN_ORBITAL_ALTITUDE = 800;
1064
1072
  declare const MAX_ORBITAL_ALTITUDE = 3000;
1065
- declare const INITIAL_SHIP_MASS = 500000;
1066
- declare const INITIAL_EXTRACTOR_RATE = 700;
1067
- declare const INITIAL_EXTRACTOR_DRAIN = 2500;
1068
- declare const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
1073
+ declare const BASE_ORBITAL_MASS = 100000;
1069
1074
  interface ShipLike {
1070
1075
  coordinates: Types.coordinates;
1071
1076
  hullmass: UInt32;
@@ -1261,12 +1266,11 @@ declare class ActionsManager extends BaseManager {
1261
1266
  join(account: NameType): Action;
1262
1267
  extract(shipId: UInt64Type): Action;
1263
1268
  warp(shipId: UInt64Type, destination: CoordinatesType): Action;
1264
- craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: {
1265
- itemId: number;
1266
- quantity: number;
1267
- seed?: bigint;
1268
- }[]): Action;
1269
+ craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
1270
+ blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
1269
1271
  deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, seed: bigint, entityName: string): Action;
1272
+ addmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, moduleCargoId: UInt64Type, targetCargoId?: UInt64Type): Action;
1273
+ rmmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, targetCargoId?: UInt64Type): Action;
1270
1274
  joinGame(account: NameType, companyName: string): Action[];
1271
1275
  }
1272
1276
 
@@ -1574,12 +1578,12 @@ interface ShipStateInput {
1574
1578
  y: number;
1575
1579
  z?: number;
1576
1580
  };
1577
- hullmass: number;
1578
- capacity: number;
1579
- energy: number;
1580
- engines: Types.movement_stats;
1581
- generator: Types.energy_stats;
1582
- loaders: Types.loader_stats;
1581
+ hullmass?: number;
1582
+ capacity?: number;
1583
+ energy?: number;
1584
+ engines?: Types.movement_stats;
1585
+ generator?: Types.energy_stats;
1586
+ loaders?: Types.loader_stats;
1583
1587
  schedule?: Types.schedule;
1584
1588
  cargo?: Types.cargo_item[];
1585
1589
  }
@@ -1600,6 +1604,8 @@ declare class Ship extends Types.entity_info {
1600
1604
  isLoading(now: Date): boolean;
1601
1605
  isUnloading(now: Date): boolean;
1602
1606
  isExtracting(now: Date): boolean;
1607
+ get hasEngines(): boolean;
1608
+ get hasGenerator(): boolean;
1603
1609
  get hasExtractor(): boolean;
1604
1610
  get hasWarp(): boolean;
1605
1611
  project(): ProjectedEntity;
@@ -1829,6 +1835,10 @@ declare function computeEntityStats(entityRecipeId: string, componentStacks: Rec
1829
1835
  key: string;
1830
1836
  value: number;
1831
1837
  }[];
1838
+ declare function blendCargoStacks(itemId: number, stacks: {
1839
+ quantity: number;
1840
+ seed: UInt64;
1841
+ }[]): UInt64;
1832
1842
 
1833
1843
  declare function hash(seed: Checksum256Type, string: string): Checksum256;
1834
1844
  declare function hash512(seed: Checksum256Type, string: string): Checksum512;
@@ -1956,7 +1966,7 @@ interface Entity {
1956
1966
  entity_name: string;
1957
1967
  location: Coordinates | Types.coordinates;
1958
1968
  }
1959
- type ShipEntity = Entity & MovementCapability & EnergyCapability & StorageCapability & LoaderCapability & MassCapability & ScheduleCapability & {
1969
+ type ShipEntity = Entity & Partial<MovementCapability> & Partial<EnergyCapability> & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability & {
1960
1970
  extractor?: Types.extractor_stats;
1961
1971
  };
1962
1972
  type WarehouseEntity = Entity & StorageCapability & LoaderCapability & ScheduleCapability;
@@ -1978,17 +1988,59 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
1978
1988
 
1979
1989
  declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
1980
1990
 
1981
- declare function calc_extraction_duration(extractor: Types.extractor_stats, cargoMass: number, stratum: number, richness: number): UInt32;
1991
+ declare function calc_extraction_duration(extractor: Types.extractor_stats, itemMass: number, quantity: number, stratum: number, richness: number): UInt32;
1982
1992
  declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
1983
1993
 
1984
1994
  interface CrafterCapability {
1985
1995
  crafter: Types.crafter_stats;
1986
1996
  }
1987
1997
  declare function capsHasCrafter(caps: EntityCapabilities): boolean;
1998
+ declare function calc_craft_duration(speed: number, totalInputMass: number, quantity: number): UInt32;
1999
+ declare function calc_craft_energy(drain: number, duration: number): UInt16;
2000
+
2001
+ declare const ITEM_ENGINE_T1 = 10006;
2002
+ declare const ITEM_GENERATOR_T1 = 10007;
2003
+ declare const ITEM_EXTRACTOR_T1 = 10014;
2004
+ declare const ITEM_LOADER_T1 = 10015;
2005
+ declare const ITEM_MANUFACTURING_T1 = 10016;
2006
+ declare const MODULE_ANY = 0;
2007
+ declare const MODULE_ENGINE = 1;
2008
+ declare const MODULE_GENERATOR = 2;
2009
+ declare const MODULE_EXTRACTOR = 3;
2010
+ declare const MODULE_LOADER = 4;
2011
+ declare const MODULE_WARP = 5;
2012
+ declare const MODULE_CRAFTER = 6;
2013
+ declare const MODULE_LAUNCHER = 7;
2014
+ interface CargoSeed {
2015
+ itemId: number;
2016
+ seed: bigint;
2017
+ }
2018
+ interface ModuleEntry {
2019
+ type: number;
2020
+ installed?: CargoSeed;
2021
+ }
2022
+ declare function moduleAccepts(slotType: number, moduleType: number): boolean;
2023
+ declare function getModuleCapabilityType(itemId: number): number;
2024
+ declare function isModuleItem(itemId: number): boolean;
2025
+
2026
+ declare const categoryColors: Record<ResourceCategory, string>;
2027
+ declare const tierColors: Record<ResourceTier, string>;
2028
+ declare const categoryIcons: Record<ResourceCategory, string>;
2029
+ declare const componentIcon = "\u25A3";
2030
+ declare const moduleIcon = "\u2B22";
2031
+ declare const itemIcons: Record<number, string>;
1988
2032
 
2033
+ declare const ITEM_DRILL_SHAFT = 10009;
2034
+ declare const ITEM_EXTRACTION_PROBE = 10010;
2035
+ declare const ITEM_CARGO_ARM = 10011;
2036
+ declare const ITEM_TOOL_BIT = 10012;
2037
+ declare const ITEM_REACTION_CHAMBER = 10013;
1989
2038
  declare const ITEM_HULL_PLATES = 10001;
1990
2039
  declare const ITEM_CARGO_LINING = 10002;
1991
2040
  declare const ITEM_CONTAINER_PACKED = 10003;
2041
+ declare const ITEM_THRUSTER_CORE = 10004;
2042
+ declare const ITEM_POWER_CELL = 10005;
2043
+ declare const ITEM_SHIP_T1_PACKED = 10008;
1992
2044
  interface RecipeInput {
1993
2045
  category?: ResourceCategory;
1994
2046
  itemId?: number;
@@ -2007,10 +2059,13 @@ interface ComponentDefinition {
2007
2059
  stats: ComponentStat[];
2008
2060
  recipe: RecipeInput[];
2009
2061
  usedIn: {
2010
- type: 'entity';
2062
+ type: 'entity' | 'module';
2011
2063
  name: string;
2012
2064
  }[];
2013
2065
  }
2066
+ interface ModuleSlot {
2067
+ type: number;
2068
+ }
2014
2069
  interface EntityRecipe {
2015
2070
  id: string;
2016
2071
  name: string;
@@ -2023,9 +2078,10 @@ interface EntityRecipe {
2023
2078
  sourceComponentId: number;
2024
2079
  sourceStatKey: string;
2025
2080
  }[];
2081
+ moduleSlots?: ModuleSlot[];
2026
2082
  }
2027
2083
  interface CraftableItem {
2028
- type: 'component' | 'entity';
2084
+ type: 'component' | 'entity' | 'module';
2029
2085
  id: number | string;
2030
2086
  name: string;
2031
2087
  description: string;
@@ -2033,6 +2089,23 @@ interface CraftableItem {
2033
2089
  }
2034
2090
  declare const components: ComponentDefinition[];
2035
2091
  declare const entityRecipes: EntityRecipe[];
2092
+ interface ModuleRecipe {
2093
+ id: string;
2094
+ name: string;
2095
+ description: string;
2096
+ color: string;
2097
+ itemId: number;
2098
+ moduleType: number;
2099
+ recipe: RecipeInput[];
2100
+ stats: {
2101
+ key: string;
2102
+ sourceComponentId: number;
2103
+ sourceStatKey: string;
2104
+ }[];
2105
+ }
2106
+ declare const moduleRecipes: ModuleRecipe[];
2107
+ declare function getModuleRecipe(id: string): ModuleRecipe | undefined;
2108
+ declare function getModuleRecipeByItemId(itemId: number): ModuleRecipe | undefined;
2036
2109
  declare function getComponentById(id: number): ComponentDefinition | undefined;
2037
2110
  declare function getEntityRecipe(id: string): EntityRecipe | undefined;
2038
2111
  declare function getEntityRecipeByItemId(itemId: number): EntityRecipe | undefined;
@@ -2040,6 +2113,73 @@ declare function getAllCraftableItems(): CraftableItem[];
2040
2113
  declare function getComponentsForCategory(category: ResourceCategory): ComponentDefinition[];
2041
2114
  declare function getComponentsForStat(statKey: string): ComponentDefinition[];
2042
2115
 
2116
+ declare function computeShipHullCapabilities(stats: Record<string, number>): {
2117
+ hullmass: number;
2118
+ capacity: number;
2119
+ };
2120
+ declare function computeEngineCapabilities(stats: Record<string, number>): {
2121
+ thrust: number;
2122
+ drain: number;
2123
+ };
2124
+ declare function computeGeneratorCapabilities(stats: Record<string, number>): {
2125
+ capacity: number;
2126
+ recharge: number;
2127
+ };
2128
+ declare function computeExtractorCapabilities(stats: Record<string, number>): {
2129
+ rate: number;
2130
+ drain: number;
2131
+ depth: number;
2132
+ drill: number;
2133
+ };
2134
+ declare function computeLoaderCapabilities(stats: Record<string, number>): {
2135
+ mass: number;
2136
+ thrust: number;
2137
+ quantity: number;
2138
+ };
2139
+ declare function computeManufacturingCapabilities(stats: Record<string, number>): {
2140
+ speed: number;
2141
+ drain: number;
2142
+ };
2143
+
2144
+ interface ResolvedItemStat {
2145
+ key: string;
2146
+ label: string;
2147
+ abbreviation: string;
2148
+ value: number;
2149
+ color: string;
2150
+ category: ResourceCategory;
2151
+ inverted?: boolean;
2152
+ }
2153
+ interface ResolvedAttributeGroup {
2154
+ capability: string;
2155
+ attributes: {
2156
+ label: string;
2157
+ value: number;
2158
+ }[];
2159
+ }
2160
+ type ResolvedItemType = 'resource' | 'component' | 'module' | 'entity';
2161
+ interface ResolvedModuleSlot {
2162
+ name?: string;
2163
+ installed: boolean;
2164
+ attributes?: {
2165
+ label: string;
2166
+ value: number;
2167
+ }[];
2168
+ }
2169
+ interface ResolvedItem {
2170
+ itemId: number;
2171
+ name: string;
2172
+ icon: string;
2173
+ category?: ResourceCategory;
2174
+ tier: ResourceTier;
2175
+ mass: number;
2176
+ itemType: ResolvedItemType;
2177
+ stats?: ResolvedItemStat[];
2178
+ attributes?: ResolvedAttributeGroup[];
2179
+ moduleSlots?: ResolvedModuleSlot[];
2180
+ }
2181
+ declare function resolveItem(itemId: UInt16Type, seed?: UInt64Type, modules?: Types.module_entry[]): ResolvedItem;
2182
+
2043
2183
  type movement_stats = Types.movement_stats;
2044
2184
  type energy_stats = Types.energy_stats;
2045
2185
  type loader_stats = Types.loader_stats;
@@ -2053,4 +2193,4 @@ type location_epoch = Types.location_epoch;
2053
2193
  type location_derived = Types.location_derived;
2054
2194
  type location_row = Types.location_row;
2055
2195
 
2056
- export { ActionsManager, AnyEntity, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CrafterCapability, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_EXTRACTOR_DRAIN, INITIAL_EXTRACTOR_EFFICIENCY, INITIAL_EXTRACTOR_RATE, INITIAL_LOADER_MASS, INITIAL_LOADER_QUANTITY, INITIAL_LOADER_THRUST, INITIAL_SHIP_CAPACITY, INITIAL_SHIP_DRAIN, INITIAL_SHIP_ENERGY, INITIAL_SHIP_GENERATOR_CAPACITY, INITIAL_SHIP_HULLMASS, INITIAL_SHIP_MASS, INITIAL_SHIP_RECHARGE, INITIAL_SHIP_THRUST, INITIAL_SHIP_Z, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_LINING, ITEM_CONTAINER_PACKED, ITEM_DOES_NOT_EXIST, ITEM_HULL_PLATES, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RecipeInput, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipEntity, ShipLike, ShipStateInput, Shipload, StackInput, StatDefinition, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendComponentStacks, blendStacks, calcCargoMass, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capsHasCrafter, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoUtils, cargo_item, components, computeComponentStats, computeContainerCapabilities, computeEntityStats, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStats, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, encodeStats, energyPercent, energy_stats, entityRecipes, estimateDealTravelTime, estimateTravelTime, extractor_stats, findNearbyPlanets, getAllCraftableItems, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, maxTravelDistance, movement_stats, needsRecharge, projectEntity, projectEntityAt, resolveStats, rotation, schedule, task, toLocation, warehouse_row };
2196
+ export { ActionsManager, AnyEntity, BASE_ORBITAL_MASS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CargoSeed, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CrafterCapability, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CONTAINER_PACKED, ITEM_DOES_NOT_EXIST, ITEM_DRILL_SHAFT, ITEM_ENGINE_T1, ITEM_EXTRACTION_PROBE, ITEM_EXTRACTOR_T1, ITEM_GENERATOR_T1, ITEM_HULL_PLATES, ITEM_LOADER_T1, ITEM_MANUFACTURING_T1, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_SHIP_T1_PACKED, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CRAFTER, MODULE_ENGINE, MODULE_EXTRACTOR, MODULE_GENERATOR, MODULE_LAUNCHER, MODULE_LOADER, MODULE_WARP, MassCapability, ModuleEntry, ModuleRecipe, ModuleSlot, MovementCapability, NO_SCHEDULE, NamedStats, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RecipeInput, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipEntity, ShipLike, ShipStateInput, Shipload, StackInput, StatDefinition, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendStacks, calcCargoMass, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capsHasCrafter, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoUtils, cargo_item, categoryColors, categoryIcons, componentIcon, components, computeComponentStats, computeContainerCapabilities, computeEngineCapabilities, computeEntityStats, computeExtractorCapabilities, computeGeneratorCapabilities, computeLoaderCapabilities, computeManufacturingCapabilities, computeShipHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStats, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, encodeStats, energyPercent, energy_stats, entityRecipes, estimateDealTravelTime, estimateTravelTime, extractor_stats, findNearbyPlanets, getAllCraftableItems, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getModuleCapabilityType, getModuleRecipe, getModuleRecipeByItemId, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isModuleItem, itemIcons, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, maxTravelDistance, moduleAccepts, moduleIcon, moduleRecipes, movement_stats, needsRecharge, projectEntity, projectEntityAt, resolveItem, resolveStats, rotation, schedule, task, tierColors, toLocation, warehouse_row };