fleethub-core 0.4.3 → 0.5.2

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/bindings.d.ts CHANGED
@@ -305,6 +305,8 @@ export type AirState =
305
305
  | "AirDenial"
306
306
  | "AirIncapability";
307
307
 
308
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
309
+
308
310
  export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
309
311
 
310
312
  export type Formation = SingleFormation | CombinedFormation;
@@ -490,6 +492,7 @@ export interface OrgState {
490
492
  a3?: AirSquadronState;
491
493
  hq_level?: number;
492
494
  org_type?: OrgType;
495
+ sortie?: string;
493
496
  route_sup?: string;
494
497
  boss_sup?: string;
495
498
  }
@@ -753,7 +756,7 @@ export interface FleetDayCutinRateInfo {
753
756
  ships: Array<ShipDayCutinRateInfo>;
754
757
  }
755
758
 
756
- export interface OrgDayCutinRateInfo {
759
+ export interface CompDayCutinRateInfo {
757
760
  main: FleetDayCutinRateInfo;
758
761
  escort: FleetDayCutinRateInfo | null;
759
762
  }
@@ -768,7 +771,7 @@ export interface ShipAntiAirInfo {
768
771
  anti_air_propellant_barrage_chance: number | null;
769
772
  }
770
773
 
771
- export interface OrgAntiAirInfo {
774
+ export interface CompAntiAirInfo {
772
775
  fleet_anti_air: number;
773
776
  ships: Array<ShipAntiAirInfo>;
774
777
  anti_air_cutin_chance: Array<[number, number]>;
@@ -806,15 +809,11 @@ export interface AirstrikeContactChance {
806
809
  total: number;
807
810
  }
808
811
 
809
- export interface OrgContactChanceInfo {
812
+ export interface CompContactChanceInfo {
810
813
  single: Array<AirstrikeContactChance> | null;
811
814
  combined: Array<AirstrikeContactChance> | null;
812
815
  }
813
816
 
814
- export interface OrgAirstrikeInfo {
815
- contact_chance: OrgContactChanceInfo;
816
- }
817
-
818
817
  export interface AttackStats {
819
818
  attack_power: AttackPower | null;
820
819
  attack_power_params: AttackPowerParams | null;
@@ -911,3 +910,5 @@ export interface SimulatorResult {
911
910
  items: Array<SimulatorResultItem>;
912
911
  sunk_vec: Array<[number, number, number]>;
913
912
  }
913
+
914
+ export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
package/node/fh_core.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ */
5
+ export function set_panic_hook(): void;
6
+ /**
4
7
  * @param {Gear} gear
5
8
  * @returns {boolean}
6
9
  */
7
10
  export function air_squadron_can_equip(gear: Gear): boolean;
8
11
  /**
9
- */
10
- export function set_panic_hook(): void;
11
- /**
12
12
  * @param {bindings.OrgType} org_type
13
13
  * @returns {boolean}
14
14
  */
@@ -71,13 +71,11 @@ export class AirSquadron {
71
71
  */
72
72
  radius(): number;
73
73
  /**
74
- * @returns {string}
75
74
  */
76
75
  id: string;
77
76
  /**
78
- * @returns {bindings.AirSquadronMode}
79
77
  */
80
- readonly mode: bindings.AirSquadronMode;
78
+ mode: bindings.AirSquadronMode;
81
79
  /**
82
80
  * @returns {string}
83
81
  */
@@ -85,9 +83,57 @@ export class AirSquadron {
85
83
  }
86
84
  /**
87
85
  */
86
+ export class Analyzer {
87
+ free(): void;
88
+ /**
89
+ * @param {Comp} comp
90
+ * @param {bindings.Formation} formation
91
+ * @param {number | undefined} adjusted_anti_air_resist
92
+ * @param {number | undefined} fleet_anti_air_resist
93
+ * @param {number | undefined} aaci
94
+ * @returns {bindings.CompAntiAirInfo}
95
+ */
96
+ analyze_anti_air(comp: Comp, formation: bindings.Formation, adjusted_anti_air_resist?: number, fleet_anti_air_resist?: number, aaci?: number): bindings.CompAntiAirInfo;
97
+ /**
98
+ * @param {Comp} comp
99
+ * @returns {bindings.CompDayCutinRateInfo}
100
+ */
101
+ analyze_day_cutin(comp: Comp): bindings.CompDayCutinRateInfo;
102
+ /**
103
+ * @param {Comp} comp
104
+ * @param {bindings.NightSituation} attacker_situation
105
+ * @param {bindings.NightSituation} target_situation
106
+ * @returns {bindings.FleetNightCutinRateInfo}
107
+ */
108
+ analyze_night_cutin(comp: Comp, attacker_situation: bindings.NightSituation, target_situation: bindings.NightSituation): bindings.FleetNightCutinRateInfo;
109
+ /**
110
+ * @param {Comp} comp
111
+ * @returns {bindings.CompContactChanceInfo}
112
+ */
113
+ analyze_contact_chance(comp: Comp): bindings.CompContactChanceInfo;
114
+ /**
115
+ * @param {bindings.WarfareAnalyzerContext} params
116
+ * @param {Ship} attacker
117
+ * @param {Ship} target
118
+ * @returns {bindings.WarfareInfo}
119
+ */
120
+ analyze_warfare(params: bindings.WarfareAnalyzerContext, attacker: Ship, target: Ship): bindings.WarfareInfo;
121
+ /**
122
+ * @param {Comp} comp
123
+ * @param {bindings.Engagement} engagement
124
+ * @returns {bindings.FleetCutinAnalysis}
125
+ */
126
+ analyze_fleet_cutin(comp: Comp, engagement: bindings.Engagement): bindings.FleetCutinAnalysis;
127
+ }
128
+ /**
129
+ */
88
130
  export class Comp {
89
131
  free(): void;
90
132
  /**
133
+ * @returns {bindings.Side}
134
+ */
135
+ side(): bindings.Side;
136
+ /**
91
137
  * @returns {boolean}
92
138
  */
93
139
  is_combined(): boolean;
@@ -122,23 +168,49 @@ export class Comp {
122
168
  */
123
169
  get_ship_by_eid_with_clone(id: string): Ship | undefined;
124
170
  /**
125
- * @returns {Fleet | undefined}
171
+ * @returns {bindings.Formation}
172
+ */
173
+ default_formation(): bindings.Formation;
174
+ /**
175
+ * 艦隊対空値
176
+ * @param {number} formation_mod
177
+ * @returns {number}
178
+ */
179
+ fleet_anti_air(formation_mod: number): number;
180
+ /**
181
+ * 制空値
182
+ * @param {boolean} anti_combined
183
+ * @param {boolean} anti_lbas
184
+ * @returns {number | undefined}
185
+ */
186
+ fighter_power(anti_combined: boolean, anti_lbas: boolean): number | undefined;
187
+ /**
188
+ * マップ索敵
189
+ * @param {number} node_divaricated_factor
190
+ * @returns {number | undefined}
191
+ */
192
+ elos(node_divaricated_factor: number): number | undefined;
193
+ /**
194
+ * 輸送物資量(TP)
195
+ * @returns {number}
196
+ */
197
+ transport_point(): number;
198
+ /**
126
199
  */
127
200
  boss_sup?: Fleet;
128
201
  /**
129
- * @returns {Fleet | undefined}
130
202
  */
131
203
  escort?: Fleet;
132
204
  /**
133
- * @returns {Fleet}
205
+ */
206
+ hq_level: number;
207
+ /**
134
208
  */
135
209
  main: Fleet;
136
210
  /**
137
- * @returns {bindings.OrgType}
138
211
  */
139
212
  org_type: bindings.OrgType;
140
213
  /**
141
- * @returns {Fleet | undefined}
142
214
  */
143
215
  route_sup?: Fleet;
144
216
  }
@@ -182,56 +254,19 @@ export class FhCore {
182
254
  */
183
255
  create_ship_by_id(ship_id: number): Ship | undefined;
184
256
  /**
185
- * @returns {Ship}
186
- */
187
- create_default_ship(): Ship;
188
- /**
189
- * @returns {Uint16Array}
190
- */
191
- get_gear_ids(): Uint16Array;
192
- /**
193
- * @param {Org} org
194
- * @param {string} key
195
- * @param {bindings.Formation} formation
196
- * @param {number | undefined} adjusted_anti_air_resist
197
- * @param {number | undefined} fleet_anti_air_resist
198
- * @returns {any}
199
- */
200
- analyze_anti_air(org: Org, key: string, formation: bindings.Formation, adjusted_anti_air_resist?: number, fleet_anti_air_resist?: number): any;
201
- /**
202
- * @param {Org} org
203
- * @param {string} key
204
- * @returns {any}
205
- */
206
- analyze_day_cutin(org: Org, key: string): any;
207
- /**
208
- * @param {Org} org
209
- * @param {string} key
210
- * @param {bindings.NightSituation} attacker_situation
211
- * @param {bindings.NightSituation} defender_situation
212
- * @returns {any}
213
- */
214
- analyze_night_cutin(org: Org, key: string, attacker_situation: bindings.NightSituation, defender_situation: bindings.NightSituation): any;
215
- /**
216
- * @param {Org} org
217
- * @param {string} key
218
- * @returns {any}
257
+ * @param {Uint16Array} main
258
+ * @param {Uint16Array | undefined} escort
259
+ * @returns {Comp}
219
260
  */
220
- analyze_contact_chance(org: Org, key: string): any;
261
+ create_comp_by_map_enemy(main: Uint16Array, escort?: Uint16Array): Comp;
221
262
  /**
222
- * @param {bindings.WarfareAnalyzerContext} params
223
- * @param {Ship} attacker
224
- * @param {Ship} target
225
- * @returns {bindings.WarfareInfo}
263
+ * @returns {Ship}
226
264
  */
227
- analyze_warfare(params: bindings.WarfareAnalyzerContext, attacker: Ship, target: Ship): bindings.WarfareInfo;
265
+ create_default_ship(): Ship;
228
266
  /**
229
- * @param {Org} org
230
- * @param {string} key
231
- * @param {bindings.Engagement} engagement
232
- * @returns {bindings.FleetCutinAnalysis}
267
+ * @returns {Analyzer}
233
268
  */
234
- analyze_fleet_cutin(org: Org, key: string, engagement: bindings.Engagement): bindings.FleetCutinAnalysis;
269
+ create_analyzer(): Analyzer;
235
270
  /**
236
271
  * @param {Comp} player
237
272
  * @param {Comp} enemy
@@ -329,13 +364,11 @@ export class Fleet {
329
364
  */
330
365
  readonly fleet_los_mod: number | undefined;
331
366
  /**
332
- * @returns {string}
333
367
  */
334
368
  id: string;
335
369
  /**
336
- * @returns {number}
337
370
  */
338
- readonly len: number;
371
+ len: number;
339
372
  /**
340
373
  * @returns {string}
341
374
  */
@@ -402,10 +435,10 @@ export class Gear {
402
435
  */
403
436
  is_contact_selection_plane(): boolean;
404
437
  /**
405
- * @param {number} air_state_modifier
438
+ * @param {bindings.AirStateRank} rank
406
439
  * @returns {number}
407
440
  */
408
- contact_selection_rate(air_state_modifier: number): number;
441
+ contact_selection_rate(rank: bindings.AirStateRank): number;
409
442
  /**
410
443
  * @param {number} level
411
444
  * @returns {number}
@@ -438,69 +471,55 @@ export class Gear {
438
471
  */
439
472
  expedition_bonus(): number;
440
473
  /**
441
- * @returns {number}
442
474
  */
443
- readonly accuracy: number;
475
+ accuracy: number;
444
476
  /**
445
477
  * @returns {number}
446
478
  */
447
479
  readonly ace: number;
448
480
  /**
449
- * @returns {number}
450
481
  */
451
- readonly adjusted_anti_air_resistance: number;
482
+ adjusted_anti_air_resistance: number;
452
483
  /**
453
- * @returns {number}
454
484
  */
455
- readonly anti_air: number;
485
+ anti_air: number;
456
486
  /**
457
487
  * @returns {number}
458
488
  */
459
489
  readonly anti_bomber: number;
460
490
  /**
461
- * @returns {number}
462
491
  */
463
- readonly armor: number;
492
+ armor: number;
464
493
  /**
465
- * @returns {number}
466
494
  */
467
- readonly asw: number;
495
+ asw: number;
468
496
  /**
469
- * @returns {number}
470
497
  */
471
- readonly bombing: number;
498
+ bombing: number;
472
499
  /**
473
- * @returns {number}
474
500
  */
475
- readonly cost: number;
501
+ cost: number;
476
502
  /**
477
- * @returns {number}
478
503
  */
479
- readonly default_exp: number;
504
+ default_exp: number;
480
505
  /**
481
- * @returns {number}
482
506
  */
483
- readonly evasion: number;
507
+ evasion: number;
484
508
  /**
485
- * @returns {number}
486
509
  */
487
- readonly exp: number;
510
+ exp: number;
488
511
  /**
489
- * @returns {number}
490
512
  */
491
- readonly firepower: number;
513
+ firepower: number;
492
514
  /**
493
- * @returns {number}
494
515
  */
495
- readonly fleet_anti_air_resistance: number;
516
+ fleet_anti_air_resistance: number;
496
517
  /**
497
- * @returns {number}
498
518
  */
499
- readonly gear_id: number;
519
+ gear_id: number;
500
520
  /**
501
- * @returns {bindings.GearType}
502
521
  */
503
- readonly gear_type: bindings.GearType;
522
+ gear_type: bindings.GearType;
504
523
  /**
505
524
  * @returns {number}
506
525
  */
@@ -510,57 +529,46 @@ export class Gear {
510
529
  */
511
530
  readonly icon_id: number;
512
531
  /**
513
- * @returns {string}
514
532
  */
515
533
  id: string;
516
534
  /**
517
- * @returns {boolean}
518
535
  */
519
- readonly improvable: boolean;
536
+ improvable: boolean;
520
537
  /**
521
538
  * @returns {number}
522
539
  */
523
540
  readonly interception: number;
524
541
  /**
525
- * @returns {number}
526
542
  */
527
- readonly los: number;
543
+ los: number;
528
544
  /**
529
- * @returns {number}
530
545
  */
531
- readonly luck: number;
546
+ luck: number;
532
547
  /**
533
- * @returns {number}
534
548
  */
535
- readonly max_hp: number;
549
+ max_hp: number;
536
550
  /**
537
- * @returns {string}
538
551
  */
539
552
  name: string;
540
553
  /**
541
- * @returns {number}
542
554
  */
543
- readonly radius: number;
555
+ radius: number;
544
556
  /**
545
- * @returns {number}
546
557
  */
547
- readonly range: number;
558
+ range: number;
548
559
  /**
549
560
  * @returns {number}
550
561
  */
551
562
  readonly special_type_id: number;
552
563
  /**
553
- * @returns {number}
554
564
  */
555
- readonly speed: number;
565
+ speed: number;
556
566
  /**
557
- * @returns {number}
558
567
  */
559
- readonly stars: number;
568
+ stars: number;
560
569
  /**
561
- * @returns {number}
562
570
  */
563
- readonly torpedo: number;
571
+ torpedo: number;
564
572
  /**
565
573
  * @returns {any}
566
574
  */
@@ -575,67 +583,51 @@ export class Gear {
575
583
  export class IBonuses {
576
584
  free(): void;
577
585
  /**
578
- * @returns {number}
579
586
  */
580
587
  adjusted_anti_air: number;
581
588
  /**
582
- * @returns {number}
583
589
  */
584
590
  asw_accuracy: number;
585
591
  /**
586
- * @returns {number}
587
592
  */
588
593
  asw_power: number;
589
594
  /**
590
- * @returns {number}
591
595
  */
592
596
  carrier_shelling_power: number;
593
597
  /**
594
- * @returns {number}
595
598
  */
596
599
  contact_selection: number;
597
600
  /**
598
- * @returns {number}
599
601
  */
600
602
  defense_power: number;
601
603
  /**
602
- * @returns {number}
603
604
  */
604
605
  elos: number;
605
606
  /**
606
- * @returns {number}
607
607
  */
608
608
  fighter_power: number;
609
609
  /**
610
- * @returns {number}
611
610
  */
612
611
  fleet_anti_air: number;
613
612
  /**
614
- * @returns {number}
615
613
  */
616
614
  night_accuracy: number;
617
615
  /**
618
- * @returns {number}
619
616
  */
620
617
  night_power: number;
621
618
  /**
622
- * @returns {number}
623
619
  */
624
620
  shelling_accuracy: number;
625
621
  /**
626
- * @returns {number}
627
622
  */
628
623
  shelling_power: number;
629
624
  /**
630
- * @returns {number}
631
625
  */
632
626
  torpedo_accuracy: number;
633
627
  /**
634
- * @returns {number}
635
628
  */
636
629
  torpedo_evasion: number;
637
630
  /**
638
- * @returns {number}
639
631
  */
640
632
  torpedo_power: number;
641
633
  }
@@ -660,16 +652,6 @@ export class Org {
660
652
  air_squadron_ids(): (string)[];
661
653
  /**
662
654
  * @param {bindings.Role} role
663
- * @returns {(string)[]}
664
- */
665
- ship_keys(role: bindings.Role): (string)[];
666
- /**
667
- * @param {bindings.Role} role
668
- * @returns {(string)[] | undefined}
669
- */
670
- sortie_ship_keys(role: bindings.Role): (string)[] | undefined;
671
- /**
672
- * @param {bindings.Role} role
673
655
  * @returns {number | undefined}
674
656
  */
675
657
  fleet_los_mod(role: bindings.Role): number | undefined;
@@ -703,6 +685,10 @@ export class Org {
703
685
  */
704
686
  get_fleet_id_by_role(role: bindings.Role): string;
705
687
  /**
688
+ * @returns {Comp}
689
+ */
690
+ create_comp(): Comp;
691
+ /**
706
692
  * @param {string} key
707
693
  * @returns {Comp}
708
694
  */
@@ -737,29 +723,6 @@ export class Org {
737
723
  */
738
724
  is_combined(): boolean;
739
725
  /**
740
- * @returns {bindings.Formation}
741
- */
742
- default_formation(): bindings.Formation;
743
- /**
744
- * 艦隊対空値
745
- * @param {number} formation_mod
746
- * @returns {number}
747
- */
748
- fleet_anti_air(formation_mod: number): number;
749
- /**
750
- * 制空値
751
- * @param {boolean} anti_combined
752
- * @param {boolean} anti_lbas
753
- * @returns {number | undefined}
754
- */
755
- fighter_power(anti_combined: boolean, anti_lbas: boolean): number | undefined;
756
- /**
757
- * マップ索敵
758
- * @param {number} node_divaricated_factor
759
- * @returns {number | undefined}
760
- */
761
- elos(node_divaricated_factor: number): number | undefined;
762
- /**
763
726
  * 防空時の基地制空値
764
727
  * @returns {number}
765
728
  */
@@ -770,12 +733,6 @@ export class Org {
770
733
  */
771
734
  high_altitude_interception_power(): number;
772
735
  /**
773
- * 輸送物資量(TP)
774
- * @param {string} key
775
- * @returns {number}
776
- */
777
- transport_point(key: string): number;
778
- /**
779
736
  * @param {Ship} ship
780
737
  * @param {bindings.Formation} formation
781
738
  * @returns {bindings.WarfareShipEnvironment}
@@ -786,25 +743,23 @@ export class Org {
786
743
  */
787
744
  static default(): Org;
788
745
  /**
789
- * @returns {string}
790
746
  */
791
- boss_sup: string;
747
+ boss_sup?: string;
792
748
  /**
793
- * @returns {number}
794
749
  */
795
- readonly hq_level: number;
750
+ hq_level: number;
796
751
  /**
797
- * @returns {string}
798
752
  */
799
753
  id: string;
800
754
  /**
801
- * @returns {bindings.OrgType}
802
755
  */
803
- readonly org_type: bindings.OrgType;
756
+ org_type: bindings.OrgType;
804
757
  /**
805
- * @returns {string}
806
758
  */
807
- route_sup: string;
759
+ route_sup?: string;
760
+ /**
761
+ */
762
+ sortie: string;
808
763
  /**
809
764
  * @returns {string}
810
765
  */
@@ -1008,9 +963,8 @@ export class Ship {
1008
963
  */
1009
964
  readonly accuracy: number;
1010
965
  /**
1011
- * @returns {number}
1012
966
  */
1013
- readonly ammo: number;
967
+ ammo: number;
1014
968
  /**
1015
969
  * @returns {number | undefined}
1016
970
  */
@@ -1028,9 +982,8 @@ export class Ship {
1028
982
  */
1029
983
  readonly ctype: number;
1030
984
  /**
1031
- * @returns {number}
1032
985
  */
1033
- readonly current_hp: number;
986
+ current_hp: number;
1034
987
  /**
1035
988
  * @returns {number | undefined}
1036
989
  */
@@ -1040,17 +993,14 @@ export class Ship {
1040
993
  */
1041
994
  readonly firepower: number | undefined;
1042
995
  /**
1043
- * @returns {number}
1044
996
  */
1045
- readonly fuel: number;
997
+ fuel: number;
1046
998
  /**
1047
- * @returns {string}
1048
999
  */
1049
1000
  id: string;
1050
1001
  /**
1051
- * @returns {number}
1052
1002
  */
1053
- readonly level: number;
1003
+ level: number;
1054
1004
  /**
1055
1005
  * @returns {number | undefined}
1056
1006
  */
@@ -1072,9 +1022,8 @@ export class Ship {
1072
1022
  */
1073
1023
  readonly max_hp: number | undefined;
1074
1024
  /**
1075
- * @returns {number}
1076
1025
  */
1077
- readonly morale: number;
1026
+ morale: number;
1078
1027
  /**
1079
1028
  * @returns {number | undefined}
1080
1029
  */
@@ -1124,17 +1073,14 @@ export class Ship {
1124
1073
  */
1125
1074
  readonly range: number | undefined;
1126
1075
  /**
1127
- * @returns {bindings.ShipClass}
1128
1076
  */
1129
- readonly ship_class: bindings.ShipClass;
1077
+ ship_class: bindings.ShipClass;
1130
1078
  /**
1131
- * @returns {number}
1132
1079
  */
1133
- readonly ship_id: number;
1080
+ ship_id: number;
1134
1081
  /**
1135
- * @returns {bindings.ShipType}
1136
1082
  */
1137
- readonly ship_type: bindings.ShipType;
1083
+ ship_type: bindings.ShipType;
1138
1084
  /**
1139
1085
  * @returns {number}
1140
1086
  */