diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..49598fb --- /dev/null +++ b/index.d.ts @@ -0,0 +1,47 @@ +interface IdentifierObject { + id: string; +} + +type Identifier = IdentifierObject | string; + +interface Role { + color: number; + hoist: boolean; + id: string; + managed: boolean; + mentionable: boolean; + name: string; + permissions: number; + position: number; +} + +interface Reward { + role: Role; + level: number; +} + +interface XPInfo { + userXp: number; + levelXp: number; + totalXp: number; +} + +interface User { + id: string; + level: number; + username: string; + discriminator: string; + avatarUrl: string; + messageCount: number; + tag: string; + xp: XPInfo; + rank: number; +} + +export default class Mee6LevelsApi { + private static getId(guildOrUser: Identifier): string; + public static async getRoleRewards(guild: Identifier): Promise; + public static async getLeaderboardPage(guild: Identifier, limit?: number, page?: number): Promise; + public static async getLeaderboard(guild: Identifier): Promise; + public static async getUserXp(guild: Identifier, user: Identifier): Promise; +} \ No newline at end of file diff --git a/package.json b/package.json index 6e3da0b..1b38603 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.2.0", "description": "An API wrapper for Mee6 levels", "main": "index.js", + "types": "index.d.ts", "repository": { "type": "git", "url": "git+https://github.com/rjt-rockx/mee6-levels-api.git"