refactor!: remove deprecated CDN method overloads (#10649)

BREAKING CHANGE: Removed user avatar decoration overload from `CDN#avatarDecoration()`
BREAKING CHANGE: Removed non-object options overload from `CDN#emoji()`

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Almeida
2024-12-09 06:58:47 +00:00
committed by GitHub
parent af4018c25f
commit b3d4259f8a
4 changed files with 5 additions and 88 deletions

View File

@@ -60,10 +60,3 @@ export const OverwrittenMimeTypes = {
} as const satisfies Readonly<Record<string, string>>;
export const BurstHandlerMajorIdKey = 'burst';
/**
* Prefix for deprecation warnings.
*
* @internal
*/
export const DEPRECATION_WARNING_PREFIX = 'DeprecationWarning' as const;

View File

@@ -1,7 +1,6 @@
import type { RESTPatchAPIChannelJSONBody, Snowflake } from 'discord-api-types/v10';
import type { REST } from '../REST.js';
import { RateLimitError } from '../errors/RateLimitError.js';
import { DEPRECATION_WARNING_PREFIX } from './constants.js';
import { RequestMethod } from './types.js';
import type { GetRateLimitOffsetFunction, RateLimitData, ResponseLike } from './types.js';
@@ -143,21 +142,6 @@ export function isBufferLike(value: unknown): value is ArrayBuffer | Buffer | Ui
return value instanceof ArrayBuffer || value instanceof Uint8Array || value instanceof Uint8ClampedArray;
}
/**
* Irrespective environment warning.
*
* @remarks Only the message is needed. The deprecation prefix is handled already.
* @param message - A string the warning will emit with
* @internal
*/
export function deprecationWarning(message: string) {
if (typeof globalThis.process === 'undefined') {
console.warn(`${DEPRECATION_WARNING_PREFIX}: ${message}`);
} else {
process.emitWarning(message, DEPRECATION_WARNING_PREFIX);
}
}
/**
* Normalizes the offset for rate limits. Applies a Math.max(0, N) to prevent negative offsets,
* also deals with callbacks.