import * as M from "./factorio-dump.models.ts"; export interface ModList { mods: { name: string; enabled: boolean }[]; } export interface PlayerData { "last-played-version": { game_version: string; build_version: number; build_mode: string; platform: string; }; } export type EffectType = "speed" | "productivity" | "consumption" | "pollution" | "quality"; export const allEffects: EffectType[] = [ "consumption", "speed", "productivity", "pollution", "quality", ]; export function isFluidIngredient( value: M.IngredientPrototype ): value is M.FluidIngredientPrototype { return value.type === "fluid"; } export function isFluidProduct(value: M.ProductPrototype): value is M.FluidProductPrototype { return value.type === "fluid"; } export function isResearchProduct(value: M.ProductPrototype): value is M.ProductPrototype { return false; } type Entities = Record; export interface DataRawDump { "agricultural-tower"?: Entities; ammo: Entities; armor: Entities; "assembling-machine": Entities; asteroid?: Entities; "asteroid-chunk": Entities; "asteroid-collector"?: Entities; beacon: Entities; boiler: Entities; capsule: Entities; "cargo-wagon": Entities; fluid: Entities; "fluid-wagon": Entities; furnace: Entities; gun: Entities; item: Entities; "item-group": Entities; "item-subgroup": Entities; "item-with-entity-data": Entities; lab: Entities; "mining-drill": Entities; module: Entities; "offshore-pump": Entities; planet: Entities; plant: Entities; pump: Entities; "rail-planner": Entities; reactor: Entities; recipe: Entities; "recipe-category": Entities; "repair-tool": Entities; resource: Entities; "rocket-silo": Entities; "rocket-silo-rocket": Entities; "selection-tool": Entities; "space-connection"?: Entities; "space-location": Entities; "space-platform-starter-pack"?: Entities; "spidertron-remote": Entities; surface: Entities; "surface-property": Entities; technology: Entities; tile: Entities; tool: Entities; "transport-belt": Entities; "utility-constants": { default: M.UtilityConstants }; } export interface Locale { names: Entities; } export type AnyItemPrototype = | M.AmmoItemPrototype | M.ArmorPrototype | M.CapsulePrototype | M.GunPrototype | M.ItemPrototype | M.ItemWithEntityDataPrototype | M.ItemWithTagsPrototype | M.ModulePrototype | M.RailPlannerPrototype | M.RepairToolPrototype | M.SelectionToolPrototype | M.SpacePlatformStarterPackPrototype | M.SpidertronRemotePrototype | M.ToolPrototype; export function isAnyItemPrototype(proto: unknown): proto is AnyItemPrototype { return ( M.isAmmoItemPrototype(proto) || M.isArmorPrototype(proto) || M.isCapsulePrototype(proto) || M.isGunPrototype(proto) || M.isItemPrototype(proto) || M.isItemWithEntityDataPrototype(proto) || M.isItemWithTagsPrototype(proto) || M.isModulePrototype(proto) || M.isRailPlannerPrototype(proto) || M.isRepairToolPrototype(proto) || M.isSelectionToolPrototype(proto) || M.isSpacePlatformStarterPackPrototype(proto) || M.isSpidertronRemotePrototype(proto) || M.isToolPrototype(proto) ); } export type AnyEntityPrototype = | M.BeaconPrototype | M.AssemblingMachinePrototype | M.BoilerPrototype | M.FurnacePrototype | M.LabPrototype | M.MiningDrillPrototype | M.OffshorePumpPrototype | M.ReactorPrototype | M.RocketSiloPrototype | M.TransportBeltPrototype | M.CargoWagonPrototype | M.FluidWagonPrototype | M.PumpPrototype | M.AsteroidCollectorPrototype | M.AgriculturalTowerPrototype; export type AnyLocationPrototype = M.PlanetPrototype | M.SurfacePrototype; export interface ModDataReport { machineSpeedZero: string[]; noProducers: string[]; resourceNoMinableProducts: string[]; resourceDuplicate: string[]; disabledRecipeDoesntExist: string[]; } export type MachineProto = | M.BoilerPrototype | M.AssemblingMachinePrototype | M.RocketSiloPrototype | M.FurnacePrototype | M.LabPrototype | M.MiningDrillPrototype | M.OffshorePumpPrototype | M.ReactorPrototype | M.AsteroidCollectorPrototype | M.AgriculturalTowerPrototype; export const anyEntityKeys = [ "beacon", "assembling-machine", "boiler", "furnace", "lab", "mining-drill", "offshore-pump", "reactor", "rocket-silo", "transport-belt", "cargo-wagon", "fluid-wagon", "pump", "asteroid-collector", "agricultural-tower", ] as const; export const anyItemKeys = [ "item", "ammo", "armor", "capsule", "gun", "item-with-entity-data", "module", "rail-planner", "repair-tool", "selection-tool", "spidertron-remote", "space-platform-starter-pack", "tool", "fluid", ] as const; export const anyLocationKeys = ["surface", "planet"] as const;