1
0
Fork 0

[node] Big Ships lib refactoring

This commit is contained in:
Julien Dessaux 2024-04-05 00:42:30 +02:00
parent a58394230d
commit 234770b611
Signed by: adyxax
GPG key ID: F92E51B86E07177E
27 changed files with 500 additions and 589 deletions

35
nodejs/lib/errors.ts Normal file
View file

@ -0,0 +1,35 @@
import { Cooldown } from './types.ts';
export type MarketTradeVolumeError = {
waypointSymbol: string;
tradeSymbol: string;
units: number;
tradeVolume: number;
};
export type RateLimitError = {
type: string;
retryAfter: number;
limitBurst: number;
limitPerSecond: number;
remaining: number;
reset: Date;
};
export type ShipIsCurrentlyInTransitError = {
arrival: Date;
departureSymbol: string;
departureTime: Date;
destinationSymbol: string;
secondsToArrival: number;
};
export type ShipIsStillOnCooldownError = {
cooldown: Cooldown;
};
export type ShipRequiresMoreFuelForNavigationError = {
fuelAvailable: number;
fuelRequired: number;
shipSymbol: string;
};