From a39d8c4d9d9088e2ed5157696450fe1980816687 Mon Sep 17 00:00:00 2001 From: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com> Date: Wed, 1 Dec 2021 06:28:22 -0500 Subject: [PATCH] =?UTF-8?q?Revert=20"types(ApplicationCommandManager):=20D?= =?UTF-8?q?eprecate=20old=20`*Data`=20type=20=E2=80=A6usages=20and=20allow?= =?UTF-8?q?=20camel=20cased=20dapi=20types=20to=20be=20used=20(#7052)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 158 +++++++++++++++++++++++----------------- package.json | 1 - tslint.json | 3 +- typings/index.d.ts | 64 ++++------------ typings/index.test-d.ts | 66 +++++------------ 5 files changed, 127 insertions(+), 165 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd5225078..9115f163e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "@types/ws": "^8.2.0", "discord-api-types": "^0.25.0", "node-fetch": "^2.6.1", - "type-fest": "^2.5.3", "ws": "^8.2.3" }, "devDependencies": { @@ -3285,23 +3284,6 @@ "node": ">=6" } }, - "node_modules/camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001271", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", @@ -4306,9 +4288,9 @@ } }, "node_modules/discord-api-types": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.0.tgz", - "integrity": "sha512-LS5TZAARsDVcJaljxplec25L9ampP2aY6rf1SFRowK66RTLdyVn0Gal3VsF+mYBhZDkeFd+awBNoJmUeECBoPQ==", + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.1.tgz", + "integrity": "sha512-8667foCE/tEP6+2ezQpWs6PL37jgPeun0rv75EMpJZaMaMYpm+OAld1gIqTH4swYc4wLIr99ELhsleVZ+NtYrQ==", "engines": { "node": ">=12" } @@ -9051,6 +9033,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/meow/node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/meow/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -9103,6 +9102,15 @@ "node": ">=8" } }, + "node_modules/meow/node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/meow/node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -10332,15 +10340,6 @@ } ] }, - "node_modules/quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -11820,6 +11819,23 @@ "node": ">=12" } }, + "node_modules/tsd/node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tsd/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -11898,6 +11914,15 @@ "node": ">=8" } }, + "node_modules/tsd/node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/tsd/node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -12158,17 +12183,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.6.0.tgz", - "integrity": "sha512-XN1FDGGtaSDA6CFsCW5iolTQqFsnJ+ZF6JqSz0SqXoh4F8GY0xqUv5RYnTilpmL+sOH8OH4FX8tf9YyAPM2LDA==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -15285,17 +15299,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - } - }, "caniuse-lite": { "version": "1.0.30001271", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz", @@ -16081,9 +16084,9 @@ } }, "discord-api-types": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.0.tgz", - "integrity": "sha512-LS5TZAARsDVcJaljxplec25L9ampP2aY6rf1SFRowK66RTLdyVn0Gal3VsF+mYBhZDkeFd+awBNoJmUeECBoPQ==" + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.25.1.tgz", + "integrity": "sha512-8667foCE/tEP6+2ezQpWs6PL37jgPeun0rv75EMpJZaMaMYpm+OAld1gIqTH4swYc4wLIr99ELhsleVZ+NtYrQ==" }, "dmd": { "version": "4.0.6", @@ -19713,6 +19716,17 @@ "yargs-parser": "^20.2.3" }, "dependencies": { + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -19750,6 +19764,12 @@ "p-limit": "^2.2.0" } }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -20682,12 +20702,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true - }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -21847,6 +21861,17 @@ "read-pkg-up": "^7.0.0" }, "dependencies": { + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -21904,6 +21929,12 @@ "p-limit": "^2.2.0" } }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -22105,11 +22136,6 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.6.0.tgz", - "integrity": "sha512-XN1FDGGtaSDA6CFsCW5iolTQqFsnJ+ZF6JqSz0SqXoh4F8GY0xqUv5RYnTilpmL+sOH8OH4FX8tf9YyAPM2LDA==" - }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", diff --git a/package.json b/package.json index 0c6b4c79c..7fff58bb2 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "@types/ws": "^8.2.0", "discord-api-types": "^0.25.0", "node-fetch": "^2.6.1", - "type-fest": "^2.5.3", "ws": "^8.2.3" }, "devDependencies": { diff --git a/tslint.json b/tslint.json index 151105a8b..d66f7bdf3 100644 --- a/tslint.json +++ b/tslint.json @@ -24,7 +24,6 @@ "array-type": [true, "array"], "one-line": false, "no-any-union": false, - "void-return": false, - "unified-signatures": false + "void-return": false } } diff --git a/typings/index.d.ts b/typings/index.d.ts index 212b8fc94..bd0587d10 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -45,7 +45,6 @@ import { APIUser, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, - RESTPatchAPIApplicationCommandJSONBody, RESTPostAPIApplicationCommandsJSONBody, Snowflake, } from 'discord-api-types/v9'; @@ -138,7 +137,6 @@ import { RawWidgetData, RawWidgetMemberData, } from './rawDataTypes'; -import type { CamelCasedPropertiesDeep } from 'type-fest'; //#region Classes @@ -215,7 +213,7 @@ export class ApplicationCommand extends Base { public readonly manager: ApplicationCommandManager; public id: Snowflake; public name: string; - public options: Camelize[]; + public options: ApplicationCommandOption[]; public permissions: ApplicationCommandPermissionsManager< PermissionsFetchType, PermissionsFetchType, @@ -226,29 +224,23 @@ export class ApplicationCommand extends Base { public type: ApplicationCommandType; public version: Snowflake; public delete(): Promise>; - /** @deprecated use `edit(Camelize)` instead */ public edit(data: ApplicationCommandData): Promise>; - public edit( - data: Camelize, - ): Promise>; public equals( - command: ApplicationCommand | Camelize | RawApplicationCommandData, + command: ApplicationCommand | ApplicationCommandData | RawApplicationCommandData, enforceOptionorder?: boolean, ): boolean; public static optionsEqual( - existing: Camelize[], - options: Camelize[] | APIApplicationCommandOption[], + existing: ApplicationCommandOption[], + options: ApplicationCommandOption[] | ApplicationCommandOptionData[] | APIApplicationCommandOption[], enforceOptionorder?: boolean, ): boolean; private static _optionEquals( - existing: Camelize[], - options: Camelize[] | APIApplicationCommandOption, + existing: ApplicationCommandOption, + options: ApplicationCommandOption | ApplicationCommandOptionData | APIApplicationCommandOption, enforceOptionorder?: boolean, ): boolean; - private static transformOption(option: Camelize, received?: boolean): unknown; - private static transformCommand( - command: Camelize, - ): RESTPostAPIApplicationCommandsJSONBody; + private static transformOption(option: ApplicationCommandOptionData, received?: boolean): unknown; + private static transformCommand(command: ApplicationCommandData): RESTPostAPIApplicationCommandsJSONBody; private static isAPICommandData(command: object): command is RESTPostAPIApplicationCommandsJSONBody; } @@ -2342,8 +2334,10 @@ export class WebhookClient extends WebhookMixin(BaseClient) { options: string | MessagePayload | WebhookEditMessageOptions, ): Promise; public fetchMessage(message: Snowflake, options?: WebhookFetchMessageOptions): Promise; + /* tslint:disable:unified-signatures */ /** @deprecated */ public fetchMessage(message: Snowflake, cache?: boolean): Promise; + /* tslint:enable:unified-signatures */ public send(options: string | MessagePayload | WebhookMessageOptions): Promise; } @@ -2644,9 +2638,7 @@ export abstract class CachedManager extends DataManager - | RESTPostAPIApplicationCommandsJSONBody; +export type ApplicationCommandDataResolvable = ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody; export class ApplicationCommandManager< ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>, @@ -2662,18 +2654,7 @@ export class ApplicationCommandManager< null >; private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown; - /** @deprecated use `create(ApplicationCommandDataResolvable)` instead */ - public create( - command: ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody, - ): Promise; - /** @deprecated use `create(ApplicationCommandDataResolvable, Snowflake)` instead */ - public create( - command: ApplicationCommandData | RESTPostAPIApplicationCommandsJSONBody, - guildId: Snowflake, - ): Promise; public create(command: ApplicationCommandDataResolvable, guildId?: Snowflake): Promise; - /** @deprecated use `delete(ApplicationCommandDataResolvable, Snowflake?)` instead */ - public delete(command: ApplicationCommandData, guildId?: Snowflake): Promise; public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise; public edit( command: ApplicationCommandResolvable, @@ -2694,20 +2675,13 @@ export class ApplicationCommandManager< id?: Snowflake, options?: FetchApplicationCommandOptions, ): Promise>; - /** @deprecated Use `set(ApplicationCommandResolvable)` instead */ - public set(commands: ApplicationCommandData[]): Promise>; - /** @deprecated Use `set(ApplicationCommandResolvable, Snowflake)` instead */ - public set( - commands: ApplicationCommandData[], - guildId: Snowflake, - ): Promise>; public set(commands: ApplicationCommandDataResolvable[]): Promise>; public set( commands: ApplicationCommandDataResolvable[], guildId: Snowflake, ): Promise>; private static transformCommand( - command: Camelize, + command: ApplicationCommandData, ): Omit; } @@ -2772,9 +2746,7 @@ export class GuildApplicationCommandManager extends ApplicationCommandManager); public guild: Guild; public create(command: ApplicationCommandDataResolvable): Promise; - /** @deprecated use `delete(ApplicationCommandDataResolvable, Snowflake?)` instead */ - public delete(command: ApplicationCommandData, guildId?: Snowflake): Promise; - public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise; + public delete(command: ApplicationCommandResolvable): Promise; public edit( command: ApplicationCommandResolvable, data: ApplicationCommandDataResolvable, @@ -2782,8 +2754,6 @@ export class GuildApplicationCommandManager extends ApplicationCommandManager; public fetch(options: BaseFetchOptions): Promise>; public fetch(id?: undefined, options?: BaseFetchOptions): Promise>; - /** @deprecated Use `set(ApplicationCommandResolvable)` instead */ - public set(commands: ApplicationCommandData[]): Promise>; public set(commands: ApplicationCommandDataResolvable[]): Promise>; } @@ -3102,8 +3072,10 @@ export interface PartialWebhookFields { options: string | MessagePayload | WebhookEditMessageOptions, ): Promise; fetchMessage(message: Snowflake | '@original', options?: WebhookFetchMessageOptions): Promise; + /* tslint:disable:unified-signatures */ /** @deprecated */ fetchMessage(message: Snowflake | '@original', cache?: boolean): Promise; + /* tslint:enable:unified-signatures */ send(options: string | MessagePayload | WebhookMessageOptions): Promise; } @@ -3369,7 +3341,6 @@ export interface ChatInputApplicationCommandData extends BaseApplicationCommandD options?: ApplicationCommandOptionData[]; } -/** @deprecated use `Camelize` instead */ export type ApplicationCommandData = | UserApplicationCommandData | MessageApplicationCommandData @@ -3457,10 +3428,6 @@ export interface ApplicationCommandNonOptions extends BaseApplicationCommandOpti type: Exclude; } -// Type alias since the lib name is very long. -export type Camelize = CamelCasedPropertiesDeep; - -/** @deprecated Use `Camelize` instead. */ export type ApplicationCommandOptionData = | ApplicationCommandSubGroupData | ApplicationCommandNonOptionsData @@ -3470,7 +3437,6 @@ export type ApplicationCommandOptionData = | ApplicationCommandNumericOptionData | ApplicationCommandSubCommandData; -/** @deprecated use `Camelize` instead */ export type ApplicationCommandOption = | ApplicationCommandSubGroup | ApplicationCommandNonOptions diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index cbaf73061..9eb72d8e9 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -1,4 +1,5 @@ -import { +import type { ChildProcess } from 'child_process'; +import type { APIInteractionGuildMember, APIMessage, APIPartialChannel, @@ -6,21 +7,15 @@ import { APIInteractionDataResolvedGuildMember, APIInteractionDataResolvedChannel, APIRole, - ChannelType, - ApplicationCommandOptionType, - APIApplicationCommand, - APIApplicationCommandOption, - APIApplicationCommandSubCommandOptions, } from 'discord-api-types/v9'; -import type { ChildProcess } from 'node:child_process'; import { ApplicationCommand, - ApplicationCommandChannelOptionData, - ApplicationCommandChoicesData, + ApplicationCommandData, ApplicationCommandManager, - ApplicationCommandNonOptionsData, + ApplicationCommandOptionData, ApplicationCommandResolvable, ApplicationCommandSubCommandData, + ApplicationCommandSubGroupData, BaseCommandInteraction, ButtonInteraction, CacheType, @@ -33,6 +28,7 @@ import { CommandInteraction, CommandInteractionOption, CommandInteractionOptionResolver, + CommandOptionNonChoiceResolvableType, Constants, ContextMenuInteraction, DMChannel, @@ -81,9 +77,6 @@ import { User, VoiceChannel, Shard, - Camelize, - ApplicationCommandAutocompleteOption, - ApplicationCommandNumericOptionData, WebSocketShard, Collector, } from '.'; @@ -693,20 +686,6 @@ client.login('absolutely-valid-token'); // Test client conditional types client.on('ready', client => { expectType>(client); - - // Test camelized post command data. - client.application.commands.create({ - name: 'Foo', - description: 'Bar', - options: [ - { - name: 'test', - description: 'test', - type: ApplicationCommandOptionType.Channel, - channelTypes: [ChannelType.GuildCategory], - }, - ], - }); }); declare const loggedInClient: Client; @@ -804,7 +783,7 @@ expectType<1>(Constants.Status.CONNECTING); expectType<0>(Constants.Opcodes.DISPATCH); expectType<2>(Constants.ClientApplicationAssetTypes.BIG); -declare const applicationCommandData: Camelize; +declare const applicationCommandData: ApplicationCommandData; declare const applicationCommandResolvable: ApplicationCommandResolvable; declare const applicationCommandManager: ApplicationCommandManager; { @@ -826,29 +805,22 @@ declare const applicationCommandManager: ApplicationCommandManager; ); } -declare const applicationSubGroupCommandData: Camelize; +declare const applicationNonChoiceOptionData: ApplicationCommandOptionData & { + type: CommandOptionNonChoiceResolvableType; +}; { - expectType( - applicationSubGroupCommandData.type, - ); - expectAssignable(applicationSubGroupCommandData.options); + // Options aren't allowed on this command type. + + // @ts-expect-error + applicationNonChoiceOptionData.choices; } -declare const applicationSubCommandData: ApplicationCommandSubCommandData; +declare const applicationSubGroupCommandData: ApplicationCommandSubGroupData; { - expectType<'SUB_COMMAND' | ApplicationCommandOptionTypes.SUB_COMMAND>(applicationSubCommandData.type); - - // Check that only subcommands can have no subcommand or subcommand group sub-options. - expectType< - | ( - | ApplicationCommandChoicesData - | ApplicationCommandNonOptionsData - | ApplicationCommandChannelOptionData - | ApplicationCommandAutocompleteOption - | ApplicationCommandNumericOptionData - )[] - | undefined - >(applicationSubCommandData.options); + expectType<'SUB_COMMAND_GROUP' | ApplicationCommandOptionTypes.SUB_COMMAND_GROUP>( + applicationSubGroupCommandData.type, + ); + expectType(applicationSubGroupCommandData.options); } declare const guildApplicationCommandManager: GuildApplicationCommandManager;