fleethub-core 1.11.5 → 1.11.7

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.
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ */
5
+ export function set_panic_hook(): void;
3
6
  /**
4
7
  * @param {ShipConditions} value
5
8
  * @returns {ShipConditions}
6
9
  */
7
10
  export function parse_ship_conditions(value: ShipConditions): ShipConditions;
8
- /**
9
- */
10
- export function set_panic_hook(): void;
11
11
  export interface AttackPower {
12
12
  precap: number;
13
13
  is_capped: boolean;
@@ -33,66 +33,27 @@ export interface AttackPowerParams {
33
33
  custom_mods: CustomPowerModifiers;
34
34
  }
35
35
 
36
- export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
37
- formation?: Formation;
38
- }
39
-
40
- export interface NodeAttackAnalyzerConfig {
41
- air_state?: AirState;
42
- engagement?: Engagement;
43
- node_state?: NodeState;
44
- left?: NodeAttackAnalyzerShipConfig;
45
- right?: NodeAttackAnalyzerShipConfig;
46
- }
47
-
48
- export interface NodeAttackAnalysis {
49
- left: AttackAnalysis;
50
- right: AttackAnalysis;
51
- shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
52
- night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
53
- }
54
-
55
- export interface AttackAnalyzerShipConfig
56
- extends ShipConditions,
57
- NightFleetConditions {
58
- fleet_los_mod?: number | null;
59
- }
60
-
61
- export interface ShellingStyle {
62
- tag: "ShellingStyle";
63
- attack_type: ShellingType;
64
- cutin: DayCutinLike | null;
65
- power_mod: number;
66
- accuracy_mod: number;
67
- hits: number;
68
- }
69
-
70
- export interface NightAttackStyle {
71
- tag: "NightAttackStyle";
72
- attack_type: NightAttackType;
73
- cutin: NightCutinLike | null;
74
- power_mod: number;
75
- accuracy_mod: number;
76
- hits: number;
36
+ export interface NightContactChance {
37
+ rank1: number;
38
+ rank2: number;
39
+ rank3: number;
77
40
  }
78
41
 
79
- export interface AswAttackStyle {
80
- tag: "AswAttackStyle";
81
- attack_type: AswAttackType;
42
+ export interface CompNightCutinAnalysis {
43
+ night_contact_chance: NightContactChance;
44
+ ships: ShipNightCutinAnalysis[];
82
45
  }
83
46
 
84
- export interface TorpedoAttackStyle {
85
- tag: "TorpedoAttackStyle";
86
- attack_type: TorpedoAttackType;
47
+ export interface ShipNightCutinAnalysis {
48
+ ship_id: number;
49
+ index: number;
50
+ normal: NightCutinActionReport;
51
+ chuuha: NightCutinActionReport;
87
52
  }
88
53
 
89
- export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
90
-
91
- export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
92
-
93
- export interface SupportShellingStyle {
94
- tag: "SupportShellingStyle";
95
- attack_type: SupportShellingType;
54
+ export interface NightCutinActionReport
55
+ extends ActionReport<NightPhaseAttackStyle> {
56
+ cutin_term: number | null;
96
57
  }
97
58
 
98
59
  export type FleetType = "Main" | "Escort" | "RouteSup" | "BossSup";
@@ -222,75 +183,75 @@ export interface OrgState {
222
183
 
223
184
  export type FleetKey = "f1" | "f2" | "f3" | "f4";
224
185
 
225
- export interface CompDayCutinAnalysis {
226
- rank3_air_state: AirState;
227
- rank2_air_state: AirState;
228
- main_fleet_los_mod: number | null;
229
- escort_fleet_los_mod: number | null;
230
- ships: ShipDayCutinAnalysis[];
186
+ export interface SupportShellingSimulatorParams {
187
+ attacker_formation?: Formation;
188
+ target_formation?: Formation;
189
+ engagement: Engagement;
231
190
  }
232
191
 
233
- export interface ShipDayCutinAnalysis {
234
- ship_id: number;
235
- role: Role;
236
- index: number;
237
- rank3: DayCutinReport;
238
- rank2: DayCutinReport;
192
+ export interface EquippabilityRule {
193
+ ship: CompiledEvaler;
194
+ keys?: string[];
195
+ include?: string;
196
+ exclude?: string;
239
197
  }
240
198
 
241
- export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
242
- observation_term: number | null;
199
+ export interface MasterEquippability {
200
+ equip_stype: EquipStype[];
201
+ equip_exslot: number[];
202
+ equip_ship: MstEquipShip[];
203
+ equip_exslot_ship: Record<number, MstEquipExslotShip>;
204
+ rules: EquippabilityRule[];
243
205
  }
244
206
 
245
- export interface ShipMeta {
246
- id: string;
247
- ship_id: number;
207
+ export interface MstEquipExslotShip {
208
+ api_ctypes: Record<number, number> | null;
209
+ api_ship_ids: Record<number, number> | null;
210
+ api_stypes: Record<number, number> | null;
248
211
  }
249
212
 
250
- export interface FleetMeta {
251
- id: string;
252
- len: number;
253
- ships: [string, ShipMeta | null][];
213
+ export interface MstEquipShip {
214
+ api_ship_id: number;
215
+ api_equip_type: number[];
254
216
  }
255
217
 
256
- export interface CompMeta {
257
- fleets: Record<FleetType, FleetMeta>;
218
+ export interface EquipStype {
219
+ id: number;
220
+ equip_type: number[];
258
221
  }
259
222
 
260
- export type NodeId = string;
223
+ export interface CompAnalyzerConfig {
224
+ engagement: Engagement;
225
+ formation: Formation;
226
+ anti_air_cutin: number | null;
227
+ ship_anti_air_resist: number;
228
+ fleet_anti_air_resist: number;
229
+ left_night_fleet_conditions: NightFleetConditions;
230
+ right_night_fleet_conditions: NightFleetConditions;
231
+ }
261
232
 
262
- export interface NodeState {
263
- map?: number;
264
- node?: NodeId;
265
- phase?: number;
266
- debuff?: boolean;
267
- disable_historical_mod?: boolean;
233
+ export interface CompNightAnalysis {
234
+ night_cutin: CompNightCutinAnalysis;
235
+ fleet_cutin: FleetCutinReport<NightAttackStyle>[];
268
236
  }
269
237
 
270
- export type OrgType =
271
- | "Single"
272
- | "CarrierTaskForce"
273
- | "SurfaceTaskForce"
274
- | "TransportEscort"
275
- | "EnemySingle"
276
- | "EnemyCombined";
238
+ export interface CompDayAnalysis {
239
+ day_cutin: CompDayCutinAnalysis;
240
+ fleet_cutin: FleetCutinReport<ShellingStyle>[];
241
+ }
277
242
 
278
- export type SlotSizeVec = (number | null)[];
243
+ export interface CompAnalysis {
244
+ day: CompDayAnalysis;
245
+ night: CompNightAnalysis;
246
+ contact: ContactAnalysis;
247
+ anti_air: CompAntiAirAnalysis;
248
+ }
279
249
 
280
- export type SpecialEnemyType =
281
- | "None"
282
- | "SoftSkinned"
283
- | "Pillbox"
284
- | "IsolatedIsland"
285
- | "SupplyDepot"
286
- | "NewSupplyDepot"
287
- | "HarbourSummerPrincess"
288
- | "PtImp"
289
- | "BattleshipSummerPrincess"
290
- | "HeavyCruiserSummerPrincess"
291
- | "FrenchBattleshipPrincess"
292
- | "AnchorageWaterDemonVacationMode"
293
- | "DockPrincess";
250
+ export interface AttackAnalyzerShipConfig
251
+ extends ShipConditions,
252
+ NightFleetConditions {
253
+ fleet_los_mod?: number | null;
254
+ }
294
255
 
295
256
  export interface MasterShip {
296
257
  ship_id: number;
@@ -326,34 +287,50 @@ export interface MasterShip {
326
287
 
327
288
  export type StatInterval = [number | null, number | null];
328
289
 
329
- export interface FleetCutinReport<T> {
330
- cutin: FleetCutin;
331
- rate: number | null;
332
- formation: Formation;
333
- attacks: FleetCutinAttackReport<T>[];
290
+ export interface ShellingStyle {
291
+ tag: "ShellingStyle";
292
+ attack_type: ShellingType;
293
+ cutin: DayCutinLike | null;
294
+ power_mod: number;
295
+ accuracy_mod: number;
296
+ hits: number;
334
297
  }
335
298
 
336
- export interface FleetCutinAttackReport<T> extends AttackReport<T> {
337
- index: number;
338
- ship_id: number;
299
+ export interface NightAttackStyle {
300
+ tag: "NightAttackStyle";
301
+ attack_type: NightAttackType;
302
+ cutin: NightCutinLike | null;
339
303
  power_mod: number;
304
+ accuracy_mod: number;
305
+ hits: number;
340
306
  }
341
307
 
342
- export type SingleFormation =
343
- | "LineAhead"
344
- | "DoubleLine"
345
- | "Diamond"
346
- | "Echelon"
347
- | "LineAbreast"
348
- | "Vanguard";
308
+ export interface AswAttackStyle {
309
+ tag: "AswAttackStyle";
310
+ attack_type: AswAttackType;
311
+ }
349
312
 
350
- export type CombinedFormation =
351
- | "Cruising1"
352
- | "Cruising2"
353
- | "Cruising3"
354
- | "Cruising4";
313
+ export interface TorpedoAttackStyle {
314
+ tag: "TorpedoAttackStyle";
315
+ attack_type: TorpedoAttackType;
316
+ }
355
317
 
356
- export type Formation = SingleFormation | CombinedFormation;
318
+ export type DayPhaseAttackStyle = ShellingStyle | AswAttackStyle;
319
+
320
+ export type NightPhaseAttackStyle = NightAttackStyle | AswAttackStyle;
321
+
322
+ export interface SupportShellingStyle {
323
+ tag: "SupportShellingStyle";
324
+ attack_type: SupportShellingType;
325
+ }
326
+
327
+ export type OrgType =
328
+ | "Single"
329
+ | "CarrierTaskForce"
330
+ | "SurfaceTaskForce"
331
+ | "TransportEscort"
332
+ | "EnemySingle"
333
+ | "EnemyCombined";
357
334
 
358
335
  export type GearVecInput = GearInput[];
359
336
 
@@ -395,6 +372,8 @@ export interface EBonuses {
395
372
  range: number;
396
373
  }
397
374
 
375
+ export type FhResult<T> = { Ok: T } | { Err: string };
376
+
398
377
  export interface MasterGear {
399
378
  gear_id: number;
400
379
  name: string;
@@ -421,34 +400,43 @@ export interface MasterGear {
421
400
  historical_aircraft_group?: number;
422
401
  }
423
402
 
424
- export interface EquippabilityRule {
425
- ship: CompiledEvaler;
426
- keys?: string[];
427
- include?: string;
428
- exclude?: string;
429
- }
430
-
431
- export interface MasterEquippability {
432
- equip_stype: EquipStype[];
433
- equip_exslot: number[];
434
- equip_ship: MstEquipShip[];
435
- equip_exslot_ship: MstEquipExslotShip[];
436
- rules: EquippabilityRule[];
403
+ export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
404
+ formation?: Formation;
437
405
  }
438
406
 
439
- export interface MstEquipExslotShip {
440
- api_slotitem_id: number;
441
- api_ship_ids: number[];
407
+ export interface NodeAttackAnalyzerConfig {
408
+ air_state?: AirState;
409
+ engagement?: Engagement;
410
+ node_state?: NodeState;
411
+ left?: NodeAttackAnalyzerShipConfig;
412
+ right?: NodeAttackAnalyzerShipConfig;
442
413
  }
443
414
 
444
- export interface MstEquipShip {
445
- api_ship_id: number;
446
- api_equip_type: number[];
415
+ export interface NodeAttackAnalysis {
416
+ left: AttackAnalysis;
417
+ right: AttackAnalysis;
418
+ shelling_fleet_cutin: FleetCutinReport<ShellingStyle>[];
419
+ night_fleet_cutin: FleetCutinReport<NightAttackStyle>[];
447
420
  }
448
421
 
449
- export interface EquipStype {
450
- id: number;
451
- equip_type: number[];
422
+ export interface CompDayCutinAnalysis {
423
+ rank3_air_state: AirState;
424
+ rank2_air_state: AirState;
425
+ main_fleet_los_mod: number | null;
426
+ escort_fleet_los_mod: number | null;
427
+ ships: ShipDayCutinAnalysis[];
428
+ }
429
+
430
+ export interface ShipDayCutinAnalysis {
431
+ ship_id: number;
432
+ role: Role;
433
+ index: number;
434
+ rank3: DayCutinReport;
435
+ rank2: DayCutinReport;
436
+ }
437
+
438
+ export interface DayCutinReport extends ActionReport<DayPhaseAttackStyle> {
439
+ observation_term: number | null;
452
440
  }
453
441
 
454
442
  export interface BattleConditions {
@@ -518,23 +506,50 @@ export type DayCutinLike = DayCutin | FleetCutin;
518
506
 
519
507
  export type NightCutinLike = NightCutin | FleetCutin;
520
508
 
521
- export interface MoveShipPayload {
522
- current: [string, string, ShipKey];
523
- target: [string | null, string, ShipKey];
524
- }
509
+ export type SingleFormation =
510
+ | "LineAhead"
511
+ | "DoubleLine"
512
+ | "Diamond"
513
+ | "Echelon"
514
+ | "LineAbreast"
515
+ | "Vanguard";
525
516
 
526
- export interface ContactAnalysis {
527
- single: DayContactChance[] | null;
528
- combined: DayContactChance[] | null;
517
+ export type CombinedFormation =
518
+ | "Cruising1"
519
+ | "Cruising2"
520
+ | "Cruising3"
521
+ | "Cruising4";
522
+
523
+ export type Formation = SingleFormation | CombinedFormation;
524
+
525
+ export type SpecialEnemyType =
526
+ | "None"
527
+ | "SoftSkinned"
528
+ | "Pillbox"
529
+ | "IsolatedIsland"
530
+ | "SupplyDepot"
531
+ | "NewSupplyDepot"
532
+ | "HarbourSummerPrincess"
533
+ | "PtImp"
534
+ | "BattleshipSummerPrincess"
535
+ | "HeavyCruiserSummerPrincess"
536
+ | "FrenchBattleshipPrincess"
537
+ | "AnchorageWaterDemonVacationMode"
538
+ | "DockPrincess";
539
+
540
+ export type SpeedGroup = "A" | "B1" | "B2" | "C";
541
+
542
+ export interface FleetCutinReport<T> {
543
+ cutin: FleetCutin;
544
+ rate: number | null;
545
+ formation: Formation;
546
+ attacks: FleetCutinAttackReport<T>[];
529
547
  }
530
548
 
531
- export interface DayContactChance {
532
- air_state: AirState;
533
- trigger_rate: number;
534
- rank3: number;
535
- rank2: number;
536
- rank1: number;
537
- total: number;
549
+ export interface FleetCutinAttackReport<T> extends AttackReport<T> {
550
+ index: number;
551
+ ship_id: number;
552
+ power_mod: number;
538
553
  }
539
554
 
540
555
  export interface FormationCombatModifiersDef {
@@ -622,6 +637,31 @@ export interface FleetState {
622
637
  s7?: ShipState;
623
638
  }
624
639
 
640
+ export interface ShipMeta {
641
+ id: string;
642
+ ship_id: number;
643
+ }
644
+
645
+ export interface FleetMeta {
646
+ id: string;
647
+ len: number;
648
+ ships: [string, ShipMeta | null][];
649
+ }
650
+
651
+ export interface CompMeta {
652
+ fleets: Record<FleetType, FleetMeta>;
653
+ }
654
+
655
+ export type NodeId = string;
656
+
657
+ export interface NodeState {
658
+ map?: number;
659
+ node?: NodeId;
660
+ phase?: number;
661
+ debuff?: boolean;
662
+ disable_historical_mod?: boolean;
663
+ }
664
+
625
665
  export interface SlotSizeVecState {
626
666
  ss1?: number;
627
667
  ss2?: number;
@@ -654,9 +694,20 @@ export interface ShipState extends GearVecState, SlotSizeVecState {
654
694
 
655
695
  export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
656
696
 
657
- export type SpeedGroup = "A" | "B1" | "B2" | "C";
697
+ export type SlotSizeVec = (number | null)[];
658
698
 
659
- export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
699
+ export interface MoveShipPayload {
700
+ current: [string, string, ShipKey];
701
+ target: [string | null, string, ShipKey];
702
+ }
703
+
704
+ export interface MasterBattleDefinitions {
705
+ formation: NestedFormationDef[];
706
+ anti_air_cutin: AntiAirCutinDef[];
707
+ day_cutin: DayCutinDef[];
708
+ night_cutin: NightCutinDef[];
709
+ historical_bonuses?: HistoricalBonusDef[];
710
+ }
660
711
 
661
712
  export interface HitRate {
662
713
  normal: number;
@@ -686,15 +737,18 @@ export interface DamageReport {
686
737
  damage_state_density: Histogram<DamageState, number>;
687
738
  }
688
739
 
689
- export interface AttackReport<T> {
690
- style: T;
691
- proc_rate: number | null;
692
- attack_power: AttackPower | null;
693
- attack_power_params: AttackPowerParams | null;
694
- hits: number;
695
- hit_rate: HitRate | null;
696
- hit_rate_params: HitRateParams | null;
697
- damage: DamageReport | null;
740
+ export interface ContactAnalysis {
741
+ single: DayContactChance[] | null;
742
+ combined: DayContactChance[] | null;
743
+ }
744
+
745
+ export interface DayContactChance {
746
+ air_state: AirState;
747
+ trigger_rate: number;
748
+ rank3: number;
749
+ rank2: number;
750
+ rank1: number;
751
+ total: number;
698
752
  }
699
753
 
700
754
  export interface AttackAnalysis {
@@ -743,8 +797,6 @@ export interface GearVecState {
743
797
  gx?: GearState;
744
798
  }
745
799
 
746
- export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
747
-
748
800
  export type ShipCategory =
749
801
  | "Battleship"
750
802
  | "AircraftCarrier"
@@ -780,19 +832,19 @@ export type ShipType =
780
832
  | "CT"
781
833
  | "AO";
782
834
 
783
- export type GearTypeIdArray = [number, number, number, number, number];
835
+ export type Histogram<K extends keyof any, V> = Partial<Record<K, V>>;
784
836
 
785
- export interface SupportShellingSimulatorParams {
786
- attacker_formation?: Formation;
787
- target_formation?: Formation;
788
- engagement: Engagement;
789
- }
837
+ export type CompiledEvaler = string;
790
838
 
791
- export interface ShipAnalyzerConfig {
792
- air_state?: AirState;
793
- engagement?: Engagement;
794
- left?: AttackAnalyzerShipConfig;
795
- right?: AttackAnalyzerShipConfig;
839
+ export interface AttackReport<T> {
840
+ style: T;
841
+ proc_rate: number | null;
842
+ attack_power: AttackPower | null;
843
+ attack_power_params: AttackPowerParams | null;
844
+ hits: number;
845
+ hit_rate: HitRate | null;
846
+ hit_rate_params: HitRateParams | null;
847
+ damage: DamageReport | null;
796
848
  }
797
849
 
798
850
  export interface ActionReport<T> {
@@ -803,58 +855,12 @@ export interface ActionReport<T> {
803
855
 
804
856
  export type AirWaveType = "Jet" | "LandBase" | "Carrier";
805
857
 
806
- export type AirSquadronMode = "Sortie" | "AirDefense";
807
-
808
- export interface AirSquadronState extends GearVecState, SlotSizeVecState {
809
- id?: string;
810
- mode?: AirSquadronMode;
811
- }
812
-
813
- export type AswAttackType = "DepthCharge" | "Aerial";
814
-
815
- export type ShellingType = "Normal" | "Aerial";
816
-
817
- export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
818
-
819
- export type SupportShellingType = ShellingType;
820
-
821
- export type AttackType =
822
- | { t: "Asw"; c: AswAttackType }
823
- | { t: "Shelling"; c: ShellingType }
824
- | { t: "Night"; c: NightAttackType }
825
- | { t: "Torpedo" }
826
- | { t: "SupportShelling"; c: SupportShellingType };
827
-
828
- export type DayPhaseAttackType =
829
- | { t: "Shelling"; c: ShellingType }
830
- | { t: "Asw"; c: AswAttackType };
831
-
832
- export type NightPhaseAttackType =
833
- | { t: "Night"; c: NightAttackType }
834
- | { t: "Asw"; c: AswAttackType };
835
-
836
- export type TorpedoAttackType = null;
837
-
838
- export type Role = "Main" | "Escort";
858
+ export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
839
859
 
840
860
  export type Side = "Player" | "Enemy";
841
861
 
842
862
  export type Align = "Left" | "Right";
843
863
 
844
- export type CompiledEvaler = string;
845
-
846
- export interface SimulatorResult {
847
- items: SimulatorResultItem[];
848
- sunk_vec: [number, number, number][];
849
- }
850
-
851
- export interface SimulatorResultItem {
852
- id: string;
853
- fleet_type: FleetType;
854
- index: number;
855
- damage_state_map: Record<DamageState, number>;
856
- }
857
-
858
864
  export interface MasterData extends MasterBattleDefinitions {
859
865
  created_at: number;
860
866
  gears: MasterGear[];
@@ -876,48 +882,38 @@ export interface MasterAttrRule<T> {
876
882
  expr: CompiledEvaler;
877
883
  }
878
884
 
879
- export interface MasterBattleDefinitions {
880
- formation: NestedFormationDef[];
881
- anti_air_cutin: AntiAirCutinDef[];
882
- day_cutin: DayCutinDef[];
883
- night_cutin: NightCutinDef[];
884
- historical_bonuses?: HistoricalBonusDef[];
885
- }
886
-
887
- export interface NightContactChance {
888
- rank1: number;
889
- rank2: number;
890
- rank3: number;
891
- }
892
-
893
- export interface CompNightCutinAnalysis {
894
- night_contact_chance: NightContactChance;
895
- ships: ShipNightCutinAnalysis[];
885
+ export interface MasterIBonuses {
886
+ shelling_power: MasterIBonusRule[];
887
+ shelling_accuracy: MasterIBonusRule[];
888
+ shelling_aerial_power: MasterIBonusRule[];
889
+ torpedo_power: MasterIBonusRule[];
890
+ torpedo_accuracy: MasterIBonusRule[];
891
+ torpedo_evasion: MasterIBonusRule[];
892
+ asw_power: MasterIBonusRule[];
893
+ asw_accuracy: MasterIBonusRule[];
894
+ night_power: MasterIBonusRule[];
895
+ night_aerial_power: MasterIBonusRule[];
896
+ night_accuracy: MasterIBonusRule[];
897
+ defense_power: MasterIBonusRule[];
898
+ contact_selection: MasterIBonusRule[];
899
+ fighter_power: MasterIBonusRule[];
900
+ ship_anti_air: MasterIBonusRule[];
901
+ fleet_anti_air: MasterIBonusRule[];
902
+ elos: MasterIBonusRule[];
896
903
  }
897
904
 
898
- export interface ShipNightCutinAnalysis {
899
- ship_id: number;
900
- index: number;
901
- normal: NightCutinActionReport;
902
- chuuha: NightCutinActionReport;
905
+ export interface MasterIBonusRule {
906
+ expr: CompiledEvaler;
907
+ formula: CompiledEvaler;
903
908
  }
904
909
 
905
- export interface NightCutinActionReport
906
- extends ActionReport<NightPhaseAttackStyle> {
907
- cutin_term: number | null;
910
+ export interface ShipPosition {
911
+ org_type?: OrgType;
912
+ fleet_type?: FleetType;
913
+ fleet_len?: number;
914
+ index?: number;
908
915
  }
909
916
 
910
- export type AirState =
911
- | "AirSupremacy"
912
- | "AirSuperiority"
913
- | "AirParity"
914
- | "AirDenial"
915
- | "AirIncapability";
916
-
917
- export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
918
-
919
- export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
920
-
921
917
  export type ShipAttr =
922
918
  | "Unknown"
923
919
  | "NightCarrier"
@@ -943,59 +939,42 @@ export interface ShipConditions extends ShipPosition {
943
939
  amagiri_index?: number | null;
944
940
  }
945
941
 
946
- export type FhResult<T> = { Ok: T } | { Err: string };
942
+ export type GearTypeIdArray = [number, number, number, number, number];
947
943
 
948
- export interface MasterIBonuses {
949
- shelling_power: MasterIBonusRule[];
950
- shelling_accuracy: MasterIBonusRule[];
951
- shelling_aerial_power: MasterIBonusRule[];
952
- torpedo_power: MasterIBonusRule[];
953
- torpedo_accuracy: MasterIBonusRule[];
954
- torpedo_evasion: MasterIBonusRule[];
955
- asw_power: MasterIBonusRule[];
956
- asw_accuracy: MasterIBonusRule[];
957
- night_power: MasterIBonusRule[];
958
- night_aerial_power: MasterIBonusRule[];
959
- night_accuracy: MasterIBonusRule[];
960
- defense_power: MasterIBonusRule[];
961
- contact_selection: MasterIBonusRule[];
962
- fighter_power: MasterIBonusRule[];
963
- ship_anti_air: MasterIBonusRule[];
964
- fleet_anti_air: MasterIBonusRule[];
965
- elos: MasterIBonusRule[];
944
+ export interface SimulatorResult {
945
+ items: SimulatorResultItem[];
946
+ sunk_vec: [number, number, number][];
966
947
  }
967
948
 
968
- export interface MasterIBonusRule {
969
- expr: CompiledEvaler;
970
- formula: CompiledEvaler;
949
+ export interface SimulatorResultItem {
950
+ id: string;
951
+ fleet_type: FleetType;
952
+ index: number;
953
+ damage_state_map: Record<DamageState, number>;
971
954
  }
972
955
 
973
- export interface CompAnalyzerConfig {
974
- engagement: Engagement;
975
- formation: Formation;
976
- anti_air_cutin: number | null;
977
- ship_anti_air_resist: number;
978
- fleet_anti_air_resist: number;
979
- left_night_fleet_conditions: NightFleetConditions;
980
- right_night_fleet_conditions: NightFleetConditions;
956
+ export interface ShipAnalyzerConfig {
957
+ air_state?: AirState;
958
+ engagement?: Engagement;
959
+ left?: AttackAnalyzerShipConfig;
960
+ right?: AttackAnalyzerShipConfig;
981
961
  }
982
962
 
983
- export interface CompNightAnalysis {
984
- night_cutin: CompNightCutinAnalysis;
985
- fleet_cutin: FleetCutinReport<NightAttackStyle>[];
986
- }
963
+ export type AirSquadronMode = "Sortie" | "AirDefense";
987
964
 
988
- export interface CompDayAnalysis {
989
- day_cutin: CompDayCutinAnalysis;
990
- fleet_cutin: FleetCutinReport<ShellingStyle>[];
965
+ export interface AirSquadronState extends GearVecState, SlotSizeVecState {
966
+ id?: string;
967
+ mode?: AirSquadronMode;
991
968
  }
992
969
 
993
- export interface CompAnalysis {
994
- day: CompDayAnalysis;
995
- night: CompNightAnalysis;
996
- contact: ContactAnalysis;
997
- anti_air: CompAntiAirAnalysis;
998
- }
970
+ export type AirState =
971
+ | "AirSupremacy"
972
+ | "AirSuperiority"
973
+ | "AirParity"
974
+ | "AirDenial"
975
+ | "AirIncapability";
976
+
977
+ export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
999
978
 
1000
979
  export interface AttackPowerModifier {
1001
980
  a?: number;
@@ -1020,16 +999,38 @@ export interface CustomPowerModifiers {
1020
999
  historical_mod?: AttackPowerModifier;
1021
1000
  }
1022
1001
 
1002
+ export type AswAttackType = "DepthCharge" | "Aerial";
1003
+
1004
+ export type ShellingType = "Normal" | "Aerial";
1005
+
1006
+ export type NightAttackType = "Normal" | "Swordfish" | "Aerial";
1007
+
1008
+ export type SupportShellingType = ShellingType;
1009
+
1010
+ export type AttackType =
1011
+ | { t: "Asw"; c: AswAttackType }
1012
+ | { t: "Shelling"; c: ShellingType }
1013
+ | { t: "Night"; c: NightAttackType }
1014
+ | { t: "Torpedo" }
1015
+ | { t: "SupportShelling"; c: SupportShellingType };
1016
+
1017
+ export type DayPhaseAttackType =
1018
+ | { t: "Shelling"; c: ShellingType }
1019
+ | { t: "Asw"; c: AswAttackType };
1020
+
1021
+ export type NightPhaseAttackType =
1022
+ | { t: "Night"; c: NightAttackType }
1023
+ | { t: "Asw"; c: AswAttackType };
1024
+
1025
+ export type TorpedoAttackType = null;
1026
+
1023
1027
  export type ContactRank = "Rank1" | "Rank2" | "Rank3";
1024
1028
 
1029
+ export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
1030
+
1025
1031
  export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
1026
1032
 
1027
- export interface ShipPosition {
1028
- org_type?: OrgType;
1029
- fleet_type?: FleetType;
1030
- fleet_len?: number;
1031
- index?: number;
1032
- }
1033
+ export type Role = "Main" | "Escort";
1033
1034
 
1034
1035
  /**
1035
1036
  */