Something went wrong. Try again.
TypeScript client for accessing TLE Community.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212import { StatusBlock } from './status';import type { IntBool } from '.';import type { components } from './schema';
export interface StatusEnvelope { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; body?: components['schemas']['body_status'];}
export interface BuildingSummary { /** * The building id. The server only puts this in the id-keyed map key, not in * the row; `body.getBuildings()` / `body.getBuildingsResources()` splice it * back onto each row so callers don't have to. */ id: number; efficiency: number; name: string; x: number; image: string; y: number; level: number; url: string;}
export interface GetBuildingsParams { body_id: number;}
export interface GetBuildingsResponse { body: { surface_image: string; }; buildings: { [index: string]: BuildingSummary; };}
export interface BuildingResources { food_hour: number; food_capacity: number; water_hour: number; water_capacity: number; waste_hour: number; waste_capacity: number; energy_hour: number; energy_capacity: number; happiness_hour: number; // ore_hour / ore_capacity / ore are all omitted for the Mining Ministry // (its ore output is driven by deployed mining platforms, not the building). ore_hour?: number; ore_capacity?: number; // Present only when the building produces that resource. food?: { [type: string]: number }; ore?: { [type: string]: number };}
export interface BuildingResourcesSummary extends BuildingSummary { resources: BuildingResources; pending_build?: { seconds_remaining: number; start: string; end: string }; work?: { seconds_remaining: number; start: string; end: string }; repair_costs?: { food: number; water: number; energy: number; ore: number };}
export interface GetBuildingsResourcesParams { body_id: number;}
export interface GetBuildingsResourcesResponse { body: { surface_image: string; }; buildings: { [index: string]: BuildingResourcesSummary; }; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; body?: components['schemas']['body_status']; };}
export interface GetStatusParams { body_id: number;}
export interface GetStatusResponse extends StatusBlock {}
export interface GetBodyStatusParams { body_id: number;}
export interface GetBodyStatusResponse { body: components['schemas']['body_status']; status: { server: components['schemas']['server_status']; empire: components['schemas']['empire_status']; };}
export interface GetBuildableParams { body_id: number; x: number; y: number; /** * Restrict the results to buildings carrying this category tag. The spec * marks it optional but the `/v2` layer rejects the call without it - pass * `''` for "no filter". */ tag: string;}
export interface BuildableEntry { url: string; image: string; build: { can: IntBool; /** Only the non-zero resource keys are sent; `time` is always present. A * plan-backed build sends `halls` instead of the resource costs. */ cost: | { food?: number; energy?: number; ore?: number; water?: number; waste?: number; time: number; } | { halls: number; time: number }; /** `0` (or `''`) when buildable, otherwise `[code, message, ...]`. */ reason: 0 | '' | [number, string, ...unknown[]]; /** Category tags, plus an optional `'Plan'` and exactly one of * `'Now'` / `'Soon'` / `'Later'`. */ tags: string[]; /** `1` for Permanent buildings, `''` otherwise. */ no_plot_use: IntBool | ''; /** Present only when a level-1 plan for this building is in storage. */ extra_level?: number; }; production: { food_hour: number; food_capacity: number; ore_hour: number; ore_capacity: number; water_hour: number; water_capacity: number; waste_hour: number; waste_capacity: number; energy_hour: number; energy_capacity: number; happiness_hour: number; };}
export interface GetBuildableResponse { /** Keyed by building display name. */ buildable: Record<string, BuildableEntry>; build_queue: { max: number; current: number }; status: StatusEnvelope;}
export interface AbandonParams { body_id: number;}
/** `abandon` returns the bare status envelope, with no `status` wrapper. */export type AbandonResponse = StatusEnvelope;
export interface RenameParams { body_id: number; name: string;}
/** `rename` returns the literal `1`. */export type RenameResponse = 1;
export interface SetColonyNotesParams { body_id: number; options: { notes: string };}
export interface SetColonyNotesResponse { status: StatusEnvelope;}
export interface RearrangeBuildingsParams { body_id: number; arrangement: Array<{ id: number; x: number; y: number; }>;}
export interface RearrangeBuildingsResponse { body: { surface_image: string; }; moved: Array<{ name: string; x: number; y: number; id: number; }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; body?: components['schemas']['body_status']; };}