Files
core/hwe/ts/defs/API/Global.ts
T
Hide_D 6d20257cf1 feat: 연감을 가져오는 API
- Global/GetHistory - 과거 기록. 캐싱 가능
- GetCurrentHistory - 현재 기록. 캐싱 불가
2022-04-18 03:05:08 +09:00

70 lines
2.0 KiB
TypeScript

import type { CityID, CrewTypeID, GameCityDefault, GameConstType, GameUnitType, GameIActionKey, GameIActionCategory, GameIActionInfo } from "@/defs/GameObj";
import type { MapResult } from "@/defs";
export interface GetConstResponse {
result: true;
cacheKey: string;
data: {
gameConst: GameConstType;
gameUnitConst: Record<CrewTypeID, GameUnitType>;
cityConst: Record<CityID, GameCityDefault>;
cityConstMap: {
region: Record<number | string, string | number>;
level: Record<number | string, string | number>; //defs.CityLevelText
};
iActionInfo: Record<
GameIActionCategory,
Record<
GameIActionKey,
GameIActionInfo
>
>;
iActionKeyMap: {
availableNationType: "nationType";
neutralNationType: "nationType";
defaultSpecialDomestic: "specialDomestic";
availableSpecialDomestic: "specialDomestic";
optionalSpecialDomestic: "specialDomestic";
defaultSpecialWar: "specialWar";
availableSpecialWar: "specialWar";
optionalSpecialWar: "specialWar";
neutralPersonality: "personality";
availablePersonality: "personality";
optionalPersonality: "personality";
allItems: "item";
};
};
}
export type HistoryObj = {
server_id: string,
year: number;
month: number;
map: MapResult,
global_history: string[],
global_action: string[],
nations: {
capital: number,
cities: string[],
color: string,
gennum: number,
level: number,
name: string,
nation: number,
power: number,
type: GameIActionKey
}[],
}
export type GetHistoryResponse = {
result: true;
data: HistoryObj & {
hash: string;
//no: number,
};
}
export type GetCurrentHistoryResponse = {
result: true;
data: HistoryObj;
}