types: use wrapper utilities (#9945)

* types: use `Awaitable<T>` instead of `Promise<T> | T`

* types: use `JSONEncodable<T>` over raw definition

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Aura
2023-11-12 22:40:59 +01:00
committed by GitHub
parent cc07a28f12
commit 4bc1dae36f
3 changed files with 7 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
import type { Readable } from 'node:stream';
import type { ReadableStream } from 'node:stream/web';
import type { Collection } from '@discordjs/collection';
import type { Awaitable } from '@discordjs/util';
import type { Agent, Dispatcher, RequestInit, BodyInit, Response } from 'undici';
import type { IHandler } from '../interfaces/Handler.js';
@@ -183,7 +184,7 @@ export interface RateLimitData {
/**
* A function that determines whether the rate limit hit should throw an Error
*/
export type RateLimitQueueFilter = (rateLimitData: RateLimitData) => Promise<boolean> | boolean;
export type RateLimitQueueFilter = (rateLimitData: RateLimitData) => Awaitable<boolean>;
export interface APIRequest {
/**