[node] finished the great typescript rewrite
This commit is contained in:
parent
8107afbd90
commit
a1d6b03ec9
30 changed files with 1019 additions and 359 deletions
|
@ -1,8 +1,7 @@
|
|||
export type APIError = {
|
||||
apiError: 'APIError';
|
||||
error: string;
|
||||
code: number;
|
||||
data: any; // TODO
|
||||
data: unknown;
|
||||
};
|
||||
|
||||
export type Meta = {
|
||||
|
|
5
nodejs/model/common.ts
Normal file
5
nodejs/model/common.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export type CommonThing = {
|
||||
description: string;
|
||||
name: string;
|
||||
symbol: string;
|
||||
};
|
8
nodejs/model/errors.ts
Normal file
8
nodejs/model/errors.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export type RateLimitError = {
|
||||
type: string;
|
||||
retryAfter: number;
|
||||
limitBurst: number;
|
||||
limitPerSecond: number;
|
||||
remaining: number;
|
||||
reset: Date;
|
||||
};
|
19
nodejs/model/market.ts
Normal file
19
nodejs/model/market.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { CommonThing } from 'common.ts';
|
||||
|
||||
export type TradeGood = CommonThing & {
|
||||
activity: string;
|
||||
purchasePrice: number;
|
||||
sellPrice: number;
|
||||
supply: string;
|
||||
tradeVolume: number;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type Market = {
|
||||
symbol: string;
|
||||
exchange: Array<CommonThing>;
|
||||
exports: Array<CommonThing>;
|
||||
imports: Array<CommonThing>;
|
||||
//transactions: Array<Transaction>;
|
||||
tradeGoods: Array<TradeGood>;
|
||||
};
|
|
@ -25,6 +25,12 @@ export type Nav = {
|
|||
waypointSymbol: string;
|
||||
};
|
||||
|
||||
export type Registration = {
|
||||
factionSymbol: string;
|
||||
name: string;
|
||||
role: string;
|
||||
};
|
||||
|
||||
export type Route = {
|
||||
arrival: Date;
|
||||
departureTime: Date;
|
||||
|
@ -51,6 +57,6 @@ export type Ship = {
|
|||
// mounts
|
||||
nav: Nav;
|
||||
// reactor
|
||||
// registration
|
||||
registration: Registration;
|
||||
symbol: string;
|
||||
};
|
||||
|
|
30
nodejs/model/system.ts
Normal file
30
nodejs/model/system.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { CommonThing } from 'common.ts';
|
||||
|
||||
export type Chart = {
|
||||
waypointSymbol: string;
|
||||
submittedBy: string;
|
||||
submittedOn: Date;
|
||||
};
|
||||
|
||||
export type System = {
|
||||
symbol: string;
|
||||
sectorSymbol: string;
|
||||
type: string;
|
||||
x: number;
|
||||
y: number;
|
||||
waypoints: Array<Waypoint>;
|
||||
};
|
||||
|
||||
export type Waypoint = {
|
||||
chart: Chart;
|
||||
factions: Array<{symbol: string;}>;
|
||||
isUnderConstruction: boolean;
|
||||
modifiers: Array<CommonThing>;
|
||||
orbitals: Array<{symbol: string;}>;
|
||||
orbits: string;
|
||||
symbol: string;
|
||||
traits: Array<CommonThing>;
|
||||
type: string;
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue