File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -21,19 +21,21 @@ export const RESEND_ERROR_CODES_BY_KEY = {
2121
2222export type RESEND_ERROR_CODE_KEY = keyof typeof RESEND_ERROR_CODES_BY_KEY ;
2323
24+ export type RateLimitExceededErrorResponse = {
25+ message : string ;
26+ name : Extract < RESEND_ERROR_CODE_KEY , 'rate_limit_exceeded' > ;
27+ /**
28+ * Time in seconds.
29+ */
30+ retryAfter : number ;
31+ } ;
32+
2433export type ErrorResponse =
2534 | {
2635 message : string ;
2736 name : Exclude < RESEND_ERROR_CODE_KEY , 'rate_limit_exceeded' > ;
2837 }
29- | {
30- message : string ;
31- name : Extract < RESEND_ERROR_CODE_KEY , 'rate_limit_exceeded' > ;
32- /**
33- * Time in seconds.
34- */
35- retryAfter : number ;
36- } ;
38+ | RateLimitExceededErrorResponse ;
3739
3840export type Response < Data > =
3941 | {
Original file line number Diff line number Diff line change 1- // @ts -expect-error: this is used in the jsdoc for `shouldResetAfter`
2- // biome-ignore lint/correctness/noUnusedImports: this is used in the jsdoc for `shouldResetAfter`
3- import type { Response } from './interfaces' ;
1+ import type { RateLimitExceededErrorResponse } from './interfaces' ;
42
53export type RateLimit = {
64 /**
7- * The maximum amount of requests that can be made in the time window of {@link shouldResetAfter}.
5+ * The maximum amount of requests that can be made in the time window of {@link RateLimit. shouldResetAfter}.
86 */
97 limit : number ;
108 /**
@@ -18,7 +16,7 @@ export type RateLimit = {
1816 * and {@link RateLimit.remainingRequests} goes back to the value of
1917 * {@link RateLimit.limit}.
2018 *
21- * @see {@link import('./interfaces').Response .retryAfter }
19+ * @see {@link RateLimitExceededErrorResponse .retryAfter }
2220 */
2321 shouldResetAfter : number ;
2422} ;
You can’t perform that action at this time.
0 commit comments