import { weapons, countryCodes, themeColors, headOnlyAbilities, clothingOnlyAbilities, shoesOnlyAbilities, stackableAbilities, headGearEnglish, clothingGearEnglish, shoesGearEnglish, } 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 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 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 } } //============================================================================== // Apollo //============================================================================== export interface UserData { user?: UserLean } export interface SearchForUserData { searchForUser?: User } export interface SearchForUserVars { discord_id?: string custom_url?: string } 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[] }