import { weapons, countryCodes, themeColors, headOnlyAbilities, clothingOnlyAbilities, shoesOnlyAbilities, stackableAbilities, headGearEnglish, clothingGearEnglish, shoesGearEnglish, maps, } from "./utils/lists" // https://github.com/microsoft/TypeScript/issues/28046#issuecomment-480516434 type ElementType> = T extends ReadonlyArray< infer ElementType > ? ElementType : never export type Weapon = ElementType export type Stage = ElementType export type CountryCode = ElementType export type ThemeColor = ElementType export type HeadOnlyAbility = ElementType export type ClothingOnlyAbility = ElementType export type ShoesOnlyAbility = ElementType export type StackableAbility = | ElementType | "UNKNOWN" export type Ability = | HeadOnlyAbility | ClothingOnlyAbility | ShoesOnlyAbility | StackableAbility export type HeadGear = ElementType export type ClothingGear = ElementType export type ShoesGear = ElementType export interface Theme { colorMode: "dark" | "light" bgColor: string darkerBgColor: string textColor: string borderStyle: string grayWithShade: string themeColorWithShade: string themeColorHex: string themeColorHexLighter: string themeColor: ThemeColor } export interface UserLean { id: string username: string discord_id: string twitter_name?: string custom_url?: string plus?: { membership_status?: "ONE" | "TWO" plus_region: "EU" | "NA" vouch_status?: "ONE" | "TWO" can_vouch?: "ONE" | "TWO" can_vouch_again_after?: string } } export interface User { id: string username: string discriminator: string discord_id: string twitch_name?: string twitter_name?: string country?: CountryCode weapons?: Weapon[] top500: boolean custom_url?: string bio?: string sens?: { stick: number motion?: number } } export interface Build { id: string weapon: Weapon title?: string description?: string headgear: [ HeadOnlyAbility | StackableAbility, StackableAbility, StackableAbility, StackableAbility | "UNKNOWN" ] clothing: [ ClothingOnlyAbility | StackableAbility, StackableAbility, StackableAbility, StackableAbility ] shoes: [ ShoesOnlyAbility | StackableAbility, StackableAbility, StackableAbility, StackableAbility | "UNKNOWN" ] headgearItem?: HeadGear clothingItem?: ClothingGear shoesItem?: ShoesGear updatedAt: string top: boolean discord_user?: { username: string discriminator: string discord_id: string } } export interface Placement { id: string weapon: Weapon rank: number mode: 1 | 2 | 3 | 4 x_power: number unique_id: string month: number year: number } export interface FreeAgentPost { id: string can_vc: "YES" | "USUALLY" | "SOMETIMES" | "NO" playstyles: ("FRONTLINE" | "MIDLINE" | "BACKLINE")[] activity?: string looking_for?: string past_experience?: string description?: string hidden: boolean createdAt: string discord_user: { username: string discriminator: string discord_id: string twitter_name?: string country?: CountryCode weapons?: Weapon[] top500: boolean } } export interface TournamentResult { date: string tweet_id?: string tournament_name: string placement: number } export interface Team { name: string twitter_name?: string challonge_name?: string discord_url?: string founded?: { month: number year: number } captain_discord_id: string member_discord_ids: string[] member_users: { discord_id: string username: string discriminator: string twitch_name?: string twitter_name?: string country?: CountryCode weapons: Weapon[] custom_url?: string }[] countries: string[] tag?: String lf_post?: String tournament_results: TournamentResult[] } export interface DetailedTeamInfo { team_name: string score: number players: { discord_user: { username: string discriminator: string twitter_name: string discord_id: string } weapon: Weapon main_abilities: Ability[] sub_abilities: Ability[][] kills: number assists: number deaths: number specials: number paint: number gear: (HeadGear | ClothingGear | ShoesGear)[] }[] } //============================================================================== // Apollo //============================================================================== export interface UserData { user?: UserLean } export interface SearchForBuildsData { searchForBuilds: Build[] } export interface SearchForBuildsVars { discord_id?: string weapon?: Weapon } export interface PlayerInfoData { playerInfo?: { placements: Placement[] } } export interface PlayerInfoVars { twitter: string } export interface FreeAgentPostsData { freeAgentPosts: FreeAgentPost[] }