guilded-api-typings
Advanced tools
Comparing version 0.12.0 to 0.12.1
# guilded-api-typings | ||
## 0.12.1 | ||
### Patch Changes | ||
- 34c82fd: feat: generic typings | ||
- 0423e02: feat: forum topic lock and unlock | ||
## 0.12.0 | ||
@@ -4,0 +11,0 @@ |
@@ -139,2 +139,13 @@ "use strict"; | ||
/** | ||
* The endpoint for a forum topic lock. | ||
* @param channelId The ID of the channel the forum topic belongs to. | ||
* @param forumTopicId The ID of the forum topic. | ||
* @see https://www.guilded.gg/docs/api/forums/ForumTopicLock | ||
* @see https://www.guilded.gg/docs/api/forums/ForumTopicUnlock | ||
* @example Routes.forumTopicLock('abc', 123); // '/channels/abc/topics/123/lock' | ||
*/ | ||
static forumTopicLock(channelId, forumTopicId) { | ||
return `/channels/${channelId}/topics/${forumTopicId}/lock`; | ||
} | ||
/** | ||
* The endpoint for list items on Guilded. | ||
@@ -141,0 +152,0 @@ * @param channelId The ID of the channel the list items belongs to. |
{ | ||
"name": "guilded-api-typings", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "Type definitions for the Guilded API.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -16,3 +16,3 @@ /** Represents a error that occurred while interacting with the Guilded REST API. */ | ||
*/ | ||
static channels: '/channels'; | ||
static channels: "/channels"; | ||
/** | ||
@@ -26,3 +26,3 @@ * The endpoint for a channel on Guilded. | ||
*/ | ||
static channel(channelId: string): `/channels/${string}`; | ||
static channel<C extends string>(channelId: C): `/channels/${C}`; | ||
/** | ||
@@ -34,3 +34,3 @@ * The endpoint for a server on Guilded. | ||
*/ | ||
static server(serverId: string): `/servers/${string}`; | ||
static server<S extends string>(serverId: S): `/servers/${S}`; | ||
/** | ||
@@ -43,3 +43,3 @@ * The endpoint for messages on Guilded. | ||
*/ | ||
static messages(channelId: string): `/channels/${string}/messages`; | ||
static messages<C extends string>(channelId: C): `/channels/${C}/messages`; | ||
/** | ||
@@ -54,3 +54,3 @@ * The endpoint for a message on Guilded. | ||
*/ | ||
static message(channelId: string, messageId: string): `/channels/${string}/messages/${string}`; | ||
static message<C extends string, M extends string>(channelId: C, messageId: M): `/channels/${C}/messages/${M}`; | ||
/** | ||
@@ -64,3 +64,3 @@ * The endpoint for a server nickname on Guilded. | ||
*/ | ||
static serverNickname(serverId: string, memberId: string): `/servers/${string}/members/${string}/nickname`; | ||
static serverNickname<S extends string, M extends string>(serverId: S, memberId: M): `/servers/${S}/members/${M}/nickname`; | ||
/** | ||
@@ -74,3 +74,3 @@ * The endpoint for a server member on Guilded. | ||
*/ | ||
static serverMember(serverId: string, memberId: string): `/servers/${string}/members/${string}`; | ||
static serverMember<S extends string, M extends string>(serverId: S, memberId: M): `/servers/${S}/members/${M}`; | ||
/** | ||
@@ -82,3 +82,3 @@ * The endpoint for server members on Guilded. | ||
*/ | ||
static serverMembers(serverId: string): `/servers/${string}/members`; | ||
static serverMembers<S extends string>(serverId: S): `/servers/${S}/members`; | ||
/** | ||
@@ -93,3 +93,3 @@ * The endpoint for a server ban on Guilded. | ||
*/ | ||
static serverBan(serverId: string, banId: string): `/servers/${string}/bans/${string}`; | ||
static serverBan<S extends string, B extends string>(serverId: S, banId: B): `/servers/${S}/bans/${B}`; | ||
/** | ||
@@ -101,3 +101,3 @@ * The endpoint for server bans on Guilded. | ||
*/ | ||
static serverBans(serverId: string): `/servers/${string}/bans`; | ||
static serverBans<S extends string>(serverId: S): `/servers/${S}/bans`; | ||
/** | ||
@@ -110,3 +110,3 @@ * The endpoint for forum topics. | ||
*/ | ||
static forumTopics(channelId: string): `/channels/${string}/topics`; | ||
static forumTopics<C extends string>(channelId: C): `/channels/${C}/topics`; | ||
/** | ||
@@ -121,3 +121,3 @@ * The endpoint for a forum topic. | ||
*/ | ||
static forumTopic(channelId: string, forumTopicId: number): `/channels/${string}/topics/${number}`; | ||
static forumTopic<C extends string, F extends number>(channelId: C, forumTopicId: F): `/channels/${C}/topics/${F}`; | ||
/** | ||
@@ -131,4 +131,13 @@ * The endpoint for a forum topic pin. | ||
*/ | ||
static forumTopicPin(channelId: string, forumTopicId: number): `/channels/${string}/topics/${number}/pin`; | ||
static forumTopicPin<C extends string, F extends number>(channelId: C, forumTopicId: F): `/channels/${C}/topics/${F}/pin`; | ||
/** | ||
* The endpoint for a forum topic lock. | ||
* @param channelId The ID of the channel the forum topic belongs to. | ||
* @param forumTopicId The ID of the forum topic. | ||
* @see https://www.guilded.gg/docs/api/forums/ForumTopicLock | ||
* @see https://www.guilded.gg/docs/api/forums/ForumTopicUnlock | ||
* @example Routes.forumTopicLock('abc', 123); // '/channels/abc/topics/123/lock' | ||
*/ | ||
static forumTopicLock<C extends string, F extends number>(channelId: C, forumTopicId: F): `/channels/${C}/topics/${F}/lock`; | ||
/** | ||
* The endpoint for list items on Guilded. | ||
@@ -140,3 +149,3 @@ * @param channelId The ID of the channel the list items belongs to. | ||
*/ | ||
static listItems(channelId: string): `/channels/${string}/items`; | ||
static listItems<C extends string>(channelId: C): `/channels/${C}/items`; | ||
/** | ||
@@ -151,3 +160,3 @@ * The endpoint for a list item on Guilded. | ||
*/ | ||
static listItem(channelId: string, listItemId: string): `/channels/${string}/items/${string}`; | ||
static listItem<C extends string, L extends string>(channelId: C, listItemId: L): `/channels/${C}/items/${L}`; | ||
/** | ||
@@ -161,3 +170,3 @@ * The endpoint for list item completions on Guilded. | ||
*/ | ||
static listItemComplete(channelId: string, listItemId: string): `/channels/${string}/items/${string}/complete`; | ||
static listItemComplete<C extends string, L extends string>(channelId: C, listItemId: L): `/channels/${C}/items/${L}/complete`; | ||
/** | ||
@@ -170,3 +179,3 @@ * The endpoint for docs on Guilded. | ||
*/ | ||
static docs(channelId: string): `/channels/${string}/docs`; | ||
static docs<C extends string>(channelId: C): `/channels/${C}/docs`; | ||
/** | ||
@@ -181,3 +190,3 @@ * The endpoint for a doc on Guilded. | ||
*/ | ||
static doc(channelId: string, docId: number): `/channels/${string}/docs/${number}`; | ||
static doc<C extends string, D extends number>(channelId: C, docId: D): `/channels/${C}/docs/${D}`; | ||
/** | ||
@@ -190,3 +199,3 @@ * The endpoint for calendar events on Guilded. | ||
*/ | ||
static calendarEvents(channelId: string): `/channels/${string}/events`; | ||
static calendarEvents<C extends string>(channelId: C): `/channels/${C}/events`; | ||
/** | ||
@@ -201,3 +210,3 @@ * The endpoint for a calendar event on Guilded. | ||
*/ | ||
static calendarEvent(channelId: string, calendarEventId: number): `/channels/${string}/events/${number}`; | ||
static calendarEvent<C extends string, CE extends number>(channelId: C, calendarEventId: CE): `/channels/${C}/events/${CE}`; | ||
/** | ||
@@ -212,3 +221,3 @@ * The endpoint for a calendar event RSVP on Guilded. | ||
*/ | ||
static calendarEventRsvp(channelId: string, calendarEventId: number, userId: string): `/channels/${string}/events/${number}/rsvps/${string}`; | ||
static calendarEventRsvp<C extends string, CE extends number, U extends string>(channelId: C, calendarEventId: CE, userId: U): `/channels/${C}/events/${CE}/rsvps/${U}`; | ||
/** | ||
@@ -220,3 +229,3 @@ * The endpoint for calendar event RSVPs on Guilded. | ||
*/ | ||
static calendarEventRsvps(channelId: string, calendarEventId: number): `/channels/${string}/events/${number}/rsvps`; | ||
static calendarEventRsvps<C extends string, CE extends number>(channelId: C, calendarEventId: CE): string; | ||
/** | ||
@@ -230,3 +239,3 @@ * The endpoint for a content reaction on Guilded. | ||
*/ | ||
static reaction(channelId: string, contentId: string, emoteId: number): `/channels/${string}/content/${string}/emotes/${number}`; | ||
static reaction<C extends string, Co extends string, E extends number>(channelId: C, contentId: Co, emoteId: E): `/channels/${C}/content/${Co}/emotes/${E}`; | ||
/** | ||
@@ -239,3 +248,3 @@ * The endpoint for server member XP on Guilded. | ||
*/ | ||
static serverMemberXp(serverId: string, memberId: string): `/servers/${string}/members/${string}/xp`; | ||
static serverMemberXp<S extends string, M extends string>(serverId: S, memberId: M): `/servers/${S}/members/${M}/xp`; | ||
/** | ||
@@ -248,3 +257,3 @@ * The endpoint for server role XP on Guilded. | ||
*/ | ||
static serverRoleXp(serverId: string, roleId: number): `/servers/${string}/roles/${number}/xp`; | ||
static serverRoleXp<S extends string, R extends number>(serverId: S, roleId: R): `/servers/${S}/roles/${R}/xp`; | ||
/** | ||
@@ -258,3 +267,3 @@ * The endpoint for a server member social link on Guilded. | ||
*/ | ||
static socialLink(serverId: string, memberId: string, type: string): `/servers/${string}/members/${string}/social-links/${string}`; | ||
static socialLink<S extends string, M extends string, T extends string>(serverId: S, memberId: M, type: T): `/servers/${S}/members/${M}/social-links/${T}`; | ||
/** | ||
@@ -268,3 +277,3 @@ * The endpoint for a group member on Guilded. | ||
*/ | ||
static groupMember(groupId: string, memberId: string): `/groups/${string}/members/${string}`; | ||
static groupMember<G extends string, M extends string>(groupId: G, memberId: M): `/groups/${G}/members/${M}`; | ||
/** | ||
@@ -279,3 +288,3 @@ * The endpoint for a server member role on Guilded. | ||
*/ | ||
static serverMemberRole(serverId: string, memberId: string, roleId: number): `/servers/${string}/members/${string}/roles/${number}`; | ||
static serverMemberRole<S extends string, M extends string, R extends number>(serverId: S, memberId: M, roleId: R): `/servers/${S}/members/${M}/roles/${R}`; | ||
/** | ||
@@ -288,3 +297,3 @@ * The endpoint for server member roles on Guilded. | ||
*/ | ||
static serverMemberRoles(serverId: string, memberId: string): `/servers/${string}/members/${string}/roles`; | ||
static serverMemberRoles<S extends string, M extends string>(serverId: S, memberId: M): `/servers/${S}/members/${M}/roles`; | ||
/** | ||
@@ -297,3 +306,3 @@ * The endpoint for webhooks on Guilded. | ||
*/ | ||
static webhooks(serverId: string): `/servers/${string}/webhooks`; | ||
static webhooks<S extends string>(serverId: S): `/servers/${S}/webhooks`; | ||
/** | ||
@@ -308,3 +317,3 @@ * The endpoint for a webhook on Guilded. | ||
*/ | ||
static webhook(serverId: string, webhookId: string): `/servers/${string}/webhooks/${string}`; | ||
static webhook<S extends string, W extends string>(serverId: S, webhookId: W): `/servers/${S}/webhooks/${W}`; | ||
/** | ||
@@ -316,4 +325,4 @@ * The endpoint for a webhook execution on Guilded. | ||
*/ | ||
static webhookExecute(webhookId: string, webhookToken: string): `/webhooks/${string}/${string}`; | ||
static webhookExecute<W extends string, WT extends string>(webhookId: W, webhookToken: WT): `/webhooks/${W}/${WT}`; | ||
} | ||
//# sourceMappingURL=REST.d.ts.map |
@@ -309,2 +309,22 @@ import { APIChannel } from './structures/Channel'; | ||
/** | ||
* Emitted when a forum topic is locked. | ||
* @see https://www.guilded.gg/docs/api/websockets/ForumTopicLocked | ||
*/ | ||
ForumTopicLocked: { | ||
/** The ID of the server the forum topic belongs to. */ | ||
serverId: string; | ||
/** The locked forum topic. */ | ||
forumTopic: APIForumTopic; | ||
}; | ||
/** | ||
* Emitted when a forum topic is unlocked. | ||
* @see https://www.guilded.gg/docs/api/websockets/ForumTopicUnlocked | ||
*/ | ||
ForumTopicUnlocked: { | ||
/** The ID of the server the forum topic belongs to. */ | ||
serverId: string; | ||
/** The unlocked forum topic. */ | ||
forumTopic: APIForumTopic; | ||
}; | ||
/** | ||
* Emitted when a calendar event RSVP is edited. | ||
@@ -311,0 +331,0 @@ * @see https://www.guilded.gg/docs/api/websockets/CalendarEventRsvpUpdated |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
131895
2063