Skip to content

Commit

Permalink
fix: typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
imconnorngl committed Nov 30, 2024
1 parent 9ca550d commit 6f7a784
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/builder/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export class Option<
* @returns {this}
*/
choices = (
// biome-ignore format: ternary operator
...e: T extends "String"
? APIApplicationCommandOptionChoice<string>[]
: T extends "Integer" | "Number"
Expand All @@ -256,8 +255,8 @@ export class Option<
* @returns {this}
*/
channel_types = (...e: T extends "Channel" ? ChannelType[] : undefined[]) =>
// @ts-expect-error
this.#assign("channel_types", ["Channel"], {
// @ts-expect-error
channel_types: e as ChannelType[],
});
/**
Expand Down
1 change: 0 additions & 1 deletion src/builder/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ export class Select<
* @returns {this}
*/
default_values = (
// biome-ignore format: ternary operator
...e: T extends "String"
? undefined[]
: {
Expand Down
4 changes: 1 addition & 3 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ abstract class ContextAll<E extends Env> {
}
}

// biome-ignore format: ternary operator
type InteractionData<T extends 2 | 3 | 4 | 5> = T extends 2
? InteractionCommandData
: T extends 3
Expand Down Expand Up @@ -174,7 +173,6 @@ abstract class Context2345<
}

type InteractionCallbackType = 1 | 4 | 5 | 6 | 7 | 9 | 10;
// biome-ignore format: ternary operator
type InteractionCallbackData<T extends InteractionCallbackType> = T extends
| 4
| 7
Expand Down Expand Up @@ -371,7 +369,7 @@ export class CommandContext<E extends Env = any> extends Context235<
}

type ComponentType = "Button" | "Select" | "Other Select" | unknown;
// biome-ignore format: ternary operator

type ComponentInteractionData<T extends ComponentType> = T extends "Button"
? APIBaseInteraction<
InteractionType.MessageComponent,
Expand Down

0 comments on commit 6f7a784

Please sign in to comment.