Skip to content

Commit 09cbcf1

Browse files
authored
Merge pull request #445 from jakehwll/master
Better types for `tickets`
2 parents 0415122 + 6df9710 commit 09cbcf1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/clients/core/tickets.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ const {Client} = require('../client');
128128
*/
129129

130130
/**
131+
* @typedef {object} TicketCollaborator
132+
* @property {number} id - The ID of the collaborator.
133+
* @property {string} name - The name of the collaborator.
134+
*/
135+
136+
/**
131137
* @typedef {object} Via
132138
* @property {string} [channel] - How the ticket or event was created expressed as a via type or via id
133139
* @property {object} source - For some channels a source object gives more information about how or why the ticket or event was created
@@ -244,7 +250,7 @@ class Tickets extends Client {
244250
/**
245251
* List collaborators of a specific ticket.
246252
* @param {number} ticketId - The ID of the ticket.
247-
* @returns {Promise<Array>} An array of collaborators for the ticket.
253+
* @returns {Promise<Array<TicketCollaborator>>} An array of collaborators for the ticket.
248254
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets}
249255
* @example
250256
* const collaborators = await client.tickets.listCollaborators(7890);
@@ -256,7 +262,7 @@ class Tickets extends Client {
256262
/**
257263
* List incidents related to a specific ticket.
258264
* @param {number} ticketId - The ID of the ticket.
259-
* @returns {Promise<Array>} An array of incidents related to the ticket.
265+
* @returns {Promise<Array<Ticket>>} An array of incidents related to the ticket.
260266
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets}
261267
* @example
262268
* const incidents = await client.tickets.listIncidents(7890);

0 commit comments

Comments
 (0)