nationstates.js
Version:
A wrapper to interact with the NationStates API.
160 lines (159 loc) • 3.35 kB
TypeScript
interface Freedom {
civilrights: string;
economy: string;
politicalfreedom: string;
}
interface Govt {
administration: number;
defence: number;
education: number;
environment: number;
healthcare: number;
commerce: number;
internationalAid: number;
lawAndOrder: number;
publicTransport: number;
socialEquality: number;
spirituality: number;
welfare: number;
}
interface Sectors {
blackmarket: number;
government: number;
industry: number;
public: number;
}
interface Deaths {
cause: {
value: number;
type: string;
}[];
}
interface Policies {
policy: {
name: string;
pic: string;
cat: string;
desc: string;
}[];
}
interface DispatchList {
id: number;
title: string;
author: string;
category: string;
subcategory: string;
created: number;
edited: number;
views: number;
score: number;
}
interface Happening {
timestamp: number;
text: string;
}
interface Zombie {
zaction: string;
zactionintended: string;
survivors: number;
zombies: number;
dead: number;
}
export declare class NationResult {
id: string;
name: string;
dbid: number;
type: string;
fullname: string;
motto: string;
category: string;
unstatus: string;
endorsements: Array<string>;
gavote: string;
scvote: string;
issuesAnswered: number;
freedom: Freedom;
region: string;
population: number;
tax: number;
animal: string;
animaltrait: string;
currency: string;
flag: URL;
banner: string;
banners: {
banner: Array<string>;
};
demonym: string;
demonym2plural: string;
gdp: number;
income: number;
richest: number;
poorest: number;
majorindustry: string;
crime: string;
govtPriority: string;
govt: Govt;
sectors: Sectors;
govtdesc: string;
industrydesc: string;
notable: string;
notables: {
notable: Array<string>;
};
admirable: string;
admirables: {
admirable: Array<string>;
};
founded: any;
foundedTime: number;
firstLogin: number;
lastLogin: number;
lastActivity: string;
influence: string;
publicSector: string;
deaths: Deaths;
leader: Array<string>;
capital: Array<string>;
religion: Array<string>;
policies: Policies;
census: {
scale: {
id: number;
score: number;
rank: number;
rrank: number;
};
};
rcensus: {
value: number;
id: number;
};
wcensus: {
value: number;
id: number;
};
legislation: {
law: Array<string>;
};
happenings: Happening[];
factbooks: number;
dispatches: number;
factbookList: DispatchList[];
dispatchList: DispatchList[];
waBadges: string;
tgcanrecruit: number;
tgcancampaign: number;
zombie: Zombie;
constructor(result: object);
/**
* Maps and returns all happenings after converting timestamps to a properly set Date object in UTC
* and fixing the format of the text by removing all @ symbols.
*/
formattedHappenings(): {
timestamp: Date;
text: string;
}[];
private static _epochToDate;
}
export {};