import { Options } from "ky"; //#region src/core/api.d.ts declare const raiderIoBasePath = "https://raider.io/api"; type ISODateString = string; interface Resource { /** * The response type of the resource * @internal */ _responseType?: T; path: string; query: Record; apiVersion: number | null; } type ResourceResponse = Promise; //#endregion //#region src/core/character.d.ts declare const roles: readonly ["tank", "healer", "dps"]; type Role = (typeof roles)[number]; declare const factions: readonly ["horde", "alliance"]; type Faction = (typeof factions)[number]; declare const genders: readonly ["male", "female"]; type Gender = (typeof genders)[number]; interface PlayableClass { id: number; name: string; slug: string; } interface PlayableRace { faction: Faction; id: number; name: string; slug: string; } interface Specialization { class_id: number; id: number; is_melee: boolean; name: string; ordinal: number; patch: string; role: Role; slug: string; } //#endregion //#region src/core/region-realm.d.ts declare const regions: readonly ["us", "eu", "tw", "kr", "cn"]; interface Realm { altName: string; altSlug: string; connectedRealmId: number; id: number; isConnected: boolean; locale: string; name: string; realmType: string; slug: string; wowConnectedRealmId: number; wowRealmId: number; } type RealmSummary = Pick; interface Region { name: string; short_name: RegionShortName; slug: string; } type RegionShortName = (typeof regions)[number]; interface SubRegion { name: string; slug: string; short_name: string; regions: Array; } //#endregion //#region src/core/season.d.ts declare const seasonReferences: string[]; type SeasonReference = (typeof seasonReferences)[number]; type SeasonSlug = Exclude; declare const weekScopes: readonly ["current", "previous"]; type WeekScope = (typeof weekScopes)[number]; //#endregion //#region src/core/common.d.ts interface Ranks { realm: number; region: number; world: number; } interface Stream { activiy_record_id: number; community_ids: Array; description?: string; game_id: string; id: string; is_featured_stream: boolean; language: string; name: string; started_at: string; thumbnail_url: string; title: string; type: string; user_id: string; viewer_count: number; } interface Video { character: { class: PlayableClass; faction: Faction; flags: unknown; id: number; level: number; name: string; path: string; persona_id: number; race: PlayableRace; realm: Realm; region: Region; spec: Specialization; }; createdByUserId: number; duration: number; id: string; seasonSlug: SeasonReference; startVideoTimeSeconds: null | number; thumbnailUrl: null | string; videoId: string; videoType: string; } //#endregion //#region src/core/expansion.d.ts declare const LEGION = 6; declare const BATTLE_FOR_AZEROTH = 7; declare const SHADOWLANDS = 8; declare const DRAGONFLIGHT = 9; declare const THE_WAR_WITHIN = 10; declare const MIDNIGHT = 11; declare const expansionIds: readonly [6, 7, 8, 9, 10, 11]; type ExpansionId = (typeof expansionIds)[number]; //#endregion //#region src/core/gear.d.ts declare const slots: string[]; type ItemSlot = (typeof slots)[number]; //#endregion //#region src/core/locales.d.ts declare const locales: readonly ["en", "ru", "ko", "cn", "pt", "it", "fr", "es", "de", "tw"]; type Locale = (typeof locales)[number]; type LocalizedString = Record; //#endregion //#region src/http/types.d.ts interface ClientOptions { key?: string; kyOptions?: Options; } //#endregion //#region src/resources/general/types.d.ts /** * Period information for each region * @see {@link https://raider.io/api#/general/getApiV1Periods} */ interface ViewPeriodsResponse { periods: Array; } type ViewSearchResponse = { matches: Array; }; interface Period { end: string; period: number; start: string; } interface RegionPeriod { current: Period; next: Period; previous: Period; region: RegionShortName; } interface SearchMatch { name: string; } type CharacterSearchMatch = SearchMatch & { type: 'character'; data: { id: number; name: string; faction: Faction; region: Region; realm: Realm; class: PlayableClass; }; }; type GuildSearchMatch = SearchMatch & { type: 'guild'; data: { id: number; name: string; displayName: null | string; faction: Faction; realm: Realm; region: Region; subregion: SubRegion | null; path: string; logo: string; isDefaultLogo: boolean; }; }; //#endregion //#region src/resources/raiding/types.d.ts /** * The rankings for the specified boss, raid, difficulty and region * @see {@link https://raider.io/api#/raiding/getApiV1RaidingBossrankings} */ interface ViewBossRankingsResponse { bossRankings: Array; } /** * The hall of fame for a given raid * @see {@link https://raider.io/api#/raiding/getApiV1RaidingHalloffame} */ interface ViewHallOfFameResponse { hallOfFame: { bossKills: Array; winningGuilds: Array; }; } /** * Details of raiding progression for a raid, showing how many guilds have reached each boss kill milestone * @see {@link https://raider.io/api#/raiding/getApiV1RaidingProgression} */ interface ViewRaidProgressionResponse { progression: Array; } /** * The raid rankings for a given raid and region * @see {@link https://raider.io/api#/raiding/getApiV1RaidingRaidrankings} */ interface ViewRaidRankingsResponse { raidRankings: Array; } /** * Raid and boss static data for a specific expansion (slugs, names, etc) * @see {@link https://raider.io/api#/raiding/getApiV1RaidingStaticdata} */ interface ViewRaidingStaticDataResponse { raids: Array; } declare const raidDifficulties: readonly ["normal", "heroic", "mythic"]; declare const raidInstances: readonly ["tier-mn-1", "manaforge-omega", "liberation-of-undermine", "nerubar-palace", "blackrock-depths", "awakened-amirdrassil-the-dreams-hope", "awakened-aberrus-the-shadowed-crucible", "awakened-vault-of-the-incarnates", "amirdrassil-the-dreams-hope", "aberrus-the-shadowed-crucible", "vault-of-the-incarnates", "fated-sepulcher-of-the-first-ones", "fated-sanctum-of-domination", "fated-castle-nathria", "sepulcher-of-the-first-ones", "sanctum-of-domination", "castle-nathria", "nyalotha-the-waking-city", "the-eternal-palace", "crucible-of-storms", "battle-of-dazaralor", "uldir", "antorus-the-burning-throne", "tomb-of-sargeras", "the-nighthold", "trial-of-valor", "the-emerald-nightmare"]; type RaidDifficulty = (typeof raidDifficulties)[number]; type RaidDifficultyRankings = Record; interface RaidEncounter { defeatedAt: ISODateString | null; name: string; slug: string; } type RaidInstance = (typeof raidInstances)[number]; type RaidProgression = Record<`${RaidDifficulty}_bosses_killed`, number> & { expansion_id: number; summary: string; total_bosses: number; }; interface RecruitmentProfile { activity_type: string; entity_type: string; recruitment_profile_id: number; } type BossRanking = Record; interface EncounterDefeated { firstDefeated: ISODateString; lastDefeated: ISODateString; slug: string; } interface GuildDefeatEntry { defeatedAt: ISODateString; guild: GuildSummary; } interface GuildEncounter { encountersDefeated: Array; guild: RaidingGuild; rank: number; } interface GuildPrivacy { raidComps: boolean; raidPercents: boolean; raidPulls: boolean; shareraidUntil: ISODateString; wereRaidCompsRestricted: boolean; wereRaidPercentsRestricted: boolean; wereRaidPullsRestricted: boolean; } interface GuildStreamers { count: number; description: string; stream: Stream; } interface GuildSummary { displayName: string; faction: Faction; id: number; name: string; realm: RealmSummary; region: Region; } interface HallOfFameBossKill { attemptedBy: { attempts: Array; totalCount: number; }; boss: string; bossKillVideo: Video; bossSummary: RaidBossSummary; defeatedBy: { guilds: Array; totalCount: number; }; } type HallOfFameGuildEntry = GuildEncounter & { defeatedAt: ISODateString; doesVideoExist: boolean; recruitmentProfiles: Array; streamers: GuildStreamers; }; interface RaidBossSummary { encounterId: number; iconUrl: string; name: string; ordinal: number; slug: string; wingId: number; } interface RaidEncounterStaticData { id: number; name: string; slug: string; } type RaidingGuild = GuildSummary & { color: string; isDefaultLogo: boolean; logo: string; path: string; realm: Realm; }; interface RaidRaceProgressionEntry { guilds: Array; progress: number; totalGuilds: number; } interface RaidRankingEncounter { bestPercent: number; id: number; isDefeated: boolean; numPulls: number; pulStartedAt: ISODateString; slug: string; } interface RaidRankingEntry { encountersDefeated: Array; encountersPulled: Array; guild: RaidingGuild; guildPrivacy: GuildPrivacy; rank: number; regionRank: number; } interface RaidStaticData { encounters: Array; ends: { ends: ISODateString; }; icon: string; id: number; name: string; short_name: string; slug: RaidInstance; starts: { starts: ISODateString; }; } //#endregion //#region src/resources/mythic-plus/types.d.ts /** * The affixes for a specific region, including the latest run seen with this affix * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusAffixes} */ interface ViewMythicPlusAffixesResponse { affix_details: Array; leaderboard_url: string; region: RegionShortName; title: string; } /** * Leaderboad capacity for a region including the lowest level and time to quality * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusLeaderboardcapacity} */ interface ViewMythicPlusLeaderboardCapacityResponse { realmListing: { affixes: Array; realms: Array; region: Region; }; } /** * Details for a specific Mythic+ run * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusRundetails} */ interface ViewMythicPlusRunDetailsResponse { canManageOthersVideos: boolean; canManageOwnVideos: boolean; canViewPrivateDetails: boolean; clear_time_ms: number; completed_at: ISODateString; deleted_at: ISODateString | null; dungeon: Dungeon; faction: Faction; isPatron: boolean; isTournamentProfile: boolean; isViewingPrivateDetails: boolean; keystone_platoon_id: number; keystone_run_id: number; keystone_team_id: number; keystone_time_ms: number; logged_details: LoggedRunDetails; logged_run_id: number; loggedSources: Array; mythic_level: number; num_chests: number; num_modifiers_active: number; replay_limit: number; roster: Array; runPrivacyMode: string; score: number; season: SeasonReference; status: string; time_remaining_ms: number; videos: Array