From be0f9468293ee984d395d50cd6f152acaca84862 Mon Sep 17 00:00:00 2001 From: JPBBerry Date: Thu, 4 Mar 2021 10:35:47 -0500 Subject: [PATCH] Changes to how typings are exported (#49) --- docs/Changelog.md | 3 +++ package-lock.json | 2 +- package.json | 2 +- src/index.ts | 2 -- src/structs/Api.ts | 2 ++ src/structs/Webhook.ts | 2 ++ src/typings.ts | 16 ++++++++-------- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 5a87489..896dc24 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -2,6 +2,9 @@ # Change Log +## 3.0.9 + - A change to how typings are used, properly exports via dist/typings + ## 3.0.8 - Change docs URL - Fix typos in a few method docs diff --git a/package-lock.json b/package-lock.json index 2e38603..f62100d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@top-gg/sdk", - "version": "3.0.6", + "version": "3.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f295ed0..1ebf84c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@top-gg/sdk", - "version": "3.0.8", + "version": "3.0.9", "description": "Official Top.gg Node SDK", "main": "./dist/index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index 54cf00b..7b2cdda 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,2 @@ -import './typings' - export * from './structs/Api' export * from './structs/Webhook' \ No newline at end of file diff --git a/src/structs/Api.ts b/src/structs/Api.ts index aa6a01a..71a803c 100644 --- a/src/structs/Api.ts +++ b/src/structs/Api.ts @@ -3,6 +3,8 @@ import ApiError from '../utils/ApiError' import qs from 'querystring' import { EventEmitter } from 'events' +import { Snowflake, BotStats, BotInfo, UserInfo, BotsResponse, ShortUser, BotsQuery } from '../typings' + interface APIOptions { /** * Top.gg Token diff --git a/src/structs/Webhook.ts b/src/structs/Webhook.ts index 4770924..4000f04 100644 --- a/src/structs/Webhook.ts +++ b/src/structs/Webhook.ts @@ -1,6 +1,8 @@ import getBody from 'raw-body' import qs from 'querystring' +import { WebhookPayload } from '../typings' + /** * Top.gg Webhook * @example diff --git a/src/typings.ts b/src/typings.ts index 10cf2e8..56db341 100644 --- a/src/typings.ts +++ b/src/typings.ts @@ -1,9 +1,9 @@ /** * Discord ID */ -type Snowflake = string +export type Snowflake = string -interface BotInfo { +export interface BotInfo { /** * The id of the bot */ @@ -99,7 +99,7 @@ interface BotInfo { donatebotguildid: Snowflake } -interface BotStats { +export interface BotStats { /** * The amount of servers the bot is in */ @@ -118,7 +118,7 @@ interface BotStats { shardCount?: number } -interface UserInfo { +export interface UserInfo { /** * The id of the user */ @@ -198,7 +198,7 @@ interface UserInfo { admin: boolean } -interface BotsQuery { +export interface BotsQuery { /** * The amount of bots to return. Max. 500 */ @@ -223,7 +223,7 @@ interface BotsQuery { fields?: string[]|string } -interface BotsResponse { +export interface BotsResponse { /** * The matching bots */ @@ -246,7 +246,7 @@ interface BotsResponse { total: number } -interface ShortUser { +export interface ShortUser { /** * User's ID */ @@ -265,7 +265,7 @@ interface ShortUser { avatar: string } -interface WebhookPayload { +export interface WebhookPayload { /** * If webhook is a bot: ID of the bot that received a vote */