diff --git a/project/src/callbacks/DialogueCallbacks.ts b/project/src/callbacks/DialogueCallbacks.ts index e5f0d59c..9e931cf1 100644 --- a/project/src/callbacks/DialogueCallbacks.ts +++ b/project/src/callbacks/DialogueCallbacks.ts @@ -31,7 +31,7 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -87,7 +87,7 @@ export class DialogueCallbacks implements OnUpdate { url: string, info: IGetMailDialogListRequestData, sessionID: string, - ): IGetBodyResponseData { + ): IGetBodyResponseData { return this.httpResponse.getBody(this.dialogueController.generateDialogueList(sessionID), 0, undefined, false); } @@ -110,7 +110,7 @@ export class DialogueCallbacks implements OnUpdate { url: string, info: IGetMailDialogInfoRequestData, sessionID: string, - ): IGetBodyResponseData { + ): IGetBodyResponseData { return this.httpResponse.getBody(this.dialogueController.getDialogueInfo(info.dialogId, sessionID)); } diff --git a/project/src/callbacks/TraderCallbacks.ts b/project/src/callbacks/TraderCallbacks.ts index d058619c..9ee71993 100644 --- a/project/src/callbacks/TraderCallbacks.ts +++ b/project/src/callbacks/TraderCallbacks.ts @@ -5,7 +5,7 @@ import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { ITraderConfig, ModdedTraders } from "@spt/models/spt/config/ITraderConfig"; +import { IModdedTraders, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { inject, injectable } from "tsyringe"; @@ -56,7 +56,7 @@ export class TraderCallbacks implements OnLoad, OnUpdate { url: string, info: IEmptyRequestData, sessionID: string, - ): IGetBodyResponseData { + ): IGetBodyResponseData { const traderConfig = this.configServer.getConfig(ConfigTypes.TRADER) as ITraderConfig; return this.httpResponse.noBody(traderConfig.moddedTraders); } diff --git a/project/src/controllers/BotController.ts b/project/src/controllers/BotController.ts index b4d7f036..6cbad945 100644 --- a/project/src/controllers/BotController.ts +++ b/project/src/controllers/BotController.ts @@ -15,7 +15,7 @@ import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaid import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { SideType } from "@spt/models/enums/SideType"; import { WildSpawnTypeNumber } from "@spt/models/enums/WildSpawnTypeNumber"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -245,7 +245,7 @@ export class BotController { raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean, - ): BotGenerationDetails { + ): IBotGenerationDetails { return { isPmc: generateAsPmc, side: generateAsPmc ? this.botHelper.getPmcSideByRole(condition.Role) : SideType.SAVAGE, @@ -280,7 +280,7 @@ export class BotController { */ protected async generateWithBotDetails( condition: ICondition, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, sessionId: string, ): Promise { const isEventBot = condition.Role.toLowerCase().includes("event"); @@ -328,7 +328,7 @@ export class BotController { * @returns A promise for the bot to be stored */ protected async generateSingleBotAndStoreInCache( - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, sessionId: string, cacheKey: string, ): Promise { @@ -450,7 +450,7 @@ export class BotController { } protected updateBotGenerationDetailsToRandomBoss( - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, possibleBossTypeWeights: Record, ): void { // Seems Actual bosses have the same Brain issues like PMC gaining Boss Brains We cant use all bosses diff --git a/project/src/controllers/DialogueController.ts b/project/src/controllers/DialogueController.ts index 0eaa1742..925f54aa 100644 --- a/project/src/controllers/DialogueController.ts +++ b/project/src/controllers/DialogueController.ts @@ -7,7 +7,7 @@ import { IGetFriendListDataResponse } from "@spt/models/eft/dialog/IGetFriendLis import { IGetMailDialogViewRequestData } from "@spt/models/eft/dialog/IGetMailDialogViewRequestData"; import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailDialogViewResponseData"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; -import { Dialogue, DialogueInfo, ISptProfile, IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IDialogueInfo, IMessage, ISptProfile, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { MessageType } from "@spt/models/enums/MessageType"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; @@ -78,8 +78,8 @@ export class DialogueController { * @param sessionID Session Id * @returns array of dialogs */ - public generateDialogueList(sessionID: string): DialogueInfo[] { - const data: DialogueInfo[] = []; + public generateDialogueList(sessionID: string): IDialogueInfo[] { + const data: IDialogueInfo[] = []; for (const dialogueId in this.dialogueHelper.getDialogsForProfile(sessionID)) { data.push(this.getDialogueInfo(dialogueId, sessionID)); } @@ -93,11 +93,11 @@ export class DialogueController { * @param sessionID Session Id * @returns DialogueInfo */ - public getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo { + public getDialogueInfo(dialogueID: string, sessionID: string): IDialogueInfo { const dialogs = this.dialogueHelper.getDialogsForProfile(sessionID); const dialogue = dialogs[dialogueID]; - const result: DialogueInfo = { + const result: IDialogueInfo = { _id: dialogueID, type: dialogue.type ? dialogue.type : MessageType.NPC_TRADER, message: this.dialogueHelper.getMessagePreview(dialogue), @@ -118,7 +118,7 @@ export class DialogueController { * @returns IUserDialogInfo array */ public getDialogueUsers( - dialog: Dialogue, + dialog: IDialogue, messageType: MessageType, sessionID: string, ): IUserDialogInfo[] | undefined { @@ -185,7 +185,7 @@ export class DialogueController { * @param request get dialog request (params used when dialog doesnt exist in profile) * @returns Dialogue */ - protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): Dialogue { + protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): IDialogue { if (!profile.dialogues[request.dialogId]) { profile.dialogues[request.dialogId] = { _id: request.dialogId, @@ -265,7 +265,7 @@ export class DialogueController { * @param messages Messages to check * @returns true if uncollected rewards found */ - protected messagesHaveUncollectedRewards(messages: Message[]): boolean { + protected messagesHaveUncollectedRewards(messages: IMessage[]): boolean { return messages.some((message) => (message.items?.data?.length ?? 0) > 0); } @@ -384,7 +384,7 @@ export class DialogueController { * @param dialogueId Dialog to get mail attachments from * @returns Message array */ - protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[] { + protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): IMessage[] { const timeNow = this.timeUtil.getTimestamp(); const dialogs = this.dialogueHelper.getDialogsForProfile(sessionId); return dialogs[dialogueId].messages.filter((message) => timeNow < message.dt + (message.maxStorageTime ?? 0)); @@ -395,7 +395,7 @@ export class DialogueController { * @param messages Messages to parse * @returns messages with items to collect */ - protected getMessagesWithAttachments(messages: Message[]): Message[] { + protected getMessagesWithAttachments(messages: IMessage[]): IMessage[] { return messages.filter((message) => (message.items?.data?.length ?? 0) > 0); } @@ -433,7 +433,7 @@ export class DialogueController { * @param message Message to check expiry of * @returns true or false */ - protected messageHasExpired(message: Message): boolean { + protected messageHasExpired(message: IMessage): boolean { return this.timeUtil.getTimestamp() > message.dt + (message.maxStorageTime ?? 0); } diff --git a/project/src/controllers/HideoutController.ts b/project/src/controllers/HideoutController.ts index 3792237b..e1c97a23 100644 --- a/project/src/controllers/HideoutController.ts +++ b/project/src/controllers/HideoutController.ts @@ -9,7 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotHideoutArea, IProduct, IScavCase, ITaskConditionCounter } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; -import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutArea, IStage } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -272,7 +272,7 @@ export class HideoutController { pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, - hideoutStage: Stage, + hideoutStage: IStage, ): void { // Add key/value to `hideoutAreaStashes` dictionary - used to link hideout area to inventory stash by its id if (!pmcData.Inventory.hideoutAreaStashes[dbHideoutArea.type]) { @@ -327,7 +327,7 @@ export class HideoutController { */ protected addMissingPresetStandItemsToProfile( sessionId: string, - equipmentPresetStage: Stage, + equipmentPresetStage: IStage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse, @@ -377,7 +377,7 @@ export class HideoutController { sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, - hideoutStage: Stage, + hideoutStage: IStage, ): void { const existingInventoryItem = pmcData.Inventory.items.find((item) => item._id === dbHideoutArea._id); if (existingInventoryItem) { @@ -403,7 +403,7 @@ export class HideoutController { sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, - hideoutStage: Stage, + hideoutStage: IStage, output: IItemEventRouterResponse, ): void { if (!output.profileChanges[sessionID].changedHideoutStashes) { diff --git a/project/src/controllers/InsuranceController.ts b/project/src/controllers/InsuranceController.ts index 56b5c2ad..3a3d748a 100644 --- a/project/src/controllers/InsuranceController.ts +++ b/project/src/controllers/InsuranceController.ts @@ -9,7 +9,7 @@ import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsu import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { Money } from "@spt/models/enums/Money"; @@ -97,7 +97,7 @@ export class InsuranceController { * @param time The time to check ready status against. Current time by default. * @returns All insured items that are ready to be processed. */ - protected filterInsuredItems(sessionID: string, time?: number): Insurance[] { + protected filterInsuredItems(sessionID: string, time?: number): IInsurance[] { // Use the current time by default. const insuranceTime = time || this.timeUtil.getTimestamp(); @@ -116,7 +116,7 @@ export class InsuranceController { * @param sessionID The session ID that should receive the processed items. * @returns void */ - protected processInsuredItems(insuranceDetails: Insurance[], sessionID: string): void { + protected processInsuredItems(insuranceDetails: IInsurance[], sessionID: string): void { this.logger.debug( `Processing ${insuranceDetails.length} insurance packages, which includes a total of ${this.countAllInsuranceItems( insuranceDetails, @@ -153,7 +153,7 @@ export class InsuranceController { * @param insurance * @returns */ - protected countAllInsuranceItems(insurance: Insurance[]): number { + protected countAllInsuranceItems(insurance: IInsurance[]): number { return this.mathUtil.arraySum(insurance.map((ins) => ins.items.length)); } @@ -164,7 +164,7 @@ export class InsuranceController { * @param index The array index of the insurance package to remove. * @returns void */ - protected removeInsurancePackageFromProfile(sessionID: string, insPackage: Insurance): void { + protected removeInsurancePackageFromProfile(sessionID: string, insPackage: IInsurance): void { const profile = this.saveServer.getProfile(sessionID); profile.insurance = profile.insurance.filter( (insurance) => @@ -184,7 +184,7 @@ export class InsuranceController { * @param insured - The insurance object containing the items to evaluate for deletion. * @returns A Set containing the IDs of items that should be deleted. */ - protected findItemsToDelete(rootItemParentID: string, insured: Insurance): Set { + protected findItemsToDelete(rootItemParentID: string, insured: IInsurance): Set { const toDelete = new Set(); // Populate a Map object of items for quick lookup by their ID and use it to populate a Map of main-parent items @@ -231,7 +231,7 @@ export class InsuranceController { */ protected populateParentAttachmentsMap( rootItemParentID: string, - insured: Insurance, + insured: IInsurance, itemsMap: Map, ): Map { const mainParentToAttachmentsMap = new Map(); @@ -348,7 +348,7 @@ export class InsuranceController { * @returns void */ protected processRegularItems( - insured: Insurance, + insured: IInsurance, toDelete: Set, parentAttachmentsMap: Map, ): void { @@ -518,7 +518,7 @@ export class InsuranceController { * @param toDelete The items that should be deleted. * @returns void */ - protected removeItemsFromInsurance(insured: Insurance, toDelete: Set): void { + protected removeItemsFromInsurance(insured: IInsurance, toDelete: Set): void { insured.items = insured.items.filter((item) => !toDelete.has(item._id)); } @@ -529,7 +529,7 @@ export class InsuranceController { * @param insurance The context of insurance to use. * @returns void */ - protected sendMail(sessionID: string, insurance: Insurance): void { + protected sendMail(sessionID: string, insurance: IInsurance): void { const labsId = "laboratory"; // After all of the item filtering that we've done, if there are no items remaining, the insurance has // successfully "failed" to return anything and an appropriate message should be sent to the player. @@ -716,9 +716,3 @@ export class InsuranceController { return response; } } - -// Represents an insurance item that has had it's common locale-name and value added to it. -interface EnrichedItem extends IItem { - name: string; - dynamicPrice: number; -} diff --git a/project/src/controllers/LauncherController.ts b/project/src/controllers/LauncherController.ts index b5045fe9..baf11650 100644 --- a/project/src/controllers/LauncherController.ts +++ b/project/src/controllers/LauncherController.ts @@ -5,7 +5,7 @@ import { IChangeRequestData } from "@spt/models/eft/launcher/IChangeRequestData" import { ILoginRequestData } from "@spt/models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "@spt/models/eft/launcher/IRegisterData"; import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse"; -import { Info, ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails, Info } from "@spt/models/eft/profile/ISptProfile"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; @@ -189,7 +189,7 @@ export class LauncherController { * @param sessionId Player id * @returns Array of mod details */ - public getServerModsProfileUsed(sessionId: string): ModDetails[] { + public getServerModsProfileUsed(sessionId: string): IModDetails[] { const profile = this.profileHelper.getFullProfile(sessionId); if (profile?.spt?.mods) { diff --git a/project/src/controllers/ProfileController.ts b/project/src/controllers/ProfileController.ts index 79e5239c..ce059556 100644 --- a/project/src/controllers/ProfileController.ts +++ b/project/src/controllers/ProfileController.ts @@ -17,7 +17,7 @@ import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfile import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse"; -import { ISptProfile, Inraid, Vitality } from "@spt/models/eft/profile/ISptProfile"; +import { IInraid, ISptProfile, IVitality } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { MessageType } from "@spt/models/enums/MessageType"; @@ -177,8 +177,8 @@ export class ProfileController { userbuilds: profileTemplate.userbuilds, dialogues: profileTemplate.dialogues, spt: this.profileHelper.getDefaultSptDataObject(), - vitality: {} as Vitality, - inraid: {} as Inraid, + vitality: {} as IVitality, + inraid: {} as IInraid, insurance: [], traderPurchases: {}, achievements: {}, diff --git a/project/src/controllers/RagfairController.ts b/project/src/controllers/RagfairController.ts index d5f9341a..9cd42169 100644 --- a/project/src/controllers/RagfairController.ts +++ b/project/src/controllers/RagfairController.ts @@ -14,7 +14,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { IAddOfferRequestData, Requirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; +import { IAddOfferRequestData, IRequirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; import { IExtendOfferRequestData } from "@spt/models/eft/ragfair/IExtendOfferRequestData"; import { IGetItemPriceResult } from "@spt/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt/models/eft/ragfair/IGetMarketPriceRequestData"; @@ -803,7 +803,7 @@ export class RagfairController { * @param requirements * @returns Rouble price */ - protected calculateRequirementsPriceInRub(requirements: Requirement[]): number { + protected calculateRequirementsPriceInRub(requirements: IRequirement[]): number { let requirementsPriceInRub = 0; for (const item of requirements) { const requestedItemTpl = item._tpl; @@ -860,7 +860,7 @@ export class RagfairController { public createPlayerOffer( sessionId: string, - requirements: Requirement[], + requirements: IRequirement[], items: IItem[], sellInOnePiece: boolean, ): IRagfairOffer { diff --git a/project/src/generators/BotEquipmentModGenerator.ts b/project/src/generators/BotEquipmentModGenerator.ts index a551b642..22dea1aa 100644 --- a/project/src/generators/BotEquipmentModGenerator.ts +++ b/project/src/generators/BotEquipmentModGenerator.ts @@ -22,7 +22,7 @@ import { import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest"; import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; -import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IBotConfig, IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; import { ExhaustableArray } from "@spt/models/spt/server/ExhaustableArray"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -80,7 +80,7 @@ export class BotEquipmentModGenerator { parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, - specificBlacklist: EquipmentFilterDetails, + specificBlacklist: IEquipmentFilterDetails, shouldForceSpawn = false, ): IItem[] { let forceSpawn = shouldForceSpawn; @@ -1272,7 +1272,7 @@ export class BotEquipmentModGenerator { desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, - botEquipBlacklist: EquipmentFilterDetails, + botEquipBlacklist: IEquipmentFilterDetails, ): void { const desiredSlotObject = modTemplate._props.Slots?.find((slot) => slot._name.includes(desiredSlotName)); if (desiredSlotObject) { @@ -1309,7 +1309,7 @@ export class BotEquipmentModGenerator { protected getDynamicModPool( parentItemId: string, modSlot: string, - botEquipBlacklist: EquipmentFilterDetails, + botEquipBlacklist: IEquipmentFilterDetails, ): string[] { const modsFromDynamicPool = this.cloner.clone( this.botEquipmentModPoolService.getCompatibleModsForWeaponSlot(parentItemId, modSlot), @@ -1335,7 +1335,7 @@ export class BotEquipmentModGenerator { */ protected filterModsByBlacklist( allowedMods: string[], - botEquipBlacklist: EquipmentFilterDetails, + botEquipBlacklist: IEquipmentFilterDetails, modSlot: string, ): string[] { // No blacklist, nothing to filter out diff --git a/project/src/generators/BotGenerator.ts b/project/src/generators/BotGenerator.ts index 5380e81e..3db4fc25 100644 --- a/project/src/generators/BotGenerator.ts +++ b/project/src/generators/BotGenerator.ts @@ -20,7 +20,7 @@ import { GameEditions } from "@spt/models/enums/GameEditions"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { SideType } from "@spt/models/enums/SideType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -76,7 +76,7 @@ export class BotGenerator { bot.Info.Settings.Role = role; bot.Info.Side = SideType.SAVAGE; - const botGenDetails: BotGenerationDetails = { + const botGenDetails: IBotGenerationDetails = { isPmc: false, side: SideType.SAVAGE, role: role, @@ -98,7 +98,7 @@ export class BotGenerator { * @param botGenerationDetails details on how to generate bots * @returns constructed bot */ - public prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase { + public prepareAndGenerateBot(sessionId: string, botGenerationDetails: IBotGenerationDetails): IBotBase { const preparedBotBase = this.getPreparedBotBase( botGenerationDetails.eventRole ?? botGenerationDetails.role, // Use eventRole if provided, botGenerationDetails.side, @@ -150,7 +150,7 @@ export class BotGenerator { sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, ): IBotBase { const botRoleLowercase = botGenerationDetails.role.toLowerCase(); const botLevel = this.botLevelGenerator.generateBotLevel( @@ -285,7 +285,7 @@ export class BotGenerator { protected setBotAppearance( bot: IBotBase, appearance: IAppearance, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, ): void { bot.Customization.Head = this.weightedRandomHelper.getWeightedValue(appearance.head); bot.Customization.Body = this.weightedRandomHelper.getWeightedValue(appearance.body); diff --git a/project/src/generators/BotInventoryGenerator.ts b/project/src/generators/BotInventoryGenerator.ts index 3cc8d6c5..abd67431 100644 --- a/project/src/generators/BotInventoryGenerator.ts +++ b/project/src/generators/BotInventoryGenerator.ts @@ -18,7 +18,7 @@ import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { GameEditions } from "@spt/models/enums/GameEditions"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; -import { EquipmentFilterDetails, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IBotConfig, IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; diff --git a/project/src/generators/BotLevelGenerator.ts b/project/src/generators/BotLevelGenerator.ts index a9b6fdbf..d171ed6b 100644 --- a/project/src/generators/BotLevelGenerator.ts +++ b/project/src/generators/BotLevelGenerator.ts @@ -1,7 +1,7 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLevelResult"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -26,7 +26,7 @@ export class BotLevelGenerator { */ public generateBotLevel( levelDetails: MinMax, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, bot: IBotBase, ): IRandomisedBotLevelResult { const expTable = this.databaseService.getGlobals().config.exp.level.exp_table; @@ -59,7 +59,7 @@ export class BotLevelGenerator { * @returns A MinMax of the lowest and highest level to generate the bots */ protected getRelativeBotLevelRange( - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number, ): MinMax { diff --git a/project/src/generators/LootGenerator.ts b/project/src/generators/LootGenerator.ts index 3065af69..009ddbb6 100644 --- a/project/src/generators/LootGenerator.ts +++ b/project/src/generators/LootGenerator.ts @@ -7,7 +7,7 @@ import { IPreset } from "@spt/models/eft/common/IGlobals"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; -import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; +import { IRewardDetails, ISealedAirdropContainerSettings } from "@spt/models/spt/config/IInventoryConfig"; import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -583,7 +583,7 @@ export class LootGenerator { * @param rewardContainerDetails * @returns Array of item with children arrays */ - public getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): IItem[][] { + public getRandomLootContainerLoot(rewardContainerDetails: IRewardDetails): IItem[][] { const itemsToReturn: IItem[][] = []; // Get random items and add to newItemRequest @@ -615,7 +615,7 @@ export class LootGenerator { * @param rewardContainerDetails * @returns Single tpl */ - protected pickRewardItem(rewardContainerDetails: RewardDetails): string { + protected pickRewardItem(rewardContainerDetails: IRewardDetails): string { if (rewardContainerDetails.rewardTplPool) { return this.weightedRandomHelper.getWeightedValue(rewardContainerDetails.rewardTplPool); } diff --git a/project/src/generators/PlayerScavGenerator.ts b/project/src/generators/PlayerScavGenerator.ts index c56ccd94..9ed0128e 100644 --- a/project/src/generators/PlayerScavGenerator.ts +++ b/project/src/generators/PlayerScavGenerator.ts @@ -13,7 +13,7 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { ItemAddedResult } from "@spt/models/enums/ItemAddedResult"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { Traders } from "@spt/models/enums/Traders"; -import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; +import { IKarmaLevel, IPlayerScavConfig } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -229,7 +229,7 @@ export class PlayerScavGenerator { * @param karmaSettings Values to modify the bot template with * @param baseBotNode bot template to modify according to karama level settings */ - protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void { + protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: IKarmaLevel, baseBotNode: IBotType): void { // Adjust equipment chance values for (const equipmentKey in karmaSettings.modifiers.equipment) { if (karmaSettings.modifiers.equipment[equipmentKey] === 0) { diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index 3dcc9127..d2ba4d49 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -9,7 +9,7 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; -import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; +import { IOfferRequirement, IRagfairOffer, IRagfairOfferUser } from "@spt/models/eft/ragfair/IRagfairOffer"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; @@ -17,9 +17,9 @@ import { Money } from "@spt/models/enums/Money"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { Condition, - Dynamic, IArmorPlateBlacklistSettings, IBarterDetails, + IDynamic, IRagfairConfig, } from "@spt/models/spt/config/IRagfairConfig"; import { ITplWithFleaPrice } from "@spt/models/spt/ragfair/ITplWithFleaPrice"; @@ -117,7 +117,7 @@ export class RagfairOfferGenerator { const isTrader = this.ragfairServerHelper.isTrader(userID); const offerRequirements = barterScheme.map((barter) => { - const offerRequirement: OfferRequirement = { + const offerRequirement: IOfferRequirement = { _tpl: barter._tpl, count: +barter.count.toFixed(2), onlyFunctional: barter.onlyFunctional ?? false, @@ -217,7 +217,7 @@ export class RagfairOfferGenerator { * @param offerRequirements barter requirements for offer * @returns rouble cost of offer */ - protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number { + protected convertOfferRequirementsIntoRoubles(offerRequirements: IOfferRequirement[]): number { let roublePrice = 0; for (const requirement of offerRequirements) { roublePrice += this.paymentHelper.isMoneyTpl(requirement._tpl) @@ -366,7 +366,7 @@ export class RagfairOfferGenerator { protected async createOffersFromAssort( assortItemWithChildren: IItem[], isExpiredOffer: boolean, - config: Dynamic, + config: IDynamic, ): Promise { const itemDetails = this.itemHelper.getItem(assortItemWithChildren[0]._tpl); const isPreset = this.presetHelper.isPreset(assortItemWithChildren[0].upd.sptPresetId); diff --git a/project/src/generators/ScavCaseRewardGenerator.ts b/project/src/generators/ScavCaseRewardGenerator.ts index a35ee980..56d2621b 100644 --- a/project/src/generators/ScavCaseRewardGenerator.ts +++ b/project/src/generators/ScavCaseRewardGenerator.ts @@ -8,8 +8,8 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { Money } from "@spt/models/enums/Money"; import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { - RewardCountAndPriceDetails, - ScavCaseRewardCountsAndPrices, + IRewardCountAndPriceDetails, + IScavCaseRewardCountsAndPrices, } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -194,7 +194,7 @@ export class ScavCaseRewardGenerator { */ protected pickRandomRewards( items: ITemplateItem[], - itemFilters: RewardCountAndPriceDetails, + itemFilters: IRewardCountAndPriceDetails, rarity: string, ): ITemplateItem[] { const result: ITemplateItem[] = []; @@ -335,7 +335,7 @@ export class ScavCaseRewardGenerator { */ protected getFilteredItemsByPrice( dbItems: ITemplateItem[], - itemFilters: RewardCountAndPriceDetails, + itemFilters: IRewardCountAndPriceDetails, ): ITemplateItem[] { return dbItems.filter((item) => { const handbookPrice = this.ragfairPriceService.getStaticPriceForItem(item._id); @@ -350,9 +350,9 @@ export class ScavCaseRewardGenerator { * @param scavCaseDetails scavcase.json values * @returns ScavCaseRewardCountsAndPrices object */ - protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): ScavCaseRewardCountsAndPrices { - const rewardTypes = Object.keys(scavCaseDetails.EndProducts) as Array; // Default is ["Common", "Rare", "Superrare"]; - const result: Partial = {}; // Make partial object as we're going to add all the data immediately after + protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): IScavCaseRewardCountsAndPrices { + const rewardTypes = Object.keys(scavCaseDetails.EndProducts) as Array; // Default is ["Common", "Rare", "Superrare"]; + const result: Partial = {}; // Make partial object as we're going to add all the data immediately after // Create reward min/max counts for each type for (const rewardType of rewardTypes) { @@ -364,7 +364,7 @@ export class ScavCaseRewardGenerator { }; } - return result as ScavCaseRewardCountsAndPrices; + return result as IScavCaseRewardCountsAndPrices; } /** diff --git a/project/src/helpers/BotHelper.ts b/project/src/helpers/BotHelper.ts index 44a55852..610c0d45 100644 --- a/project/src/helpers/BotHelper.ts +++ b/project/src/helpers/BotHelper.ts @@ -1,7 +1,7 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IBotType, IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IBotConfig, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -126,7 +126,7 @@ export class BotHelper { public getBotRandomizationDetails( botLevel: number, botEquipConfig: EquipmentFilters, - ): RandomisationDetails | undefined { + ): IRandomisationDetails | undefined { // No randomisation details found, skip if (!botEquipConfig || Object.keys(botEquipConfig).length === 0 || !botEquipConfig.randomisation) { return undefined; diff --git a/project/src/helpers/DialogueHelper.ts b/project/src/helpers/DialogueHelper.ts index d39ed98f..1a8b698b 100644 --- a/project/src/helpers/DialogueHelper.ts +++ b/project/src/helpers/DialogueHelper.ts @@ -2,7 +2,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, MessagePreview } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IMessagePreview } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -28,10 +28,10 @@ export class DialogueHelper { * @param dialogue * @returns MessagePreview */ - public getMessagePreview(dialogue: Dialogue): MessagePreview { + public getMessagePreview(dialogue: IDialogue): IMessagePreview { // The last message of the dialogue should be shown on the preview. const message = dialogue.messages[dialogue.messages.length - 1]; - const result: MessagePreview = { + const result: IMessagePreview = { dt: message?.dt, type: message?.type, templateId: message?.templateId, @@ -94,7 +94,7 @@ export class DialogueHelper { * @param sessionId Session/player id * @returns Dialog dictionary */ - public getDialogsForProfile(sessionId: string): Record { + public getDialogsForProfile(sessionId: string): Record { const profile = this.saveServer.getProfile(sessionId); if (!profile.dialogues) { profile.dialogues = {}; diff --git a/project/src/helpers/HealthHelper.ts b/project/src/helpers/HealthHelper.ts index 40034b10..6d17723c 100644 --- a/project/src/helpers/HealthHelper.ts +++ b/project/src/helpers/HealthHelper.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBodyPartsHealth, IHealth } from "@spt/models/eft/common/tables/IBotBase"; import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; -import { Effects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; +import { IEffects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { IHealthConfig } from "@spt/models/spt/config/IHealthConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -275,7 +275,7 @@ export class HealthHelper { protected saveEffects( pmcData: IPmcData, sessionId: string, - bodyPartsWithEffects: Effects, + bodyPartsWithEffects: IEffects, deleteExistingEffects = true, ): void { if (!this.healthConfig.save.effects) { diff --git a/project/src/helpers/HideoutHelper.ts b/project/src/helpers/HideoutHelper.ts index 5c05f202..c712d199 100644 --- a/project/src/helpers/HideoutHelper.ts +++ b/project/src/helpers/HideoutHelper.ts @@ -4,7 +4,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotHideoutArea, IHideoutImprovement, IProduction, IProductive } from "@spt/models/eft/common/tables/IBotBase"; import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; -import { IHideoutArea, StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutArea, IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -155,7 +155,7 @@ export class HideoutHelper { * @param pmcData Profile to add bonus to * @param bonus Bonus to add to profile */ - public applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void { + public applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: IStageBonus): void { // Handle additional changes some bonuses need before being added switch (bonus.type) { case BonusType.STASH_SIZE: { diff --git a/project/src/helpers/InventoryHelper.ts b/project/src/helpers/InventoryHelper.ts index ac72d98e..329079e3 100644 --- a/project/src/helpers/InventoryHelper.ts +++ b/project/src/helpers/InventoryHelper.ts @@ -20,7 +20,7 @@ import { BackendErrorCodes } from "@spt/models/enums/BackendErrorCodes"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { BonusType } from "@spt/models/enums/BonusType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { IInventoryConfig, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; +import { IInventoryConfig, IRewardDetails } from "@spt/models/spt/config/IInventoryConfig"; import { IOwnerInventoryItems } from "@spt/models/spt/inventory/IOwnerInventoryItems"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -1105,7 +1105,7 @@ export class InventoryHelper { * @param itemTpl Container being opened * @returns Reward details */ - public getRandomLootContainerRewardDetails(itemTpl: string): RewardDetails { + public getRandomLootContainerRewardDetails(itemTpl: string): IRewardDetails { return this.inventoryConfig.randomLootContainers[itemTpl]; } diff --git a/project/src/helpers/NotificationSendHelper.ts b/project/src/helpers/NotificationSendHelper.ts index 8d35be44..0fd850ba 100644 --- a/project/src/helpers/NotificationSendHelper.ts +++ b/project/src/helpers/NotificationSendHelper.ts @@ -1,4 +1,4 @@ -import { Dialogue, IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IMessage, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { IWsChatMessageReceived } from "@spt/models/eft/ws/IWsChatMessageReceived"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; @@ -48,7 +48,7 @@ export class NotificationSendHelper { const dialog = this.getDialog(sessionId, messageType, senderDetails); dialog.new += 1; - const message: Message = { + const message: IMessage = { _id: this.hashUtil.generate(), uid: dialog._id, type: messageType, @@ -76,7 +76,7 @@ export class NotificationSendHelper { * @param senderDetails Who is sending the message * @returns Dialogue */ - protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue { + protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): IDialogue { // Use trader id if sender is trader, otherwise use nickname const key = senderDetails.Info.MemberCategory === MemberCategory.TRADER @@ -84,7 +84,7 @@ export class NotificationSendHelper { : senderDetails.Info.Nickname; const dialogueData = this.saveServer.getProfile(sessionId).dialogues; const isNewDialogue = !(key in dialogueData); - let dialogue: Dialogue = dialogueData[key]; + let dialogue: IDialogue = dialogueData[key]; // Existing dialog not found, make new one if (isNewDialogue) { diff --git a/project/src/helpers/NotifierHelper.ts b/project/src/helpers/NotifierHelper.ts index 9ddde42f..42c7d1e8 100644 --- a/project/src/helpers/NotifierHelper.ts +++ b/project/src/helpers/NotifierHelper.ts @@ -1,5 +1,5 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; -import { Message, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IMessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; import { IWsChatMessageReceived } from "@spt/models/eft/ws/IWsChatMessageReceived"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsRagfairOfferSold } from "@spt/models/eft/ws/IWsRagfairOfferSold"; @@ -26,8 +26,8 @@ export class NotifierHelper { * @returns */ public createRagfairOfferSoldNotification( - dialogueMessage: Message, - ragfairData: MessageContentRagfair, + dialogueMessage: IMessage, + ragfairData: IMessageContentRagfair, ): IWsRagfairOfferSold { return { type: NotificationEventType.RAGFAIR_OFFER_SOLD, @@ -41,7 +41,7 @@ export class NotifierHelper { * @param dialogueMessage * @returns */ - public createNewMessageNotification(dialogueMessage: Message): IWsChatMessageReceived { + public createNewMessageNotification(dialogueMessage: IMessage): IWsChatMessageReceived { return { type: NotificationEventType.CHAT_MESSAGE_RECEIVED, eventId: dialogueMessage._id, diff --git a/project/src/helpers/RepairHelper.ts b/project/src/helpers/RepairHelper.ts index 89aa906b..e6fc3ba6 100644 --- a/project/src/helpers/RepairHelper.ts +++ b/project/src/helpers/RepairHelper.ts @@ -1,5 +1,5 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -136,7 +136,7 @@ export class RepairHelper { * @returns Amount to reduce max durability by */ protected getRandomisedWeaponRepairDegradationValue( - itemProps: Props, + itemProps: IProps, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number, diff --git a/project/src/loaders/PreSptModLoader.ts b/project/src/loaders/PreSptModLoader.ts index 70ba95c3..a96e5a76 100644 --- a/project/src/loaders/PreSptModLoader.ts +++ b/project/src/loaders/PreSptModLoader.ts @@ -3,7 +3,7 @@ import os from "node:os"; import path from "node:path"; import { ModLoadOrder } from "@spt/loaders/ModLoadOrder"; import { ModTypeCheck } from "@spt/loaders/ModTypeCheck"; -import { ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails } from "@spt/models/eft/profile/ISptProfile"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod"; import { IPreSptLoadModAsync } from "@spt/models/external/IPreSptLoadModAsync"; @@ -68,9 +68,9 @@ export class PreSptModLoader implements IModLoader { return this.imported; } - public getProfileModsGroupedByModName(profileMods: ModDetails[]): ModDetails[] { + public getProfileModsGroupedByModName(profileMods: IModDetails[]): IModDetails[] { // Group all mods used by profile by name - const modsGroupedByName: Record = {}; + const modsGroupedByName: Record = {}; for (const mod of profileMods) { if (!modsGroupedByName[mod.name]) { modsGroupedByName[mod.name] = []; diff --git a/project/src/models/eft/common/tables/ICustomizationItem.ts b/project/src/models/eft/common/tables/ICustomizationItem.ts index 61d15ac0..9a279710 100644 --- a/project/src/models/eft/common/tables/ICustomizationItem.ts +++ b/project/src/models/eft/common/tables/ICustomizationItem.ts @@ -5,11 +5,11 @@ export interface ICustomizationItem { _name: string; _parent: string; _type: string; - _props: Props; + _props: IProps; _proto: string; } -export interface Props { +export interface IProps { Name: string; ShortName: string; Description: string; diff --git a/project/src/models/eft/common/tables/IProfileTemplate.ts b/project/src/models/eft/common/tables/IProfileTemplate.ts index 49464dac..4ff9c98e 100644 --- a/project/src/models/eft/common/tables/IProfileTemplate.ts +++ b/project/src/models/eft/common/tables/IProfileTemplate.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Dialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; export interface IProfileTemplates { Standard: IProfileSides; @@ -22,7 +22,7 @@ export interface IProfileSides { export interface ITemplateSide { character: IPmcData; suits: string[]; - dialogues: Record; + dialogues: Record; userbuilds: IUserBuilds; trader: IProfileTraderTemplate; } diff --git a/project/src/models/eft/common/tables/ITemplateItem.ts b/project/src/models/eft/common/tables/ITemplateItem.ts index f7426bb5..d7a99e3d 100644 --- a/project/src/models/eft/common/tables/ITemplateItem.ts +++ b/project/src/models/eft/common/tables/ITemplateItem.ts @@ -5,12 +5,12 @@ export interface ITemplateItem { _name: string; _parent: string; _type: ItemType; - _props: Props; + _props: IProps; _proto?: string; } -export interface Props { - AllowSpawnOnLocations?: any[]; +export interface IProps { + AllowSpawnOnLocations?: string[]; BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; @@ -177,7 +177,7 @@ export interface Props { spawnRarity?: string; minCountSpawn?: number; maxCountSpawn?: number; - openedByKeyID?: any[]; + openedByKeyID?: string[]; RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; diff --git a/project/src/models/eft/dialog/IGetAllAttachmentsResponse.ts b/project/src/models/eft/dialog/IGetAllAttachmentsResponse.ts index 0989abf9..bd6c02de 100644 --- a/project/src/models/eft/dialog/IGetAllAttachmentsResponse.ts +++ b/project/src/models/eft/dialog/IGetAllAttachmentsResponse.ts @@ -1,7 +1,7 @@ -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; export interface IGetAllAttachmentsResponse { - messages: Message[]; + messages: IMessage[]; profiles: any[]; hasMessagesWithRewards: boolean; } diff --git a/project/src/models/eft/dialog/IGetMailDialogViewResponseData.ts b/project/src/models/eft/dialog/IGetMailDialogViewResponseData.ts index bdc8df8c..96bf7689 100644 --- a/project/src/models/eft/dialog/IGetMailDialogViewResponseData.ts +++ b/project/src/models/eft/dialog/IGetMailDialogViewResponseData.ts @@ -1,7 +1,7 @@ -import { IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IGetMailDialogViewResponseData { - messages: Message[]; + messages: IMessage[]; profiles: IUserDialogInfo[]; hasMessagesWithRewards: boolean; } diff --git a/project/src/models/eft/game/IVersionValidateRequestData.ts b/project/src/models/eft/game/IVersionValidateRequestData.ts index 04f2fd04..ad3cb32b 100644 --- a/project/src/models/eft/game/IVersionValidateRequestData.ts +++ b/project/src/models/eft/game/IVersionValidateRequestData.ts @@ -1,9 +1,9 @@ export interface IVersionValidateRequestData { - version: Version; + version: IVersion; develop: boolean; } -export interface Version { +export interface IVersion { major: string; minor: string; game: string; diff --git a/project/src/models/eft/hideout/IHideoutArea.ts b/project/src/models/eft/hideout/IHideoutArea.ts index f8617103..830d73dd 100644 --- a/project/src/models/eft/hideout/IHideoutArea.ts +++ b/project/src/models/eft/hideout/IHideoutArea.ts @@ -13,7 +13,7 @@ export interface IHideoutArea { displayLevel: boolean; enableAreaRequirements: boolean; parentArea?: string; - stages: Record; + stages: Record; } export interface IAreaRequirement { @@ -22,9 +22,9 @@ export interface IAreaRequirement { type: string; } -export interface Stage { +export interface IStage { autoUpgrade: boolean; - bonuses: StageBonus[]; + bonuses: IStageBonus[]; constructionTime: number; /** Containers inventory tpl */ container?: string; @@ -71,7 +71,7 @@ export interface IStageRequirement extends IRequirementBase { skillLevel?: number; } -export interface StageBonus { +export interface IStageBonus { value: number; passive: boolean; production: boolean; diff --git a/project/src/models/eft/hideout/IHideoutImproveAreaRequestData.ts b/project/src/models/eft/hideout/IHideoutImproveAreaRequestData.ts index 499e0291..474725ff 100644 --- a/project/src/models/eft/hideout/IHideoutImproveAreaRequestData.ts +++ b/project/src/models/eft/hideout/IHideoutImproveAreaRequestData.ts @@ -3,11 +3,11 @@ export interface IHideoutImproveAreaRequestData { /** Hideout area id from areas.json */ id: string; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { /** Hideout inventory id that was used by improvement action */ id: string; count: number; diff --git a/project/src/models/eft/hideout/IHideoutProduction.ts b/project/src/models/eft/hideout/IHideoutProduction.ts index dc0b9a16..8e787f91 100644 --- a/project/src/models/eft/hideout/IHideoutProduction.ts +++ b/project/src/models/eft/hideout/IHideoutProduction.ts @@ -10,7 +10,7 @@ export interface IHideoutProductionData { export interface IHideoutProduction { _id: string; areaType: number; - requirements: Requirement[]; + requirements: IRequirement[]; productionTime: number; /** Tpl of item being crafted */ endProduct: string; @@ -22,7 +22,7 @@ export interface IHideoutProduction { productionLimitCount: number; } -export interface Requirement extends IRequirementBase { +export interface IRequirement extends IRequirementBase { templateId?: string; count?: number; isEncoded?: boolean; @@ -39,7 +39,7 @@ export interface IRequirementBase { export type IScavRecipe = { _id: string; - requirements: Requirement[]; + requirements: IRequirement[]; productionTime: number; endProducts: IEndProducts; }; diff --git a/project/src/models/eft/hideout/IHideoutScavCase.ts b/project/src/models/eft/hideout/IHideoutScavCase.ts index 11dba6f3..6809263f 100644 --- a/project/src/models/eft/hideout/IHideoutScavCase.ts +++ b/project/src/models/eft/hideout/IHideoutScavCase.ts @@ -3,17 +3,17 @@ import { MinMax } from "@spt/models/common/MinMax"; export interface IHideoutScavCase { _id: string; ProductionTime: number; - Requirements: Requirement[]; - EndProducts: EndProducts; + Requirements: IRequirement[]; + EndProducts: IEndProducts; } -export interface Requirement { +export interface IRequirement { templateId: string; count: number; isFunctional: boolean; type: string; } -export interface EndProducts { +export interface IEndProducts { Common: MinMax; Rare: MinMax; Superrare: MinMax; diff --git a/project/src/models/eft/hideout/IHideoutScavCaseStartRequestData.ts b/project/src/models/eft/hideout/IHideoutScavCaseStartRequestData.ts index f7a971d6..c6855c80 100644 --- a/project/src/models/eft/hideout/IHideoutScavCaseStartRequestData.ts +++ b/project/src/models/eft/hideout/IHideoutScavCaseStartRequestData.ts @@ -1,17 +1,17 @@ export interface IHideoutScavCaseStartRequestData { Action: "HideoutScavCaseProductionStart"; recipeId: string; - items: HideoutItem[]; - tools: Tool[]; + items: IHideoutItem[]; + tools: ITool[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { id: string; count: number; } -export interface Tool { +export interface ITool { id: string; count: number; } diff --git a/project/src/models/eft/hideout/IHideoutUpgradeRequestData.ts b/project/src/models/eft/hideout/IHideoutUpgradeRequestData.ts index 073fd2e8..52ca5204 100644 --- a/project/src/models/eft/hideout/IHideoutUpgradeRequestData.ts +++ b/project/src/models/eft/hideout/IHideoutUpgradeRequestData.ts @@ -1,11 +1,11 @@ export interface IHideoutUpgradeRequestData { Action: "HideoutUpgrade"; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { count: number; id: string; } diff --git a/project/src/models/eft/inventory/IInventoryAddRequestData.ts b/project/src/models/eft/inventory/IInventoryAddRequestData.ts index e4b3c38c..5b5d2b76 100644 --- a/project/src/models/eft/inventory/IInventoryAddRequestData.ts +++ b/project/src/models/eft/inventory/IInventoryAddRequestData.ts @@ -1,7 +1,7 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryAddRequestData extends IInventoryBaseActionRequestData { Action: "Add"; item: string; - container: Container; + container: IContainer; } diff --git a/project/src/models/eft/inventory/IInventoryBaseActionRequestData.ts b/project/src/models/eft/inventory/IInventoryBaseActionRequestData.ts index b2b7d614..d6c3b138 100644 --- a/project/src/models/eft/inventory/IInventoryBaseActionRequestData.ts +++ b/project/src/models/eft/inventory/IInventoryBaseActionRequestData.ts @@ -3,20 +3,20 @@ import { IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData {} -export interface To { +export interface ITo { id: string; container: string; location?: IItemLocation | number; // Hack isSearched?: boolean; } -export interface Container { +export interface IContainer { id: string; container: string; - location?: Location | number; // Hack - BSG data object shows it as Location only + location?: ILocation | number; // Hack - BSG data object shows it as Location only } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/project/src/models/eft/inventory/IInventoryCreateMarkerRequestData.ts b/project/src/models/eft/inventory/IInventoryCreateMarkerRequestData.ts index d7e19178..1f69d183 100644 --- a/project/src/models/eft/inventory/IInventoryCreateMarkerRequestData.ts +++ b/project/src/models/eft/inventory/IInventoryCreateMarkerRequestData.ts @@ -3,10 +3,10 @@ import { IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInve export interface IInventoryCreateMarkerRequestData extends IInventoryBaseActionRequestData { Action: "CreateMapMarker"; item: string; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/project/src/models/eft/inventory/IInventoryEditMarkerRequestData.ts b/project/src/models/eft/inventory/IInventoryEditMarkerRequestData.ts index 676f6df1..b41f9583 100644 --- a/project/src/models/eft/inventory/IInventoryEditMarkerRequestData.ts +++ b/project/src/models/eft/inventory/IInventoryEditMarkerRequestData.ts @@ -5,10 +5,10 @@ export interface IInventoryEditMarkerRequestData extends IInventoryBaseActionReq item: string; X: number; Y: number; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/project/src/models/eft/inventory/IInventoryMoveRequestData.ts b/project/src/models/eft/inventory/IInventoryMoveRequestData.ts index 8d594673..6cb95779 100644 --- a/project/src/models/eft/inventory/IInventoryMoveRequestData.ts +++ b/project/src/models/eft/inventory/IInventoryMoveRequestData.ts @@ -1,7 +1,7 @@ -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryMoveRequestData extends IInventoryBaseActionRequestData { Action: "Move"; item: string; - to: To; + to: ITo; } diff --git a/project/src/models/eft/inventory/IInventorySplitRequestData.ts b/project/src/models/eft/inventory/IInventorySplitRequestData.ts index 58259004..d3f2ad6f 100644 --- a/project/src/models/eft/inventory/IInventorySplitRequestData.ts +++ b/project/src/models/eft/inventory/IInventorySplitRequestData.ts @@ -1,4 +1,4 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; @@ -7,6 +7,6 @@ export interface IInventorySplitRequestData extends IInventoryBaseActionRequestD /** Id of new item stack */ newItem: string; /** Destination new item will be placed in */ - container: Container; + container: IContainer; count: number; } diff --git a/project/src/models/eft/inventory/IInventorySwapRequestData.ts b/project/src/models/eft/inventory/IInventorySwapRequestData.ts index 6b824e08..6e620e15 100644 --- a/project/src/models/eft/inventory/IInventorySwapRequestData.ts +++ b/project/src/models/eft/inventory/IInventorySwapRequestData.ts @@ -1,12 +1,12 @@ import { OwnerInfo } from "@spt/models/eft/common/request/IBaseInteractionRequestData"; -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySwapRequestData extends IInventoryBaseActionRequestData { Action: "Swap"; item: string; - to: To; + to: ITo; item2: string; - to2: To; + to2: ITo; fromOwner2: OwnerInfo; toOwner2: OwnerInfo; } diff --git a/project/src/models/eft/inventory/IOpenRandomLootContainerRequestData.ts b/project/src/models/eft/inventory/IOpenRandomLootContainerRequestData.ts index 884bcc35..23529bac 100644 --- a/project/src/models/eft/inventory/IOpenRandomLootContainerRequestData.ts +++ b/project/src/models/eft/inventory/IOpenRandomLootContainerRequestData.ts @@ -4,10 +4,10 @@ export interface IOpenRandomLootContainerRequestData extends IInventoryBaseActio Action: "OpenRandomLootContainer"; /** Container item id being opened */ item: string; - to: To[]; + to: ITo[]; } -export interface To { +export interface ITo { /** Player character (pmc/scav) id items will be sent to */ id: string; } diff --git a/project/src/models/eft/itemEvent/IItemEventRouterBase.ts b/project/src/models/eft/itemEvent/IItemEventRouterBase.ts index 4bcc2c4e..ecdf5944 100644 --- a/project/src/models/eft/itemEvent/IItemEventRouterBase.ts +++ b/project/src/models/eft/itemEvent/IItemEventRouterBase.ts @@ -39,7 +39,7 @@ export interface IProfileChange { improvements: Record; skills: ISkills; health: IHealth; - traderRelations: Record; + traderRelations: Record; moneyTransferLimitData: IMoneyTransferLimits; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; @@ -76,7 +76,7 @@ export interface IItemChanges { } /** Related to TraderInfo */ -export interface TraderData { +export interface ITraderData { salesSum: number; standing: number; loyalty: number; diff --git a/project/src/models/eft/itemEvent/IItemEventRouterRequest.ts b/project/src/models/eft/itemEvent/IItemEventRouterRequest.ts index 5da80586..979987eb 100644 --- a/project/src/models/eft/itemEvent/IItemEventRouterRequest.ts +++ b/project/src/models/eft/itemEvent/IItemEventRouterRequest.ts @@ -1,22 +1,22 @@ export interface IItemEventRouterRequest { - data: Daum[]; + data: IDaum[]; tm: number; reload: number; } -export interface Daum { +export interface IDaum { Action: string; item: string; - to: To; + to: ITo; } -export interface To { +export interface ITo { id: string; container: string; - location?: Location; + location?: ILocation; } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/project/src/models/eft/launcher/IMiniProfile.ts b/project/src/models/eft/launcher/IMiniProfile.ts index f9a0a2b6..2a3cdc27 100644 --- a/project/src/models/eft/launcher/IMiniProfile.ts +++ b/project/src/models/eft/launcher/IMiniProfile.ts @@ -1,4 +1,4 @@ -import { Spt } from "../profile/ISptProfile"; +import { ISpt } from "../profile/ISptProfile"; export interface IMiniProfile { username: string; @@ -11,5 +11,5 @@ export interface IMiniProfile { maxlvl: number; edition: string; profileId: string; - sptData: Spt; + sptData: ISpt; } diff --git a/project/src/models/eft/match/IRaidSettings.ts b/project/src/models/eft/match/IRaidSettings.ts index 6fedf4b3..34e602a6 100644 --- a/project/src/models/eft/match/IRaidSettings.ts +++ b/project/src/models/eft/match/IRaidSettings.ts @@ -16,16 +16,16 @@ export interface IRaidSettings { isLocationTransition: boolean; timeVariant: DateTime; metabolismDisabled: boolean; - timeAndWeatherSettings: TimeAndWeatherSettings; - botSettings: BotSettings; - wavesSettings: WavesSettings; + timeAndWeatherSettings: ITimeAndWeatherSettings; + botSettings: IBotSettings; + wavesSettings: IWavesSettings; side: SideType; raidMode: RaidMode; playersSpawnPlace: PlayersSpawnPlace; CanShowGroupPreview: boolean; } -export interface TimeAndWeatherSettings { +export interface ITimeAndWeatherSettings { isRandomTime: boolean; isRandomWeather: boolean; cloudinessType: CloudinessType; @@ -36,12 +36,12 @@ export interface TimeAndWeatherSettings { hourOfDay: number; } -export interface BotSettings { +export interface IBotSettings { isScavWars: boolean; botAmount: BotAmount; } -export interface WavesSettings { +export interface IWavesSettings { botAmount: BotAmount; botDifficulty: BotDifficulty; isBosses: boolean; diff --git a/project/src/models/eft/profile/ISptProfile.ts b/project/src/models/eft/profile/ISptProfile.ts index a1cb14fb..1a460b73 100644 --- a/project/src/models/eft/profile/ISptProfile.ts +++ b/project/src/models/eft/profile/ISptProfile.ts @@ -7,22 +7,22 @@ import { IProfileChangeEvent } from "@spt/models/spt/dialog/ISendMessageDetails" export interface ISptProfile { info: Info; - characters: Characters; + characters: ICharacters; /** Clothing purchases */ suits: string[]; userbuilds: IUserBuilds; - dialogues: Record; - spt: Spt; - vitality: Vitality; - inraid: Inraid; - insurance: Insurance[]; + dialogues: Record; + spt: ISpt; + vitality: IVitality; + inraid: IInraid; + insurance: IInsurance[]; /** Assort purchases made by player since last trader refresh */ - traderPurchases?: Record>; + traderPurchases?: Record>; /** Achievements earned by player */ achievements: Record; } -export class TraderPurchaseData { +export class ITraderPurchaseData { count: number; purchaseTimestamp: number; } @@ -38,7 +38,7 @@ export interface Info { edition: string; } -export interface Characters { +export interface ICharacters { pmc: IPmcData; scav: IPmcData; } @@ -86,13 +86,13 @@ export interface IDefaultEquipmentPreset extends IUserBuild { type: string; } -export interface Dialogue { +export interface IDialogue { attachmentsNew: number; new: number; type: MessageType; Users?: IUserDialogInfo[]; pinned: boolean; - messages: Message[]; + messages: IMessage[]; _id: string; } @@ -111,17 +111,17 @@ export interface IUserDialogDetails { } // @Cleanup: Maybe the same as Dialogue? -export interface DialogueInfo { +export interface IDialogueInfo { attachmentsNew: number; new: number; _id: string; type: MessageType; pinned: boolean; Users?: IUserDialogInfo[]; - message: MessagePreview; + message: IMessagePreview; } -export interface Message { +export interface IMessage { _id: string; uid: string; type: MessageType; @@ -133,7 +133,7 @@ export interface Message { replyTo?: IReplyTo; hasRewards?: boolean; rewardCollected: boolean; - items?: MessageItems; + items?: IMessageItems; maxStorageTime?: number; systemData?: ISystemData; profileChangeEvents?: IProfileChangeEvent[]; @@ -147,7 +147,7 @@ export interface IReplyTo { text?: string; } -export interface MessagePreview { +export interface IMessagePreview { uid: string; type: MessageType; dt: number; @@ -156,7 +156,7 @@ export interface MessagePreview { systemData?: ISystemData; } -export interface MessageItems { +export interface IMessageItems { stash?: string; data?: IItem[]; } @@ -179,18 +179,13 @@ export interface IUpdatableChatMember { Banned: boolean; } -export interface DateTime { - date: string; - time: string; -} - -export interface Spt { +export interface ISpt { /** What version of SPT was this profile made with */ version: string; /** What mods has this profile loaded at any point in time */ - mods?: ModDetails[]; + mods?: IModDetails[]; /** What gifts has this profile received and how many */ - receivedGifts?: ReceivedGift[]; + receivedGifts?: IReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; /** key: daily type */ @@ -199,7 +194,7 @@ export interface Spt { migrations?: Record; } -export interface ModDetails { +export interface IModDetails { name: string; version: string; author: string; @@ -207,18 +202,18 @@ export interface ModDetails { url: string; } -export interface ReceivedGift { +export interface IReceivedGift { giftId: string; timestampLastAccepted: number; current: number; } -export interface Vitality { - health: Health; - effects: Effects; +export interface IVitality { + health: IHealth; + effects: IEffects; } -export interface Health { +export interface IHealth { Hydration: number; Energy: number; Temperature: number; @@ -231,44 +226,44 @@ export interface Health { RightLeg: number; } -export interface Effects { - Head: Head; - Chest: Chest; - Stomach: Stomach; - LeftArm: LeftArm; - RightArm: RightArm; - LeftLeg: LeftLeg; - RightLeg: RightLeg; +export interface IEffects { + Head: IHead; + Chest: IChest; + Stomach: IStomach; + LeftArm: ILeftArm; + RightArm: IRightArm; + LeftLeg: ILeftLeg; + RightLeg: IRightLeg; } -export type Head = {}; +export type IHead = {}; -export type Chest = {}; +export type IChest = {}; -export type Stomach = {}; +export type IStomach = {}; -export interface LeftArm { +export interface ILeftArm { Fracture?: number; } -export interface RightArm { +export interface IRightArm { Fracture?: number; } -export interface LeftLeg { +export interface ILeftLeg { Fracture?: number; } -export interface RightLeg { +export interface IRightLeg { Fracture?: number; } -export interface Inraid { +export interface IInraid { location: string; character: string; } -export interface Insurance { +export interface IInsurance { scheduledTime: number; traderId: string; maxStorageTime: number; @@ -278,7 +273,7 @@ export interface Insurance { items: IItem[]; } -export interface MessageContentRagfair { +export interface IMessageContentRagfair { offerId: string; count: number; handbookId: string; diff --git a/project/src/models/eft/ragfair/IAddOfferRequestData.ts b/project/src/models/eft/ragfair/IAddOfferRequestData.ts index 52c91862..0d8f2409 100644 --- a/project/src/models/eft/ragfair/IAddOfferRequestData.ts +++ b/project/src/models/eft/ragfair/IAddOfferRequestData.ts @@ -2,10 +2,10 @@ export interface IAddOfferRequestData { Action: string; sellInOnePiece: boolean; items: string[]; - requirements: Requirement[]; + requirements: IRequirement[]; } -export interface Requirement { +export interface IRequirement { _tpl: string; count: number; level: number; diff --git a/project/src/models/eft/ragfair/IRagfairOffer.ts b/project/src/models/eft/ragfair/IRagfairOffer.ts index 0d4d094e..34ec3a29 100644 --- a/project/src/models/eft/ragfair/IRagfairOffer.ts +++ b/project/src/models/eft/ragfair/IRagfairOffer.ts @@ -6,7 +6,7 @@ export interface IRagfairOffer { sellResult?: ISellResult[]; _id: string; items: IItem[]; - requirements: OfferRequirement[]; + requirements: IOfferRequirement[]; root: string; intId: number; /** Handbook price */ @@ -29,7 +29,7 @@ export interface IRagfairOffer { locked?: boolean; } -export interface OfferRequirement { +export interface IOfferRequirement { _tpl: string; count: number; onlyFunctional: boolean; diff --git a/project/src/models/eft/repair/IRepairActionDataRequest.ts b/project/src/models/eft/repair/IRepairActionDataRequest.ts index 887df87d..ed9b5dfa 100644 --- a/project/src/models/eft/repair/IRepairActionDataRequest.ts +++ b/project/src/models/eft/repair/IRepairActionDataRequest.ts @@ -2,11 +2,11 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepair export interface IRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "Repair"; - repairKitsInfo: RepairKitsInfo[]; + repairKitsInfo: IRepairKitsInfo[]; target: string; // item to repair } -export interface RepairKitsInfo { +export interface IRepairKitsInfo { _id: string; // id of repair kit to use count: number; // amout of units to reduce kit by } diff --git a/project/src/models/eft/repair/ITraderRepairActionDataRequest.ts b/project/src/models/eft/repair/ITraderRepairActionDataRequest.ts index 9765ff38..d7b96de2 100644 --- a/project/src/models/eft/repair/ITraderRepairActionDataRequest.ts +++ b/project/src/models/eft/repair/ITraderRepairActionDataRequest.ts @@ -3,10 +3,10 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepair export interface ITraderRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "TraderRepair"; tid: string; - repairItems: RepairItem[]; + repairItems: IRepairItem[]; } -export interface RepairItem { +export interface IRepairItem { _id: string; count: number; } diff --git a/project/src/models/eft/ws/IWsChatMessageReceived.ts b/project/src/models/eft/ws/IWsChatMessageReceived.ts index 41a3b8a9..22edb51b 100644 --- a/project/src/models/eft/ws/IWsChatMessageReceived.ts +++ b/project/src/models/eft/ws/IWsChatMessageReceived.ts @@ -1,9 +1,9 @@ import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter"; -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; export interface IWsChatMessageReceived extends IWsNotificationEvent { dialogId: string; - message: Message; + message: IMessage; profiles?: IGroupCharacter[]; } diff --git a/project/src/models/spt/bots/BotGenerationDetails.ts b/project/src/models/spt/bots/BotGenerationDetails.ts index 24f7e740..ee1d7d20 100644 --- a/project/src/models/spt/bots/BotGenerationDetails.ts +++ b/project/src/models/spt/bots/BotGenerationDetails.ts @@ -1,6 +1,6 @@ import { MinMax } from "@spt/models/common/MinMax"; -export interface BotGenerationDetails { +export interface IBotGenerationDetails { /** Should the bot be generated as a PMC */ isPmc: boolean; /** assault/pmcBot etc */ diff --git a/project/src/models/spt/bots/IGenerateEquipmentProperties.ts b/project/src/models/spt/bots/IGenerateEquipmentProperties.ts index f45c65f4..61de0f9a 100644 --- a/project/src/models/spt/bots/IGenerateEquipmentProperties.ts +++ b/project/src/models/spt/bots/IGenerateEquipmentProperties.ts @@ -1,6 +1,6 @@ import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; import { IChances, IMods } from "@spt/models/eft/common/tables/IBotType"; -import { EquipmentFilters, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { IBotData } from "./IGenerateWeaponRequest"; export interface IGenerateEquipmentProperties { @@ -16,7 +16,7 @@ export interface IGenerateEquipmentProperties { inventory: PmcInventory; botEquipmentConfig: EquipmentFilters; /** Settings from bot.json to adjust how item is generated */ - randomisationDetails: RandomisationDetails; + randomisationDetails: IRandomisationDetails; /** OPTIONAL - Do not generate mods for tpls in this array */ generateModsBlacklist?: string[]; generatingPlayerLevel: number; diff --git a/project/src/models/spt/bots/IModToSpawnRequest.ts b/project/src/models/spt/bots/IModToSpawnRequest.ts index 8a0c3a3d..18379103 100644 --- a/project/src/models/spt/bots/IModToSpawnRequest.ts +++ b/project/src/models/spt/bots/IModToSpawnRequest.ts @@ -2,7 +2,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; -import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ @@ -12,7 +12,7 @@ export interface IModToSpawnRequest { /** Parent slot the item will be a part of */ botWeaponSightWhitelist: Record; /** Blacklist to prevent mods from being picked */ - botEquipBlacklist: EquipmentFilterDetails; + botEquipBlacklist: IEquipmentFilterDetails; /** Pool of items to pick from */ itemModPool: Record; /** Array with only weapon tpl in it, ready for mods to be added */ diff --git a/project/src/models/spt/callbacks/IDialogueCallbacks.ts b/project/src/models/spt/callbacks/IDialogueCallbacks.ts index 329979eb..780cd6ad 100644 --- a/project/src/models/spt/callbacks/IDialogueCallbacks.ts +++ b/project/src/models/spt/callbacks/IDialogueCallbacks.ts @@ -14,7 +14,7 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IDialogueCallbacks { getFriendList( @@ -27,7 +27,7 @@ export interface IDialogueCallbacks { url: string, info: IGetMailDialogListRequestData, sessionID: string, - ): IGetBodyResponseData; + ): IGetBodyResponseData; getMailDialogView( url: string, info: IGetMailDialogViewRequestData, diff --git a/project/src/models/spt/config/IBotConfig.ts b/project/src/models/spt/config/IBotConfig.ts index d731c48c..00076e1b 100644 --- a/project/src/models/spt/config/IBotConfig.ts +++ b/project/src/models/spt/config/IBotConfig.ts @@ -6,7 +6,7 @@ import { IBotDurability } from "@spt/models/spt/config/IBotDurability"; export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ - presetBatch: PresetBatch; + presetBatch: IPresetBatch; /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ @@ -58,7 +58,7 @@ export interface IAssaultToBossConversion { } /** Number of bots to generate and store in cache on raid start per bot type */ -export interface PresetBatch { +export interface IPresetBatch { assault: number; bossBully: number; bossGluhar: number; @@ -109,7 +109,7 @@ export interface IWalletLootSettings { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ - weaponModLimits: ModLimits; + weaponModLimits: IModLimits; /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; /** Chance face shield is down/active */ @@ -130,29 +130,29 @@ export interface EquipmentFilters { /** What additional slot ids should be seen as required when choosing a mod to add to a weapon */ weaponSlotIdsToMakeRequired?: string[]; /** Adjust weighting/chances of items on bot by level of bot */ - randomisation: RandomisationDetails[]; + randomisation: IRandomisationDetails[]; /** Blacklist equipment by level of bot */ - blacklist: EquipmentFilterDetails[]; + blacklist: IEquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ - whitelist: EquipmentFilterDetails[]; + whitelist: IEquipmentFilterDetails[]; /** Adjust equipment/ammo */ - weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + weightingAdjustmentsByBotLevel: IWeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ - weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + weightingAdjustmentsByPlayerLevel?: IWeightingAdjustmentDetails[]; /** Should the stock mod be forced to spawn on bot */ forceStock?: boolean; armorPlateWeighting?: IArmorPlateWeights[]; forceRigWhenNoVest?: boolean; } -export interface ModLimits { +export interface IModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ scopeLimit?: number; /** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */ lightLaserLimit?: number; } -export interface RandomisationDetails { +export interface IRandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; generation?: Record; @@ -175,7 +175,7 @@ export interface INighttimeChanges { //weaponModsModifiers: Record; //TODO } -export interface EquipmentFilterDetails { +export interface IEquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ levelRange: MinMax; /** Key: mod slot name e.g. mod_magazine, value: item tpls */ @@ -184,7 +184,7 @@ export interface EquipmentFilterDetails { cartridge: Record; } -export interface WeightingAdjustmentDetails { +export interface IWeightingAdjustmentDetails { /** Between what levels do these weight settings apply to */ levelRange: MinMax; /** Key: ammo type e.g. Caliber556x45NATO, value: item tpl + weight */ diff --git a/project/src/models/spt/config/IBotDurability.ts b/project/src/models/spt/config/IBotDurability.ts index 90375f20..1b00e634 100644 --- a/project/src/models/spt/config/IBotDurability.ts +++ b/project/src/models/spt/config/IBotDurability.ts @@ -1,6 +1,6 @@ export interface IBotDurability { default: IDefaultDurability; - pmc: PmcDurability; + pmc: IPmcDurability; boss: IBotDurability; follower: IBotDurability; assault: IBotDurability; @@ -22,7 +22,7 @@ export interface IDefaultDurability { weapon: IWeaponDurability; } -export interface PmcDurability { +export interface IPmcDurability { armor: IPmcDurabilityArmor; weapon: IWeaponDurability; } diff --git a/project/src/models/spt/config/IHealthConfig.ts b/project/src/models/spt/config/IHealthConfig.ts index 3422a259..85630c12 100644 --- a/project/src/models/spt/config/IHealthConfig.ts +++ b/project/src/models/spt/config/IHealthConfig.ts @@ -2,16 +2,16 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IHealthConfig extends IBaseConfig { kind: "spt-health"; - healthMultipliers: HealthMultipliers; - save: Save; + healthMultipliers: IHealthMultipliers; + save: ISave; } -export interface HealthMultipliers { +export interface IHealthMultipliers { death: number; blacked: number; } -export interface Save { +export interface ISave { health: boolean; effects: boolean; } diff --git a/project/src/models/spt/config/IHideoutConfig.ts b/project/src/models/spt/config/IHideoutConfig.ts index 877595a5..2bdeb39b 100644 --- a/project/src/models/spt/config/IHideoutConfig.ts +++ b/project/src/models/spt/config/IHideoutConfig.ts @@ -20,11 +20,11 @@ export interface ICultistCircleSettings { maxRewardItemCount: number; maxAttemptsToPickRewardsWithinBudget: number; rewardPriceMultiplerMinMax: MinMax; - craftTimeThreshholds: CraftTimeThreshhold[]; + craftTimeThreshholds: ICraftTimeThreshhold[]; /** -1 means no override */ craftTimeOverride: number; /** Specific reward pool when player sacrificed one specific item */ - directRewards: Record; + directRewards: Record; directRewardStackSize: Record; /** Item tpls to exclude from the reward pool */ rewardItemBlacklist: string[]; @@ -33,11 +33,11 @@ export interface ICultistCircleSettings { currencyRewards: Record; } -export interface CraftTimeThreshhold extends MinMax { +export interface ICraftTimeThreshhold extends MinMax { craftTimeSeconds: number; } -export interface DirectRewardSettings { +export interface IDirectRewardSettings { rewardTpls: string[]; craftTimeSeconds: number; } diff --git a/project/src/models/spt/config/IInRaidConfig.ts b/project/src/models/spt/config/IInRaidConfig.ts index 7b220970..aaec8f12 100644 --- a/project/src/models/spt/config/IInRaidConfig.ts +++ b/project/src/models/spt/config/IInRaidConfig.ts @@ -3,9 +3,9 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInRaidConfig extends IBaseConfig { kind: "spt-inraid"; /** Overrides to apply to the pre-raid settings screen */ - raidMenuSettings: RaidMenuSettings; + raidMenuSettings: IRaidMenuSettings; /** What effects should be saved post-raid */ - save: Save; + save: ISave; /** Names of car extracts */ carExtracts: string[]; /** Names of coop extracts */ @@ -26,7 +26,7 @@ export interface IInRaidConfig extends IBaseConfig { playerScavHostileChancePercent: number; } -export interface RaidMenuSettings { +export interface IRaidMenuSettings { aiAmount: string; aiDifficulty: string; bossEnabled: boolean; @@ -37,7 +37,7 @@ export interface RaidMenuSettings { randomTime: boolean; } -export interface Save { +export interface ISave { /** Should loot gained from raid be saved */ loot: boolean; } diff --git a/project/src/models/spt/config/IInventoryConfig.ts b/project/src/models/spt/config/IInventoryConfig.ts index 104c6ea2..69668d22 100644 --- a/project/src/models/spt/config/IInventoryConfig.ts +++ b/project/src/models/spt/config/IInventoryConfig.ts @@ -5,7 +5,7 @@ export interface IInventoryConfig extends IBaseConfig { kind: "spt-inventory"; /** Should new items purchased by flagged as found in raid */ newItemsMarkedFound: boolean; - randomLootContainers: Record; + randomLootContainers: Record; sealedAirdropContainer: ISealedAirdropContainerSettings; /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ customMoneyTpls: string[]; @@ -13,7 +13,7 @@ export interface IInventoryConfig extends IBaseConfig { skillGainMultiplers: Record; } -export interface RewardDetails { +export interface IRewardDetails { rewardCount: number; foundInRaid: boolean; rewardTplPool?: Record; diff --git a/project/src/models/spt/config/IPlayerScavConfig.ts b/project/src/models/spt/config/IPlayerScavConfig.ts index 3a6bf80f..7012bd6d 100644 --- a/project/src/models/spt/config/IPlayerScavConfig.ts +++ b/project/src/models/spt/config/IPlayerScavConfig.ts @@ -3,18 +3,18 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "spt-playerscav"; - karmaLevel: Record; + karmaLevel: Record; } -export interface KarmaLevel { +export interface IKarmaLevel { botTypeForLoot: string; - modifiers: Modifiers; + modifiers: IModifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; lootItemsToAddChancePercent: Record; } -export interface Modifiers { +export interface IModifiers { equipment: Record; mod: Record; } diff --git a/project/src/models/spt/config/IPmcConfig.ts b/project/src/models/spt/config/IPmcConfig.ts index 5eec5788..2d4c2672 100644 --- a/project/src/models/spt/config/IPmcConfig.ts +++ b/project/src/models/spt/config/IPmcConfig.ts @@ -10,11 +10,11 @@ export interface IPmcConfig extends IBaseConfig { /** What account type should the PMC have */ accountTypeWeight: Record; /** Global whitelist/blacklist of vest loot for PMCs */ - vestLoot: SlotLootSettings; + vestLoot: ISlotLootSettings; /** Global whitelist/blacklist of pocket loot for PMCs */ - pocketLoot: SlotLootSettings; + pocketLoot: ISlotLootSettings; /** Global whitelist/blacklist of backpack loot for PMCs */ - backpackLoot: SlotLootSettings; + backpackLoot: ISlotLootSettings; /** Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value */ useDifficultyOverride: boolean; /** Difficulty override e.g. "AsOnline/Hard" */ @@ -33,7 +33,7 @@ export interface IPmcConfig extends IBaseConfig { bearType: string; /** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */ pmcType: Record>>; - maxBackpackLootTotalRub: MinMaxLootValue[]; + maxBackpackLootTotalRub: IMinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; /** Percentage chance a bot from a wave is converted into a PMC, first key = map, second key = bot wildspawn type (assault/exusec), value: min+max chance to be converted */ @@ -64,16 +64,16 @@ export interface IHostilitySettings { savagePlayerBehaviour?: string; } -export interface PmcTypes { +export interface IPmcTypes { usec: string; bear: string; } -export interface SlotLootSettings { +export interface ISlotLootSettings { whitelist: string[]; blacklist: string[]; } -export interface MinMaxLootValue extends MinMax { +export interface IMinMaxLootValue extends MinMax { value: number; } diff --git a/project/src/models/spt/config/IRagfairConfig.ts b/project/src/models/spt/config/IRagfairConfig.ts index 60e73c9f..d692a121 100644 --- a/project/src/models/spt/config/IRagfairConfig.ts +++ b/project/src/models/spt/config/IRagfairConfig.ts @@ -8,14 +8,14 @@ export interface IRagfairConfig extends IBaseConfig { /** Default values used to hydrate `runIntervalSeconds` with */ runIntervalValues: IRunIntervalValues; /** Player listing settings */ - sell: Sell; + sell: ISell; /** Trader ids + should their assorts be listed on flea */ traders: Record; - dynamic: Dynamic; + dynamic: IDynamic; tieredFlea: ITieredFlea; } -export interface Sell { +export interface ISell { /** Should a fee be deducted from player when liting an item for sale */ fees: boolean; /** Settings to control chances of offer being sold */ @@ -37,7 +37,7 @@ export interface Chance { minSellChancePercent: number; } -export interface Dynamic { +export interface IDynamic { // Should a purchased dynamic offers items be flagged as found in raid purchasesAreFoundInRaid: boolean; /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ @@ -46,7 +46,7 @@ export interface Dynamic { barter: IBarterDetails; pack: IPackDetails; /** Dynamic offer price below handbook adjustment values */ - offerAdjustment: OfferAdjustment; + offerAdjustment: IOfferAdjustment; /** How many offers should expire before an offer regeneration occurs */ expiredOfferThreshold: number; /** How many offers should be listed */ @@ -75,7 +75,7 @@ export interface Dynamic { /** Should christmas/halloween items be removed from flea when not within the seasonal bounds */ removeSeasonalItemsWhenNotInEvent: boolean; /** Flea blacklist settings */ - blacklist: Blacklist; + blacklist: IRagfairBlacklist; /** Dict of price limits keyed by item type */ unreasonableModPrices: Record; } @@ -112,7 +112,7 @@ export interface IPackDetails { itemTypeWhitelist: string[]; } -export interface OfferAdjustment { +export interface IOfferAdjustment { /** Shuld offer price be adjusted when below handbook price */ adjustPriceWhenBelowHandbookPrice: boolean; /** How big a percentage difference does price need to vary from handbook to be considered for adjustment */ @@ -130,7 +130,7 @@ export interface Condition { max: MinMax; } -export interface Blacklist { +export interface IRagfairBlacklist { /** Damaged ammo packs */ damagedAmmoPacks: boolean; /** Custom blacklist for item Tpls */ diff --git a/project/src/models/spt/config/IRepairConfig.ts b/project/src/models/spt/config/IRepairConfig.ts index c8690d8d..2fe796a6 100644 --- a/project/src/models/spt/config/IRepairConfig.ts +++ b/project/src/models/spt/config/IRepairConfig.ts @@ -12,7 +12,7 @@ export interface IRepairConfig extends IBaseConfig { // ** How much INT can be given to player per repair action */ maxIntellectGainPerRepair: IMaxIntellectGainValues; weaponTreatment: IWeaponTreatmentRepairValues; - repairKit: RepairKit; + repairKit: IRepairKit; } export interface IIntellectGainValues { @@ -36,19 +36,19 @@ export interface IWeaponTreatmentRepairValues { pointGainMultiplier: number; } -export interface RepairKit { - armor: BonusSettings; - weapon: BonusSettings; +export interface IRepairKit { + armor: IBonusSettings; + weapon: IBonusSettings; } -export interface BonusSettings { +export interface IBonusSettings { rarityWeight: Record; bonusTypeWeight: Record; - common: Record; - rare: Record; + common: Record; + rare: Record; } -export interface BonusValues { +export interface IBonusValues { valuesMinMax: MinMax; /** What dura is buff active between (min max of current max) */ activeDurabilityPercentMinMax: MinMax; diff --git a/project/src/models/spt/config/ITraderConfig.ts b/project/src/models/spt/config/ITraderConfig.ts index 9ae08169..f74b40e9 100644 --- a/project/src/models/spt/config/ITraderConfig.ts +++ b/project/src/models/spt/config/ITraderConfig.ts @@ -4,24 +4,24 @@ import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; export interface ITraderConfig extends IBaseConfig { kind: "spt-trader"; - updateTime: UpdateTime[]; + updateTime: IUpdateTime[]; purchasesAreFoundInRaid: boolean; /** Should trader reset times be set based on server start time (false = bsg time - on the hour) */ tradersResetFromServerStart: boolean; updateTimeDefault: number; traderPriceMultipler: number; - fence: FenceConfig; - moddedTraders: ModdedTraders; + fence: IFenceConfig; + moddedTraders: IModdedTraders; } -export interface UpdateTime { +export interface IUpdateTime { traderId: string; /** Seconds between trader resets */ seconds: MinMax; } -export interface FenceConfig { - discountOptions: DiscountOptions; +export interface IFenceConfig { + discountOptions: IDiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; @@ -48,7 +48,7 @@ export interface FenceConfig { /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ ammoMaxPenLimit: number; blacklist: string[]; - coopExtractGift: CoopExtractReward; + coopExtractGift: ICoopExtractReward; btrDeliveryExpireHours: number; } @@ -57,13 +57,13 @@ export interface IItemDurabilityCurrentMax { max: MinMax; } -export interface CoopExtractReward extends ILootRequest { +export interface ICoopExtractReward extends ILootRequest { sendGift: boolean; messageLocaleIds: string[]; giftExpiryHours: number; } -export interface DiscountOptions { +export interface IDiscountOptions { assortSize: number; itemPriceMult: number; presetPriceMult: number; @@ -72,7 +72,7 @@ export interface DiscountOptions { } /** Custom trader data needed client side for things such as the clothing service */ -export interface ModdedTraders { +export interface IModdedTraders { /** Trader Ids to enable the clothing service for */ clothingService: string[]; } diff --git a/project/src/models/spt/dialog/ISendMessageDetails.ts b/project/src/models/spt/dialog/ISendMessageDetails.ts index 90705058..4fe61069 100644 --- a/project/src/models/spt/dialog/ISendMessageDetails.ts +++ b/project/src/models/spt/dialog/ISendMessageDetails.ts @@ -1,5 +1,5 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ISystemData, IUserDialogInfo, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IMessageContentRagfair, ISystemData, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; @@ -25,7 +25,7 @@ export interface ISendMessageDetails { /** Optional - ragfair related */ systemData?: ISystemData; /** Optional - Used by ragfair messages */ - ragfairDetails?: MessageContentRagfair; + ragfairDetails?: IMessageContentRagfair; /** OPTIONAL - allows modification of profile settings via mail */ profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/project/src/models/spt/hideout/ScavCaseRewardCountsAndPrices.ts b/project/src/models/spt/hideout/ScavCaseRewardCountsAndPrices.ts index 830c08c0..7ce2ae10 100644 --- a/project/src/models/spt/hideout/ScavCaseRewardCountsAndPrices.ts +++ b/project/src/models/spt/hideout/ScavCaseRewardCountsAndPrices.ts @@ -1,10 +1,10 @@ -export interface ScavCaseRewardCountsAndPrices { - Common: RewardCountAndPriceDetails; - Rare: RewardCountAndPriceDetails; - Superrare: RewardCountAndPriceDetails; +export interface IScavCaseRewardCountsAndPrices { + Common: IRewardCountAndPriceDetails; + Rare: IRewardCountAndPriceDetails; + Superrare: IRewardCountAndPriceDetails; } -export interface RewardCountAndPriceDetails { +export interface IRewardCountAndPriceDetails { minCount: number; maxCount: number; minPriceRub: number; diff --git a/project/src/models/spt/mod/NewItemDetails.ts b/project/src/models/spt/mod/NewItemDetails.ts index 6534cd0c..96162bc2 100644 --- a/project/src/models/spt/mod/NewItemDetails.ts +++ b/project/src/models/spt/mod/NewItemDetails.ts @@ -1,4 +1,4 @@ -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export abstract class NewItemDetailsBase { /** Price of the item on flea market */ @@ -22,7 +22,7 @@ export class NewItemFromCloneDetails extends NewItemDetailsBase { itemTplToClone: string; /** Item properties that should be applied over the top of the cloned base */ - overrideProperties: Props; + overrideProperties: IProps; /** ParentId for the new item (item type) */ parentId: string; diff --git a/project/src/models/spt/server/ISettingsBase.ts b/project/src/models/spt/server/ISettingsBase.ts index 17082d7d..0e428bc1 100644 --- a/project/src/models/spt/server/ISettingsBase.ts +++ b/project/src/models/spt/server/ISettingsBase.ts @@ -1,26 +1,26 @@ export interface ISettingsBase { - config: Config; + config: IConfig; } -export interface Config { +export interface IConfig { AFKTimeoutSeconds: number; AdditionalRandomDelaySeconds: number; ClientSendRateLimit: number; CriticalRetriesCount: number; DefaultRetriesCount: number; FirstCycleDelaySeconds: number; - FramerateLimit: FramerateLimit; + FramerateLimit: IFramerateLimit; GroupStatusInterval: number; GroupStatusButtonInterval: number; KeepAliveInterval: number; LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; - MemoryManagementSettings: MemoryManagementSettings; + MemoryManagementSettings: IMemoryManagementSettings; NVidiaHighlights: boolean; NextCycleDelaySeconds: number; PingServerResultSendInterval: number; PingServersInterval: number; - ReleaseProfiler: ReleaseProfiler; + ReleaseProfiler: IReleaseProfiler; RequestConfirmationTimeouts: number[]; RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; @@ -32,13 +32,13 @@ export interface Config { WsReconnectionDelays: string[]; } -export interface FramerateLimit { +export interface IFramerateLimit { MaxFramerateGameLimit: number; MaxFramerateLobbyLimit: number; MinFramerateLimit: number; } -export interface MemoryManagementSettings { +export interface IMemoryManagementSettings { AggressiveGC: boolean; GigabytesRequiredToDisableGCDuringRaid: number; HeapPreAllocationEnabled: boolean; @@ -47,7 +47,7 @@ export interface MemoryManagementSettings { RamCleanerEnabled: boolean; } -export interface ReleaseProfiler { +export interface IReleaseProfiler { Enabled: boolean; MaxRecords: number; RecordTriggerValue: number; diff --git a/project/src/models/spt/utils/ILogger.ts b/project/src/models/spt/utils/ILogger.ts index c2f9ad8b..aff35156 100644 --- a/project/src/models/spt/utils/ILogger.ts +++ b/project/src/models/spt/utils/ILogger.ts @@ -1,9 +1,9 @@ -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; export interface ILogger { - writeToLogFile(data: string | Daum): void; + writeToLogFile(data: string | IDaum): void; log(data: string | Record | Error, color: string, backgroundColor?: string): void; logWithColor( data: string | Record, diff --git a/project/src/routers/EventOutputHolder.ts b/project/src/routers/EventOutputHolder.ts index 7d2d6415..34f95d92 100644 --- a/project/src/routers/EventOutputHolder.ts +++ b/project/src/routers/EventOutputHolder.ts @@ -6,7 +6,7 @@ import { IProductive, ITraderInfo, } from "@spt/models/eft/common/tables/IBotBase"; -import { IProfileChange, TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; +import { IProfileChange, ITraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { TimeUtil } from "@spt/utils/TimeUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -103,8 +103,8 @@ export class EventOutputHolder { * @param traderData server data for traders * @returns dict of trader id + TraderData */ - protected constructTraderRelations(traderData: Record): Record { - const result: Record = {}; + protected constructTraderRelations(traderData: Record): Record { + const result: Record = {}; for (const traderId in traderData) { const baseData = traderData[traderId]; diff --git a/project/src/routers/static/DialogStaticRouter.ts b/project/src/routers/static/DialogStaticRouter.ts index 1578287d..2a651b7e 100644 --- a/project/src/routers/static/DialogStaticRouter.ts +++ b/project/src/routers/static/DialogStaticRouter.ts @@ -11,7 +11,7 @@ import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailD import { IRemoveUserGroupMailRequest } from "@spt/models/eft/dialog/IRemoveUserGroupMailRequest"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; import { inject, injectable } from "tsyringe"; @injectable() @@ -36,7 +36,7 @@ export class DialogStaticRouter extends StaticRouter { info: any, sessionID: string, output: string, - ): Promise> => { + ): Promise> => { return this.dialogueCallbacks.getMailDialogList(url, info, sessionID); }, ), @@ -58,7 +58,7 @@ export class DialogStaticRouter extends StaticRouter { info: any, sessionID: string, output: string, - ): Promise> => { + ): Promise> => { return this.dialogueCallbacks.getMailDialogInfo(url, info, sessionID); }, ), diff --git a/project/src/routers/static/TraderStaticRouter.ts b/project/src/routers/static/TraderStaticRouter.ts index 2b38ab7f..2e9f1b3c 100644 --- a/project/src/routers/static/TraderStaticRouter.ts +++ b/project/src/routers/static/TraderStaticRouter.ts @@ -2,7 +2,7 @@ import { TraderCallbacks } from "@spt/callbacks/TraderCallbacks"; import { RouteAction, StaticRouter } from "@spt/di/Router"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { ModdedTraders } from "@spt/models/spt/config/ITraderConfig"; +import { IModdedTraders } from "@spt/models/spt/config/ITraderConfig"; import { inject, injectable } from "tsyringe"; @injectable() @@ -27,7 +27,7 @@ export class TraderStaticRouter extends StaticRouter { info: any, sessionID: string, output: string, - ): Promise> => { + ): Promise> => { return this.traderCallbacks.getModdedTraderData(url, info, sessionID); }, ), diff --git a/project/src/services/BotEquipmentFilterService.ts b/project/src/services/BotEquipmentFilterService.ts index cca175b4..425b7654 100644 --- a/project/src/services/BotEquipmentFilterService.ts +++ b/project/src/services/BotEquipmentFilterService.ts @@ -8,13 +8,13 @@ import { IModsChances, } from "@spt/models/eft/common/tables/IBotType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { - EquipmentFilterDetails, EquipmentFilters, IAdjustmentDetails, IBotConfig, - WeightingAdjustmentDetails, + IEquipmentFilterDetails, + IWeightingAdjustmentDetails, } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -46,7 +46,7 @@ export class BotEquipmentFilterService { sessionId: string, baseBotNode: IBotType, botLevel: number, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, ): void { const pmcProfile = this.profileHelper.getPmcProfile(sessionId); @@ -154,7 +154,7 @@ export class BotEquipmentFilterService { * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - public getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined { + public getBotEquipmentBlacklist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined { const blacklistDetailsForBot = this.botEquipmentConfig[botRole]; // No equipment blacklist found, skip @@ -177,7 +177,7 @@ export class BotEquipmentFilterService { * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined { + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined { const botEquipmentConfig = this.botEquipmentConfig[botRole]; // No equipment blacklist found, skip @@ -196,7 +196,7 @@ export class BotEquipmentFilterService { * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined { + protected getBotWeightingAdjustments(botRole: string, botLevel: number): IWeightingAdjustmentDetails | undefined { const botEquipmentConfig = this.botEquipmentConfig[botRole]; // No config found, skip @@ -222,7 +222,7 @@ export class BotEquipmentFilterService { protected getBotWeightingAdjustmentsByPlayerLevel( botRole: string, playerlevel: number, - ): WeightingAdjustmentDetails | undefined { + ): IWeightingAdjustmentDetails | undefined { const botEquipmentConfig = this.botEquipmentConfig[botRole]; // No config found, skip @@ -248,8 +248,8 @@ export class BotEquipmentFilterService { */ protected filterEquipment( baseBotNode: IBotType, - blacklist: EquipmentFilterDetails, - whitelist: EquipmentFilterDetails, + blacklist: IEquipmentFilterDetails, + whitelist: IEquipmentFilterDetails, ): void { if (whitelist) { for (const equipmentSlotKey in baseBotNode.inventory.equipment) { @@ -304,8 +304,8 @@ export class BotEquipmentFilterService { */ protected filterCartridges( baseBotNode: IBotType, - blacklist: EquipmentFilterDetails, - whitelist: EquipmentFilterDetails, + blacklist: IEquipmentFilterDetails, + whitelist: IEquipmentFilterDetails, ): void { if (whitelist) { for (const ammoCaliberKey in baseBotNode.inventory.Ammo) { diff --git a/project/src/services/BotLootCacheService.ts b/project/src/services/BotLootCacheService.ts index 4d8132e5..a9ccbea4 100644 --- a/project/src/services/BotLootCacheService.ts +++ b/project/src/services/BotLootCacheService.ts @@ -1,7 +1,7 @@ import { PMCLootGenerator } from "@spt/generators/PMCLootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { IBotLootCache, LootCacheType } from "@spt/models/spt/bots/IBotLootCache"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -421,7 +421,7 @@ export class BotLootCacheService { * @param props * @returns */ - protected isBulletOrGrenade(props: Props): boolean { + protected isBulletOrGrenade(props: IProps): boolean { return "ammoType" in props; } @@ -430,7 +430,7 @@ export class BotLootCacheService { * @param props * @returns */ - protected isMagazine(props: Props): boolean { + protected isMagazine(props: IProps): boolean { return "ReloadMagType" in props; } @@ -439,7 +439,7 @@ export class BotLootCacheService { * @param props * @returns */ - protected isMedicalItem(props: Props): boolean { + protected isMedicalItem(props: IProps): boolean { return "medUseTime" in props; } @@ -448,7 +448,7 @@ export class BotLootCacheService { * @param props * @returns */ - protected isGrenade(props: Props): boolean { + protected isGrenade(props: IProps): boolean { return "ThrowType" in props; } diff --git a/project/src/services/BotNameService.ts b/project/src/services/BotNameService.ts index 12b612e3..e79c458e 100644 --- a/project/src/services/BotNameService.ts +++ b/project/src/services/BotNameService.ts @@ -2,7 +2,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -53,7 +53,7 @@ export class BotNameService { */ public generateUniqueBotNickname( botJsonTemplate: IBotType, - botGenerationDetails: BotGenerationDetails, + botGenerationDetails: IBotGenerationDetails, botRole: string, uniqueRoles?: string[], ): string { diff --git a/project/src/services/CircleOfCultistService.ts b/project/src/services/CircleOfCultistService.ts index 60c7d312..4adee815 100644 --- a/project/src/services/CircleOfCultistService.ts +++ b/project/src/services/CircleOfCultistService.ts @@ -11,8 +11,8 @@ import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/e import { IHideoutProduction, IHideoutProductionData, + IRequirement, IRequirementBase, - Requirement, } from "@spt/models/eft/hideout/IHideoutProduction"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; @@ -20,7 +20,7 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; -import { DirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IDirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -175,7 +175,7 @@ export class CircleOfCultistService { recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, - directRewardSettings?: DirectRewardSettings, + directRewardSettings?: IDirectRewardSettings, ): void { // Create circle production/craft object to add to player profile const cultistProduction = this.hideoutHelper.initProduction( @@ -203,7 +203,7 @@ export class CircleOfCultistService { */ protected getCircleCraftTimeSeconds( rewardAmountRoubles: number, - directRewardSettings?: DirectRewardSettings, + directRewardSettings?: IDirectRewardSettings, ): number { // Edge case, check if override exists if (this.hideoutConfig.cultistCircle.craftTimeOverride !== -1) { @@ -346,7 +346,7 @@ export class CircleOfCultistService { * @returns Array of item arrays */ protected getExplicitRewards( - explicitRewardSettings: DirectRewardSettings, + explicitRewardSettings: IDirectRewardSettings, cultistCircleStashId: string, ): IItem[][] { // Prep rewards array (reward can be item with children, hence array of arrays) @@ -573,7 +573,7 @@ export class CircleOfCultistService { * @param requirements Requirements to iterate over * @returns Array of item requirements */ - protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | Requirement)[] { + protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | IRequirement)[] { return requirements.filter((requirement) => requirement.type === "Item"); } } diff --git a/project/src/services/MailSendService.ts b/project/src/services/MailSendService.ts index 7eff3829..3d08e002 100644 --- a/project/src/services/MailSendService.ts +++ b/project/src/services/MailSendService.ts @@ -5,12 +5,12 @@ import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { - Dialogue, + IDialogue, + IMessage, + IMessageContentRagfair, + IMessageItems, ISystemData, IUserDialogInfo, - Message, - MessageContentRagfair, - MessageItems, } from "@spt/models/eft/profile/ISptProfile"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { MessageType } from "@spt/models/enums/MessageType"; @@ -59,7 +59,7 @@ export class MailSendService { items: IItem[] = [], maxStorageTimeSeconds?: number, systemData?: ISystemData, - ragfair?: MessageContentRagfair, + ragfair?: IMessageContentRagfair, ): void { if (!trader) { this.logger.error( @@ -114,7 +114,7 @@ export class MailSendService { items: IItem[] = [], maxStorageTimeSeconds?: number, systemData?: ISystemData, - ragfair?: MessageContentRagfair, + ragfair?: IMessageContentRagfair, ): void { if (!trader) { this.logger.error( @@ -334,8 +334,8 @@ export class MailSendService { * @param messageDetails Various details on what the message must contain/do * @returns Message */ - protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): Message { - const message: Message = { + protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): IMessage { + const message: IMessage = { _id: this.hashUtil.generate(), uid: dialogId, // must match the dialog id type: messageDetails.sender, // Same enum is used for defining dialog type + message type, thanks bsg @@ -369,8 +369,8 @@ export class MailSendService { * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ protected addRewardItemsToMessage( - message: Message, - itemsToSendToPlayer: MessageItems | undefined, + message: IMessage, + itemsToSendToPlayer: IMessageItems | undefined, maxStorageTimeSeconds: number | undefined, ): void { if ((itemsToSendToPlayer?.data?.length ?? 0) > 0) { @@ -390,10 +390,10 @@ export class MailSendService { protected processItemsBeforeAddingToMail( dialogType: MessageType, messageDetails: ISendMessageDetails, - ): MessageItems { + ): IMessageItems { const items = this.databaseService.getItems(); - let itemsToSendToPlayer: MessageItems = {}; + let itemsToSendToPlayer: IMessageItems = {}; if ((messageDetails.items?.length ?? 0) > 0) { // Find base item that should be the 'primary' + have its parent id be used as the dialogs 'stash' value const parentItem = this.getBaseItemFromRewards(messageDetails.items); @@ -500,7 +500,7 @@ export class MailSendService { * @param messageDetails Data on what message should do * @returns Relevant Dialogue */ - protected getDialog(messageDetails: ISendMessageDetails): Dialogue { + protected getDialog(messageDetails: ISendMessageDetails): IDialogue { const dialogsInProfile = this.dialogueHelper.getDialogsForProfile(messageDetails.recipientId); const senderId = this.getMessageSenderIdByType(messageDetails); if (!senderId) { diff --git a/project/src/services/ProfileFixerService.ts b/project/src/services/ProfileFixerService.ts index 6eb03c2a..a322e4d1 100644 --- a/project/src/services/ProfileFixerService.ts +++ b/project/src/services/ProfileFixerService.ts @@ -7,7 +7,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBonus, IHideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IEquipmentBuild, IMagazineBuild, ISptProfile, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; import { BonusType } from "@spt/models/enums/BonusType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; @@ -632,7 +632,7 @@ export class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: IBonus[], bonus: StageBonus): IBonus | undefined { + protected getBonusFromProfile(profileBonuses: IBonus[], bonus: IStageBonus): IBonus | undefined { // match by id first, used by "TextBonus" bonuses if (bonus.id) { return profileBonuses.find((x) => x.id === bonus.id); diff --git a/project/src/services/RepairService.ts b/project/src/services/RepairService.ts index 40f95357..12f7a31e 100644 --- a/project/src/services/RepairService.ts +++ b/project/src/services/RepairService.ts @@ -8,15 +8,15 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { RepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; -import { RepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; +import { IRepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; +import { IRepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { BonusType } from "@spt/models/enums/BonusType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { Money } from "@spt/models/enums/Money"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; -import { BonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; +import { IBonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -55,7 +55,7 @@ export class RepairService { public repairItemByTrader( sessionID: string, pmcData: IPmcData, - repairItemDetails: RepairItem, + repairItemDetails: IRepairItem, traderId: string, ): RepairDetails { const itemToRepair = pmcData.Inventory.items.find((item) => item._id === repairItemDetails._id); @@ -288,7 +288,7 @@ export class RepairService { public repairItemByKit( sessionId: string, pmcData: IPmcData, - repairKits: RepairKitsInfo[], + repairKits: IRepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse, ): RepairDetails { @@ -470,7 +470,7 @@ export class RepairService { * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - public addBuff(itemConfig: BonusSettings, item: IItem): void { + public addBuff(itemConfig: IBonusSettings, item: IItem): void { const bonusRarity = this.weightedRandomHelper.getWeightedValue(itemConfig.rarityWeight); const bonusType = this.weightedRandomHelper.getWeightedValue(itemConfig.bonusTypeWeight); diff --git a/project/src/services/TraderPurchasePersisterService.ts b/project/src/services/TraderPurchasePersisterService.ts index e843d29d..4101b5bb 100644 --- a/project/src/services/TraderPurchasePersisterService.ts +++ b/project/src/services/TraderPurchasePersisterService.ts @@ -1,5 +1,5 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { TraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; +import { ITraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -36,7 +36,7 @@ export class TraderPurchasePersisterService { public getProfileTraderPurchases( sessionId: string, traderId: string, - ): Record | undefined { + ): Record | undefined { const profile = this.profileHelper.getFullProfile(sessionId); if (!profile.traderPurchases) { @@ -57,7 +57,7 @@ export class TraderPurchasePersisterService { sessionId: string, traderId: string, assortId: string, - ): TraderPurchaseData | undefined { + ): ITraderPurchaseData | undefined { const profile = this.profileHelper.getFullProfile(sessionId); if (!profile.traderPurchases) { diff --git a/project/src/services/mod/CustomItemService.ts b/project/src/services/mod/CustomItemService.ts index 92f2a36d..034eef51 100644 --- a/project/src/services/mod/CustomItemService.ts +++ b/project/src/services/mod/CustomItemService.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { @@ -137,7 +137,7 @@ export class CustomItemService { * @param overrideProperties new properties to apply * @param itemClone item to update */ - protected updateBaseItemPropertiesWithOverrides(overrideProperties: Props, itemClone: ITemplateItem): void { + protected updateBaseItemPropertiesWithOverrides(overrideProperties: IProps, itemClone: ITemplateItem): void { for (const propKey in overrideProperties) { itemClone._props[propKey] = overrideProperties[propKey]; } diff --git a/project/src/utils/logging/AbstractWinstonLogger.ts b/project/src/utils/logging/AbstractWinstonLogger.ts index db06ea12..b496bf9d 100644 --- a/project/src/utils/logging/AbstractWinstonLogger.ts +++ b/project/src/utils/logging/AbstractWinstonLogger.ts @@ -1,8 +1,8 @@ -import path from "node:path"; import crypto from "node:crypto"; import fs from "node:fs"; +import path from "node:path"; import { promisify } from "node:util"; -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; import { SptLogger } from "@spt/models/spt/logging/SptLogger"; @@ -112,7 +112,7 @@ export abstract class AbstractWinstonLogger implements ILogger { return "14d"; } - public async writeToLogFile(data: string | Daum): Promise { + public async writeToLogFile(data: string | IDaum): Promise { const command: ICommand = { uuid: crypto.randomUUID(), cmd: async () => await this.writeFilePromisify(this.filePath, `${data}\n`, true), diff --git a/project/tests/__factories__/ProfileInsurance.factory.ts b/project/tests/__factories__/ProfileInsurance.factory.ts index a1a83ec6..810beef0 100644 --- a/project/tests/__factories__/ProfileInsurance.factory.ts +++ b/project/tests/__factories__/ProfileInsurance.factory.ts @@ -1,7 +1,7 @@ import "reflect-metadata"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; import { profileInsuranceFixture } from "@tests/__fixture__/profileInsurance.fixture"; import { format } from "date-fns"; import { container } from "tsyringe"; @@ -9,7 +9,7 @@ import { container } from "tsyringe"; type DateInput = number | number[] | { [index: number]: number }; export class ProfileInsuranceFactory { - private profileInsuranceFixture: Insurance[]; + private profileInsuranceFixture: IInsurance[]; constructor() { this.init(); @@ -74,7 +74,7 @@ export class ProfileInsuranceFactory { return this; } - public get(): Insurance[] { + public get(): IInsurance[] { return this.profileInsuranceFixture; } } diff --git a/project/tests/__fixture__/profileInsurance.fixture.ts b/project/tests/__fixture__/profileInsurance.fixture.ts index a361039d..426b7ec9 100644 --- a/project/tests/__fixture__/profileInsurance.fixture.ts +++ b/project/tests/__fixture__/profileInsurance.fixture.ts @@ -1,6 +1,6 @@ -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; -export const profileInsuranceFixture: Insurance[] = [ +export const profileInsuranceFixture: IInsurance[] = [ { scheduledTime: 1712950044.4, traderId: "54cb50c76803fa8b248b4571", diff --git a/project/tests/__mocks__/WinstonLogger.mock.ts b/project/tests/__mocks__/WinstonLogger.mock.ts index 14c5673a..03736be3 100644 --- a/project/tests/__mocks__/WinstonLogger.mock.ts +++ b/project/tests/__mocks__/WinstonLogger.mock.ts @@ -1,10 +1,10 @@ -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; import { ILogger } from "@spt/models/spt/utils/ILogger"; export class WinstonLogger implements ILogger { - writeToLogFile(data: string | Daum): void {} + writeToLogFile(data: string | IDaum): void {} log(data: string | Record | Error, color: string, backgroundColor?: string): void {} diff --git a/project/tests/controllers/InsuranceController.test.ts b/project/tests/controllers/InsuranceController.test.ts index ae94f53b..3248bcef 100644 --- a/project/tests/controllers/InsuranceController.test.ts +++ b/project/tests/controllers/InsuranceController.test.ts @@ -2,7 +2,7 @@ import "reflect-metadata"; import { InsuranceController } from "@spt/controllers/InsuranceController"; import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { ProfileInsuranceFactory } from "@tests/__factories__/ProfileInsurance.factory"; import { container } from "tsyringe"; @@ -10,7 +10,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; describe("InsuranceController", () => { let insuranceController: any; // Using "any" to access private/protected methods without type errors. - let insuranceFixture: Insurance[]; + let insuranceFixture: IInsurance[]; beforeEach(() => { insuranceController = container.resolve("InsuranceController"); diff --git a/project/tests/generators/BotLevelGenerator.test.ts b/project/tests/generators/BotLevelGenerator.test.ts index 0b5ba030..2141ccd7 100644 --- a/project/tests/generators/BotLevelGenerator.test.ts +++ b/project/tests/generators/BotLevelGenerator.test.ts @@ -2,7 +2,7 @@ import "reflect-metadata"; import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; import { MinMax } from "@spt/models/common/MinMax"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { container } from "tsyringe"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; @@ -21,7 +21,7 @@ describe("BotLevelGenerator", () => { it("should return value between 5 and 10 when player is level 5 and max is 10", () => { const levelDetails: MinMax = { min: 5, max: 10 }; - const botGenerationDetails: BotGenerationDetails = { + const botGenerationDetails: IBotGenerationDetails = { isPmc: false, role: "", side: "", @@ -42,7 +42,7 @@ describe("BotLevelGenerator", () => { describe("getRelativeBotLevelRange", () => { it("should return 10 when player level is 5 and delta is 5", () => { const levelDetails: MinMax = { min: 5, max: 10 }; - const botGenDetails: BotGenerationDetails = { + const botGenDetails: IBotGenerationDetails = { isPmc: false, role: "", side: "", @@ -62,7 +62,7 @@ describe("BotLevelGenerator", () => { it("should return 79 when player level is above possible max (100), desired max is 100 and delta is 5", () => { const levelDetails: MinMax = { min: 100, max: 100 }; - const botGenDetails: BotGenerationDetails = { + const botGenDetails: IBotGenerationDetails = { isPmc: false, role: "", side: "",