UNPKG

splatoon3api

Version:

A simple Method to get current and next Splatoon 3 maps, Salmonrun Schedules and Splatnet gear

320 lines (319 loc) 7.76 kB
export type Lang = 'de-DE' | 'en-GB' | 'en-US' | 'es-ES' | 'es-MX' | 'fr-FR' | 'fr-CA' | 'it-IT' | 'ja-JP' | 'ko-KR' | 'nl-NL' | 'ru-RU' | 'zh-CN' | 'zh-TW'; export type SplatRules = 'Turf War' | 'Splat Zones' | 'Rainmaker' | 'Clam Blitz'; export type FestRegion = 'US' | 'EU' | 'JP' | 'AP'; export type RuleID = 'VnNSdWxlLTQ=' | 'VnNSdWxlLTI=' | 'VnNSdWxlLTE=' | 'VnNSdWxlLTM='; export interface Options { schedulesURL: string | "https://splatoon3.ink/data/schedules.json"; salmonGearURL: string | "https://splatoon3.ink/data/coop.json"; gearURL: string | "https://splatoon3.ink/data/gear.json"; festURL: string | "https://splatoon3.ink/data/festivals.json"; userAgent: string | undefined; cache: CacheOptions | { enabled: boolean | true; ttl: number | 60; }; } export interface GearTranslations { "en-GB": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "en-US": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "de-DE": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "nl-NL": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "fr-FR": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "fr-CA": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "es-ES": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "es-MX": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "it-IT": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "ru-RU": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "ko-KR": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "zh-CN": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "zh-TW": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; "ja-JP": { HeadGear: string; ClothingGear: string; ShoesGear: string; }; } export interface CacheOptions { enabled?: boolean; ttl?: number; } export interface SplatGearpower { name: string; image: string; } export interface SplatStage { name: string; image: string; } export interface SplatTricolorStage { start_time: string; end_time: string; name: string; image: string; rulesImg: string; } export interface SplatRotation { start_time: string; end_time: string; stage1: SplatStage; stage2: SplatStage; rules: SplatRules; rulesImg: string; } export interface FestMatchSetting { regular: FestRotation | null; challenge: FestRotation | null; } export interface FestRotation { start_time: string; end_time: string; stage1: SplatStage; stage2: SplatStage; rules: SplatRules; rulesImg: string; festMode: string; } export interface RankedModes { series: SplatRotation; open: SplatRotation; } export interface StagesResponse { regular: SplatRotation | null; ranked: RankedModes | null; xbattle: SplatRotation | null; festSchedule: FestMatchSetting | null; triColorStage: SplatTricolorStage | null; } /** * @callback StagesCallback * @param {StagesResponse} res - The response from the API */ export interface AllStagesResponse { regular: (null | SplatRotation)[]; ranked: (null | RankedModes)[]; xbattle: (null | SplatRotation)[]; festSchedule: (null | FestMatchSetting)[]; triColorStage: SplatTricolorStage | null; } /** * @callback AllStagesCallback * @param {AllStagesResponse} res - The response from the API */ export interface ChallengeTimePeriod { startTime: string; endTime: string; } /** * @callback SplatChallengeCallback * @param {SplatChallenge[]} res - The response from the API */ export interface SplatChallenge { name: string; desc: string; eventRule: string; gameRule: SplatRules; gameRuleImg: string; stages: SplatStage[]; timePeriods: ChallengeTimePeriod[]; } export interface SalmonMonthlygear { name: string; type: string; image: string; } export interface SalmonRunWeapon { name: string; image: string; } export interface SalmonSchedule { start_time: string; end_time: string; stage: SplatStage; weapons: { [key: string]: SalmonRunWeapon; }; } export interface SalmonResult { regularSchedules: { [key: string]: SalmonSchedule; } | null; bigRunSchedules: { [key: string]: SalmonSchedule; } | null; monthlyGear: SalmonMonthlygear | null; } /** * @callback SalmonResultCallback * @param {SalmonResult} res - The response from the API */ export interface SplatnetGearFeatured { name: string; /** @deprecated Use `type` instead. */ typ: string; type: string; image: string; primaryGearPower: SplatGearpower; additionalGearPowers: SplatGearpower[]; price: number; saleEnd: string; } export interface Brand { name: string; image: string; } export interface SplatnetGear { name: string; /** @deprecated Use `type` instead. */ typ: string; type: string; image: string; primaryGearPower: SplatGearpower; additionalGearPowers: SplatGearpower[]; price: number; saleEnd: string; brand: Brand; } export interface SplatnetFeaturedBrand { name: string; banner: string; usualPower: SplatGearpower; saleEnd: string; brandGears: { [key: string]: SplatnetGearFeatured; }; } export interface SplatnetResult { featuredBrand: SplatnetFeaturedBrand | null; limitedGear: { [key: string]: SplatnetGear; } | null; } /** * @callback SplatnetResultCallback * @param {SplatnetResult} res - The response from the API */ export interface FestTeam { teamName: string; image: string; color: string; colorHEX: string; } export interface FestSchedule { title: string; startTime: string; endTime: string; teams: { [key: string]: FestTeam; }; } export interface FestData { US: FestSchedule[]; EU: FestSchedule[]; JP: FestSchedule[]; AP: FestSchedule[]; } /** * @callback FestDataCallback * @param {FestData} res - The response from the API */ export interface PastFestTeamResults { isWinner: boolean; conchShellsRatio: number; conchShellsTop: boolean; voteRatio: number; isVoteTop: boolean; regularContributionRatio: number; isRegularContributionTop: boolean; proModeContributionRatio: number; isProModeContributionTop: boolean; tricolorContributionRatio: number; isTricolorContributionRatioTop: boolean; } export interface PastFestTeam { teamName: string; image: string; color: string; colorHEX: string; role: string; results: PastFestTeamResults; } export interface PastFestSchedule { title: string; startTime: string; endTime: string; teams: { [key: string]: PastFestTeam; }; } export interface PastFestData { US: PastFestSchedule[]; EU: PastFestSchedule[]; JP: PastFestSchedule[]; AP: PastFestSchedule[]; } /** * @callback PastFestDataCallback * @param {PastFestData} res - The response from the API */ export interface CurrentFestData { US: FestSchedule; EU: FestSchedule; JP: FestSchedule; AP: FestSchedule; } /** * @callback CurrentFestDataCallback * @param {CurrentFestData} res - The response from the API */