From 5e585605366dda7dbdecc6021b0fcc6c2d1d0ea5 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 25 Mar 2022 19:21:13 +0000 Subject: [PATCH] fix typescript issues --- .gitignore | 1 + package.json | 2 +- src/responses/{api.d.ts => api.ts} | 0 src/responses/{error.d.ts => error.ts} | 0 src/responses/{friends.d.ts => friends.ts} | 0 src/responses/{player.d.ts => player.ts} | 0 .../{recentgames.d.ts => recentgames.ts} | 0 .../{collections.d.ts => collections.ts} | 0 .../skyblock/{election.d.ts => election.ts} | 0 .../skyblock/{items.d.ts => items.ts} | 8 +++--- .../skyblock/{skills.d.ts => skills.ts} | 0 ...profile_member.d.ts => _profile_member.ts} | 27 ++++++++++++------- .../skyblock/{profile.d.ts => profile.ts} | 0 .../skyblock/{profiles.d.ts => profiles.ts} | 0 src/responses/{status.d.ts => status.ts} | 0 tsconfig.json | 6 ++--- 16 files changed, 26 insertions(+), 18 deletions(-) rename src/responses/{api.d.ts => api.ts} (100%) rename src/responses/{error.d.ts => error.ts} (100%) rename src/responses/{friends.d.ts => friends.ts} (100%) rename src/responses/{player.d.ts => player.ts} (100%) rename src/responses/{recentgames.d.ts => recentgames.ts} (100%) rename src/responses/resources/skyblock/{collections.d.ts => collections.ts} (100%) rename src/responses/resources/skyblock/{election.d.ts => election.ts} (100%) rename src/responses/resources/skyblock/{items.d.ts => items.ts} (93%) rename src/responses/resources/skyblock/{skills.d.ts => skills.ts} (100%) rename src/responses/skyblock/{_profile_member.d.ts => _profile_member.ts} (86%) rename src/responses/skyblock/{profile.d.ts => profile.ts} (100%) rename src/responses/skyblock/{profiles.d.ts => profiles.ts} (100%) rename src/responses/{status.d.ts => status.ts} (100%) diff --git a/.gitignore b/.gitignore index 3c3629e..8c08c51 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +/build diff --git a/package.json b/package.json index 28355fb..cb2f263 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "typed-hypixel-api", "version": "0.1.0", - "main": "src/index.ts", + "main": "build/index.js", "repository": "https://github.com/skyblockstats/typed-hypixel-api.git", "author": "mat ", "license": "MIT", diff --git a/src/responses/api.d.ts b/src/responses/api.ts similarity index 100% rename from src/responses/api.d.ts rename to src/responses/api.ts diff --git a/src/responses/error.d.ts b/src/responses/error.ts similarity index 100% rename from src/responses/error.d.ts rename to src/responses/error.ts diff --git a/src/responses/friends.d.ts b/src/responses/friends.ts similarity index 100% rename from src/responses/friends.d.ts rename to src/responses/friends.ts diff --git a/src/responses/player.d.ts b/src/responses/player.ts similarity index 100% rename from src/responses/player.d.ts rename to src/responses/player.ts diff --git a/src/responses/recentgames.d.ts b/src/responses/recentgames.ts similarity index 100% rename from src/responses/recentgames.d.ts rename to src/responses/recentgames.ts diff --git a/src/responses/resources/skyblock/collections.d.ts b/src/responses/resources/skyblock/collections.ts similarity index 100% rename from src/responses/resources/skyblock/collections.d.ts rename to src/responses/resources/skyblock/collections.ts diff --git a/src/responses/resources/skyblock/election.d.ts b/src/responses/resources/skyblock/election.ts similarity index 100% rename from src/responses/resources/skyblock/election.d.ts rename to src/responses/resources/skyblock/election.ts diff --git a/src/responses/resources/skyblock/items.d.ts b/src/responses/resources/skyblock/items.ts similarity index 93% rename from src/responses/resources/skyblock/items.d.ts rename to src/responses/resources/skyblock/items.ts index 52cc076..fa99ddb 100644 --- a/src/responses/resources/skyblock/items.d.ts +++ b/src/responses/resources/skyblock/items.ts @@ -19,7 +19,7 @@ export interface SkyBlockItemsResponse { npc_sell_price?: number essence: { essence_type: string - costs: nummber[] + costs: number[] } catacombs_requirements?: { dungeon: { @@ -43,11 +43,11 @@ export interface SkyBlockItemsResponse { } & ({ generator: string generator_tier: number - }?) & ({ + } | {}) & ({ material: 'SKULL_ITEM' skin: string - }?) & ({ + } | {}) & ({ material: 'LEATHER_CHESTPLATE' color: `${number},${number},${number}` - }?))[] + } | {}))[] } \ No newline at end of file diff --git a/src/responses/resources/skyblock/skills.d.ts b/src/responses/resources/skyblock/skills.ts similarity index 100% rename from src/responses/resources/skyblock/skills.d.ts rename to src/responses/resources/skyblock/skills.ts diff --git a/src/responses/skyblock/_profile_member.d.ts b/src/responses/skyblock/_profile_member.ts similarity index 86% rename from src/responses/skyblock/_profile_member.d.ts rename to src/responses/skyblock/_profile_member.ts index 043f5ba..b88593c 100644 --- a/src/responses/skyblock/_profile_member.d.ts +++ b/src/responses/skyblock/_profile_member.ts @@ -90,13 +90,10 @@ export interface ProfileMember { */ achievement_spawned_island_types?: string[] slayer_bosses?: Record<'wolf' | 'zombie' | 'spider' | 'enderman', { - claimed_levels: { - [`level_${number}`]?: true - } - [`boss_kills_tier_${number}`]?: number + claimed_levels: Record<`level_${number}`, true> boss_kills_tier_1?: number xp?: number - }> + } & Record<`boss_kills_tier_${number}`, number>> pets?: [] dungeons?: { dungeon_types: { @@ -132,10 +129,9 @@ export interface ProfileMember { harp_quest?: { selected_song: string selected_song_epoch: number - [`song_${string}_best_completion`]?: number, - [`song_${string}_completions`]?: number, - [`song_${string}_perfect_completions`]?: number, - } + } & Record<`song_${string}_best_completion`, number> + & Record<`song_${string}_completions`, number> + & Record<`song_${string}_perfect_completions`, number>, active_effects: [] paused_effects?: [] visited_modes?: string[] @@ -153,7 +149,6 @@ export interface ProfileMember { forge?: { forge_processes: {} } - [`experience_skill_${string}`]?: number unlocked_coll_tiers?: string[] backpack_contents?: Record quiver?: Inventory @@ -173,4 +168,16 @@ export interface ProfileMember { essence_wither?: Inventory essence_spider?: Inventory candy_inventory_contents?: Inventory + + experience_skill_alchemy?: number + experience_skill_carpentry?: number + experience_skill_combat?: number + experience_skill_enchanting?: number + experience_skill_farming?: number + experience_skill_fishing?: number + experience_skill_foraging?: number + experience_skill_mining?: number + experience_skill_runecrafting?: number + experience_skill_social?: number + experience_skill_taming?: number } \ No newline at end of file diff --git a/src/responses/skyblock/profile.d.ts b/src/responses/skyblock/profile.ts similarity index 100% rename from src/responses/skyblock/profile.d.ts rename to src/responses/skyblock/profile.ts diff --git a/src/responses/skyblock/profiles.d.ts b/src/responses/skyblock/profiles.ts similarity index 100% rename from src/responses/skyblock/profiles.d.ts rename to src/responses/skyblock/profiles.ts diff --git a/src/responses/status.d.ts b/src/responses/status.ts similarity index 100% rename from src/responses/status.d.ts rename to src/responses/status.ts diff --git a/tsconfig.json b/tsconfig.json index e51f02b..b8b1c4b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -42,12 +42,12 @@ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ + "outDir": "./build", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */